{"version":3,"file":"pixi.min.js","sources":["../../../../node_modules/promise-polyfill/src/index.js","../../../../node_modules/promise-polyfill/src/finally.js","../../../../node_modules/promise-polyfill/src/allSettled.js","../../../../node_modules/object-assign/index.js","../../../../packages/settings/dist/esm/settings.min.mjs","../../../../packages/polyfill/dist/esm/polyfill.min.mjs","../../../../node_modules/eventemitter3/index.js","../../../../node_modules/earcut/src/earcut.js","../../../../node_modules/url/node_modules/punycode/punycode.js","../../../../node_modules/url/util.js","../../../../node_modules/querystring/decode.js","../../../../node_modules/querystring/encode.js","../../../../node_modules/querystring/index.js","../../../../node_modules/url/url.js","../../../../packages/constants/dist/esm/constants.min.mjs","../../../../packages/utils/dist/esm/utils.min.mjs","../../../../packages/math/dist/esm/math.min.mjs","../../../../packages/display/dist/esm/display.min.mjs","../../../../packages/extensions/dist/esm/extensions.min.mjs","../../../../packages/runner/dist/esm/runner.min.mjs","../../../../packages/ticker/dist/esm/ticker.min.mjs","../../../../packages/core/dist/esm/core.min.mjs","../../../../packages/accessibility/dist/esm/accessibility.min.mjs","../../../../packages/interaction/dist/esm/interaction.min.mjs","../../../../packages/extract/dist/esm/extract.min.mjs","../../../../packages/loaders/dist/esm/loaders.min.mjs","../../../../packages/compressed-textures/dist/esm/compressed-textures.min.mjs","../../../../packages/particle-container/dist/esm/particle-container.min.mjs","../../../../packages/graphics/dist/esm/graphics.min.mjs","../../../../packages/sprite/dist/esm/sprite.min.mjs","../../../../packages/text/dist/esm/text.min.mjs","../../../../packages/prepare/dist/esm/prepare.min.mjs","../../../../packages/spritesheet/dist/esm/spritesheet.min.mjs","../../../../packages/sprite-tiling/dist/esm/sprite-tiling.min.mjs","../../../../packages/mesh/dist/esm/mesh.min.mjs","../../../../packages/text-bitmap/dist/esm/text-bitmap.min.mjs","../../../../packages/filter-alpha/dist/esm/filter-alpha.min.mjs","../../../../packages/filter-blur/dist/esm/filter-blur.min.mjs","../../../../packages/filter-color-matrix/dist/esm/filter-color-matrix.min.mjs","../../../../packages/filter-displacement/dist/esm/filter-displacement.min.mjs","../../../../packages/mixin-cache-as-bitmap/dist/esm/mixin-cache-as-bitmap.min.mjs","../../../../packages/filter-fxaa/dist/esm/filter-fxaa.min.mjs","../../../../packages/filter-noise/dist/esm/filter-noise.min.mjs","../../../../packages/mixin-get-child-by-name/dist/esm/mixin-get-child-by-name.min.mjs","../../../../packages/mixin-get-global-position/dist/esm/mixin-get-global-position.min.mjs","../../../../packages/app/dist/esm/app.min.mjs","../../../../packages/mesh-extras/dist/esm/mesh-extras.min.mjs","../../../../packages/sprite-animated/dist/esm/sprite-animated.min.mjs","../../src/index.ts"],"sourcesContent":["import promiseFinally from './finally';\nimport allSettled from './allSettled';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction isArray(x) {\n return Boolean(x && typeof x.length !== 'undefined');\n}\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\n/**\n * @constructor\n * @param {Function} fn\n */\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n /** @type {!number} */\n this._state = 0;\n /** @type {!boolean} */\n this._handled = false;\n /** @type {Promise|undefined} */\n this._value = undefined;\n /** @type {!Array} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/*!\n * @pixi/settings - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/settings is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nvar E,_,T,N,R,A,I,e,n,O,L,i,t,U,o,S,P,a,r,M;!function(E){E[E.WEBGL_LEGACY=0]=\"WEBGL_LEGACY\",E[E.WEBGL=1]=\"WEBGL\",E[E.WEBGL2=2]=\"WEBGL2\"}(E||(E={})),function(E){E[E.UNKNOWN=0]=\"UNKNOWN\",E[E.WEBGL=1]=\"WEBGL\",E[E.CANVAS=2]=\"CANVAS\"}(_||(_={})),function(E){E[E.COLOR=16384]=\"COLOR\",E[E.DEPTH=256]=\"DEPTH\",E[E.STENCIL=1024]=\"STENCIL\"}(T||(T={})),function(E){E[E.NORMAL=0]=\"NORMAL\",E[E.ADD=1]=\"ADD\",E[E.MULTIPLY=2]=\"MULTIPLY\",E[E.SCREEN=3]=\"SCREEN\",E[E.OVERLAY=4]=\"OVERLAY\",E[E.DARKEN=5]=\"DARKEN\",E[E.LIGHTEN=6]=\"LIGHTEN\",E[E.COLOR_DODGE=7]=\"COLOR_DODGE\",E[E.COLOR_BURN=8]=\"COLOR_BURN\",E[E.HARD_LIGHT=9]=\"HARD_LIGHT\",E[E.SOFT_LIGHT=10]=\"SOFT_LIGHT\",E[E.DIFFERENCE=11]=\"DIFFERENCE\",E[E.EXCLUSION=12]=\"EXCLUSION\",E[E.HUE=13]=\"HUE\",E[E.SATURATION=14]=\"SATURATION\",E[E.COLOR=15]=\"COLOR\",E[E.LUMINOSITY=16]=\"LUMINOSITY\",E[E.NORMAL_NPM=17]=\"NORMAL_NPM\",E[E.ADD_NPM=18]=\"ADD_NPM\",E[E.SCREEN_NPM=19]=\"SCREEN_NPM\",E[E.NONE=20]=\"NONE\",E[E.SRC_OVER=0]=\"SRC_OVER\",E[E.SRC_IN=21]=\"SRC_IN\",E[E.SRC_OUT=22]=\"SRC_OUT\",E[E.SRC_ATOP=23]=\"SRC_ATOP\",E[E.DST_OVER=24]=\"DST_OVER\",E[E.DST_IN=25]=\"DST_IN\",E[E.DST_OUT=26]=\"DST_OUT\",E[E.DST_ATOP=27]=\"DST_ATOP\",E[E.ERASE=26]=\"ERASE\",E[E.SUBTRACT=28]=\"SUBTRACT\",E[E.XOR=29]=\"XOR\"}(N||(N={})),function(E){E[E.POINTS=0]=\"POINTS\",E[E.LINES=1]=\"LINES\",E[E.LINE_LOOP=2]=\"LINE_LOOP\",E[E.LINE_STRIP=3]=\"LINE_STRIP\",E[E.TRIANGLES=4]=\"TRIANGLES\",E[E.TRIANGLE_STRIP=5]=\"TRIANGLE_STRIP\",E[E.TRIANGLE_FAN=6]=\"TRIANGLE_FAN\"}(R||(R={})),function(E){E[E.RGBA=6408]=\"RGBA\",E[E.RGB=6407]=\"RGB\",E[E.RG=33319]=\"RG\",E[E.RED=6403]=\"RED\",E[E.RGBA_INTEGER=36249]=\"RGBA_INTEGER\",E[E.RGB_INTEGER=36248]=\"RGB_INTEGER\",E[E.RG_INTEGER=33320]=\"RG_INTEGER\",E[E.RED_INTEGER=36244]=\"RED_INTEGER\",E[E.ALPHA=6406]=\"ALPHA\",E[E.LUMINANCE=6409]=\"LUMINANCE\",E[E.LUMINANCE_ALPHA=6410]=\"LUMINANCE_ALPHA\",E[E.DEPTH_COMPONENT=6402]=\"DEPTH_COMPONENT\",E[E.DEPTH_STENCIL=34041]=\"DEPTH_STENCIL\"}(A||(A={})),function(E){E[E.TEXTURE_2D=3553]=\"TEXTURE_2D\",E[E.TEXTURE_CUBE_MAP=34067]=\"TEXTURE_CUBE_MAP\",E[E.TEXTURE_2D_ARRAY=35866]=\"TEXTURE_2D_ARRAY\",E[E.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=\"TEXTURE_CUBE_MAP_POSITIVE_X\",E[E.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=\"TEXTURE_CUBE_MAP_NEGATIVE_X\",E[E.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=\"TEXTURE_CUBE_MAP_POSITIVE_Y\",E[E.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=\"TEXTURE_CUBE_MAP_NEGATIVE_Y\",E[E.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=\"TEXTURE_CUBE_MAP_POSITIVE_Z\",E[E.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=\"TEXTURE_CUBE_MAP_NEGATIVE_Z\"}(I||(I={})),function(E){E[E.UNSIGNED_BYTE=5121]=\"UNSIGNED_BYTE\",E[E.UNSIGNED_SHORT=5123]=\"UNSIGNED_SHORT\",E[E.UNSIGNED_SHORT_5_6_5=33635]=\"UNSIGNED_SHORT_5_6_5\",E[E.UNSIGNED_SHORT_4_4_4_4=32819]=\"UNSIGNED_SHORT_4_4_4_4\",E[E.UNSIGNED_SHORT_5_5_5_1=32820]=\"UNSIGNED_SHORT_5_5_5_1\",E[E.UNSIGNED_INT=5125]=\"UNSIGNED_INT\",E[E.UNSIGNED_INT_10F_11F_11F_REV=35899]=\"UNSIGNED_INT_10F_11F_11F_REV\",E[E.UNSIGNED_INT_2_10_10_10_REV=33640]=\"UNSIGNED_INT_2_10_10_10_REV\",E[E.UNSIGNED_INT_24_8=34042]=\"UNSIGNED_INT_24_8\",E[E.UNSIGNED_INT_5_9_9_9_REV=35902]=\"UNSIGNED_INT_5_9_9_9_REV\",E[E.BYTE=5120]=\"BYTE\",E[E.SHORT=5122]=\"SHORT\",E[E.INT=5124]=\"INT\",E[E.FLOAT=5126]=\"FLOAT\",E[E.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=\"FLOAT_32_UNSIGNED_INT_24_8_REV\",E[E.HALF_FLOAT=36193]=\"HALF_FLOAT\"}(e||(e={})),function(E){E[E.FLOAT=0]=\"FLOAT\",E[E.INT=1]=\"INT\",E[E.UINT=2]=\"UINT\"}(n||(n={})),function(E){E[E.NEAREST=0]=\"NEAREST\",E[E.LINEAR=1]=\"LINEAR\"}(O||(O={})),function(E){E[E.CLAMP=33071]=\"CLAMP\",E[E.REPEAT=10497]=\"REPEAT\",E[E.MIRRORED_REPEAT=33648]=\"MIRRORED_REPEAT\"}(L||(L={})),function(E){E[E.OFF=0]=\"OFF\",E[E.POW2=1]=\"POW2\",E[E.ON=2]=\"ON\",E[E.ON_MANUAL=3]=\"ON_MANUAL\"}(i||(i={})),function(E){E[E.NPM=0]=\"NPM\",E[E.UNPACK=1]=\"UNPACK\",E[E.PMA=2]=\"PMA\",E[E.NO_PREMULTIPLIED_ALPHA=0]=\"NO_PREMULTIPLIED_ALPHA\",E[E.PREMULTIPLY_ON_UPLOAD=1]=\"PREMULTIPLY_ON_UPLOAD\",E[E.PREMULTIPLY_ALPHA=2]=\"PREMULTIPLY_ALPHA\",E[E.PREMULTIPLIED_ALPHA=2]=\"PREMULTIPLIED_ALPHA\"}(t||(t={})),function(E){E[E.NO=0]=\"NO\",E[E.YES=1]=\"YES\",E[E.AUTO=2]=\"AUTO\",E[E.BLEND=0]=\"BLEND\",E[E.CLEAR=1]=\"CLEAR\",E[E.BLIT=2]=\"BLIT\"}(U||(U={})),function(E){E[E.AUTO=0]=\"AUTO\",E[E.MANUAL=1]=\"MANUAL\"}(o||(o={})),function(E){E.LOW=\"lowp\",E.MEDIUM=\"mediump\",E.HIGH=\"highp\"}(S||(S={})),function(E){E[E.NONE=0]=\"NONE\",E[E.SCISSOR=1]=\"SCISSOR\",E[E.STENCIL=2]=\"STENCIL\",E[E.SPRITE=3]=\"SPRITE\",E[E.COLOR=4]=\"COLOR\"}(P||(P={})),function(E){E[E.RED=1]=\"RED\",E[E.GREEN=2]=\"GREEN\",E[E.BLUE=4]=\"BLUE\",E[E.ALPHA=8]=\"ALPHA\"}(a||(a={})),function(E){E[E.NONE=0]=\"NONE\",E[E.LOW=2]=\"LOW\",E[E.MEDIUM=4]=\"MEDIUM\",E[E.HIGH=8]=\"HIGH\"}(r||(r={})),function(E){E[E.ELEMENT_ARRAY_BUFFER=34963]=\"ELEMENT_ARRAY_BUFFER\",E[E.ARRAY_BUFFER=34962]=\"ARRAY_BUFFER\",E[E.UNIFORM_BUFFER=35345]=\"UNIFORM_BUFFER\"}(M||(M={}));var D={createCanvas:function(E,_){var T=document.createElement(\"canvas\");return T.width=E,T.height=_,T},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var E;return null!==(E=document.baseURI)&&void 0!==E?E:window.location.href},fetch:function(E,_){return fetch(E,_)}},C=/iPhone/i,G=/iPod/i,u=/iPad/i,c=/\\biOS-universal(?:.+)Mac\\b/i,B=/\\bAndroid(?:.+)Mobile\\b/i,d=/Android/i,f=/(?:SD4930UR|\\bSilk(?:.+)Mobile\\b)/i,l=/Silk/i,H=/Windows Phone/i,p=/\\bWindows(?:.+)ARM\\b/i,F=/BlackBerry/i,v=/BB10/i,s=/Opera Mini/i,h=/\\b(CriOS|Chrome)(?:.+)Mobile/i,b=/Mobile(?:.+)Firefox\\b/i,g=function(E){return void 0!==E&&\"MacIntel\"===E.platform&&\"number\"==typeof E.maxTouchPoints&&E.maxTouchPoints>1&&\"undefined\"==typeof MSStream};var X=function(E){var _={userAgent:\"\",platform:\"\",maxTouchPoints:0};E||\"undefined\"==typeof navigator?\"string\"==typeof E?_.userAgent=E:E&&E.userAgent&&(_={userAgent:E.userAgent,platform:E.platform,maxTouchPoints:E.maxTouchPoints||0}):_={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var T=_.userAgent,N=T.split(\"[FBAN\");void 0!==N[1]&&(T=N[0]),void 0!==(N=T.split(\"Twitter\"))[1]&&(T=N[0]);var R=function(E){return function(_){return _.test(E)}}(T),A={apple:{phone:R(C)&&!R(H),ipod:R(G),tablet:!R(C)&&(R(u)||g(_))&&!R(H),universal:R(c),device:(R(C)||R(G)||R(u)||R(c)||g(_))&&!R(H)},amazon:{phone:R(f),tablet:!R(f)&&R(l),device:R(f)||R(l)},android:{phone:!R(H)&&R(f)||!R(H)&&R(B),tablet:!R(H)&&!R(f)&&!R(B)&&(R(l)||R(d)),device:!R(H)&&(R(f)||R(l)||R(B)||R(d))||R(/\\bokhttp\\b/i)},windows:{phone:R(H),tablet:R(p),device:R(H)||R(p)},other:{blackberry:R(F),blackberry10:R(v),opera:R(s),firefox:R(b),chrome:R(h),device:R(F)||R(v)||R(s)||R(b)||R(h)},any:!1,phone:!1,tablet:!1};return A.any=A.apple.device||A.android.device||A.windows.device||A.other.device,A.phone=A.apple.phone||A.android.phone||A.windows.phone,A.tablet=A.apple.tablet||A.android.tablet||A.windows.tablet,A}(globalThis.navigator);var V={ADAPTER:D,MIPMAP_TEXTURES:i.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:r.NONE,SPRITE_MAX_TEXTURES:function(E){var _=!0;if(X.tablet||X.phone){var T;if(X.apple.device)if(T=navigator.userAgent.match(/OS (\\d+)_(\\d+)?/))parseInt(T[1],10)<11&&(_=!1);if(X.android.device)if(T=navigator.userAgent.match(/Android\\s([0-9.]*)/))parseInt(T[1],10)<7&&(_=!1)}return _?E:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:o.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:L.CLAMP,SCALE_MODE:O.LINEAR,PRECISION_VERTEX:S.HIGH,PRECISION_FRAGMENT:X.apple.device?S.HIGH:S.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!X.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};export{D as BrowserAdapter,X as isMobile,V as settings};\n//# sourceMappingURL=settings.min.mjs.map\n","/*!\n * @pixi/polyfill - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/polyfill is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport a from\"promise-polyfill\";import r from\"object-assign\";\"undefined\"==typeof globalThis&&(\"undefined\"!=typeof self?self.globalThis=self:\"undefined\"!=typeof global&&(global.globalThis=global)),globalThis.Promise||(globalThis.Promise=a),Object.assign||(Object.assign=r);if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!globalThis.performance||!globalThis.performance.now){var e=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-e}}for(var o=Date.now(),i=[\"ms\",\"moz\",\"webkit\",\"o\"],n=0;n0?1:-1}),Number.isInteger||(Number.isInteger=function(a){return\"number\"==typeof a&&isFinite(a)&&Math.floor(a)===a}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array);\n//# sourceMappingURL=polyfill.min.mjs.map\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","'use strict';\n\nmodule.exports = earcut;\nmodule.exports.default = earcut;\n\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 32767 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim | 0);\n triangles.push(ear.i / dim | 0);\n triangles.push(next.i / dim | 0);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n var p = c.next;\n while (p !== a) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(x0, y0, minX, minY, invSize),\n maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim | 0);\n triangles.push(p.i / dim | 0);\n triangles.push(b.i / dim | 0);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n outerNode = eliminateHole(queue[i], outerNode);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n var bridge = findHoleBridge(hole, outerNode);\n if (!bridge) {\n return outerNode;\n }\n\n var bridgeReverse = splitPolygon(bridge, hole);\n\n // filter collinear points around the cuts\n filterPoints(bridgeReverse, bridgeReverse.next);\n return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n m = p.x < p.next.x ? p : p.next;\n if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = (x - minX) * invSize | 0;\n y = (y - minY) * invSize | 0;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = 0;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n","/*! https://mths.be/punycode v1.3.2 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see \n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * http://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.3.2',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see \n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n","'use strict';\n\nmodule.exports = {\n isString: function(arg) {\n return typeof(arg) === 'string';\n },\n isObject: function(arg) {\n return typeof(arg) === 'object' && arg !== null;\n },\n isNull: function(arg) {\n return arg === null;\n },\n isNullOrUndefined: function(arg) {\n return arg == null;\n }\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (Array.isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return Object.keys(obj).map(function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (Array.isArray(obj[k])) {\n return obj[k].map(function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar punycode = require('punycode');\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n\n var u = new Url;\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n var queryIndex = url.indexOf('?'),\n splitter =\n (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n hostEnd = hec;\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1)\n hostEnd = rest.length;\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n // now rest is set to the post-host stuff.\n // chop off any delim chars.\n if (!unsafeProtocol[lowerProto]) {\n\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1)\n continue;\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) this.pathname = rest;\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n //to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function() {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ?\n this.hostname :\n '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query &&\n util.isObject(this.query) &&\n Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n if (this.slashes ||\n (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n\n pathname = pathname.replace(/[?#]/g, function(match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol')\n result[rkey] = relative[rkey];\n }\n\n //urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] &&\n result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift()));\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n isRelAbs = (\n relative.host ||\n relative.pathname && relative.pathname.charAt(0) === '/'\n ),\n mustEndAbs = (isRelAbs || isSourceAbs ||\n (result.host && relative.pathname)),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;\n else srcPath.unshift(result.host);\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;\n else relPath.unshift(relative.host);\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = (relative.host || relative.host === '') ?\n relative.host : result.host;\n result.hostname = (relative.hostname || relative.hostname === '') ?\n relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift();\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n //to support http.request\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null;\n //to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (\n (result.host || relative.host || srcPath.length > 1) &&\n (last === '.' || last === '..') || last === '');\n\n // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' &&\n (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' ||\n (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' :\n srcPath.length ? srcPath.shift() : '';\n //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n var authInHost = result.host && result.host.indexOf('@') > 0 ?\n result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n }\n\n //to support request.http\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') +\n (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function() {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) this.hostname = host;\n};\n","/*!\n * @pixi/constants - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/constants is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nvar E,_,N,T,R,I,A,L,O,U,S,P,D,G,C,M,B,H,F,n;!function(E){E[E.WEBGL_LEGACY=0]=\"WEBGL_LEGACY\",E[E.WEBGL=1]=\"WEBGL\",E[E.WEBGL2=2]=\"WEBGL2\"}(E||(E={})),function(E){E[E.UNKNOWN=0]=\"UNKNOWN\",E[E.WEBGL=1]=\"WEBGL\",E[E.CANVAS=2]=\"CANVAS\"}(_||(_={})),function(E){E[E.COLOR=16384]=\"COLOR\",E[E.DEPTH=256]=\"DEPTH\",E[E.STENCIL=1024]=\"STENCIL\"}(N||(N={})),function(E){E[E.NORMAL=0]=\"NORMAL\",E[E.ADD=1]=\"ADD\",E[E.MULTIPLY=2]=\"MULTIPLY\",E[E.SCREEN=3]=\"SCREEN\",E[E.OVERLAY=4]=\"OVERLAY\",E[E.DARKEN=5]=\"DARKEN\",E[E.LIGHTEN=6]=\"LIGHTEN\",E[E.COLOR_DODGE=7]=\"COLOR_DODGE\",E[E.COLOR_BURN=8]=\"COLOR_BURN\",E[E.HARD_LIGHT=9]=\"HARD_LIGHT\",E[E.SOFT_LIGHT=10]=\"SOFT_LIGHT\",E[E.DIFFERENCE=11]=\"DIFFERENCE\",E[E.EXCLUSION=12]=\"EXCLUSION\",E[E.HUE=13]=\"HUE\",E[E.SATURATION=14]=\"SATURATION\",E[E.COLOR=15]=\"COLOR\",E[E.LUMINOSITY=16]=\"LUMINOSITY\",E[E.NORMAL_NPM=17]=\"NORMAL_NPM\",E[E.ADD_NPM=18]=\"ADD_NPM\",E[E.SCREEN_NPM=19]=\"SCREEN_NPM\",E[E.NONE=20]=\"NONE\",E[E.SRC_OVER=0]=\"SRC_OVER\",E[E.SRC_IN=21]=\"SRC_IN\",E[E.SRC_OUT=22]=\"SRC_OUT\",E[E.SRC_ATOP=23]=\"SRC_ATOP\",E[E.DST_OVER=24]=\"DST_OVER\",E[E.DST_IN=25]=\"DST_IN\",E[E.DST_OUT=26]=\"DST_OUT\",E[E.DST_ATOP=27]=\"DST_ATOP\",E[E.ERASE=26]=\"ERASE\",E[E.SUBTRACT=28]=\"SUBTRACT\",E[E.XOR=29]=\"XOR\"}(T||(T={})),function(E){E[E.POINTS=0]=\"POINTS\",E[E.LINES=1]=\"LINES\",E[E.LINE_LOOP=2]=\"LINE_LOOP\",E[E.LINE_STRIP=3]=\"LINE_STRIP\",E[E.TRIANGLES=4]=\"TRIANGLES\",E[E.TRIANGLE_STRIP=5]=\"TRIANGLE_STRIP\",E[E.TRIANGLE_FAN=6]=\"TRIANGLE_FAN\"}(R||(R={})),function(E){E[E.RGBA=6408]=\"RGBA\",E[E.RGB=6407]=\"RGB\",E[E.RG=33319]=\"RG\",E[E.RED=6403]=\"RED\",E[E.RGBA_INTEGER=36249]=\"RGBA_INTEGER\",E[E.RGB_INTEGER=36248]=\"RGB_INTEGER\",E[E.RG_INTEGER=33320]=\"RG_INTEGER\",E[E.RED_INTEGER=36244]=\"RED_INTEGER\",E[E.ALPHA=6406]=\"ALPHA\",E[E.LUMINANCE=6409]=\"LUMINANCE\",E[E.LUMINANCE_ALPHA=6410]=\"LUMINANCE_ALPHA\",E[E.DEPTH_COMPONENT=6402]=\"DEPTH_COMPONENT\",E[E.DEPTH_STENCIL=34041]=\"DEPTH_STENCIL\"}(I||(I={})),function(E){E[E.TEXTURE_2D=3553]=\"TEXTURE_2D\",E[E.TEXTURE_CUBE_MAP=34067]=\"TEXTURE_CUBE_MAP\",E[E.TEXTURE_2D_ARRAY=35866]=\"TEXTURE_2D_ARRAY\",E[E.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=\"TEXTURE_CUBE_MAP_POSITIVE_X\",E[E.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=\"TEXTURE_CUBE_MAP_NEGATIVE_X\",E[E.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=\"TEXTURE_CUBE_MAP_POSITIVE_Y\",E[E.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=\"TEXTURE_CUBE_MAP_NEGATIVE_Y\",E[E.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=\"TEXTURE_CUBE_MAP_POSITIVE_Z\",E[E.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=\"TEXTURE_CUBE_MAP_NEGATIVE_Z\"}(A||(A={})),function(E){E[E.UNSIGNED_BYTE=5121]=\"UNSIGNED_BYTE\",E[E.UNSIGNED_SHORT=5123]=\"UNSIGNED_SHORT\",E[E.UNSIGNED_SHORT_5_6_5=33635]=\"UNSIGNED_SHORT_5_6_5\",E[E.UNSIGNED_SHORT_4_4_4_4=32819]=\"UNSIGNED_SHORT_4_4_4_4\",E[E.UNSIGNED_SHORT_5_5_5_1=32820]=\"UNSIGNED_SHORT_5_5_5_1\",E[E.UNSIGNED_INT=5125]=\"UNSIGNED_INT\",E[E.UNSIGNED_INT_10F_11F_11F_REV=35899]=\"UNSIGNED_INT_10F_11F_11F_REV\",E[E.UNSIGNED_INT_2_10_10_10_REV=33640]=\"UNSIGNED_INT_2_10_10_10_REV\",E[E.UNSIGNED_INT_24_8=34042]=\"UNSIGNED_INT_24_8\",E[E.UNSIGNED_INT_5_9_9_9_REV=35902]=\"UNSIGNED_INT_5_9_9_9_REV\",E[E.BYTE=5120]=\"BYTE\",E[E.SHORT=5122]=\"SHORT\",E[E.INT=5124]=\"INT\",E[E.FLOAT=5126]=\"FLOAT\",E[E.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=\"FLOAT_32_UNSIGNED_INT_24_8_REV\",E[E.HALF_FLOAT=36193]=\"HALF_FLOAT\"}(L||(L={})),function(E){E[E.FLOAT=0]=\"FLOAT\",E[E.INT=1]=\"INT\",E[E.UINT=2]=\"UINT\"}(O||(O={})),function(E){E[E.NEAREST=0]=\"NEAREST\",E[E.LINEAR=1]=\"LINEAR\"}(U||(U={})),function(E){E[E.CLAMP=33071]=\"CLAMP\",E[E.REPEAT=10497]=\"REPEAT\",E[E.MIRRORED_REPEAT=33648]=\"MIRRORED_REPEAT\"}(S||(S={})),function(E){E[E.OFF=0]=\"OFF\",E[E.POW2=1]=\"POW2\",E[E.ON=2]=\"ON\",E[E.ON_MANUAL=3]=\"ON_MANUAL\"}(P||(P={})),function(E){E[E.NPM=0]=\"NPM\",E[E.UNPACK=1]=\"UNPACK\",E[E.PMA=2]=\"PMA\",E[E.NO_PREMULTIPLIED_ALPHA=0]=\"NO_PREMULTIPLIED_ALPHA\",E[E.PREMULTIPLY_ON_UPLOAD=1]=\"PREMULTIPLY_ON_UPLOAD\",E[E.PREMULTIPLY_ALPHA=2]=\"PREMULTIPLY_ALPHA\",E[E.PREMULTIPLIED_ALPHA=2]=\"PREMULTIPLIED_ALPHA\"}(D||(D={})),function(E){E[E.NO=0]=\"NO\",E[E.YES=1]=\"YES\",E[E.AUTO=2]=\"AUTO\",E[E.BLEND=0]=\"BLEND\",E[E.CLEAR=1]=\"CLEAR\",E[E.BLIT=2]=\"BLIT\"}(G||(G={})),function(E){E[E.AUTO=0]=\"AUTO\",E[E.MANUAL=1]=\"MANUAL\"}(C||(C={})),function(E){E.LOW=\"lowp\",E.MEDIUM=\"mediump\",E.HIGH=\"highp\"}(M||(M={})),function(E){E[E.NONE=0]=\"NONE\",E[E.SCISSOR=1]=\"SCISSOR\",E[E.STENCIL=2]=\"STENCIL\",E[E.SPRITE=3]=\"SPRITE\",E[E.COLOR=4]=\"COLOR\"}(B||(B={})),function(E){E[E.RED=1]=\"RED\",E[E.GREEN=2]=\"GREEN\",E[E.BLUE=4]=\"BLUE\",E[E.ALPHA=8]=\"ALPHA\"}(H||(H={})),function(E){E[E.NONE=0]=\"NONE\",E[E.LOW=2]=\"LOW\",E[E.MEDIUM=4]=\"MEDIUM\",E[E.HIGH=8]=\"HIGH\"}(F||(F={})),function(E){E[E.ELEMENT_ARRAY_BUFFER=34963]=\"ELEMENT_ARRAY_BUFFER\",E[E.ARRAY_BUFFER=34962]=\"ARRAY_BUFFER\",E[E.UNIFORM_BUFFER=35345]=\"UNIFORM_BUFFER\"}(n||(n={}));export{D as ALPHA_MODES,T as BLEND_MODES,N as BUFFER_BITS,n as BUFFER_TYPE,G as CLEAR_MODES,H as COLOR_MASK_BITS,R as DRAW_MODES,E as ENV,I as FORMATS,C as GC_MODES,B as MASK_TYPES,P as MIPMAP_MODES,F as MSAA_QUALITY,M as PRECISION,_ as RENDERER_TYPE,O as SAMPLER_TYPES,U as SCALE_MODES,A as TARGETS,L as TYPES,S as WRAP_MODES};\n//# sourceMappingURL=constants.min.mjs.map\n","/*!\n * @pixi/utils - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/utils is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{settings as e}from\"@pixi/settings\";export{isMobile}from\"@pixi/settings\";export{default as EventEmitter}from\"eventemitter3\";export{default as earcut}from\"earcut\";import{parse as r,format as t,resolve as n}from\"url\";import{BLEND_MODES as a}from\"@pixi/constants\";var o={parse:r,format:t,resolve:n};e.RETINA_PREFIX=/@([0-9\\.]+)x/,e.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var f,i=!1;function l(){i=!0}function c(r){var t;if(!i){if(e.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf(\"chrome\")>-1){var n=[\"\\n %c %c %c PixiJS 6.5.1 - ✰ \"+r+\" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \\n\\n\",\"background: #ff66a5; padding:5px 0;\",\"background: #ff66a5; padding:5px 0;\",\"color: #ff66a5; background: #030307; padding:5px 0;\",\"background: #ff66a5; padding:5px 0;\",\"background: #ffc3dc; padding:5px 0;\",\"background: #ff66a5; padding:5px 0;\",\"color: #ff2424; background: #fff; padding:5px 0;\",\"color: #ff2424; background: #fff; padding:5px 0;\",\"color: #ff2424; background: #fff; padding:5px 0;\"];(t=globalThis.console).log.apply(t,n)}else globalThis.console&&globalThis.console.log(\"PixiJS 6.5.1 - \"+r+\" - http://www.pixijs.com/\");i=!0}}function d(){return void 0===f&&(f=function(){var r={stencil:!0,failIfMajorPerformanceCaveat:e.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!e.ADAPTER.getWebGLRenderingContext())return!1;var t=e.ADAPTER.createCanvas(),n=t.getContext(\"webgl\",r)||t.getContext(\"experimental-webgl\",r),a=!(!n||!n.getContextAttributes().stencil);if(n){var o=n.getExtension(\"WEBGL_lose_context\");o&&o.loseContext()}return n=null,a}catch(e){return!1}}()),f}var u={aliceblue:\"#f0f8ff\",antiquewhite:\"#faebd7\",aqua:\"#00ffff\",aquamarine:\"#7fffd4\",azure:\"#f0ffff\",beige:\"#f5f5dc\",bisque:\"#ffe4c4\",black:\"#000000\",blanchedalmond:\"#ffebcd\",blue:\"#0000ff\",blueviolet:\"#8a2be2\",brown:\"#a52a2a\",burlywood:\"#deb887\",cadetblue:\"#5f9ea0\",chartreuse:\"#7fff00\",chocolate:\"#d2691e\",coral:\"#ff7f50\",cornflowerblue:\"#6495ed\",cornsilk:\"#fff8dc\",crimson:\"#dc143c\",cyan:\"#00ffff\",darkblue:\"#00008b\",darkcyan:\"#008b8b\",darkgoldenrod:\"#b8860b\",darkgray:\"#a9a9a9\",darkgreen:\"#006400\",darkgrey:\"#a9a9a9\",darkkhaki:\"#bdb76b\",darkmagenta:\"#8b008b\",darkolivegreen:\"#556b2f\",darkorange:\"#ff8c00\",darkorchid:\"#9932cc\",darkred:\"#8b0000\",darksalmon:\"#e9967a\",darkseagreen:\"#8fbc8f\",darkslateblue:\"#483d8b\",darkslategray:\"#2f4f4f\",darkslategrey:\"#2f4f4f\",darkturquoise:\"#00ced1\",darkviolet:\"#9400d3\",deeppink:\"#ff1493\",deepskyblue:\"#00bfff\",dimgray:\"#696969\",dimgrey:\"#696969\",dodgerblue:\"#1e90ff\",firebrick:\"#b22222\",floralwhite:\"#fffaf0\",forestgreen:\"#228b22\",fuchsia:\"#ff00ff\",gainsboro:\"#dcdcdc\",ghostwhite:\"#f8f8ff\",goldenrod:\"#daa520\",gold:\"#ffd700\",gray:\"#808080\",green:\"#008000\",greenyellow:\"#adff2f\",grey:\"#808080\",honeydew:\"#f0fff0\",hotpink:\"#ff69b4\",indianred:\"#cd5c5c\",indigo:\"#4b0082\",ivory:\"#fffff0\",khaki:\"#f0e68c\",lavenderblush:\"#fff0f5\",lavender:\"#e6e6fa\",lawngreen:\"#7cfc00\",lemonchiffon:\"#fffacd\",lightblue:\"#add8e6\",lightcoral:\"#f08080\",lightcyan:\"#e0ffff\",lightgoldenrodyellow:\"#fafad2\",lightgray:\"#d3d3d3\",lightgreen:\"#90ee90\",lightgrey:\"#d3d3d3\",lightpink:\"#ffb6c1\",lightsalmon:\"#ffa07a\",lightseagreen:\"#20b2aa\",lightskyblue:\"#87cefa\",lightslategray:\"#778899\",lightslategrey:\"#778899\",lightsteelblue:\"#b0c4de\",lightyellow:\"#ffffe0\",lime:\"#00ff00\",limegreen:\"#32cd32\",linen:\"#faf0e6\",magenta:\"#ff00ff\",maroon:\"#800000\",mediumaquamarine:\"#66cdaa\",mediumblue:\"#0000cd\",mediumorchid:\"#ba55d3\",mediumpurple:\"#9370db\",mediumseagreen:\"#3cb371\",mediumslateblue:\"#7b68ee\",mediumspringgreen:\"#00fa9a\",mediumturquoise:\"#48d1cc\",mediumvioletred:\"#c71585\",midnightblue:\"#191970\",mintcream:\"#f5fffa\",mistyrose:\"#ffe4e1\",moccasin:\"#ffe4b5\",navajowhite:\"#ffdead\",navy:\"#000080\",oldlace:\"#fdf5e6\",olive:\"#808000\",olivedrab:\"#6b8e23\",orange:\"#ffa500\",orangered:\"#ff4500\",orchid:\"#da70d6\",palegoldenrod:\"#eee8aa\",palegreen:\"#98fb98\",paleturquoise:\"#afeeee\",palevioletred:\"#db7093\",papayawhip:\"#ffefd5\",peachpuff:\"#ffdab9\",peru:\"#cd853f\",pink:\"#ffc0cb\",plum:\"#dda0dd\",powderblue:\"#b0e0e6\",purple:\"#800080\",rebeccapurple:\"#663399\",red:\"#ff0000\",rosybrown:\"#bc8f8f\",royalblue:\"#4169e1\",saddlebrown:\"#8b4513\",salmon:\"#fa8072\",sandybrown:\"#f4a460\",seagreen:\"#2e8b57\",seashell:\"#fff5ee\",sienna:\"#a0522d\",silver:\"#c0c0c0\",skyblue:\"#87ceeb\",slateblue:\"#6a5acd\",slategray:\"#708090\",slategrey:\"#708090\",snow:\"#fffafa\",springgreen:\"#00ff7f\",steelblue:\"#4682b4\",tan:\"#d2b48c\",teal:\"#008080\",thistle:\"#d8bfd8\",tomato:\"#ff6347\",turquoise:\"#40e0d0\",violet:\"#ee82ee\",wheat:\"#f5deb3\",white:\"#ffffff\",whitesmoke:\"#f5f5f5\",yellow:\"#ffff00\",yellowgreen:\"#9acd32\"};function s(e,r){return void 0===r&&(r=[]),r[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,r}function g(e){var r=e.toString(16);return\"#\"+(r=\"000000\".substring(0,6-r.length)+r)}function h(e){return\"string\"==typeof e&&\"#\"===(e=u[e.toLowerCase()]||e)[0]&&(e=e.slice(1)),parseInt(e,16)}function b(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)}var p=function(){for(var e=[],r=[],t=0;t<32;t++)e[t]=t,r[t]=t;e[a.NORMAL_NPM]=a.NORMAL,e[a.ADD_NPM]=a.ADD,e[a.SCREEN_NPM]=a.SCREEN,r[a.NORMAL]=a.NORMAL_NPM,r[a.ADD]=a.ADD_NPM,r[a.SCREEN]=a.SCREEN_NPM;var n=[];return n.push(r),n.push(e),n}();function v(e,r){return p[r?1:0][e]}function m(e,r,t,n){return t=t||new Float32Array(4),n||void 0===n?(t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r):(t[0]=e[0],t[1]=e[1],t[2]=e[2]),t[3]=r,t}function y(e,r){if(1===r)return(255*r<<24)+e;if(0===r)return 0;var t=e>>16&255,n=e>>8&255,a=255&e;return(255*r<<24)+((t=t*r+.5|0)<<16)+((n=n*r+.5|0)<<8)+(a=a*r+.5|0)}function w(e,r,t,n){return(t=t||new Float32Array(4))[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,(n||void 0===n)&&(t[0]*=r,t[1]*=r,t[2]*=r),t[3]=r,t}function A(e,r){void 0===r&&(r=null);var t=6*e;if((r=r||new Uint16Array(t)).length!==t)throw new Error(\"Out buffer length is incorrect, got \"+r.length+\" and expected \"+t);for(var n=0,a=0;n>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1}function C(e){return!(e&e-1||!e)}function P(e){var r=(e>65535?1:0)<<4,t=((e>>>=r)>255?1:0)<<3;return r|=t,r|=t=((e>>>=t)>15?1:0)<<2,(r|=t=((e>>>=t)>3?1:0)<<1)|(e>>>=t)>>1}function _(e,r,t){var n,a=e.length;if(!(r>=a||0===t)){var o=a-(t=r+t>a?a-r:t);for(n=r;n=this.x&&t=this.y&&it.right?t.right:this.right)<=h)return!1;var s=this.yt.bottom?t.bottom:this.bottom)>s}var o=this.left,r=this.right,e=this.top,a=this.bottom;if(r<=o||a<=e)return!1;var c=n[0].set(t.left,t.top),y=n[1].set(t.left,t.bottom),u=n[2].set(t.right,t.top),p=n[3].set(t.right,t.bottom);if(u.x<=c.x||y.y<=c.y)return!1;var x=Math.sign(i.a*i.d-i.b*i.c);if(0===x)return!1;if(i.apply(c,c),i.apply(y,y),i.apply(u,u),i.apply(p,p),Math.max(c.x,y.x,u.x,p.x)<=o||Math.min(c.x,y.x,u.x,p.x)>=r||Math.max(c.y,y.y,u.y,p.y)<=e||Math.min(c.y,y.y,u.y,p.y)>=a)return!1;var d=x*(y.y-c.y),f=x*(c.x-y.x),l=d*o+f*e,b=d*r+f*e,v=d*o+f*a,w=d*r+f*a;if(Math.max(l,b,v,w)<=d*c.x+f*c.y||Math.min(l,b,v,w)>=d*p.x+f*p.y)return!1;var _=x*(c.y-u.y),g=x*(u.x-c.x),m=_*o+g*e,M=_*r+g*e,I=_*o+g*a,D=_*r+g*a;return!(Math.max(m,M,I,D)<=_*c.x+g*c.y||Math.min(m,M,I,D)>=_*p.x+g*p.y)},i.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},i.prototype.fit=function(t){var i=Math.max(this.x,t.x),h=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(h-i,0),this.y=s,this.height=Math.max(o-s,0),this},i.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var h=Math.ceil((this.x+this.width-i)*t)/t,s=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=h-this.x,this.height=s-this.y,this},i.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),h=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=h-i,this.y=s,this.height=o-s,this},i}(),e=function(){function i(i,h,s){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),this.x=i,this.y=h,this.radius=s,this.type=t.CIRC}return i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,i){if(this.radius<=0)return!1;var h=this.radius*this.radius,s=this.x-t,o=this.y-i;return(s*=s)+(o*=o)<=h},i.prototype.getBounds=function(){return new r(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},i}(),a=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=i,this.y=h,this.width=s,this.height=o,this.type=t.ELIP}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var h=(t-this.x)/this.width,s=(i-this.y)/this.height;return(h*=h)+(s*=s)<=1},i.prototype.getBounds=function(){return new r(this.x-this.width,this.y-this.height,this.width,this.height)},i}(),c=function(){function i(){for(var i=arguments,h=[],s=0;si!=c>i&&t<(i-e)/(c-e)*(a-r)+r&&(h=!h)}return h},i}(),y=function(){function i(i,h,s,o,n){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===n&&(n=20),this.x=i,this.y=h,this.width=s,this.height=o,this.radius=n,this.type=t.RREC}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){var h=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+h&&i<=this.y+this.height-h||t>=this.x+h&&t<=this.x+this.width-h)return!0;var s=t-(this.x+h),o=i-(this.y+h),n=h*h;if(s*s+o*o<=n)return!0;if((s=t-(this.x+this.width-h))*s+o*o<=n)return!0;if(s*s+(o=i-(this.y+this.height-h))*o<=n)return!0;if((s=t-(this.x+h))*s+o*o<=n)return!0}return!1},i}(),u=function(){function t(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0),this._x=h,this._y=s,this.cb=t,this.scope=i}return t.prototype.clone=function(i,h){return void 0===i&&(i=this.cb),void 0===h&&(h=this.scope),new t(i,h,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,\"x\",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"y\",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),p=function(){function t(t,i,h,s,o,n){void 0===t&&(t=1),void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=1),void 0===o&&(o=0),void 0===n&&(n=0),this.array=null,this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,h,s,o,n){return this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var h=i||this.array;return t?(h[0]=this.a,h[1]=this.b,h[2]=0,h[3]=this.c,h[4]=this.d,h[5]=0,h[6]=this.tx,h[7]=this.ty,h[8]=1):(h[0]=this.a,h[1]=this.c,h[2]=this.tx,h[3]=this.b,h[4]=this.d,h[5]=this.ty,h[6]=0,h[7]=0,h[8]=1),h},t.prototype.apply=function(t,i){i=i||new o;var h=t.x,s=t.y;return i.x=this.a*h+this.c*s+this.tx,i.y=this.b*h+this.d*s+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new o;var h=1/(this.a*this.d+this.c*-this.b),s=t.x,n=t.y;return i.x=this.d*h*s+-this.c*h*n+(this.ty*this.c-this.tx*this.d)*h,i.y=this.a*h*n+-this.b*h*s+(-this.ty*this.a+this.tx*this.b)*h,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),h=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*i-this.b*h,this.b=s*h+this.b*i,this.c=o*i-this.d*h,this.d=o*h+this.d*i,this.tx=n*i-this.ty*h,this.ty=n*h+this.ty*i,this},t.prototype.append=function(t){var i=this.a,h=this.b,s=this.c,o=this.d;return this.a=t.a*i+t.b*s,this.b=t.a*h+t.b*o,this.c=t.c*i+t.d*s,this.d=t.c*h+t.d*o,this.tx=t.tx*i+t.ty*s+this.tx,this.ty=t.tx*h+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,h,s,o,n,r,e,a){return this.a=Math.cos(r+a)*o,this.b=Math.sin(r+a)*o,this.c=-Math.sin(r-e)*n,this.d=Math.cos(r-e)*n,this.tx=t-(h*this.a+s*this.c),this.ty=i-(h*this.b+s*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var h=this.a,s=this.c;this.a=h*t.a+this.b*t.c,this.b=h*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var h=this.a,s=this.b,o=this.c,n=this.d,r=t.pivot,e=-Math.atan2(-o,n),a=Math.atan2(s,h),c=Math.abs(e+a);return c<1e-5||Math.abs(i-c)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=a),t.scale.x=Math.sqrt(h*h+s*s),t.scale.y=Math.sqrt(o*o+n*n),t.position.x=this.tx+(r.x*h+r.y*o),t.position.y=this.ty+(r.x*s+r.y*n),t},t.prototype.invert=function(){var t=this.a,i=this.b,h=this.c,s=this.d,o=this.tx,n=t*s-i*h;return this.a=s/n,this.b=-i/n,this.c=-h/n,this.d=t/n,this.tx=(h*this.ty-s*o)/n,this.ty=-(t*this.ty-i*o)/n,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,\"IDENTITY\",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,\"TEMP_MATRIX\",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),x=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],d=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],f=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],l=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],b=[],v=[],w=Math.sign;!function(){for(var t=0;t<16;t++){var i=[];b.push(i);for(var h=0;h<16;h++)for(var s=w(x[t]*x[h]+f[t]*d[h]),o=w(d[t]*x[h]+l[t]*d[h]),n=w(x[t]*f[h]+f[t]*l[h]),r=w(d[t]*f[h]+l[t]*l[h]),e=0;e<16;e++)if(x[e]===s&&d[e]===o&&f[e]===n&&l[e]===r){i.push(e);break}}for(t=0;t<16;t++){var a=new p;a.set(x[t],d[t],f[t],l[t],0,0),v.push(a)}}();var _={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return x[t]},uY:function(t){return d[t]},vX:function(t){return f[t]},vY:function(t){return l[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return b[t][i]},sub:function(t,i){return b[t][_.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?_.S:_.N:2*Math.abs(i)<=Math.abs(t)?t>0?_.E:_.W:i>0?t>0?_.SE:_.SW:t>0?_.NE:_.NW},matrixAppendRotationInv:function(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0);var o=v[_.inv(i)];o.tx=h,o.ty=s,t.append(o)}},g=function(){function t(){this.worldTransform=new p,this.localTransform=new p,this.position=new u(this.onChange,this,0,0),this.scale=new u(this.onChange,this,1,1),this.pivot=new u(this.onChange,this,0,0),this.skew=new u(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var h=t.worldTransform,s=this.worldTransform;s.a=i.a*h.a+i.b*h.c,s.b=i.a*h.b+i.b*h.d,s.c=i.c*h.a+i.d*h.c,s.d=i.c*h.b+i.d*h.d,s.tx=i.tx*h.a+i.ty*h.c+h.tx,s.ty=i.tx*h.b+i.ty*h.d+h.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,\"rotation\",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();export{e as Circle,s as DEG_TO_RAD,a as Ellipse,p as Matrix,u as ObservablePoint,i as PI_2,o as Point,c as Polygon,h as RAD_TO_DEG,r as Rectangle,y as RoundedRectangle,t as SHAPES,g as Transform,_ as groupD8};\n//# sourceMappingURL=math.min.mjs.map\n","/*!\n * @pixi/display - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/display is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{settings as t}from\"@pixi/settings\";import{Rectangle as i,RAD_TO_DEG as e,DEG_TO_RAD as n,Transform as r}from\"@pixi/math\";import{EventEmitter as s,removeItems as o}from\"@pixi/utils\";t.SORTABLE_CHILDREN=!1;var a=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?i.EMPTY:((t=t||new i(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},t.prototype.addPointMatrix=function(t,i){var e=t.a,n=t.b,r=t.c,s=t.d,o=t.tx,a=t.ty,h=e*i.x+r*i.y+o,l=n*i.x+s*i.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},t.prototype.addQuad=function(t){var i=this.minX,e=this.minY,n=this.maxX,r=this.maxY,s=t[0],o=t[1];i=sn?s:n,r=o>r?o:r,i=(s=t[2])n?s:n,r=o>r?o:r,i=(s=t[4])n?s:n,r=o>r?o:r,i=(s=t[6])n?s:n,r=o>r?o:r,this.minX=i,this.minY=e,this.maxX=n,this.maxY=r},t.prototype.addFrame=function(t,i,e,n,r){this.addFrameMatrix(t.worldTransform,i,e,n,r)},t.prototype.addFrameMatrix=function(t,i,e,n,r){var s=t.a,o=t.b,a=t.c,h=t.d,l=t.tx,d=t.ty,u=this.minX,_=this.minY,p=this.maxX,m=this.maxY,c=s*i+a*e+l,f=o*i+h*e+d;u=cp?c:p,m=f>m?f:m,u=(c=s*n+a*e+l)p?c:p,m=f>m?f:m,u=(c=s*i+a*r+l)p?c:p,m=f>m?f:m,u=(c=s*n+a*r+l)p?c:p,m=f>m?f:m,this.minX=u,this.minY=_,this.maxX=p,this.maxY=m},t.prototype.addVertexData=function(t,i,e){for(var n=this.minX,r=this.minY,s=this.maxX,o=this.maxY,a=i;as?h:s,o=l>o?l:o}this.minX=n,this.minY=r,this.maxX=s,this.maxY=o},t.prototype.addVertices=function(t,i,e,n){this.addVerticesMatrix(t.worldTransform,i,e,n)},t.prototype.addVerticesMatrix=function(t,i,e,n,r,s){void 0===r&&(r=0),void 0===s&&(s=r);for(var o=t.a,a=t.b,h=t.c,l=t.d,d=t.tx,u=t.ty,_=this.minX,p=this.minY,m=this.maxX,c=this.maxY,f=e;fn?t.maxX:n,this.maxY=t.maxY>r?t.maxY:r},t.prototype.addBoundsMask=function(t,i){var e=t.minX>i.minX?t.minX:i.minX,n=t.minY>i.minY?t.minY:i.minY,r=t.maxXh?r:h,this.maxY=s>l?s:l}},t.prototype.addBoundsMatrix=function(t,i){this.addFrameMatrix(i,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,i){var e=t.minX>i.x?t.minX:i.x,n=t.minY>i.y?t.minY:i.y,r=t.maxXh?r:h,this.maxY=s>l?s:l}},t.prototype.pad=function(t,i){void 0===t&&(t=0),void 0===i&&(i=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=i,this.maxY+=i)},t.prototype.addFramePad=function(t,i,e,n,r,s){t-=r,i-=s,e+=r,n+=s,this.minX=this.minXe?this.maxX:e,this.minY=this.minYn?this.maxY:n},t}(),h=function(t,i){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])},h(t,i)};function l(t,i){function e(){this.constructor=t}h(t,i),t.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}var d,u,_,p,m,c,f,E,T,N,R,I,A,O,y,b,P,L,x,D,U=function(t){function s(){var i=t.call(this)||this;return i.tempDisplayObjectParent=null,i.transform=new r,i.alpha=1,i.visible=!0,i.renderable=!0,i.cullable=!1,i.cullArea=null,i.parent=null,i.worldAlpha=1,i._lastSortedIndex=0,i._zIndex=0,i.filterArea=null,i.filters=null,i._enabledFilters=null,i._bounds=new a,i._localBounds=null,i._boundsID=0,i._boundsRect=null,i._localBoundsRect=null,i._mask=null,i._maskRefCount=0,i._destroyed=!1,i.isSprite=!1,i.isMask=!1,i}return l(s,t),s.mixin=function(t){for(var i=Object.keys(t),e=0;e1)for(var n=0;nthis.children.length)throw new Error(t+\"addChildAt: The index \"+i+\" supplied is out of bounds \"+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(i,0,t),this._boundsID++,this.onChildrenChange(i),t.emit(\"added\",this),this.emit(\"childAdded\",t,this,i),t},e.prototype.swapChildren=function(t,i){if(t!==i){var e=this.getChildIndex(t),n=this.getChildIndex(i);this.children[e]=i,this.children[n]=t,this.onChildrenChange(e=this.children.length)throw new Error(\"The index \"+i+\" supplied is out of bounds \"+this.children.length);var e=this.getChildIndex(t);o(this.children,e,1),this.children.splice(i,0,t),this.onChildrenChange(i)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error(\"getChildAt: Index (\"+t+\") does not exist.\");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,i=[],e=0;e1)for(var n=0;n0&&r<=i){e=this.children.splice(n,r);for(var s=0;s1&&this.children.sort(v),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,i=this.children.length;t0&&i.height>0){var n,r;if(this.cullArea?(n=this.cullArea,r=this.worldTransform):this._render!==e.prototype._render&&(n=this.getBounds(!0)),n&&i.intersects(n,r))this._render(t);else if(this.cullArea)return;for(var s=0,o=this.children.length;s8)throw new Error(\"max arguments reached\");var u=this,a=u.name,m=u.items;this._aliasCount++;for(var p=0,l=m.length;p0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,\"empty\",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"name\",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(t.prototype,{dispatch:{value:t.prototype.emit},run:{value:t.prototype.emit}});export{t as Runner};\n//# sourceMappingURL=runner.min.mjs.map\n","/*!\n * @pixi/ticker - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/ticker is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{settings as t}from\"@pixi/settings\";import{ExtensionType as e}from\"@pixi/extensions\";var i;t.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]=\"INTERACTION\",t[t.HIGH=25]=\"HIGH\",t[t.NORMAL=0]=\"NORMAL\",t[t.LOW=-25]=\"LOW\",t[t.UTILITY=-50]=\"UTILITY\"}(i||(i={}));var s=function(){function t(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=0),void 0===s&&(s=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=s}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),n=function(){function e(){var e=this;this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new s(null,null,1/0),this.deltaMS=1/t.TARGET_FPMS,this.elapsedMS=1/t.TARGET_FPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&null===e._requestId&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return e.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},e.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},e.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},e.prototype.add=function(t,e,n){return void 0===n&&(n=i.NORMAL),this._addListener(new s(t,e,n))},e.prototype.addOnce=function(t,e,n){return void 0===n&&(n=i.NORMAL),this._addListener(new s(t,e,n,!0))},e.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},e.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(e.prototype,\"count\",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},e.prototype.update=function(e){var i;if(void 0===e&&(e=performance.now()),e>this.lastTime){if((i=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(i=this._maxElapsedMS),i*=this.speed,this._minElapsedMS){var s=e-this._lastFrame|0;if(s=0;--n){var o=Y[n];if(o.test&&o.test(e,r))return new o(e,t)}throw new Error(\"Unrecognized source type to auto-detect Resource\")}var q=function(e,t){return q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},q(e,t)};function Z(e,t){function r(){this.constructor=e}q(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var $=function(){return $=Object.assign||function(e){for(var t,r=arguments,i=1,n=arguments.length;i0&&p>0,u.textureCacheIds=[],u.destroyed=!1,u.resource=null,u._batchEnabled=0,u._batchLocation=0,u.parentTextureArray=null,u.setResource(i),u}return Z(i,t),Object.defineProperty(i.prototype,\"realWidth\",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"realHeight\",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"mipmap\",{get:function(){return this._mipmap},set:function(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"scaleMode\",{get:function(){return this._scaleMode},set:function(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,\"wrapMode\",{get:function(){return this._wrapMode},set:function(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),i.prototype.setStyle=function(e,t){var r;return void 0!==e&&e!==this.scaleMode&&(this.scaleMode=e,r=!0),void 0!==t&&t!==this.mipmap&&(this.mipmap=t,r=!0),r&&this.dirtyStyleId++,this},i.prototype.setSize=function(e,t,r){return r=r||this.resolution,this.setRealSize(e*r,t*r,r)},i.prototype.setRealSize=function(e,t,r){return this.resolution=r||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(t)/this.resolution,this._refreshPOT(),this.update(),this},i.prototype._refreshPOT=function(){this.isPowerOfTwo=x(this.realWidth)&&x(this.realHeight)},i.prototype.setResolution=function(e){var t=this.resolution;return t===e||(this.resolution=e,this.valid&&(this.width=Math.round(this.width*t)/e,this.height=Math.round(this.height*t)/e,this.emit(\"update\",this)),this._refreshPOT()),this},i.prototype.setResource=function(e){if(this.resource===e)return this;if(this.resource)throw new Error(\"Resource can be set only once\");return e.bind(this),this.resource=e,this},i.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit(\"update\",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit(\"loaded\",this),this.emit(\"update\",this))},i.prototype.onError=function(e){this.emit(\"error\",this,e)},i.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete E[this.cacheId],delete T[this.cacheId],this.cacheId=null),this.dispose(),i.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},i.prototype.dispose=function(){this.emit(\"dispose\",this)},i.prototype.castToBaseTexture=function(){return this},i.from=function(t,r,n){void 0===n&&(n=e.STRICT_TEXTURE_CACHE);var o=\"string\"==typeof t,s=null;if(o)s=t;else{if(!t._pixiId){var a=r&&r.pixiIdPrefix||\"pixiid\";t._pixiId=a+\"_\"+R()}s=t._pixiId}var u=E[s];if(o&&n&&!u)throw new Error('The cacheId \"'+s+'\" does not exist in BaseTextureCache.');return u||((u=new i(t,r)).cacheId=s,i.addToCache(u,s)),u},i.fromBuffer=function(e,t,r,n){e=e||new Float32Array(t*r*4);var s=new Q(e,{width:t,height:r}),a=e instanceof Float32Array?o.FLOAT:o.UNSIGNED_BYTE;return new i(s,Object.assign(ee,n||{width:t,height:r,type:a}))},i.addToCache=function(e,t){t&&(-1===e.textureCacheIds.indexOf(t)&&e.textureCacheIds.push(t),E[t]&&console.warn(\"BaseTexture added to the cache with an id [\"+t+\"] that already had an entry\"),E[t]=e)},i.removeFromCache=function(e){if(\"string\"==typeof e){var t=E[e];if(t){var r=t.textureCacheIds.indexOf(e);return r>-1&&t.textureCacheIds.splice(r,1),delete E[e],t}}else if(e&&e.textureCacheIds){for(var i=0;i0){if(!e.resource)throw new Error(\"CubeResource does not support copying of renderTexture.\");this.addResourceAt(e.resource,t)}else e.target=s.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.parentTextureArray=this.baseTexture,this.items[t]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[t]=e,this},t.prototype.upload=function(e,r,i){for(var n=this.itemDirtyIds,o=0;o)?\\s*()]*-->)?\\s*\\]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*>/i,t}(ne),he=function(e){function t(r,i){var n=this;if(i=i||{},!(r instanceof HTMLVideoElement)){var o=document.createElement(\"video\");o.setAttribute(\"preload\",\"auto\"),o.setAttribute(\"webkit-playsinline\",\"\"),o.setAttribute(\"playsinline\",\"\"),\"string\"==typeof r&&(r=[r]);var s=r[0].src||r[0];ne.crossOrigin(o,s,i.crossorigin);for(var a=0;a0&&!1===e.paused&&!1===e.ended&&e.readyState>2},t.prototype._isSourceReady=function(){var e=this.source;return 3===e.readyState||4===e.readyState},t.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(H.shared.add(this.update,this),this._isConnectedToTicker=!0)},t.prototype._onPlayStop=function(){this._isConnectedToTicker&&(H.shared.remove(this.update,this),this._isConnectedToTicker=!1)},t.prototype._onCanPlay=function(){var e=this.source;e.removeEventListener(\"canplay\",this._onCanPlay),e.removeEventListener(\"canplaythrough\",this._onCanPlay);var t=this.valid;this.resize(e.videoWidth,e.videoHeight),!t&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()},t.prototype.dispose=function(){this._isConnectedToTicker&&(H.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener(\"error\",this._onError,!0),t.pause(),t.src=\"\",t.load()),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,\"autoUpdate\",{get:function(){return this._autoUpdate},set:function(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(H.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(H.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"updateFPS\",{get:function(){return this._updateFPS},set:function(e){e!==this._updateFPS&&(this._updateFPS=e)},enumerable:!1,configurable:!0}),t.test=function(e,r){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.indexOf(r)>-1},t.TYPES=[\"mp4\",\"m4v\",\"webm\",\"ogg\",\"ogv\",\"h264\",\"avi\",\"mov\"],t.MIME_TYPES={ogv:\"video/ogg\",mov:\"video/quicktime\",m4v:\"video/mp4\"},t}(ne),le=function(e){function t(t){return e.call(this,t)||this}return Z(t,e),t.test=function(e){return!!globalThis.createImageBitmap&&\"undefined\"!=typeof ImageBitmap&&e instanceof ImageBitmap},t}(ne);Y.push(ae,le,oe,he,ue,Q,se,ie);var fe={__proto__:null,Resource:J,BaseImageResource:ne,INSTALLED:Y,autoDetectResource:K,AbstractMultiResource:re,ArrayResource:ie,BufferResource:Q,CanvasResource:oe,CubeResource:se,ImageResource:ae,SVGResource:ue,VideoResource:he,ImageBitmapResource:le},de=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Z(t,e),t.prototype.upload=function(e,t,i){var n=e.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.alphaMode===r.UNPACK);var o=t.realWidth,s=t.realHeight;return i.width===o&&i.height===s?n.texSubImage2D(t.target,0,0,0,o,s,t.format,i.type,this.data):(i.width=o,i.height=s,n.texImage2D(t.target,0,i.internalFormat,o,s,0,t.format,i.type,this.data)),!0},t}(Q),ce=function(){function e(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new V(\"disposeFramebuffer\"),this.multisample=u.NONE}return Object.defineProperty(e.prototype,\"colorTexture\",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),e.prototype.addColorTexture=function(e,t){return void 0===e&&(e=0),this.colorTextures[e]=t||new te(null,{scaleMode:i.NEAREST,resolution:1,mipmap:a.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.addDepthTexture=function(e){return this.depthTexture=e||new te(new de(null,{width:this.width,height:this.height}),{scaleMode:i.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:a.OFF,format:n.DEPTH_COMPONENT,type:o.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},e.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),e!==this.width||t!==this.height){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&t.textureCacheIds.splice(r,1),delete T[e],t}}else if(e&&e.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?\"and\":\"or\",u=\"X: \"+t+\" + \"+i+\" = \"+(t+i)+\" > \"+this.baseTexture.width,h=\"Y: \"+r+\" + \"+n+\" = \"+(r+n)+\" > \"+this.baseTexture.height;throw new Error(\"Texture Error: frame does not fit inside the base Texture dimensions: \"+u+\" \"+a+\" \"+h)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=e),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"rotate\",{get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"width\",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"height\",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),r.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(r,\"EMPTY\",{get:function(){return r._EMPTY||(r._EMPTY=new r(new te),ge(r._EMPTY),ge(r._EMPTY.baseTexture)),r._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(r,\"WHITE\",{get:function(){if(!r._WHITE){var t=e.ADAPTER.createCanvas(16,16),i=t.getContext(\"2d\");t.width=16,t.height=16,i.fillStyle=\"white\",i.fillRect(0,0,16,16),r._WHITE=new r(te.from(t)),ge(r._WHITE),ge(r._WHITE.baseTexture)}return r._WHITE},enumerable:!1,configurable:!0}),r}(S),_e=function(e){function t(t,r){var i=e.call(this,t,r)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return Z(t,e),Object.defineProperty(t.prototype,\"framebuffer\",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"multisample\",{get:function(){return this.framebuffer.multisample},set:function(e){this.framebuffer.multisample=e},enumerable:!1,configurable:!0}),t.prototype.resize=function(e,t,r){void 0===r&&(r=!0);var i=this.baseTexture.resolution,n=Math.round(e*i)/i,o=Math.round(t*i)/i;this.valid=n>0&&o>0,this._frame.width=this.orig.width=n,this._frame.height=this.orig.height=o,r&&this.baseTexture.resize(n,o),this.updateUvs()},t.prototype.setResolution=function(e){var t=this.baseTexture;t.resolution!==e&&(t.setResolution(e),this.resize(t.width,t.height,!1))},t.create=function(e){for(var r=arguments,i=[],n=1;n1?-i:-1:(n=((65535&(e=I(e)))<<16|65535&(t=I(t)))>>>0,i>1&&(n+=4294967296*i)),this.texturePool[n]||(this.texturePool[n]=[]);var o=this.texturePool[n].pop();return o||(o=this.createTexture(e,t,i)),o.filterPoolKey=n,o.setResolution(r),o},e.prototype.getFilterTexture=function(e,t,r){var i=this.getOptimalTexture(e.width,e.height,t||e.resolution,r||u.NONE);return i.filterFrame=e.filterFrame,i},e.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},e.prototype.returnFilterTexture=function(e){this.returnTexture(e)},e.prototype.clear=function(e){if(e=!1!==e)for(var t in this.texturePool){var r=this.texturePool[t];if(r)for(var i=0;i0&&e.height>0,this.texturePool)if(Number(t)<0){var r=this.texturePool[t];if(r)for(var i=0;i1){for(var h=0;h1&&((f=this.getOptimalFilterTexture(h.width,h.height,t.resolution)).filterFrame=h.filterFrame),r[d].apply(this,h,f,l.CLEAR,t);var c=h;h=f,f=c}r[d].apply(this,h,u.renderTexture,l.BLEND,t),d>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(h),this.returnFilterTexture(f)}t.clear(),this.statePool.push(t)},e.prototype.bindAndClear=function(e,t){void 0===t&&(t=l.CLEAR);var r=this.renderer,i=r.renderTexture,n=r.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var o=this.tempRect;o.x=0,o.y=0,o.width=e.filterFrame.width,o.height=e.filterFrame.height,i.bind(e,e.filterFrame,o)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&n.stateId||this.forceClear;(t===l.CLEAR||t===l.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},e.prototype.applyFilter=function(e,t,r,i){var n=this.renderer;n.state.set(e.state),this.bindAndClear(r,i),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(f.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(f.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(e,t){var r=this.activeState,i=r.sourceFrame,n=r.destinationFrame,o=t._texture.orig,s=e.set(n.width,0,0,n.height,i.x,i.y),a=t.worldTransform.copyTo(W.TEMP_MATRIX);return a.invert(),s.prepend(a),s.scale(1/o.width,1/o.height),s.translate(t.anchor.x,t.anchor.y),s},e.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(e,t,r,i){return void 0===r&&(r=1),void 0===i&&(i=u.NONE),this.texturePool.getOptimalTexture(e,t,r,i)},e.prototype.getFilterTexture=function(e,t,r){if(\"number\"==typeof e){var i=e;e=t,t=i}e=e||this.activeState.renderTexture;var n=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,r||u.NONE);return n.filterFrame=e.filterFrame,n},e.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e.prototype.transformAABB=function(e,t){var r=Pe[0],i=Pe[1],n=Pe[2],o=Pe[3];r.set(t.left,t.top),i.set(t.left,t.bottom),n.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(r,r),e.apply(i,i),e.apply(n,n),e.apply(o,o);var s=Math.min(r.x,i.x,n.x,o.x),a=Math.min(r.y,i.y,n.y,o.y),u=Math.max(r.x,i.x,n.x,o.x),h=Math.max(r.y,i.y,n.y,o.y);t.x=s,t.y=a,t.width=u-s,t.height=h-a},e.prototype.roundFrame=function(e,t,r,i,n){if(!(e.width<=0||e.height<=0||r.width<=0||r.height<=0)){if(n){var o=n.a,s=n.b,a=n.c,u=n.d;if((Math.abs(s)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}(n=n?Be.copyFrom(n):Be.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(n,e),e.ceil(t),this.transformAABB(n.invert(),e)}},e}(),Le=function(){function e(e){this.renderer=e}return e.prototype.flush=function(){},e.prototype.destroy=function(){this.renderer=null},e.prototype.start=function(){},e.prototype.stop=function(){this.flush()},e.prototype.render=function(e){},e}(),De=function(){function e(e){this.renderer=e,this.emptyRenderer=new Le(e),this.currentRenderer=this.emptyRenderer}return e.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(e,t){for(var r=this.renderer.texture.boundTextures,i=t-1;i>=0;--i)e[i]=r[i]||null,e[i]&&(e[i]._batchLocation=i)},e.prototype.boundArray=function(e,t,r,i){for(var n=e.elements,o=e.ids,s=e.count,a=0,u=0;u=0&&l=t.WEBGL2&&(n=r.getContext(\"webgl2\",i)),n)this.webGLVersion=2;else if(this.webGLVersion=1,!(n=r.getContext(\"webgl\",i)||r.getContext(\"experimental-webgl\",i)))throw new Error(\"This browser does not support WebGL. Try using the canvas renderer\");return this.gl=n,this.getExtensions(),this.gl},r.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension(\"EXT_texture_filter_anisotropic\"),floatTextureLinear:e.getExtension(\"OES_texture_float_linear\"),s3tc:e.getExtension(\"WEBGL_compressed_texture_s3tc\"),s3tc_sRGB:e.getExtension(\"WEBGL_compressed_texture_s3tc_srgb\"),etc:e.getExtension(\"WEBGL_compressed_texture_etc\"),etc1:e.getExtension(\"WEBGL_compressed_texture_etc1\"),pvrtc:e.getExtension(\"WEBGL_compressed_texture_pvrtc\")||e.getExtension(\"WEBKIT_WEBGL_compressed_texture_pvrtc\"),atc:e.getExtension(\"WEBGL_compressed_texture_atc\"),astc:e.getExtension(\"WEBGL_compressed_texture_astc\")};1===this.webGLVersion?Object.assign(this.extensions,t,{drawBuffers:e.getExtension(\"WEBGL_draw_buffers\"),depthTexture:e.getExtension(\"WEBGL_depth_texture\"),loseContext:e.getExtension(\"WEBGL_lose_context\"),vertexArrayObject:e.getExtension(\"OES_vertex_array_object\")||e.getExtension(\"MOZ_OES_vertex_array_object\")||e.getExtension(\"WEBKIT_OES_vertex_array_object\"),uint32ElementIndex:e.getExtension(\"OES_element_index_uint\"),floatTexture:e.getExtension(\"OES_texture_float\"),floatTextureLinear:e.getExtension(\"OES_texture_float_linear\"),textureHalfFloat:e.getExtension(\"OES_texture_half_float\"),textureHalfFloatLinear:e.getExtension(\"OES_texture_half_float_linear\")}):2===this.webGLVersion&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension(\"EXT_color_buffer_float\")})},r.prototype.handleContextLost=function(e){e.preventDefault()},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener(\"webglcontextlost\",this.handleContextLost),e.removeEventListener(\"webglcontextrestored\",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(e){var t=e.getContextAttributes(),r=\"WebGL2RenderingContext\"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),t&&!t.stencil&&console.warn(\"Provided WebGL context does not have a stencil buffer, masks may not render correctly\");var i=r||!!e.getExtension(\"OES_element_index_uint\");this.supports.uint32Indices=i,i||console.warn(\"Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly\")},r}(),Ve=function(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=u.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},He=new z,je=function(){function r(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new ce(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){var r=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new z,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var i=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;e.PREFER_ENV===t.WEBGL_LEGACY&&(i=null,n=null),i?r.drawBuffers=function(e){return i.drawBuffersWEBGL(e)}:(this.hasMRT=!1,r.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=r.getInternalformatParameter(r.RENDERBUFFER,r.RGBA8,r.SAMPLES)},r.prototype.bind=function(e,t,r){void 0===r&&(r=0);var i=this.gl;if(e){var n=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,i.bindFramebuffer(i.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==r&&(e.dirtyId++,e.dirtyFormat++,n.mipLevel=r),n.dirtyId!==e.dirtyId&&(n.dirtyId=e.dirtyId,n.dirtyFormat!==e.dirtyFormat?(n.dirtyFormat=e.dirtyFormat,n.dirtySize=e.dirtySize,this.updateFramebuffer(e,r)):n.dirtySize!==e.dirtySize&&(n.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var o=0;o>r,u=t.height>>r,h=a/t.width;this.setViewport(t.x*h,t.y*h,a,u)}else{a=e.width>>r,u=e.height>>r;this.setViewport(0,0,a,u)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},r.prototype.setViewport=function(e,t,r,i){var n=this.viewport;e=Math.round(e),t=Math.round(t),r=Math.round(r),i=Math.round(i),n.width===r&&n.height===i&&n.x===e&&n.y===t||(n.x=e,n.y=t,n.width=r,n.height=i,this.gl.viewport(e,t,r,i))},Object.defineProperty(r.prototype,\"size\",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),r.prototype.clear=function(e,t,r,i,n){void 0===n&&(n=d.COLOR|d.DEPTH);var o=this.gl;o.clearColor(e,t,r,i),o.clear(n)},r.prototype.initFramebuffer=function(e){var t=this.gl,r=new Ve(t.createFramebuffer());return r.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(e),e.disposeRunner.add(this),r},r.prototype.resizeFramebuffer=function(e){var t=this.gl,r=e.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,r.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.RGBA8,e.width,e.height)),r.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,r.stencil),r.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,r.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var i=e.colorTextures,n=i.length;t.drawBuffers||(n=Math.min(n,1));for(var o=0;o1&&this.canMultisampleFramebuffer(e)?(i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.RGBA8,e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i.msaaBuffer)):i.msaaBuffer&&(r.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));for(var s=[],a=0;a1&&r.drawBuffers(s),e.depthTexture)&&this.writeDepthTexture){var l=e.depthTexture;this.renderer.texture.bind(l,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,t)}!e.stencil&&!e.depth||e.depthTexture&&this.writeDepthTexture?i.stencil&&(r.deleteRenderbuffer(i.stencil),i.stencil=null):(i.stencil=i.stencil||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.DEPTH24_STENCIL8,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e.width,e.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,i.stencil))},r.prototype.canMultisampleFramebuffer=function(e){return 1!==this.renderer.context.webGLVersion&&e.colorTextures.length<=1&&!e.depthTexture},r.prototype.detectSamples=function(e){var t=this.msaaSamples,r=u.NONE;if(e<=1||null===t)return r;for(var i=0;i=0&&this.managedFramebuffers.splice(n,1),e.disposeRunner.remove(this),t||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&r.blitFramebuffer.dispose()}},r.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=t.WEBGL2&&(i=r.getContext(\"webgl2\",{})),i||((i=r.getContext(\"webgl\",{})||r.getContext(\"experimental-webgl\",{}))?i.getExtension(\"WEBGL_draw_buffers\"):i=null),Qe=i}return Qe}function tt(e,t,r){if(\"precision\"!==e.substring(0,9)){var i=t;return t===p.HIGH&&r!==p.HIGH&&(i=p.MEDIUM),\"precision \"+i+\" float;\\n\"+e}return r!==p.HIGH&&\"precision highp\"===e.substring(0,15)?e.replace(\"precision highp\",\"precision mediump\"):e}var rt={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function it(e){return rt[e]}var nt=null,ot={FLOAT:\"float\",FLOAT_VEC2:\"vec2\",FLOAT_VEC3:\"vec3\",FLOAT_VEC4:\"vec4\",INT:\"int\",INT_VEC2:\"ivec2\",INT_VEC3:\"ivec3\",INT_VEC4:\"ivec4\",UNSIGNED_INT:\"uint\",UNSIGNED_INT_VEC2:\"uvec2\",UNSIGNED_INT_VEC3:\"uvec3\",UNSIGNED_INT_VEC4:\"uvec4\",BOOL:\"bool\",BOOL_VEC2:\"bvec2\",BOOL_VEC3:\"bvec3\",BOOL_VEC4:\"bvec4\",FLOAT_MAT2:\"mat2\",FLOAT_MAT3:\"mat3\",FLOAT_MAT4:\"mat4\",SAMPLER_2D:\"sampler2D\",INT_SAMPLER_2D:\"sampler2D\",UNSIGNED_INT_SAMPLER_2D:\"sampler2D\",SAMPLER_CUBE:\"samplerCube\",INT_SAMPLER_CUBE:\"samplerCube\",UNSIGNED_INT_SAMPLER_CUBE:\"samplerCube\",SAMPLER_2D_ARRAY:\"sampler2DArray\",INT_SAMPLER_2D_ARRAY:\"sampler2DArray\",UNSIGNED_INT_SAMPLER_2D_ARRAY:\"sampler2DArray\"};function st(e,t){if(!nt){var r=Object.keys(ot);nt={};for(var i=0;i0&&(t+=\"\\nelse \"),r0?this.maskStack[this.maskStack.length-1]._colorMask:15;r!==t&&this.renderer.gl.colorMask(0!=(1&r),0!=(2&r),0!=(4&r),0!=(8&r))},e.prototype.destroy=function(){this.renderer=null},e}(),Rt=function(){function e(e){this.renderer=e,this.maskStack=[],this.glConst=0}return e.prototype.getStackLength=function(){return this.maskStack.length},e.prototype.setMaskStack=function(e){var t=this.renderer.gl,r=this.getStackLength();this.maskStack=e;var i=this.getStackLength();i!==r&&(0===i?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))},e.prototype._useCurrent=function(){},e.prototype.destroy=function(){this.renderer=null,this.maskStack=null},e}(),St=new W,wt=[],At=function(t){function r(r){var i=t.call(this,r)||this;return i.glConst=e.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,i}return Z(r,t),r.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0},r.prototype.calcScissorRect=function(e){var t;if(!e._scissorRectLocal){var r=e._scissorRect,i=e.maskObject,n=this.renderer,o=n.renderTexture,s=i.getBounds(!0,null!==(t=wt.pop())&&void 0!==t?t:new z);this.roundFrameToPixels(s,o.current?o.current.resolution:n.resolution,o.sourceFrame,o.destinationFrame,n.projection.transform),r&&s.fit(r),e._scissorRectLocal=s}},r.isMatrixRotated=function(e){if(!e)return!1;var t=e.a,r=e.b,i=e.c,n=e.d;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(n)>1e-4)},r.prototype.testScissor=function(e){var t=e.maskObject;if(!t.isFastRect||!t.isFastRect())return!1;if(r.isMatrixRotated(t.worldTransform))return!1;if(r.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);var i=e._scissorRectLocal;return i.width>0&&i.height>0},r.prototype.roundFrameToPixels=function(e,t,i,n,o){r.isMatrixRotated(o)||((o=o?St.copyFrom(o):St.identity()).translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.renderer.filter.transformAABB(o,e),e.fit(n),e.x=Math.round(e.x*t),e.y=Math.round(e.y*t),e.width=Math.round(e.width*t),e.height=Math.round(e.height*t))},r.prototype.push=function(e){e._scissorRectLocal||this.calcScissorRect(e);var t=this.renderer.gl;e._scissorRect||t.enable(t.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()},r.prototype.pop=function(e){var t=this.renderer.gl;e&&wt.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},r.prototype._useCurrent=function(){var e,t=this.maskStack[this.maskStack.length-1]._scissorRect;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)},r}(Rt),It=function(t){function r(r){var i=t.call(this,r)||this;return i.glConst=e.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,i}return Z(r,t),r.prototype.getStackLength=function(){var e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0},r.prototype.push=function(e){var t=e.maskObject,r=this.renderer.gl,i=e._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),e._stencilCounter++;var n=e._colorMask;0!==n&&(e._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilFunc(r.EQUAL,i,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,0!==n&&(e._colorMask=n,r.colorMask(0!=(1&n),0!=(2&n),0!=(4&n),0!=(8&n))),this._useCurrent()},r.prototype.pop=function(e){var t=this.renderer.gl;if(0===this.getStackLength())t.disable(t.STENCIL_TEST);else{var r=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,i=r?r._colorMask:15;0!==i&&(r._colorMask=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,0!==i&&(r._colorMask=i,t.colorMask(0!=(1&i),0!=(2&i),0!=(4&i),0!=(8&i))),this._useCurrent()}},r.prototype._useCurrent=function(){var e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},r}(Rt),Ct=function(){function e(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new W,this.transform=null}return e.prototype.update=function(e,t,r,i){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,r,i),this.transform&&this.projectionMatrix.append(this.transform);var n=this.renderer;n.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,n.globalUniforms.update(),n.shader.shader&&n.shader.syncUniformGroup(n.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(e,t,r,i){var n=this.projectionMatrix,o=i?-1:1;n.identity(),n.a=1/t.width*2,n.d=o*(1/t.height*2),n.tx=-1-t.x*n.a,n.ty=-o-t.y*n.d},e.prototype.setTransform=function(e){},e.prototype.destroy=function(){this.renderer=null},e}(),Ft=new z,Nt=new z,Ot=function(){function e(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new z,this.destinationFrame=new z,this.viewportFrame=new z}return e.prototype.bind=function(e,t,r){void 0===e&&(e=null);var i,n,o,s=this.renderer;this.current=e,e?(o=(i=e.baseTexture).resolution,t||(Ft.width=e.frame.width,Ft.height=e.frame.height,t=Ft),r||(Nt.x=e.frame.x,Nt.y=e.frame.y,Nt.width=t.width,Nt.height=t.height,r=Nt),n=i.framebuffer):(o=s.resolution,t||(Ft.width=s.screen.width,Ft.height=s.screen.height,t=Ft),r||((r=Ft).width=t.width,r.height=t.height));var a=this.viewportFrame;a.x=r.x*o,a.y=r.y*o,a.width=r.width*o,a.height=r.height*o,e||(a.y=s.view.height-(a.y+a.height)),a.ceil(),this.renderer.framebuffer.bind(n,a),this.renderer.projection.update(r,t,o,!n),e?this.renderer.mask.setMaskStack(i.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(r)},e.prototype.clear=function(e,t){e=this.current?e||this.current.baseTexture.clearColor:e||this.clearColor;var r=this.destinationFrame,i=this.current?this.current.baseTexture:this.renderer.screen,n=r.width!==i.width||r.height!==i.height;if(n){var o=this.viewportFrame,s=o.x,a=o.y,u=o.width,h=o.height;s=Math.round(s),a=Math.round(a),u=Math.round(u),h=Math.round(h),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(s,a,u,h)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),n&&this.renderer.scissor.pop()},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e.prototype.destroy=function(){this.renderer=null},e}();function Mt(e,t,r,i,n){r.buffer.update(n)}var Pt={float:\"\\n data[offset] = v;\\n \",vec2:\"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n \",vec3:\"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n data[offset+2] = v[2];\\n\\n \",vec4:\"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n data[offset+2] = v[2];\\n data[offset+3] = v[3];\\n \",mat2:\"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n\\n data[offset+4] = v[2];\\n data[offset+5] = v[3];\\n \",mat3:\"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n data[offset+2] = v[2];\\n\\n data[offset + 4] = v[3];\\n data[offset + 5] = v[4];\\n data[offset + 6] = v[5];\\n\\n data[offset + 8] = v[6];\\n data[offset + 9] = v[7];\\n data[offset + 10] = v[8];\\n \",mat4:\"\\n for(var i = 0; i < 16; i++)\\n {\\n data[offset + i] = v[i];\\n }\\n \"},Bt={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function Ut(e){for(var t=e.map((function(e){return{data:e,offset:0,dataLen:0,dirty:0}})),r=0,i=0,n=0,o=0;o1&&(r=Math.max(r,16)*s.data.size),s.dataLen=r,i%r!=0&&i<16){var a=i%r%16;i+=a,n+=a}i+r>16?(n=16*Math.ceil(n/16),s.offset=n,n+=r,i=r):(s.offset=n,i+=r,n+=r)}return{uboElements:t,size:n=16*Math.ceil(n/16)}}function Lt(e,t){var r=[];for(var i in e)t[i]&&r.push(t[i]);return r.sort((function(e,t){return e.index-t.index})),r}function Dt(e,t){if(!e.autoManage)return{size:0,syncFunc:Mt};for(var r=Ut(Lt(e.uniforms,t)),i=r.uboElements,n=r.size,o=[\"\\n var v = null;\\n var v2 = null;\\n var cv = null;\\n var t = 0;\\n var gl = renderer.gl\\n var index = 0;\\n var data = buffer.data;\\n \"],s=0;s1){var c=it(a.data.type),p=Math.max(Bt[a.data.type]/16,1),v=c/p,m=(4-v%4)%4;o.push(\"\\n cv = ud.\"+h+\".value;\\n v = uv.\"+h+\";\\n offset = \"+a.offset/4+\";\\n\\n t = 0;\\n\\n for(var i=0; i < \"+a.data.size*p+\"; i++)\\n {\\n for(var j = 0; j < \"+v+\"; j++)\\n {\\n data[offset++] = v[t++];\\n }\\n offset += \"+m+\";\\n }\\n\\n \")}else{var g=Pt[a.data.type];o.push(\"\\n cv = ud.\"+h+\".value;\\n v = uv.\"+h+\";\\n offset = \"+a.offset/4+\";\\n \"+g+\";\\n \")}}return o.push(\"\\n renderer.buffer.update(buffer);\\n \"),{size:n,syncFunc:new Function(\"ud\",\"uv\",\"renderer\",\"syncData\",\"buffer\",o.join(\"\\n\"))}}var Gt=function(){},kt=function(){function e(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return e.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},e}();function Vt(e,t){var r=Ye(e,e.VERTEX_SHADER,t.vertexSrc),i=Ye(e,e.FRAGMENT_SHADER,t.fragmentSrc),n=e.createProgram();if(e.attachShader(n,r),e.attachShader(n,i),e.linkProgram(n),e.getProgramParameter(n,e.LINK_STATUS)||function(e,t,r,i){e.getProgramParameter(t,e.LINK_STATUS)||(e.getShaderParameter(r,e.COMPILE_STATUS)||Ke(e,r),e.getShaderParameter(i,e.COMPILE_STATUS)||Ke(e,i),console.error(\"PixiJS Error: Could not initialize shader.\"),\"\"!==e.getProgramInfoLog(t)&&console.warn(\"PixiJS Warning: gl.getProgramInfoLog()\",e.getProgramInfoLog(t)))}(e,n,r,i),t.attributeData=function(e,t){for(var r={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=0;nt?1:-1}));for(var s=0;s>=1,r++;this.stateId=e.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},t.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,r=!1,i=0;ithis.maxIdle&&(e.destroyTexture(n,!0),t[i]=null,r=!0)}if(r){var o=0;for(i=0;i=0;i--)this.unload(e.children[i])},t.prototype.destroy=function(){this.renderer=null},t}();var Yt=function(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=o.UNSIGNED_BYTE,this.internalFormat=n.RGBA,this.samplerType=0},Kt=function(){function e(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new te,this.hasIntegerTextures=!1}return e.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(e){var t,r,i,s,a,u,h,l,f,d,c,p,v,m,g,y,_,b,x,E,T,R,S;return\"WebGL2RenderingContext\"in globalThis&&e instanceof globalThis.WebGL2RenderingContext?((t={})[o.UNSIGNED_BYTE]=((r={})[n.RGBA]=e.RGBA8,r[n.RGB]=e.RGB8,r[n.RG]=e.RG8,r[n.RED]=e.R8,r[n.RGBA_INTEGER]=e.RGBA8UI,r[n.RGB_INTEGER]=e.RGB8UI,r[n.RG_INTEGER]=e.RG8UI,r[n.RED_INTEGER]=e.R8UI,r[n.ALPHA]=e.ALPHA,r[n.LUMINANCE]=e.LUMINANCE,r[n.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,r),t[o.BYTE]=((i={})[n.RGBA]=e.RGBA8_SNORM,i[n.RGB]=e.RGB8_SNORM,i[n.RG]=e.RG8_SNORM,i[n.RED]=e.R8_SNORM,i[n.RGBA_INTEGER]=e.RGBA8I,i[n.RGB_INTEGER]=e.RGB8I,i[n.RG_INTEGER]=e.RG8I,i[n.RED_INTEGER]=e.R8I,i),t[o.UNSIGNED_SHORT]=((s={})[n.RGBA_INTEGER]=e.RGBA16UI,s[n.RGB_INTEGER]=e.RGB16UI,s[n.RG_INTEGER]=e.RG16UI,s[n.RED_INTEGER]=e.R16UI,s[n.DEPTH_COMPONENT]=e.DEPTH_COMPONENT16,s),t[o.SHORT]=((a={})[n.RGBA_INTEGER]=e.RGBA16I,a[n.RGB_INTEGER]=e.RGB16I,a[n.RG_INTEGER]=e.RG16I,a[n.RED_INTEGER]=e.R16I,a),t[o.UNSIGNED_INT]=((u={})[n.RGBA_INTEGER]=e.RGBA32UI,u[n.RGB_INTEGER]=e.RGB32UI,u[n.RG_INTEGER]=e.RG32UI,u[n.RED_INTEGER]=e.R32UI,u[n.DEPTH_COMPONENT]=e.DEPTH_COMPONENT24,u),t[o.INT]=((h={})[n.RGBA_INTEGER]=e.RGBA32I,h[n.RGB_INTEGER]=e.RGB32I,h[n.RG_INTEGER]=e.RG32I,h[n.RED_INTEGER]=e.R32I,h),t[o.FLOAT]=((l={})[n.RGBA]=e.RGBA32F,l[n.RGB]=e.RGB32F,l[n.RG]=e.RG32F,l[n.RED]=e.R32F,l[n.DEPTH_COMPONENT]=e.DEPTH_COMPONENT32F,l),t[o.HALF_FLOAT]=((f={})[n.RGBA]=e.RGBA16F,f[n.RGB]=e.RGB16F,f[n.RG]=e.RG16F,f[n.RED]=e.R16F,f),t[o.UNSIGNED_SHORT_5_6_5]=((d={})[n.RGB]=e.RGB565,d),t[o.UNSIGNED_SHORT_4_4_4_4]=((c={})[n.RGBA]=e.RGBA4,c),t[o.UNSIGNED_SHORT_5_5_5_1]=((p={})[n.RGBA]=e.RGB5_A1,p),t[o.UNSIGNED_INT_2_10_10_10_REV]=((v={})[n.RGBA]=e.RGB10_A2,v[n.RGBA_INTEGER]=e.RGB10_A2UI,v),t[o.UNSIGNED_INT_10F_11F_11F_REV]=((m={})[n.RGB]=e.R11F_G11F_B10F,m),t[o.UNSIGNED_INT_5_9_9_9_REV]=((g={})[n.RGB]=e.RGB9_E5,g),t[o.UNSIGNED_INT_24_8]=((y={})[n.DEPTH_STENCIL]=e.DEPTH24_STENCIL8,y),t[o.FLOAT_32_UNSIGNED_INT_24_8_REV]=((_={})[n.DEPTH_STENCIL]=e.DEPTH32F_STENCIL8,_),S=t):((b={})[o.UNSIGNED_BYTE]=((x={})[n.RGBA]=e.RGBA,x[n.RGB]=e.RGB,x[n.ALPHA]=e.ALPHA,x[n.LUMINANCE]=e.LUMINANCE,x[n.LUMINANCE_ALPHA]=e.LUMINANCE_ALPHA,x),b[o.UNSIGNED_SHORT_5_6_5]=((E={})[n.RGB]=e.RGB,E),b[o.UNSIGNED_SHORT_4_4_4_4]=((T={})[n.RGBA]=e.RGBA,T),b[o.UNSIGNED_SHORT_5_5_5_1]=((R={})[n.RGBA]=e.RGBA,R),S=b),S}(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var r=0;r=0;--o){var s=r[o];if(s)s._glTextures[n].samplerType!==g.FLOAT&&this.renderer.texture.unbind(s)}},e.prototype.initTexture=function(e){var t=new Yt(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on(\"dispose\",this.destroyTexture,this),t},e.prototype.initTextureType=function(e,t){var r,i;t.internalFormat=null!==(i=null===(r=this.internalFormats[e.type])||void 0===r?void 0:r[e.format])&&void 0!==i?i:e.format,2===this.webGLVersion&&e.type===o.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},e.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var r=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(r,e,t))t.samplerType!==g.FLOAT&&(this.hasIntegerTextures=!0);else{var i=e.realWidth,n=e.realHeight,o=r.gl;(t.width!==i||t.height!==n||t.dirtyId<0)&&(t.width=i,t.height=n,o.texImage2D(e.target,0,t.internalFormat,i,n,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},e.prototype.destroyTexture=function(e,t){var r=this.gl;if((e=e.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(e),r.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off(\"dispose\",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var i=this.managedTextures.indexOf(e);-1!==i&&N(this.managedTextures,i,1)}},e.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&(e.mipmap!==a.POW2&&2===this.webGLVersion||e.isPowerOfTwo?t.mipmap=e.mipmap>=1:t.mipmap=!1,2===this.webGLVersion||e.isPowerOfTwo?t.wrapMode=e.wrapMode:t.wrapMode=y.CLAMP,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},e.prototype.setStyle=function(e,t){var r=this.gl;if(t.mipmap&&e.mipmap!==a.ON_MANUAL&&r.generateMipmap(e.target),r.texParameteri(e.target,r.TEXTURE_WRAP_S,t.wrapMode),r.texParameteri(e.target,r.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===i.LINEAR){var o=Math.min(e.anisotropicLevel,r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else r.texParameteri(e.target,r.TEXTURE_MIN_FILTER,e.scaleMode===i.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(e.target,r.TEXTURE_MAG_FILTER,e.scaleMode===i.LINEAR?r.LINEAR:r.NEAREST)},e.prototype.destroy=function(){this.renderer=null},e}(),qt={__proto__:null,FilterSystem:Ue,BatchSystem:De,ContextSystem:ke,FramebufferSystem:je,GeometrySystem:Xe,MaskSystem:Tt,ScissorSystem:At,StencilSystem:It,ProjectionSystem:Ct,RenderTextureSystem:Ot,ShaderSystem:zt,StateSystem:Xt,TextureGCSystem:Wt,TextureSystem:Kt},Zt=new W,$t=function(t){function r(r,i){void 0===r&&(r=_.UNKNOWN);var n=t.call(this)||this;return i=Object.assign({},e.RENDER_OPTIONS,i),n.options=i,n.type=r,n.screen=new z(0,0,i.width,i.height),n.view=i.view||e.ADAPTER.createCanvas(),n.resolution=i.resolution||e.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString=\"#000000\",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,void 0!==i.transparent&&(n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return Z(r,t),r.prototype.initPlugins=function(e){for(var t in e)this.plugins[t]=new e[t](this)},Object.defineProperty(r.prototype,\"width\",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"height\",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),r.prototype.resize=function(e,t){this.view.width=Math.round(e*this.resolution),this.view.height=Math.round(t*this.resolution);var r=this.view.width/this.resolution,i=this.view.height/this.resolution;this.screen.width=r,this.screen.height=i,this.autoDensity&&(this.view.style.width=r+\"px\",this.view.style.height=i+\"px\"),this.emit(\"resize\",r,i)},r.prototype.generateTexture=function(e,t,r,i){void 0===t&&(t={}),\"number\"==typeof t&&(t={scaleMode:t,resolution:r,region:i});var n=t.region,o=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&\"function\"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n=e.data.byteLength)t.bufferSubData(e.type,0,e.data);else{var n=e.static?t.STATIC_DRAW:t.DYNAMIC_DRAW;i.byteLength=e.data.byteLength,t.bufferData(e.type,e.data,n)}},e.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var r=e._glBuffers[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this),r&&(t||i.deleteBuffer(r.buffer),delete e._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),r=0;r=u.HIGH?this.multisample=u.HIGH:e>=u.MEDIUM?this.multisample=u.MEDIUM:e>=u.LOW?this.multisample=u.LOW:this.multisample=u.NONE},t.prototype.addSystem=function(e,t){var r=new e(this);if(this[t])throw new Error('Whoops! The name \"'+t+'\" is already in use');for(var i in this[t]=r,this.runners)this.runners[i].add(r);return this},t.prototype.render=function(e,t){var r,i,n,o;if(t&&(t instanceof _e?(r=t,i=arguments[2],n=arguments[3],o=arguments[4]):(r=t.renderTexture,i=t.clear,n=t.transform,o=t.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit(\"prerender\"),this.projection.transform=n,!this.context.isLost){if(r||(this._lastObjectRendered=e),!o){var s=e.enableTempParent();e.updateTransform(),e.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),e.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit(\"postrender\")}},t.prototype.generateTexture=function(t,r,i,n){void 0===r&&(r={});var o=e.prototype.generateTexture.call(this,t,r,i,n);return this.framebuffer.blit(),o},t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this.runners.resize.emit(this.screen.height,this.screen.width)},t.prototype.reset=function(){return this.runners.reset.emit(),this},t.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},t.prototype.destroy=function(t){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();e.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(t.prototype,\"extract\",{get:function(){return this.plugins.extract},enumerable:!1,configurable:!0}),t.registerPlugin=function(e,t){G.add({name:e,type:k.RendererPlugin,ref:t})},t.__plugins={},t}($t);function tr(e){return er.create(e)}G.handleByMap(k.RendererPlugin,er.__plugins);var rr=\"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\",ir=\"attribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvec2 filterTextureCoord( void )\\n{\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n}\\n\\nvoid main(void)\\n{\\n gl_Position = filterVertexPosition();\\n vTextureCoord = filterTextureCoord();\\n}\\n\",nr=function(){function e(e){this.renderer=e}return e.prototype.destroy=function(){this.renderer=null},e}(),or=function(){this.texArray=null,this.blend=0,this.type=f.TRIANGLES,this.start=0,this.size=0,this.data=null},sr=function(){function e(){this.elements=[],this.ids=[],this.count=0}return e.prototype.clear=function(){for(var e=0;ethis.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)},i.prototype.buildTexturesAndDrawCalls=function(){var e=this._bufferedTextures,t=this.MAX_TEXTURES,r=i._textureArrayPool,n=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,a=++te._globalBatch,u=0,h=r[0],l=0;n.copyBoundTextures(o,t);for(var f=0;f=t&&(n.boundArray(h,o,a,t),this.buildDrawCalls(h,l,f),l=f,h=r[++u],++a),d._batchEnabled=a,d.touched=s,h.elements[h.count++]=d)}h.count>0&&(n.boundArray(h,o,a,t),this.buildDrawCalls(h,l,this._bufferSize),++u,++a);for(f=0;f0&&(t+=\"\\nelse \"),r title : \"+e.title+\"
tabIndex: \"+e.tabIndex},e.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,s=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>s&&(e.height=s-e.y)},e.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement(\"button\")).style.width=\"100px\",t.style.height=\"100px\",t.style.backgroundColor=this.debug?\"rgba(255,255,255,0.5)\":\"transparent\",t.style.position=\"absolute\",t.style.zIndex=2..toString(),t.style.borderStyle=\"none\",navigator.userAgent.toLowerCase().indexOf(\"chrome\")>-1?t.setAttribute(\"aria-live\",\"off\"):t.setAttribute(\"aria-live\",\"polite\"),navigator.userAgent.match(/rv:.*Gecko\\//)?t.setAttribute(\"aria-relevant\",\"additions\"):t.setAttribute(\"aria-relevant\",\"text\"),t.addEventListener(\"click\",this._onClick.bind(this)),t.addEventListener(\"focus\",this._onFocus.bind(this)),t.addEventListener(\"focusout\",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title=\"displayObject \"+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute(\"aria-label\",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},e.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,\"click\",s),t.dispatchEvent(i,\"pointertap\",s),t.dispatchEvent(i,\"tap\",s)},e.prototype._onFocus=function(e){e.target.getAttribute(\"aria-live\")||e.target.setAttribute(\"aria-live\",\"assertive\");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,\"mouseover\",s)},e.prototype._onFocusOut=function(e){e.target.getAttribute(\"aria-live\")||e.target.setAttribute(\"aria-live\",\"polite\");var t=this.renderer.plugins.interaction,i=e.target.displayObject,s=t.eventData;t.dispatchEvent(i,\"mouseout\",s)},e.prototype._onKeyDown=function(e){9===e.keyCode&&this.activate()},e.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},e.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener(\"mousemove\",this._onMouseMove,!0),globalThis.removeEventListener(\"keydown\",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},e.extension={name:\"accessibility\",type:[s.RendererPlugin,s.CanvasRendererPlugin]},e}();export{o as AccessibilityManager,n as accessibleTarget};\n//# sourceMappingURL=accessibility.min.mjs.map\n","/*!\n * @pixi/interaction - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/interaction is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Point as t}from\"@pixi/math\";import{Ticker as e,UPDATE_PRIORITY as i}from\"@pixi/ticker\";import{DisplayObject as n,TemporaryDisplayObject as o}from\"@pixi/display\";import{EventEmitter as r}from\"@pixi/utils\";import{ExtensionType as s}from\"@pixi/core\";var a=function(){function e(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new t,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(e.prototype,\"pointerId\",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),e.prototype.getLocalPosition=function(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)},e.prototype.copyEvent=function(t){\"isPrimary\"in t&&t.isPrimary&&(this.isPrimary=!0),this.button=\"button\"in t&&t.button;var e=\"buttons\"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:\"which\"in t&&t.which,this.width=\"width\"in t&&t.width,this.height=\"height\"in t&&t.height,this.tiltX=\"tiltX\"in t&&t.tiltX,this.tiltY=\"tiltY\"in t&&t.tiltY,this.pointerType=\"pointerType\"in t&&t.pointerType,this.pressure=\"pressure\"in t&&t.pressure,this.rotationAngle=\"rotationAngle\"in t&&t.rotationAngle,this.twist=\"twist\"in t&&t.twist||0,this.tangentialPressure=\"tangentialPressure\"in t&&t.tangentialPressure||0},e.prototype.reset=function(){this.isPrimary=!1},e}(),h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},h(t,e)};var p=function(){function t(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return t.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},t.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},t}(),c=function(){function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE}return t.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Object.defineProperty(t.prototype,\"pointerId\",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"flags\",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"none\",{get:function(){return this._flags===t.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"over\",{get:function(){return 0!=(this._flags&t.FLAGS.OVER)},set:function(e){this._doSet(t.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"rightDown\",{get:function(){return 0!=(this._flags&t.FLAGS.RIGHT_DOWN)},set:function(e){this._doSet(t.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"leftDown\",{get:function(){return 0!=(this._flags&t.FLAGS.LEFT_DOWN)},set:function(e){this._doSet(t.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),t.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),t}(),u=function(){function e(){this._tempPoint=new t}return e.prototype.recursiveFindHit=function(t,e,i,n,o){var r;if(!e||!e.visible)return!1;var s=t.data.global,a=!1,h=o=e.interactive||o,p=!0;if(e.hitArea)n&&(e.worldTransform.applyInverse(s,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(n=!1,p=!1)),h=!1;else if(e._mask&&n){var c=e._mask.isMaskData?e._mask.maskObject:e._mask;c&&!(null===(r=c.containsPoint)||void 0===r?void 0:r.call(c,s))&&(n=!1)}if(p&&e.interactiveChildren&&e.children)for(var u=e.children,l=u.length-1;l>=0;l--){var v=u[l],d=this.recursiveFindHit(t,v,i,n,h);if(d){if(!v.parent)continue;h=!1,d&&(t.target&&(n=!1),a=!0)}}return o&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(s)&&(a=!0),e.interactive&&(a&&!t.target&&(t.target=e),i&&i(t,e,!!a))),a},e.prototype.findHit=function(t,e,i,n){this.recursiveFindHit(t,e,i,n,!1)},e}(),l={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return\"pointer\"===this.cursor},set buttonMode(t){t?this.cursor=\"pointer\":\"pointer\"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};n.mixin(l);var v={target:null,data:{global:null}},d=function(t){function n(e,i){var n=t.call(this)||this;return i=i||{},n.renderer=e,n.autoPreventDefault=void 0===i.autoPreventDefault||i.autoPreventDefault,n.interactionFrequency=i.interactionFrequency||10,n.mouse=new a,n.mouse.identifier=1,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[1]=n.mouse,n.interactionDataPool=[],n.eventData=new p,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!(\"PointerEvent\"in globalThis),n.supportsTouchEvents=\"ontouchstart\"in globalThis,n.supportsPointerEvents=!!globalThis.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:\"inherit\",pointer:\"pointer\"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new u,n._tempDisplayObject=new o,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=void 0===i.useSystemTicker||i.useSystemTicker,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return function(t,e){function i(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(n,t),Object.defineProperty(n.prototype,\"useSystemTicker\",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"lastObjectRendered\",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),n.prototype.hitTest=function(t,e){return v.target=null,v.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(v,e,null,!0),v.target},n.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},n.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(e.system.add(this.tickerUpdate,this,i.INTERACTION),this.tickerAdded=!0)},n.prototype.removeTickerListener=function(){this.tickerAdded&&(e.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},n.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming=\"none\",t.msTouchAction=\"none\"):this.supportsPointerEvents&&(t.touchAction=\"none\"),this.supportsPointerEvents?(globalThis.document.addEventListener(\"pointermove\",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(\"pointerdown\",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(\"pointerleave\",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(\"pointerover\",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(\"pointercancel\",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener(\"pointerup\",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener(\"mousemove\",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(\"mousedown\",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(\"mouseout\",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(\"mouseover\",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(\"mouseup\",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener(\"touchstart\",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(\"touchcancel\",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener(\"touchend\",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener(\"touchmove\",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},n.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming=\"\",t.msTouchAction=\"\"):this.supportsPointerEvents&&(t.touchAction=\"\"),this.supportsPointerEvents?(globalThis.document.removeEventListener(\"pointermove\",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(\"pointerdown\",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(\"pointerleave\",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(\"pointerover\",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(\"pointercancel\",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener(\"pointerup\",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener(\"mousemove\",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(\"mousedown\",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(\"mouseout\",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(\"mouseover\",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(\"mouseup\",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener(\"touchstart\",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(\"touchcancel\",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(\"touchend\",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(\"touchmove\",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},n.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime0&&(r=t.composedPath()[0]);for(var s=r!==this.interactionDOMElement?\"outside\":\"\",a=0;a0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?i=200:1223===i&&(i=204),2===(i/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=r,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(r),this.type=t.TYPE.JSON}catch(t){return void this.abort(\"Error trying to parse loaded json: \"+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var n=new DOMParser;this.data=n.parseFromString(r,\"text/xml\")}else{var s=document.createElement(\"div\");s.innerHTML=r,this.data=s}this.type=t.TYPE.XML}catch(t){return void this.abort(\"Error trying to parse loaded xml: \"+t)}else this.data=e.response||r;this.complete()}else this.abort(\"[\"+e.status+\"] \"+e.statusText+\": \"+e.responseURL)},t.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf(\"data:\"))return\"\";if(globalThis.origin!==globalThis.location.origin)return\"anonymous\";e=e||globalThis.location,h||(h=document.createElement(\"a\")),h.href=t;var r=a(h.href,{strictMode:!0}),i=!r.port&&\"\"===e.port||r.port===e.port,n=r.protocol?r.protocol+\":\":\"\";return r.host===e.hostname&&i&&n===e.protocol?\"\":\"anonymous\"},t.prototype._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},t.prototype._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},t.prototype._getExtension=function(t){void 0===t&&(t=this.url);var e=\"\";if(this.isDataUrl){var r=t.indexOf(\"/\");e=t.substring(r+1,t.indexOf(\";\",r))}else{var i=t.indexOf(\"?\"),n=t.indexOf(\"#\"),s=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,s)).substring(t.lastIndexOf(\".\")+1)}return e.toLowerCase()},t.prototype._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return\"application/octet-binary\";case t.XHR_RESPONSE_TYPE.BLOB:return\"application/blob\";case t.XHR_RESPONSE_TYPE.DOCUMENT:return\"application/xml\";case t.XHR_RESPONSE_TYPE.JSON:return\"application/json\";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return\"text/plain\"}},t}();function c(){}function _(t){return function(){for(var e=arguments,r=[],i=0;i>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(s=0;s0&&T[T.length-1])||6!==r[0]&&2!==r[0])){E=0;continue}if(3===r[0]&&(!T||r[1]>T[0]&&r[1]=33776&&_<=33779)return\"s3tc\";if(_>=37488&&_<=37497)return\"etc\";if(_>=35840&&_<=35843)return\"pvrtc\";if(_>=36196)return\"etc1\";if(_>=35986&&_<=34798)return\"atc\";throw new Error(\"Invalid (compressed) texture format given!\")},e._createLevelBuffers=function(_,e,R,t,T,r,E){for(var G=new Array(R),O=_.byteOffset,A=r,D=E,M=A+t-1&~(t-1),S=D+T-1&~(T-1),I=M*S*n[e],o=0;o1?A:M,levelHeight:R>1?D:S,levelBuffer:new Uint8Array(_.buffer,O,I)},O+=I,I=(M=(A=A>>1||1)+t-1&~(t-1))*(S=(D=D>>1||1)+T-1&~(T-1))*n[e];return G},e}(B),P=function(){function _(){}return _.use=function(e,R){var t=e.data;if(e.type===r.TYPE.JSON&&t&&t.cacheID&&t.textures){for(var T=t.textures,G=void 0,O=void 0,A=0,D=T.length;A>>=1,s>>>=1}var x=148;for(C=0;Ce-T){console.error(\"KTXLoader: keyAndValueByteSize out of bounds\");break}for(var O=0;O1||0!==E?N:c,levelHeight:X>1||0!==E?l:U,levelBuffer:new Uint8Array(R,v,f)},v+=f}L=(L+=h+4)%4!=0?L+4-L%4:L,f=(c=(N=N>>1||1)+4-1&-4)*(U=(l=l>>1||1)+4-1&-4)*i}return 0!==E?{uncompressed:P.map((function(_){var R=_[0].levelBuffer,t=!1;return E===A.FLOAT?R=new Float32Array(_[0].levelBuffer.buffer,_[0].levelBuffer.byteOffset,_[0].levelBuffer.byteLength/4):E===A.UNSIGNED_INT?(t=!0,R=new Uint32Array(_[0].levelBuffer.buffer,_[0].levelBuffer.byteOffset,_[0].levelBuffer.byteLength/4)):E===A.INT&&(t=!0,R=new Int32Array(_[0].levelBuffer.buffer,_[0].levelBuffer.byteOffset,_[0].levelBuffer.byteLength/4)),{resource:new e(R,{width:_[0].levelWidth,height:_[0].levelHeight}),type:E,format:t?t_(G):G}})),kvData:C}:{compressed:P.map((function(_){return new u(null,{format:O,width:D,height:M,levels:X,levelBuffers:_})})),kvData:C}}function t_(_){switch(_){case D.RGBA:return D.RGBA_INTEGER;case D.RGB:return D.RGB_INTEGER;case D.RG:return D.RG_INTEGER;case D.RED:return D.RED_INTEGER;default:return _}}r.setExtensionXhrType(\"dds\",r.XHR_RESPONSE_TYPE.BUFFER);var T_=function(){function _(){}return _.use=function(_,e){if(\"dds\"===_.extension&&_.data)try{Object.assign(_,s(_.name||_.url,b(_.data),_.metadata))}catch(_){return void e(_)}e()},_.extension=R.Loader,_}();r.setExtensionXhrType(\"ktx\",r.XHR_RESPONSE_TYPE.BUFFER);var r_=function(){function _(){}return _.use=function(_,e){if(\"ktx\"===_.extension&&_.data)try{var R=_.name||_.url,r=R_(0,_.data,this.loadKeyValueData),E=r.compressed,A=r.uncompressed,D=r.kvData;if(E){var M=s(R,E,_.metadata);if(D&&M.textures)for(var S in M.textures)M.textures[S].baseTexture.ktxKeyValueData=D;Object.assign(_,M)}else if(A){var n={};A.forEach((function(_,e){var r=new t(new T(_.resource,{mipmap:G.OFF,alphaMode:O.NO_PREMULTIPLIED_ALPHA,type:_.type,format:_.format})),E=R+\"-\"+(e+1);D&&(r.baseTexture.ktxKeyValueData=D),T.addToCache(r.baseTexture,E),t.addToCache(r,E),0===e&&(n[R]=r,T.addToCache(r.baseTexture,R),t.addToCache(r,R)),n[E]=r})),Object.assign(_,{textures:n})}}catch(_){return void e(_)}e()},_.extension=R.Loader,_.loadKeyValueData=!1,_}();export{B as BlobResource,P as CompressedTextureLoader,u as CompressedTextureResource,T_ as DDSLoader,__ as FORMATS_TO_COMPONENTS,S as INTERNAL_FORMATS,n as INTERNAL_FORMAT_TO_BYTES_PER_PIXEL,r_ as KTXLoader,$ as TYPES_TO_BYTES_PER_COMPONENT,e_ as TYPES_TO_BYTES_PER_PIXEL,b as parseDDS,R_ as parseKTX};\n//# sourceMappingURL=compressed-textures.min.mjs.map\n","/*!\n * @pixi/particle-container - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/particle-container is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{BLEND_MODES as t,TYPES as e}from\"@pixi/constants\";import{Container as i}from\"@pixi/display\";import{hex2rgb as r,createIndicesForQuads as o,correctBlendMode as a,premultiplyRgba as n,premultiplyTint as s}from\"@pixi/utils\";import{Geometry as u,Buffer as p,ExtensionType as h,ObjectRenderer as f,Shader as d,State as l}from\"@pixi/core\";import{Matrix as c}from\"@pixi/math\";var y=function(t,e){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},y(t,e)};function v(t,e){function i(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var m=function(e){function i(i,r,o,a){void 0===i&&(i=1500),void 0===o&&(o=16384),void 0===a&&(a=!1);var n=e.call(this)||this;return o>16384&&(o=16384),n._properties=[!1,!0,!1,!1,!1],n._maxSize=i,n._batchSize=o,n._buffers=null,n._bufferUpdateIDs=[],n._updateID=0,n.interactiveChildren=!1,n.blendMode=t.NORMAL,n.autoResize=a,n.roundPixels=!0,n.baseTexture=null,n.setProperties(r),n._tint=0,n.tintRgb=new Float32Array(4),n.tint=16777215,n}return v(i,e),i.prototype.setProperties=function(t){t&&(this._properties[0]=\"vertices\"in t||\"scale\"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]=\"position\"in t?!!t.position:this._properties[1],this._properties[2]=\"rotation\"in t?!!t.rotation:this._properties[2],this._properties[3]=\"uvs\"in t?!!t.uvs:this._properties[3],this._properties[4]=\"tint\"in t||\"alpha\"in t?!!t.tint||!!t.alpha:this._properties[4])},i.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(i.prototype,\"tint\",{get:function(){return this._tint},set:function(t){this._tint=t,r(t,this.tintRgb)},enumerable:!1,configurable:!0}),i.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once(\"update\",(function(){return e.onChildrenChange(0)}))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},i.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(s=i);var u=t._buffers;u||(u=t._buffers=this.generateBuffers(t));var p=e[0]._texture.baseTexture,h=p.alphaMode>0;this.state.blendMode=a(t.blendMode,h),o.state.set(this.state);var f=o.gl,d=t.worldTransform.copyTo(this.tempMatrix);d.prepend(o.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=d.toArray(!0),this.shader.uniforms.uColor=n(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h),this.shader.uniforms.uSampler=p,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,y=0;cr&&(v=r),y>=u.length&&u.push(this._generateOneMoreBuffer(t));var m=u[y];m.uploadDynamic(e,c,v);var _=t._bufferUpdateIDs[y]||0;(l=l||m._updateID<_)&&(m._updateID=t._updateID,m.uploadStatic(e,c,v)),o.geometry.bind(m.geometry),f.drawElements(f.TRIANGLES,6*v,f.UNSIGNED_SHORT,0)}}},i.prototype.generateBuffers=function(t){for(var e=[],i=t._maxSize,r=t._batchSize,o=t._properties,a=0;a0,h=u.alpha,f=h<1&&p?s(u._tintRGB,h):u._tintRGB+(255*h<<24);r[a]=f,r[a+o]=f,r[a+2*o]=f,r[a+3*o]=f,a+=4*o}},i.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},i.extension={name:\"particle\",type:h.RendererPlugin},i}(f);export{m as ParticleContainer,x as ParticleRenderer};\n//# sourceMappingURL=particle-container.min.mjs.map\n","/*!\n * @pixi/graphics - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/graphics is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Texture as t,BaseTexture as e,BatchDrawCall as i,BatchTextureArray as r,BatchGeometry as n,UniformGroup as s,Shader as h,State as a}from\"@pixi/core\";import{SHAPES as o,Point as l,PI_2 as u,Polygon as p,Rectangle as c,RoundedRectangle as f,Circle as d,Ellipse as y,Matrix as v}from\"@pixi/math\";import{earcut as g,premultiplyTint as b,hex2rgb as m}from\"@pixi/utils\";import{WRAP_MODES as x,DRAW_MODES as _,BLEND_MODES as w}from\"@pixi/constants\";import{Bounds as S,Container as M}from\"@pixi/display\";var P,T;!function(t){t.MITER=\"miter\",t.BEVEL=\"bevel\",t.ROUND=\"round\"}(P||(P={})),function(t){t.BUTT=\"butt\",t.ROUND=\"round\",t.SQUARE=\"square\"}(T||(T={}));var D={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var i=Math.ceil(t/this.maxLength);return ithis.maxSegments&&(i=this.maxSegments),i}},A=function(){function e(){this.color=16777215,this.alpha=1,this.texture=t.WHITE,this.matrix=null,this.visible=!1,this.reset()}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},e.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=t.WHITE,this.matrix=null,this.visible=!1},e.prototype.destroy=function(){this.texture=null,this.matrix=null},e}(),E=function(t,e){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},E(t,e)};function C(t,e){function i(){this.constructor=t}E(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function R(t,e){var i,r;void 0===e&&(e=!1);var n=t.length;if(!(n<6)){for(var s=0,h=0,a=t[n-2],o=t[n-1];h0||e&&s<=0){var p=n/2;for(h=p+p%2;h=6){R(i,!1);for(var h=[],a=0;a=0&&h>=0&&r>=0&&n>=0){var d=Math.ceil(2.3*Math.sqrt(s+h)),y=8*d+(r?4:0)+(n?4:0);if(a.length=y,0!==y){if(0===d)return a.length=8,a[0]=a[6]=e+r,a[1]=a[3]=i+n,a[2]=a[4]=e-r,void(a[5]=a[7]=i-n);var v=0,g=4*d+(r?2:0)+2,b=g,m=y,x=e+(T=r+s),_=e-T,w=i+(D=n);if(a[v++]=x,a[v++]=w,a[--g]=w,a[--g]=_,n){var S=i-D;a[b++]=_,a[b++]=S,a[--m]=S,a[--m]=x}for(var M=1;Mp&&(p+=2*Math.PI);var c=u,f=p-u,d=Math.abs(f),y=Math.sqrt(o*o+l*l),v=1+(15*d*Math.sqrt(y)/Math.PI>>0),g=f/v;if(c+=g,a){h.push(t,e),h.push(i,r);for(var b=1,m=c;bx?(Y?(d.push(K,$),d.push(S+C*j,M+R*j),d.push(K,$),d.push(S+I*j,M+B*j)):(d.push(S-C*O,M-R*O),d.push(tt,et),d.push(S-I*O,M-B*O),d.push(tt,et)),v+=2):s.join===P.ROUND?Y?(d.push(K,$),d.push(S+C*j,M+R*j),v+=F(S,M,S+C*j,M+R*j,S+I*j,M+B*j,d,!0)+4,d.push(K,$),d.push(S+I*j,M+B*j)):(d.push(S-C*O,M-R*O),d.push(tt,et),v+=F(S,M,S-C*O,M-R*O,S-I*O,M-B*O,d,!1)+4,d.push(S-I*O,M-B*O),d.push(tt,et)):(d.push(K,$),d.push(tt,et)):(d.push(S-C*O,M-R*O),d.push(S+C*j,M+R*j),s.join===P.ROUND?v+=Y?F(S,M,S+C*j,M+R*j,S+I*j,M+B*j,d,!0)+2:F(S,M,S-C*O,M-R*O,S-I*O,M-B*O,d,!1)+2:s.join===P.MITER&&J/m<=x&&(Y?(d.push(tt,et),d.push(tt,et)):(d.push(K,$),d.push(K,$)),v+=2),d.push(S-I*O,M-B*O),d.push(S+I*j,M+B*j),v+=2)}}_=r[2*(y-2)],w=r[2*(y-2)+1],S=r[2*(y-1)],C=-(w-(M=r[2*(y-1)+1])),R=_-S,C/=L=Math.sqrt(C*C+R*R),R/=L,C*=b,R*=b,d.push(S-C*O,M-R*O),d.push(S+C*j,M+R*j),u||(s.cap===T.ROUND?v+=F(S-C*(O-j)*.5,M-R*(O-j)*.5,S-C*O,M-R*O,S+C*j,M+R*j,d,!1)+2:s.cap===T.SQUARE&&(v+=N(S,M,C,R,O,j,!1,d)));var rt=e.indices,nt=D.epsilon*D.epsilon;for(z=g;zu*a}},t.arc=function(t,e,i,r,n,s,h,a,o){for(var l=h-s,p=D._segmentsCount(Math.abs(l)*n,40*Math.ceil(Math.abs(l)/u)),c=l/(2*p),f=2*c,d=Math.cos(c),y=Math.sin(c),v=p-1,g=v%1/v,b=0;b<=v;++b){var m=c+s+f*(b+g*b),x=Math.cos(m),_=-Math.sin(m);o.push((d*x+y*_)*n+i,(d*-_+y*x)*n+r)}},t}(),H=function(){function t(){}return t.curveLength=function(t,e,i,r,n,s,h,a){for(var o=0,l=0,u=0,p=0,c=0,f=0,d=0,y=0,v=0,g=0,b=0,m=t,x=e,_=1;_<=10;++_)g=m-(y=(d=(f=(c=1-(l=_/10))*c)*c)*t+3*f*l*i+3*c*(u=l*l)*n+(p=u*l)*h),b=x-(v=d*e+3*f*l*r+3*c*u*s+p*a),m=y,x=v,o+=Math.sqrt(g*g+b*b);return o},t.curveTo=function(e,i,r,n,s,h,a){var o=a[a.length-2],l=a[a.length-1];a.length-=2;var u=D._segmentsCount(t.curveLength(o,l,e,i,r,n,s,h)),p=0,c=0,f=0,d=0,y=0;a.push(o,l);for(var v=1,g=0;v<=u;++v)f=(c=(p=1-(g=v/u))*p)*p,y=(d=g*g)*g,a.push(f*o+3*c*g*e+3*p*d*r+y*s,f*l+3*c*g*i+3*p*d*n+y*h)},t}(),G=function(){function t(){}return t.curveLength=function(t,e,i,r,n,s){var h=t-2*i+n,a=e-2*r+s,o=2*i-2*t,l=2*r-2*e,u=4*(h*h+a*a),p=4*(h*o+a*l),c=o*o+l*l,f=2*Math.sqrt(u+p+c),d=Math.sqrt(u),y=2*u*d,v=2*Math.sqrt(c),g=p/d;return(y*f+d*p*(f-v)+(4*c*u-p*p)*Math.log((2*d+g+f)/(g+v)))/(4*y)},t.curveTo=function(e,i,r,n,s){for(var h=s[s.length-2],a=s[s.length-1],o=D._segmentsCount(t.curveLength(h,a,e,i,r,n)),l=0,u=0,p=1;p<=o;++p){var c=p/o;l=h+(e-h)*c,u=a+(i-a)*c,s.push(l+(e+(r-e)*c-l)*c,u+(i+(n-i)*c-u)*c)}},t}(),W=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),Y=((q={})[o.POLY]=I,q[o.CIRC]=B,q[o.ELIP]=B,q[o.RECT]=L,q[o.RREC]=j,q),V=[],Q=[],X=function(){function t(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),Z=new l,J=function(t){function n(){var e=t.call(this)||this;return e.closePointEps=1e-4,e.boundsPadding=0,e.uvsFloat32=null,e.indicesUint16=null,e.batchable=!1,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.drawCalls=[],e.batchDirty=-1,e.batches=[],e.dirty=0,e.cacheDirty=-1,e.clearDirty=0,e.shapeIndex=0,e._bounds=new S,e.boundsDirty=-1,e}return C(n,t),Object.defineProperty(n.prototype,\"bounds\",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),n.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},n.prototype.drawShape=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null);var n=new X(t,e,i,r);return this.graphicsData.push(n),this.dirty++,this},n.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var i=new X(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),this.dirty++,this},n.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e0&&(r=(i=this.batches[this.batches.length-1]).style);for(var n=this.shapeIndex;n65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&v===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=v?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},n.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},n.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t131070)return!1;for(var t=this.batches,e=0;e0&&((a=Q.pop())||((a=new i).texArray=new r),this.drawCalls.push(a)),a.start=f,a.size=0,a.texArray.count=0,a.type=c),v.touched=1,v._batchEnabled=t,v._batchLocation=o,v.wrapMode=x.REPEAT,a.texArray.elements[a.texArray.count++]=v,o++)),a.size+=d.size,f+=d.size,u=v._batchLocation,this.addColors(s,y.color,y.alpha,d.attribSize,d.attribStart),this.addTextureIds(h,u,d.attribSize,d.attribStart)}e._globalBatch=t,this.packAttributes()},n.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,i=this.colors,r=this.textureIds,n=new ArrayBuffer(3*t.length*4),s=new Float32Array(n),h=new Uint32Array(n),a=0,o=0;o>16)+(65280&e)+((255&e)<<16),i);t.length=Math.max(t.length,n+r);for(var h=0;h0&&e.alpha>0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:i},e)):this._lineStyle.reset(),this},i.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new p,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new p,this.currentPath.closeStroke=!1},i.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},i.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},i.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],n=i[i.length-1];return r===t&&n===e||i.push(t,e),this},i.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},i.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),G.curveTo(t,e,i,r,n),this},i.prototype.bezierCurveTo=function(t,e,i,r,n,s){return this._initCurve(),H.curveTo(t,e,i,r,n,s,this.currentPath.points),this},i.prototype.arcTo=function(t,e,i,r,n){this._initCurve(t,e);var s=this.currentPath.points,h=k.curveTo(t,e,i,r,n,s);if(h){var a=h.cx,o=h.cy,l=h.radius,u=h.startAngle,p=h.endAngle,c=h.anticlockwise;this.arc(a,o,l,u,p,c)}return this},i.prototype.arc=function(t,e,i,r,n,s){if(void 0===s&&(s=!1),r===n)return this;if(!s&&n<=r?n+=u:s&&r<=n&&(r+=u),0===n-r)return this;var h=t+Math.cos(r)*i,a=e+Math.sin(r)*i,o=this._geometry.closePointEps,l=this.currentPath?this.currentPath.points:null;if(l){var p=Math.abs(l[l.length-2]-h),c=Math.abs(l[l.length-1]-a);p0;return i?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:i},e)):this._fillStyle.reset(),this},i.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},i.prototype.drawRect=function(t,e,i,r){return this.drawShape(new c(t,e,i,r))},i.prototype.drawRoundedRect=function(t,e,i,r,n){return this.drawShape(new f(t,e,i,r,n))},i.prototype.drawCircle=function(t,e,i){return this.drawShape(new d(t,e,i))},i.prototype.drawEllipse=function(t,e,i,r){return this.drawShape(new y(t,e,i,r))},i.prototype.drawPolygon=function(){for(var t,e=arguments,i=[],r=0;r>16&255)/255*n,s.tint[1]=(r>>8&255)/255*n,s.tint[2]=(255&r)/255*n,s.tint[3]=n,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var a=0,o=h.length;a>16)+(65280&n)+((255&n)<<16)}}},i.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,i=e.a,r=e.b,n=e.c,s=e.d,h=e.tx,a=e.ty,o=this._geometry.points,l=this.vertexData,u=0,p=0;p=r&&c.x=o&&c.y>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,\"texture\",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off(\"update\",this._onTextureUpdate,this),this._texture=t||e.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once(\"update\",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),o}(r);export{l as Sprite};\n//# sourceMappingURL=sprite.min.mjs.map\n","/*!\n * @pixi/text - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/text is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Sprite as t}from\"@pixi/sprite\";import{Texture as e}from\"@pixi/core\";import{settings as i}from\"@pixi/settings\";import{Rectangle as n}from\"@pixi/math\";import{hex2string as r,hex2rgb as o,string2hex as a,trimCanvas as s,sign as h}from\"@pixi/utils\";var l,c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},c(t,e)};!function(t){t[t.LINEAR_VERTICAL=0]=\"LINEAR_VERTICAL\",t[t.LINEAR_HORIZONTAL=1]=\"LINEAR_HORIZONTAL\"}(l||(l={}));var f={align:\"left\",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:\"black\",dropShadowDistance:5,fill:\"black\",fillGradientType:l.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:\"Arial\",fontSize:26,fontStyle:\"normal\",fontVariant:\"normal\",fontWeight:\"normal\",letterSpacing:0,lineHeight:0,lineJoin:\"miter\",miterLimit:10,padding:0,stroke:\"black\",strokeThickness:0,textBaseline:\"alphabetic\",trim:!1,whiteSpace:\"pre\",wordWrap:!1,wordWrapWidth:100,leading:0},u=[\"serif\",\"sans-serif\",\"monospace\",\"cursive\",\"fantasy\",\"system-ui\"],p=function(){function t(t){this.styleID=0,this.reset(),y(this,t,t)}return t.prototype.clone=function(){var e={};return y(e,this,f),new t(e)},t.prototype.reset=function(){y(this,f,f)},Object.defineProperty(t.prototype,\"align\",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"breakWords\",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadow\",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadowAlpha\",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadowAngle\",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadowBlur\",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadowColor\",{get:function(){return this._dropShadowColor},set:function(t){var e=g(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"dropShadowDistance\",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"fill\",{get:function(){return this._fill},set:function(t){var e=g(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"fillGradientType\",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"fillGradientStops\",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i=0;i--){var n=e[i].trim();!/([\\\"\\'])[^\\'\\\"]+\\1/.test(n)&&u.indexOf(n)<0&&(n='\"'+n+'\"'),e[i]=n}return this.fontStyle+\" \"+this.fontVariant+\" \"+this.fontWeight+\" \"+t+\" \"+e.join(\",\")},t}();function d(t){return\"number\"==typeof t?r(t):(\"string\"==typeof t&&0===t.indexOf(\"0x\")&&(t=t.replace(\"0x\",\"#\")),t)}function g(t){if(Array.isArray(t)){for(var e=0;ed)if(\"\"!==a&&(s+=t.addLine(a),a=\"\",o=0),t.canBreakWords(_,i.breakWords))for(var w=t.wordWrapSplit(_),v=0;vd&&(s+=t.addLine(a),p=!1,a=\"\",o=0),a+=x,o+=L}else{a.length>0&&(s+=t.addLine(a),a=\"\",o=0);var O=y===g.length-1;s+=t.addLine(_,!O),p=!1,a=\"\",o=0}else m+o>d&&(p=!1,s+=t.addLine(a),a=\"\",o=0),(a.length>0||!t.isBreakingSpace(_)||p)&&(a+=_,o+=m)}return s+=t.addLine(a,!1)},t.addLine=function(e,i){return void 0===i&&(i=!0),e=t.trimRight(e),e=i?e+\"\\n\":e},t.getFromCache=function(t,e,i,n){var r=i[t];if(\"number\"!=typeof r){var o=t.length*e;r=n.measureText(t).width+o,i[t]=r}return r},t.collapseSpaces=function(t){return\"normal\"===t||\"pre-line\"===t},t.collapseNewlines=function(t){return\"normal\"===t},t.trimRight=function(e){if(\"string\"!=typeof e)return\"\";for(var i=e.length-1;i>=0;i--){var n=e[i];if(!t.isBreakingSpace(n))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return\"string\"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e,i){return\"string\"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var i=[],n=\"\";if(\"string\"!=typeof e)return i;for(var r=0;rs;--u){for(g=0;g0&&g>y&&(_=(y+g)/2);var b=y+d,S=i.lineHeight*(p+1),m=b;p+10},t}();function c(t,i){var r=!1;if(t&&t._textures&&t._textures.length)for(var o=0;o=0;e--)this.add(t.children[e]);return this},e.prototype.destroy=function(){this.ticking&&n.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},e}();function v(t,e){return e instanceof i&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function _(t,e){if(!(e instanceof o))return!1;var i=e.geometry;e.finishPoly(),i.updateBatches();for(var r=i.batches,n=0;n=n&&x.x=o&&x.y1?r.from(\"#version 300 es\\n#define SHADER_NAME Tiling-Sprite-300\\n\\nprecision lowp float;\\n\\nin vec2 aVertexPosition;\\nin vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nout vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n\",\"#version 300 es\\n#define SHADER_NAME Tiling-Sprite-100\\n\\nprecision lowp float;\\n\\nin vec2 vTextureCoord;\\n\\nout vec4 fragmentColor;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\nuniform mat3 uMapCoord;\\nuniform vec4 uClampFrame;\\nuniform vec2 uClampOffset;\\n\\nvoid main(void)\\n{\\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\\n vec2 unclamped = coord;\\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\\n\\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\\n\\n fragmentColor = texSample * uColor;\\n}\\n\",t):r.from(g,\"#version 100\\n#ifdef GL_EXT_shader_texture_lod\\n #extension GL_EXT_shader_texture_lod : enable\\n#endif\\n#define SHADER_NAME Tiling-Sprite-100\\n\\nprecision lowp float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\nuniform mat3 uMapCoord;\\nuniform vec4 uClampFrame;\\nuniform vec2 uClampOffset;\\n\\nvoid main(void)\\n{\\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\\n vec2 unclamped = coord;\\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\\n\\n #ifdef GL_EXT_shader_texture_lod\\n vec4 texSample = unclamped == coord\\n ? texture2D(uSampler, coord) \\n : texture2DLodEXT(uSampler, coord, 0);\\n #else\\n vec4 texSample = texture2D(uSampler, coord);\\n #endif\\n\\n gl_FragColor = texSample * uColor;\\n}\\n\",t)},t.prototype.render=function(e){var t=this.renderer,r=this.quad,n=r.vertices;n[0]=n[6]=e._width*-e.anchor.x,n[1]=n[3]=e._height*-e.anchor.y,n[2]=n[4]=e._width*(1-e.anchor.x),n[5]=n[7]=e._height*(1-e.anchor.y);var o=e.uvRespectAnchor?e.anchor.x:0,i=e.uvRespectAnchor?e.anchor.y:0;(n=r.uvs)[0]=n[6]=-o,n[1]=n[3]=-i,n[2]=n[4]=1-o,n[5]=n[7]=1-i,r.invalidate();var a=e._texture,u=a.baseTexture,s=u.alphaMode>0,c=e.tileTransform.localTransform,l=e.uvMatrix,h=u.isPowerOfTwo&&a.frame.width===u.width&&a.frame.height===u.height;h&&(u._glTextures[t.CONTEXT_UID]?h=u.wrapMode!==p.CLAMP:u.wrapMode===p.CLAMP&&(u.wrapMode=p.REPEAT));var f=h?this.simpleShader:this.shader,v=a.width,x=a.height,_=e._width,g=e._height;y.set(c.a*v/_,c.b*v/g,c.c*x/_,c.d*x/g,c.tx/_,c.ty/g),y.invert(),h?y.prepend(l.mapCoord):(f.uniforms.uMapCoord=l.mapCoord.toArray(!0),f.uniforms.uClampFrame=l.uClampFrame,f.uniforms.uClampOffset=l.uClampOffset),f.uniforms.uTransform=y.toArray(!0),f.uniforms.uColor=d(e.tint,e.worldAlpha,f.uniforms.uColor,s),f.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,t.shader.bind(f),t.geometry.bind(r),this.state.blendMode=m(e.blendMode,s),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},t.extension={name:\"tilingSprite\",type:n.RendererPlugin},t}(a);export{_ as TilingSprite,C as TilingSpriteRenderer};\n//# sourceMappingURL=sprite-tiling.min.mjs.map\n","/*!\n * @pixi/mesh - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/mesh is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{State as t,Program as e,TextureMatrix as r,Shader as i,Buffer as n,Geometry as o}from\"@pixi/core\";import{Point as a,Polygon as s,Matrix as u}from\"@pixi/math\";import{DRAW_MODES as h,TYPES as l}from\"@pixi/constants\";import{Container as f}from\"@pixi/display\";import{settings as d}from\"@pixi/settings\";import{premultiplyTintToRgba as p}from\"@pixi/utils\";var c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},c(t,e)};function m(t,e){function r(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var y=function(){function t(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return t.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}},t}(),x=new a,v=new s,g=function(e){function r(r,i,n,o){void 0===o&&(o=h.TRIANGLES);var a=e.call(this)||this;return a.geometry=r,a.shader=i,a.state=n||t.for2d(),a.drawMode=o,a.start=0,a.size=0,a.uvs=null,a.indices=null,a.vertexData=new Float32Array(1),a.vertexDirty=-1,a._transformID=-1,a._roundPixels=d.ROUND_PIXELS,a.batchUvs=null,a}return m(r,e),Object.defineProperty(r.prototype,\"geometry\",{get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"uvBuffer\",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"verticesBuffer\",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"material\",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"blendMode\",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"roundPixels\",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"tint\",{get:function(){return\"tint\"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,\"texture\",{get:function(){return\"texture\"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),r.prototype._render=function(t){var e=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===h.TRIANGLES&&e.length<2*r.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},r.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},r.prototype._renderToBatch=function(t){var e=this.geometry,r=this.shader;r.uvMatrix&&(r.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=r._tintRGB,this._texture=r.texture;var i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].render(this)},r.prototype.calculateVertices=function(){var t=this.geometry.buffers[0],e=t.data,r=t._updateID;if(r!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var i=this.transform.worldTransform,n=i.a,o=i.b,a=i.c,s=i.d,u=i.tx,h=i.ty,l=this.vertexData,f=0;f>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),i.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;p(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},i}(i),_=function(t){function e(e,r,i){var o=t.call(this)||this,a=new n(e),s=new n(r,!0),u=new n(i,!0,!0);return o.addAttribute(\"aVertexPosition\",a,2,!1,l.FLOAT).addAttribute(\"aTextureCoord\",s,2,!1,l.FLOAT).addIndex(u),o._updateId=-1,o}return m(e,t),Object.defineProperty(e.prototype,\"vertexDirtyId\",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(o);export{g as Mesh,y as MeshBatchUvs,_ as MeshGeometry,b as MeshMaterial};\n//# sourceMappingURL=mesh.min.mjs.map\n","/*!\n * @pixi/text-bitmap - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/text-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Rectangle as e,Point as t,ObservablePoint as r}from\"@pixi/math\";import{settings as i}from\"@pixi/settings\";import{MeshGeometry as n,MeshMaterial as a,Mesh as o}from\"@pixi/mesh\";import{hex2rgb as s,string2hex as h,getResolutionOfUrl as l,removeItems as u}from\"@pixi/utils\";import{BaseTexture as f,Texture as c,Program as d,ExtensionType as p}from\"@pixi/core\";import{TEXT_GRADIENT as g,TextStyle as m,TextMetrics as x}from\"@pixi/text\";import{ALPHA_MODES as v,BLEND_MODES as y}from\"@pixi/constants\";import{Container as b}from\"@pixi/display\";import{LoaderResource as _}from\"@pixi/loaders\";var w=function(e,t){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},w(e,t)};var T=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},A=function(){function e(){}return e.test=function(e){return\"string\"==typeof e&&0===e.indexOf(\"info face=\")},e.parse=function(e){var t=e.match(/^[a-z]+\\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var i in t){var n=t[i].match(/^[a-z]+/gm)[0],a=t[i].match(/[a-zA-Z]+=([^\\s\"']+|\"([^\"]*)\")/gm),o={};for(var s in a){var h=a[s].split(\"=\"),l=h[0],u=h[1].replace(/\"/gm,\"\"),f=parseFloat(u),c=isNaN(f)?u:f;o[l]=c}r[n].push(o)}var d=new T;return r.info.forEach((function(e){return d.info.push({face:e.face,size:parseInt(e.size,10)})})),r.common.forEach((function(e){return d.common.push({lineHeight:parseInt(e.lineHeight,10)})})),r.page.forEach((function(e){return d.page.push({id:parseInt(e.id,10),file:e.file})})),r.char.forEach((function(e){return d.char.push({id:parseInt(e.id,10),page:parseInt(e.page,10),x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xoffset:parseInt(e.xoffset,10),yoffset:parseInt(e.yoffset,10),xadvance:parseInt(e.xadvance,10)})})),r.kerning.forEach((function(e){return d.kerning.push({first:parseInt(e.first,10),second:parseInt(e.second,10),amount:parseInt(e.amount,10)})})),r.distanceField.forEach((function(e){return d.distanceField.push({distanceRange:parseInt(e.distanceRange,10),fieldType:e.fieldType})})),d},e}(),S=function(){function e(){}return e.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName(\"page\").length&&null!==e.getElementsByTagName(\"info\")[0].getAttribute(\"face\")},e.parse=function(e){for(var t=new T,r=e.getElementsByTagName(\"info\"),i=e.getElementsByTagName(\"common\"),n=e.getElementsByTagName(\"page\"),a=e.getElementsByTagName(\"char\"),o=e.getElementsByTagName(\"kerning\"),s=e.getElementsByTagName(\"distanceField\"),h=0;h\")>-1){var t=(new globalThis.DOMParser).parseFromString(e,\"text/xml\");return S.test(t)}return!1},e.parse=function(e){var t=(new globalThis.DOMParser).parseFromString(e,\"text/xml\");return S.parse(t)},e}(),M=[A,S,P];function C(e){for(var t=0;t=u-k*h){if(0===A)throw new Error(\"[BitmapFont] textureHeight \"+u+\"px is too small for \"+p.fontSize+\"px fonts\");--M,y=null,b=null,_=null,A=0,w=0,S=0}else if(S=Math.max(k+C.fontProperties.descent,S),N*h+w>=g)--M,A+=S*h,A=Math.ceil(A),w=0,S=0;else{I(y,b,C,w,A,h,p);var z=E(C.text);v.char.push({id:z,page:P.length-1,x:w/h,y:A/h,width:N,height:k,xoffset:0,yoffset:0,xadvance:Math.ceil(F-(p.dropShadow?p.dropShadowDistance:0)-(p.stroke?p.strokeThickness:0))}),w+=(N+2*s)*h,w=Math.ceil(w)}}M=0;for(var H=d.length;M0&&s.x>g&&(++A,u(h,1+w-A,1+M-w),M=w,w=-1,l.push(T),f.push(h.length>0?h[h.length-1].prevSpaces:0),b=Math.max(b,T),_++,s.x=0,s.y+=r.lineHeight,x=null,P=0)}}else l.push(v),f.push(-1),b=Math.max(b,v),++_,++A,s.x=0,s.y+=r.lineHeight,x=null,P=0}var D=p[p.length-1];\"\\r\"!==D&&\"\\n\"!==D&&(/(?:\\s)/.test(D)&&(v=T),l.push(v),b=Math.max(b,v),f.push(-1));var B=[];for(M=0;M<=_;M++){var L=0;\"right\"===this._align?L=b-l[M]:\"center\"===this._align?L=(b-l[M])/2:\"justify\"===this._align&&(L=f[M]<0?0:(b-l[M])/f[M]),B.push(L)}var R=h.length,j={},W=[],U=this._activePagesMeshData;for(M=0;M6*$)||le.vertices.length<2*o.BATCHABLE_SIZE)le.vertices=new Float32Array(8*$),le.uvs=new Float32Array(8*$),le.indices=new Uint16Array(6*$);else for(var J=le.total,K=le.vertices,Q=4*J*2;Q=i&&(e=t-_-1),n+=o=o.replace(\"%value%\",r[e].toString()),n+=\"\\n\"}return(E=E.replace(\"%blur%\",n)).replace(\"%size%\",t.toString())}(_);return(o=t.call(this,T,N)||this).horizontal=r,o.resolution=n,o._quality=0,o.quality=E,o.blur=i,o}return i(r,t),r.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var E=t.getFilterTexture(),n=t.renderer,_=e,o=E;this.state.blend=!1,t.applyFilter(this,_,o,a.CLEAR);for(var T=1;T 0.0) {\\n c.rgb /= c.a;\\n }\\n\\n vec4 result;\\n\\n result.r = (m[0] * c.r);\\n result.r += (m[1] * c.g);\\n result.r += (m[2] * c.b);\\n result.r += (m[3] * c.a);\\n result.r += m[4];\\n\\n result.g = (m[5] * c.r);\\n result.g += (m[6] * c.g);\\n result.g += (m[7] * c.b);\\n result.g += (m[8] * c.a);\\n result.g += m[9];\\n\\n result.b = (m[10] * c.r);\\n result.b += (m[11] * c.g);\\n result.b += (m[12] * c.b);\\n result.b += (m[13] * c.a);\\n result.b += m[14];\\n\\n result.a = (m[15] * c.r);\\n result.a += (m[16] * c.g);\\n result.a += (m[17] * c.b);\\n result.a += (m[18] * c.a);\\n result.a += m[19];\\n\\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\\n\\n // Premultiply alpha again.\\n rgb *= result.a;\\n\\n gl_FragColor = vec4(rgb, result.a);\\n}\\n\",n)||this).alpha=1,o}return function(t,r){function n(){this.constructor=t}o(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}(n,r),n.prototype._loadMatrix=function(t,r){void 0===r&&(r=!1);var o=t;r&&(this._multiply(o,this.uniforms.m,t),o=this._colorMatrix(o)),this.uniforms.m=o},n.prototype._multiply=function(t,r,o){return t[0]=r[0]*o[0]+r[1]*o[5]+r[2]*o[10]+r[3]*o[15],t[1]=r[0]*o[1]+r[1]*o[6]+r[2]*o[11]+r[3]*o[16],t[2]=r[0]*o[2]+r[1]*o[7]+r[2]*o[12]+r[3]*o[17],t[3]=r[0]*o[3]+r[1]*o[8]+r[2]*o[13]+r[3]*o[18],t[4]=r[0]*o[4]+r[1]*o[9]+r[2]*o[14]+r[3]*o[19]+r[4],t[5]=r[5]*o[0]+r[6]*o[5]+r[7]*o[10]+r[8]*o[15],t[6]=r[5]*o[1]+r[6]*o[6]+r[7]*o[11]+r[8]*o[16],t[7]=r[5]*o[2]+r[6]*o[7]+r[7]*o[12]+r[8]*o[17],t[8]=r[5]*o[3]+r[6]*o[8]+r[7]*o[13]+r[8]*o[18],t[9]=r[5]*o[4]+r[6]*o[9]+r[7]*o[14]+r[8]*o[19]+r[9],t[10]=r[10]*o[0]+r[11]*o[5]+r[12]*o[10]+r[13]*o[15],t[11]=r[10]*o[1]+r[11]*o[6]+r[12]*o[11]+r[13]*o[16],t[12]=r[10]*o[2]+r[11]*o[7]+r[12]*o[12]+r[13]*o[17],t[13]=r[10]*o[3]+r[11]*o[8]+r[12]*o[13]+r[13]*o[18],t[14]=r[10]*o[4]+r[11]*o[9]+r[12]*o[14]+r[13]*o[19]+r[14],t[15]=r[15]*o[0]+r[16]*o[5]+r[17]*o[10]+r[18]*o[15],t[16]=r[15]*o[1]+r[16]*o[6]+r[17]*o[11]+r[18]*o[16],t[17]=r[15]*o[2]+r[16]*o[7]+r[17]*o[12]+r[18]*o[17],t[18]=r[15]*o[3]+r[16]*o[8]+r[17]*o[13]+r[18]*o[18],t[19]=r[15]*o[4]+r[16]*o[9]+r[17]*o[14]+r[18]*o[19]+r[19],t},n.prototype._colorMatrix=function(t){var r=new Float32Array(t);return r[4]/=255,r[9]/=255,r[14]/=255,r[19]/=255,r},n.prototype.brightness=function(t,r){var o=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(o,r)},n.prototype.tint=function(t,r){var o=[(t>>16&255)/255,0,0,0,0,0,(t>>8&255)/255,0,0,0,0,0,(255&t)/255,0,0,0,0,0,1,0];this._loadMatrix(o,r)},n.prototype.greyscale=function(t,r){var o=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(o,r)},n.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},n.prototype.hue=function(t,r){t=(t||0)/180*Math.PI;var o=Math.cos(t),n=Math.sin(t),e=1/3,i=(0,Math.sqrt)(e),a=[o+(1-o)*e,e*(1-o)-i*n,e*(1-o)+i*n,0,0,e*(1-o)+i*n,o+e*(1-o),e*(1-o)-i*n,0,0,e*(1-o)-i*n,e*(1-o)+i*n,o+e*(1-o),0,0,0,0,0,1,0];this._loadMatrix(a,r)},n.prototype.contrast=function(t,r){var o=(t||0)+1,n=-.5*(o-1),e=[o,0,0,0,n,0,o,0,0,n,0,0,o,0,n,0,0,0,1,0];this._loadMatrix(e,r)},n.prototype.saturate=function(t,r){void 0===t&&(t=0);var o=2*t/3+1,n=-.5*(o-1),e=[o,n,n,0,0,n,o,n,0,0,n,n,o,0,0,0,0,0,1,0];this._loadMatrix(e,r)},n.prototype.desaturate=function(){this.saturate(-1)},n.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},n.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},n.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},n.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},n.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},n.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},n.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},n.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},n.prototype.colorTone=function(t,r,o,n,e){var i=((o=o||16770432)>>16&255)/255,a=(o>>8&255)/255,u=(255&o)/255,l=((n=n||3375104)>>16&255)/255,p=(n>>8&255)/255,c=(255&n)/255,s=[.3,.59,.11,0,0,i,a,u,t=t||.2,0,l,p,c,r=r||.15,0,i-l,a-p,u-c,0,0];this._loadMatrix(s,e)},n.prototype.night=function(t,r){var o=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(o,r)},n.prototype.predator=function(t,r){var o=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(o,r)},n.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},n.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(n.prototype,\"matrix\",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,\"alpha\",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),n}(r);n.prototype.grayscale=n.prototype.greyscale;export{n as ColorMatrixFilter};\n//# sourceMappingURL=filter-color-matrix.min.mjs.map\n","/*!\n * @pixi/filter-displacement - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/filter-displacement is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Filter as t}from\"@pixi/core\";import{Matrix as r,Point as n}from\"@pixi/math\";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])},e(t,r)};var i=function(t){function i(e,i){var o=this,a=new r;return e.renderable=!1,(o=t.call(this,\"attribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 filterMatrix;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec2 vFilterCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvec2 filterTextureCoord( void )\\n{\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n}\\n\\nvoid main(void)\\n{\\n\\tgl_Position = filterVertexPosition();\\n\\tvTextureCoord = filterTextureCoord();\\n\\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\\n}\\n\",\"varying vec2 vFilterCoord;\\nvarying vec2 vTextureCoord;\\n\\nuniform vec2 scale;\\nuniform mat2 rotation;\\nuniform sampler2D uSampler;\\nuniform sampler2D mapSampler;\\n\\nuniform highp vec4 inputSize;\\nuniform vec4 inputClamp;\\n\\nvoid main(void)\\n{\\n vec4 map = texture2D(mapSampler, vFilterCoord);\\n\\n map -= 0.5;\\n map.xy = scale * inputSize.zw * (rotation * map.xy);\\n\\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\\n}\\n\",{mapSampler:e._texture,filterMatrix:a,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,o.maskMatrix=a,null==i&&(i=20),o.scale=new n(i,i),o}return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}(i,t),i.prototype.apply=function(t,r,n,e){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var i=this.maskSprite.worldTransform,o=Math.sqrt(i.a*i.a+i.b*i.b),a=Math.sqrt(i.c*i.c+i.d*i.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=i.a/o,this.uniforms.rotation[1]=i.b/o,this.uniforms.rotation[2]=i.c/a,this.uniforms.rotation[3]=i.d/a),t.applyFilter(this,r,n,e)},Object.defineProperty(i.prototype,\"map\",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),i}(t);export{i as DisplacementFilter};\n//# sourceMappingURL=filter-displacement.min.mjs.map\n","/*!\n * @pixi/mixin-cache-as-bitmap - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/mixin-cache-as-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{RenderTexture as t,BaseTexture as a,Texture as i}from\"@pixi/core\";import{Sprite as e}from\"@pixi/sprite\";import{DisplayObject as s}from\"@pixi/display\";import{Matrix as r}from\"@pixi/math\";import{uid as n}from\"@pixi/utils\";import{settings as _}from\"@pixi/settings\";var o,h,E,c,T,l,N,R,A,I,d,p,u,L,O,D,U,C,P,m;!function(t){t[t.WEBGL_LEGACY=0]=\"WEBGL_LEGACY\",t[t.WEBGL=1]=\"WEBGL\",t[t.WEBGL2=2]=\"WEBGL2\"}(o||(o={})),function(t){t[t.UNKNOWN=0]=\"UNKNOWN\",t[t.WEBGL=1]=\"WEBGL\",t[t.CANVAS=2]=\"CANVAS\"}(h||(h={})),function(t){t[t.COLOR=16384]=\"COLOR\",t[t.DEPTH=256]=\"DEPTH\",t[t.STENCIL=1024]=\"STENCIL\"}(E||(E={})),function(t){t[t.NORMAL=0]=\"NORMAL\",t[t.ADD=1]=\"ADD\",t[t.MULTIPLY=2]=\"MULTIPLY\",t[t.SCREEN=3]=\"SCREEN\",t[t.OVERLAY=4]=\"OVERLAY\",t[t.DARKEN=5]=\"DARKEN\",t[t.LIGHTEN=6]=\"LIGHTEN\",t[t.COLOR_DODGE=7]=\"COLOR_DODGE\",t[t.COLOR_BURN=8]=\"COLOR_BURN\",t[t.HARD_LIGHT=9]=\"HARD_LIGHT\",t[t.SOFT_LIGHT=10]=\"SOFT_LIGHT\",t[t.DIFFERENCE=11]=\"DIFFERENCE\",t[t.EXCLUSION=12]=\"EXCLUSION\",t[t.HUE=13]=\"HUE\",t[t.SATURATION=14]=\"SATURATION\",t[t.COLOR=15]=\"COLOR\",t[t.LUMINOSITY=16]=\"LUMINOSITY\",t[t.NORMAL_NPM=17]=\"NORMAL_NPM\",t[t.ADD_NPM=18]=\"ADD_NPM\",t[t.SCREEN_NPM=19]=\"SCREEN_NPM\",t[t.NONE=20]=\"NONE\",t[t.SRC_OVER=0]=\"SRC_OVER\",t[t.SRC_IN=21]=\"SRC_IN\",t[t.SRC_OUT=22]=\"SRC_OUT\",t[t.SRC_ATOP=23]=\"SRC_ATOP\",t[t.DST_OVER=24]=\"DST_OVER\",t[t.DST_IN=25]=\"DST_IN\",t[t.DST_OUT=26]=\"DST_OUT\",t[t.DST_ATOP=27]=\"DST_ATOP\",t[t.ERASE=26]=\"ERASE\",t[t.SUBTRACT=28]=\"SUBTRACT\",t[t.XOR=29]=\"XOR\"}(c||(c={})),function(t){t[t.POINTS=0]=\"POINTS\",t[t.LINES=1]=\"LINES\",t[t.LINE_LOOP=2]=\"LINE_LOOP\",t[t.LINE_STRIP=3]=\"LINE_STRIP\",t[t.TRIANGLES=4]=\"TRIANGLES\",t[t.TRIANGLE_STRIP=5]=\"TRIANGLE_STRIP\",t[t.TRIANGLE_FAN=6]=\"TRIANGLE_FAN\"}(T||(T={})),function(t){t[t.RGBA=6408]=\"RGBA\",t[t.RGB=6407]=\"RGB\",t[t.RG=33319]=\"RG\",t[t.RED=6403]=\"RED\",t[t.RGBA_INTEGER=36249]=\"RGBA_INTEGER\",t[t.RGB_INTEGER=36248]=\"RGB_INTEGER\",t[t.RG_INTEGER=33320]=\"RG_INTEGER\",t[t.RED_INTEGER=36244]=\"RED_INTEGER\",t[t.ALPHA=6406]=\"ALPHA\",t[t.LUMINANCE=6409]=\"LUMINANCE\",t[t.LUMINANCE_ALPHA=6410]=\"LUMINANCE_ALPHA\",t[t.DEPTH_COMPONENT=6402]=\"DEPTH_COMPONENT\",t[t.DEPTH_STENCIL=34041]=\"DEPTH_STENCIL\"}(l||(l={})),function(t){t[t.TEXTURE_2D=3553]=\"TEXTURE_2D\",t[t.TEXTURE_CUBE_MAP=34067]=\"TEXTURE_CUBE_MAP\",t[t.TEXTURE_2D_ARRAY=35866]=\"TEXTURE_2D_ARRAY\",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=\"TEXTURE_CUBE_MAP_POSITIVE_X\",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=\"TEXTURE_CUBE_MAP_NEGATIVE_X\",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=\"TEXTURE_CUBE_MAP_POSITIVE_Y\",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=\"TEXTURE_CUBE_MAP_NEGATIVE_Y\",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=\"TEXTURE_CUBE_MAP_POSITIVE_Z\",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=\"TEXTURE_CUBE_MAP_NEGATIVE_Z\"}(N||(N={})),function(t){t[t.UNSIGNED_BYTE=5121]=\"UNSIGNED_BYTE\",t[t.UNSIGNED_SHORT=5123]=\"UNSIGNED_SHORT\",t[t.UNSIGNED_SHORT_5_6_5=33635]=\"UNSIGNED_SHORT_5_6_5\",t[t.UNSIGNED_SHORT_4_4_4_4=32819]=\"UNSIGNED_SHORT_4_4_4_4\",t[t.UNSIGNED_SHORT_5_5_5_1=32820]=\"UNSIGNED_SHORT_5_5_5_1\",t[t.UNSIGNED_INT=5125]=\"UNSIGNED_INT\",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]=\"UNSIGNED_INT_10F_11F_11F_REV\",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]=\"UNSIGNED_INT_2_10_10_10_REV\",t[t.UNSIGNED_INT_24_8=34042]=\"UNSIGNED_INT_24_8\",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]=\"UNSIGNED_INT_5_9_9_9_REV\",t[t.BYTE=5120]=\"BYTE\",t[t.SHORT=5122]=\"SHORT\",t[t.INT=5124]=\"INT\",t[t.FLOAT=5126]=\"FLOAT\",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=\"FLOAT_32_UNSIGNED_INT_24_8_REV\",t[t.HALF_FLOAT=36193]=\"HALF_FLOAT\"}(R||(R={})),function(t){t[t.FLOAT=0]=\"FLOAT\",t[t.INT=1]=\"INT\",t[t.UINT=2]=\"UINT\"}(A||(A={})),function(t){t[t.NEAREST=0]=\"NEAREST\",t[t.LINEAR=1]=\"LINEAR\"}(I||(I={})),function(t){t[t.CLAMP=33071]=\"CLAMP\",t[t.REPEAT=10497]=\"REPEAT\",t[t.MIRRORED_REPEAT=33648]=\"MIRRORED_REPEAT\"}(d||(d={})),function(t){t[t.OFF=0]=\"OFF\",t[t.POW2=1]=\"POW2\",t[t.ON=2]=\"ON\",t[t.ON_MANUAL=3]=\"ON_MANUAL\"}(p||(p={})),function(t){t[t.NPM=0]=\"NPM\",t[t.UNPACK=1]=\"UNPACK\",t[t.PMA=2]=\"PMA\",t[t.NO_PREMULTIPLIED_ALPHA=0]=\"NO_PREMULTIPLIED_ALPHA\",t[t.PREMULTIPLY_ON_UPLOAD=1]=\"PREMULTIPLY_ON_UPLOAD\",t[t.PREMULTIPLY_ALPHA=2]=\"PREMULTIPLY_ALPHA\",t[t.PREMULTIPLIED_ALPHA=2]=\"PREMULTIPLIED_ALPHA\"}(u||(u={})),function(t){t[t.NO=0]=\"NO\",t[t.YES=1]=\"YES\",t[t.AUTO=2]=\"AUTO\",t[t.BLEND=0]=\"BLEND\",t[t.CLEAR=1]=\"CLEAR\",t[t.BLIT=2]=\"BLIT\"}(L||(L={})),function(t){t[t.AUTO=0]=\"AUTO\",t[t.MANUAL=1]=\"MANUAL\"}(O||(O={})),function(t){t.LOW=\"lowp\",t.MEDIUM=\"mediump\",t.HIGH=\"highp\"}(D||(D={})),function(t){t[t.NONE=0]=\"NONE\",t[t.SCISSOR=1]=\"SCISSOR\",t[t.STENCIL=2]=\"STENCIL\",t[t.SPRITE=3]=\"SPRITE\",t[t.COLOR=4]=\"COLOR\"}(U||(U={})),function(t){t[t.RED=1]=\"RED\",t[t.GREEN=2]=\"GREEN\",t[t.BLUE=4]=\"BLUE\",t[t.ALPHA=8]=\"ALPHA\"}(C||(C={})),function(t){t[t.NONE=0]=\"NONE\",t[t.LOW=2]=\"LOW\",t[t.MEDIUM=4]=\"MEDIUM\",t[t.HIGH=8]=\"HIGH\"}(P||(P={})),function(t){t[t.ELEMENT_ARRAY_BUFFER=34963]=\"ELEMENT_ARRAY_BUFFER\",t[t.ARRAY_BUFFER=34962]=\"ARRAY_BUFFER\",t[t.UNIFORM_BUFFER=35345]=\"UNIFORM_BUFFER\"}(m||(m={}));var B=new r;s.prototype._cacheAsBitmap=!1,s.prototype._cacheData=null,s.prototype._cacheAsBitmapResolution=null,s.prototype._cacheAsBitmapMultisample=P.NONE;var S=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(s.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var a;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new S),(a=this._cacheData).originalRender=this.render,a.originalRenderCanvas=this.renderCanvas,a.originalUpdateTransform=this.updateTransform,a.originalCalculateBounds=this.calculateBounds,a.originalGetLocalBounds=this.getLocalBounds,a.originalDestroy=this.destroy,a.originalContainsPoint=this.containsPoint,a.originalMask=this._mask,a.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((a=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=a.originalRender,this.renderCanvas=a.originalRenderCanvas,this.calculateBounds=a.originalCalculateBounds,this.getLocalBounds=a.originalGetLocalBounds,this.destroy=a.originalDestroy,this.updateTransform=a.originalUpdateTransform,this.containsPoint=a.originalContainsPoint,this._mask=a.originalMask,this.filterArea=a.originalFilterArea))}}}),s.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},s.prototype._initCachedDisplayObject=function(s){var r;if(!this._cacheData||!this._cacheData.sprite){var o=this.alpha;this.alpha=1,s.batch.flush();var h=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var E=this.filters[0].padding;h.pad(E)}h.ceil(_.RESOLUTION);var c=s.renderTexture.current,T=s.renderTexture.sourceFrame.clone(),l=s.renderTexture.destinationFrame.clone(),N=s.projection.transform,R=t.create({width:h.width,height:h.height,resolution:this.cacheAsBitmapResolution||s.resolution,multisample:null!==(r=this.cacheAsBitmapMultisample)&&void 0!==r?r:s.multisample}),A=\"cacheAsBitmap_\"+n();this._cacheData.textureCacheId=A,a.addToCache(R.baseTexture,A),i.addToCache(R,A);var I=this.transform.localTransform.copyTo(B).invert().translate(-h.x,-h.y);this.render=this._cacheData.originalRender,s.render(this,{renderTexture:R,clear:!0,transform:I,skipUpdateTransform:!1}),s.framebuffer.blit(),s.projection.transform=N,s.renderTexture.bind(c,T,l),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=o;var d=new e(R);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-h.x/h.width,d.anchor.y=-h.y/h.height,d.alpha=o,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},s.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},s.prototype._initCachedDisplayObjectCanvas=function(s){if(!this._cacheData||!this._cacheData.sprite){var r=this.getLocalBounds(null,!0),o=this.alpha;this.alpha=1;var h=s.context,E=s._projTransform;r.ceil(_.RESOLUTION);var c=t.create({width:r.width,height:r.height}),T=\"cacheAsBitmap_\"+n();this._cacheData.textureCacheId=T,a.addToCache(c.baseTexture,T),i.addToCache(c,T);var l=B;this.transform.localTransform.copyTo(l),l.invert(),l.tx-=r.x,l.ty-=r.y,this.renderCanvas=this._cacheData.originalRenderCanvas,s.render(this,{renderTexture:c,clear:!0,transform:l,skipUpdateTransform:!1}),s.context=h,s._projTransform=E,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=o;var N=new e(c);N.transform.worldTransform=this.transform.worldTransform,N.anchor.x=-r.x/r.width,N.anchor.y=-r.y/r.height,N.alpha=o,N._bounds=this._bounds,this._cacheData.sprite=N,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=s._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=N.containsPoint.bind(N)}},s.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},s.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},s.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,a.removeFromCache(this._cacheData.textureCacheId),i.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},s.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)};export{S as CacheData};\n//# sourceMappingURL=mixin-cache-as-bitmap.min.mjs.map\n","/*!\n * @pixi/filter-fxaa - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/filter-fxaa is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Filter as n}from\"@pixi/core\";var e=function(n,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r])},e(n,r)};var r=function(n){function r(){return n.call(this,\"\\nattribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vFragCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\\n out vec2 v_rgbNW, out vec2 v_rgbNE,\\n out vec2 v_rgbSW, out vec2 v_rgbSE,\\n out vec2 v_rgbM) {\\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\\n v_rgbM = vec2(fragCoord * inverseVP);\\n}\\n\\nvoid main(void) {\\n\\n gl_Position = filterVertexPosition();\\n\\n vFragCoord = aVertexPosition * outputFrame.zw;\\n\\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n}\\n\",'varying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vFragCoord;\\nuniform sampler2D uSampler;\\nuniform highp vec4 inputSize;\\n\\n\\n/**\\n Basic FXAA implementation based on the code on geeks3d.com with the\\n modification that the texture2DLod stuff was removed since it\\'s\\n unsupported by WebGL.\\n\\n --\\n\\n From:\\n https://github.com/mitsuhiko/webgl-meincraft\\n\\n Copyright (c) 2011 by Armin Ronacher.\\n\\n Some rights reserved.\\n\\n Redistribution and use in source and binary forms, with or without\\n modification, are permitted provided that the following conditions are\\n met:\\n\\n * Redistributions of source code must retain the above copyright\\n notice, this list of conditions and the following disclaimer.\\n\\n * Redistributions in binary form must reproduce the above\\n copyright notice, this list of conditions and the following\\n disclaimer in the documentation and/or other materials provided\\n with the distribution.\\n\\n * The names of the contributors may not be used to endorse or\\n promote products derived from this software without specific\\n prior written permission.\\n\\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n */\\n\\n#ifndef FXAA_REDUCE_MIN\\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\\n#endif\\n#ifndef FXAA_REDUCE_MUL\\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\\n#endif\\n#ifndef FXAA_SPAN_MAX\\n#define FXAA_SPAN_MAX 8.0\\n#endif\\n\\n//optimized version for mobile, where dependent\\n//texture reads can be a bottleneck\\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\\n vec2 v_rgbNW, vec2 v_rgbNE,\\n vec2 v_rgbSW, vec2 v_rgbSE,\\n vec2 v_rgbM) {\\n vec4 color;\\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\\n vec4 texColor = texture2D(tex, v_rgbM);\\n vec3 rgbM = texColor.xyz;\\n vec3 luma = vec3(0.299, 0.587, 0.114);\\n float lumaNW = dot(rgbNW, luma);\\n float lumaNE = dot(rgbNE, luma);\\n float lumaSW = dot(rgbSW, luma);\\n float lumaSE = dot(rgbSE, luma);\\n float lumaM = dot(rgbM, luma);\\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\\n\\n mediump vec2 dir;\\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\\n\\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\\n\\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\\n dir * rcpDirMin)) * inverseVP;\\n\\n vec3 rgbA = 0.5 * (\\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\\n\\n float lumaB = dot(rgbB, luma);\\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\\n color = vec4(rgbA, texColor.a);\\n else\\n color = vec4(rgbB, texColor.a);\\n return color;\\n}\\n\\nvoid main() {\\n\\n vec4 color;\\n\\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n\\n gl_FragColor = color;\\n}\\n')||this}return function(n,r){function o(){this.constructor=n}e(n,r),n.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}(r,n),r}(n);export{r as FXAAFilter};\n//# sourceMappingURL=filter-fxaa.min.mjs.map\n","/*!\n * @pixi/filter-noise - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/filter-noise is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{defaultFilterVertex as o,Filter as n}from\"@pixi/core\";var r=function(o,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,n){o.__proto__=n}||function(o,n){for(var r in n)n.hasOwnProperty(r)&&(o[r]=n[r])},r(o,n)};var e=function(n){function e(r,e){void 0===r&&(r=.5),void 0===e&&(e=Math.random());var t=n.call(this,o,\"precision highp float;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform float uNoise;\\nuniform float uSeed;\\nuniform sampler2D uSampler;\\n\\nfloat rand(vec2 co)\\n{\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main()\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float randomValue = rand(gl_FragCoord.xy * uSeed);\\n float diff = (randomValue - 0.5) * uNoise;\\n\\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\\n if (color.a > 0.0) {\\n color.rgb /= color.a;\\n }\\n\\n color.r += diff;\\n color.g += diff;\\n color.b += diff;\\n\\n // Premultiply alpha again.\\n color.rgb *= color.a;\\n\\n gl_FragColor = color;\\n}\\n\",{uNoise:0,uSeed:0})||this;return t.noise=r,t.seed=e,t}return function(o,n){function e(){this.constructor=o}r(o,n),o.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(e,n),Object.defineProperty(e.prototype,\"noise\",{get:function(){return this.uniforms.uNoise},set:function(o){this.uniforms.uNoise=o},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"seed\",{get:function(){return this.uniforms.uSeed},set:function(o){this.uniforms.uSeed=o},enumerable:!1,configurable:!0}),e}(n);export{e as NoiseFilter};\n//# sourceMappingURL=filter-noise.min.mjs.map\n","/*!\n * @pixi/mixin-get-child-by-name - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/mixin-get-child-by-name is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{DisplayObject as i,Container as e}from\"@pixi/display\";i.prototype.name=null,e.prototype.getChildByName=function(i,e){for(var r=0,t=this.children.length;r0){var p=n.x-t[d].x,g=n.y-t[d].y,c=Math.sqrt(p*p+g*g);n=t[d],s+=c/a}else s=d/(u-1);h[f]=s,h[f+1]=0,h[f+2]=s,h[f+3]=1}var l=0;for(d=0;d0?this.textureScale*this._width/2:this._width/2;r/=d,h/=d,r*=f,h*=f,o[u]=a.x+r,o[u+1]=a.y+h,o[u+2]=a.x-r,o[u+3]=a.y-h,i=a}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(t),u=function(t){function e(e,h,o){void 0===o&&(o=0);var s=this,n=new a(e.height,h,o),u=new i(e);return o>0&&(e.baseTexture.wrapMode=r.REPEAT),(s=t.call(this,n,u)||this).autoUpdate=!0,s}return s(e,t),e.prototype._render=function(e){var i=this.geometry;(this.autoUpdate||i._width!==this.shader.texture.height)&&(i._width=this.shader.texture.height,i.update()),t.prototype._render.call(this,e)},e}(e),d=function(t){function e(e,r,o){var s=this,a=new n(e.width,e.height,r,o),u=new i(h.WHITE);return(s=t.call(this,a,u)||this).texture=e,s.autoResize=!0,s}return s(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,e=this.shader.texture,i=e.width,r=e.height;!this.autoResize||t.width===i&&t.height===r||(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,\"texture\",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once(\"update\",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e.prototype.destroy=function(e){this.shader.texture.off(\"update\",this.textureUpdated,this),t.prototype.destroy.call(this,e)},e}(e),f=function(e){function r(r,o,s,n,a){void 0===r&&(r=h.EMPTY);var u=this,d=new t(o,s,n);d.getBuffer(\"aVertexPosition\").static=!1;var f=new i(r);return(u=e.call(this,d,f,null,a)||this).autoUpdate=!0,u}return s(r,e),Object.defineProperty(r.prototype,\"vertices\",{get:function(){return this.geometry.getBuffer(\"aVertexPosition\").data},set:function(t){this.geometry.getBuffer(\"aVertexPosition\").data=t},enumerable:!1,configurable:!0}),r.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer(\"aVertexPosition\").update(),e.prototype._render.call(this,t)},r}(e),p=function(t){function e(e,i,r,o,s){void 0===i&&(i=10),void 0===r&&(r=10),void 0===o&&(o=10),void 0===s&&(s=10);var n=t.call(this,h.WHITE,4,4)||this;return n._origWidth=e.orig.width,n._origHeight=e.orig.height,n._width=n._origWidth,n._height=n._origHeight,n._leftWidth=i,n._rightWidth=o,n._topHeight=r,n._bottomHeight=s,n.texture=e,n}return s(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,\"vertices\",{get:function(){return this.geometry.getBuffer(\"aVertexPosition\").data},set:function(t){this.geometry.getBuffer(\"aVertexPosition\").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,i=this._topHeight+this._bottomHeight,r=this._height>i?1:this._height/i;return Math.min(e,r)},Object.defineProperty(e.prototype,\"width\",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"height\",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"leftWidth\",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"rightWidth\",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"topHeight\",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"bottomHeight\",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(d);export{p as NineSlicePlane,n as PlaneGeometry,a as RopeGeometry,f as SimpleMesh,d as SimplePlane,u as SimpleRope};\n//# sourceMappingURL=mesh-extras.min.mjs.map\n","/*!\n * @pixi/sprite-animated - v6.5.1\n * Compiled Sun, 24 Jul 2022 20:56:21 UTC\n *\n * @pixi/sprite-animated is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport{Texture as t}from\"@pixi/core\";import{Sprite as e}from\"@pixi/sprite\";import{Ticker as r,UPDATE_PRIORITY as i}from\"@pixi/ticker\";var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},o(t,e)};var n=function(e){function n(r,i){void 0===i&&(i=!0);var o=e.call(this,r[0]instanceof t?r[0]:r[0].texture)||this;return o._textures=null,o._durations=null,o._autoUpdate=i,o._isConnectedToTicker=!1,o.animationSpeed=1,o.loop=!0,o.updateAnchor=!1,o.onComplete=null,o.onFrameChange=null,o.onLoop=null,o._currentTime=0,o._playing=!1,o._previousFrame=null,o.textures=r,o}return function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(n,e),n.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(r.shared.remove(this.update,this),this._isConnectedToTicker=!1))},n.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(r.shared.add(this.update,this,i.HIGH),this._isConnectedToTicker=!0))},n.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},n.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},n.prototype.update=function(t){if(this._playing){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var o=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*o,this._currentTime+=o;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer)&&this.onLoop(),this.updateTexture())}},n.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},n.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},n.fromFrames=function(e){for(var r=[],i=0;i