pixijs-input-devices 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,355 @@
1
+ import{parse as t,format as e,resolve as r}from"url";class CustomDevice{constructor(t){this.id=t,this.type="custom",this.lastUpdated=performance.now()}update(t){}clear(){}}const i=0,n=1,o=2,s=3,a={A:0,B:1,X:2,Y:3,LeftShoulder:4,RightShoulder:5,LeftTrigger:6,RightTrigger:7,Back:8,Start:9,LeftStick:10,RightStick:11,DPadUp:12,DPadDown:13,DPadLeft:14,DPadRight:15};function AggregateError(t,e){this.name="AggregateError",this.errors=t,this.message=e||""}AggregateError.prototype=Error.prototype;var h=setTimeout;function isArray(t){return Boolean(t&&void 0!==t.length)}function noop(){}function Promise$1(t){if(!(this instanceof Promise$1))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],doResolve(t,this)}function handle(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,Promise$1._immediateFn((function(){var r=1===t._state?e.onFulfilled:e.onRejected;if(null!==r){var i;try{i=r(t._value)}catch(t){return void reject(e.promise,t)}resolve(e.promise,i)}else(1===t._state?resolve:reject)(e.promise,t._value)}))):t._deferreds.push(e)}function resolve(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if(e instanceof Promise$1)return t._state=3,t._value=e,void finale(t);if("function"==typeof r)return void doResolve(function bind(t,e){return function(){t.apply(e,arguments)}}(r,e),t)}t._state=1,t._value=e,finale(t)}catch(e){reject(t,e)}}function reject(t,e){t._state=2,t._value=e,finale(t)}function finale(t){2===t._state&&0===t._deferreds.length&&Promise$1._immediateFn((function(){t._handled||Promise$1._unhandledRejectionFn(t._value)}));for(var e=0,r=t._deferreds.length;e<r;e++)handle(t,t._deferreds[e]);t._deferreds=null}function Handler(t,e,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=r}function doResolve(t,e){var r=!1;try{t((function(t){r||(r=!0,resolve(e,t))}),(function(t){r||(r=!0,reject(e,t))}))}catch(t){if(r)return;r=!0,reject(e,t)}}function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}
2
+ /*
3
+ object-assign
4
+ (c) Sindre Sorhus
5
+ @license MIT
6
+ */Promise$1.prototype.catch=function(t){return this.then(null,t)},Promise$1.prototype.then=function(t,e){var r=new this.constructor(noop);return handle(this,new Handler(t,e,r)),r},Promise$1.prototype.finally=function finallyConstructor(t){var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){return e.reject(r)}))}))},Promise$1.all=function(t){return new Promise$1((function(e,r){if(!isArray(t))return r(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var n=i.length;function res(t,o){try{if(o&&("object"==typeof o||"function"==typeof o)){var s=o.then;if("function"==typeof s)return void s.call(o,(function(e){res(t,e)}),r)}i[t]=o,0==--n&&e(i)}catch(t){r(t)}}for(var o=0;o<i.length;o++)res(o,i[o])}))},Promise$1.any=function any(t){var e=this;return new e((function(r,i){if(!t||void 0===t.length)return i(new TypeError("Promise.any accepts an array"));var n=Array.prototype.slice.call(t);if(0===n.length)return i();for(var o=[],s=0;s<n.length;s++)try{e.resolve(n[s]).then(r).catch((function(t){o.push(t),o.length===n.length&&i(new AggregateError(o,"All promises were rejected"))}))}catch(t){i(t)}}))},Promise$1.allSettled=function allSettled(t){return new this((function(e,r){if(!t||void 0===t.length)return r(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var n=i.length;function res(t,r){if(r&&("object"==typeof r||"function"==typeof r)){var o=r.then;if("function"==typeof o)return void o.call(r,(function(e){res(t,e)}),(function(r){i[t]={status:"rejected",reason:r},0==--n&&e(i)}))}i[t]={status:"fulfilled",value:r},0==--n&&e(i)}for(var o=0;o<i.length;o++)res(o,i[o])}))},Promise$1.resolve=function(t){return t&&"object"==typeof t&&t.constructor===Promise$1?t:new Promise$1((function(e){e(t)}))},Promise$1.reject=function(t){return new Promise$1((function(e,r){r(t)}))},Promise$1.race=function(t){return new Promise$1((function(e,r){if(!isArray(t))return r(new TypeError("Promise.race accepts an array"));for(var i=0,n=t.length;i<n;i++)Promise$1.resolve(t[i]).then(e,r)}))},Promise$1._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){h(t,0)},Promise$1._unhandledRejectionFn=function _unhandledRejectionFn(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var u=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;var d=getDefaultExportFromCjs(function shouldUseNative(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(t){i[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,i,n=function toObject(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),o=1;o<arguments.length;o++){for(var s in r=Object(arguments[o]))l.call(r,s)&&(n[s]=r[s]);if(u){i=u(r);for(var a=0;a<i.length;a++)c.call(r,i[a])&&(n[i[a]]=r[i[a]])}}return n});
7
+ /*!
8
+ * @pixi/polyfill - v6.3.2
9
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
10
+ *
11
+ * @pixi/polyfill is licensed under the MIT License.
12
+ * http://www.opensource.org/licenses/mit-license
13
+ */
14
+ "undefined"==typeof globalThis&&("undefined"!=typeof self?self.globalThis=self:"undefined"!=typeof global&&(global.globalThis=global)),globalThis.Promise||(globalThis.Promise=Promise$1),Object.assign||(Object.assign=d);if(Date.now&&Date.prototype.getTime||(Date.now=function now(){return(new Date).getTime()}),!globalThis.performance||!globalThis.performance.now){var p=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-p}}for(var f=Date.now(),_=["ms","moz","webkit","o"],m=0;m<_.length&&!globalThis.requestAnimationFrame;++m){var y=_[m];globalThis.requestAnimationFrame=globalThis[y+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[y+"CancelAnimationFrame"]||globalThis[y+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),r=16+f-e;return r<0&&(r=0),f=e,globalThis.self.setTimeout((function(){f=Date.now(),t(performance.now())}),r)}),globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(t){return clearTimeout(t)}),Math.sign||(Math.sign=function mathSign(t){return 0===(t=Number(t))||isNaN(t)?t:t>0?1:-1}),Number.isInteger||(Number.isInteger=function numberIsInteger(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),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);var g=/iPhone/i,v=/iPod/i,T=/iPad/i,E=/\biOS-universal(?:.+)Mac\b/i,x=/\bAndroid(?:.+)Mobile\b/i,b=/Android/i,R=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,S=/Silk/i,A=/Windows Phone/i,O=/\bWindows(?:.+)ARM\b/i,I=/BlackBerry/i,P=/BB10/i,M=/Opera Mini/i,D=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i,isAppleTabletOnIos13=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};
15
+ /*!
16
+ * @pixi/settings - v6.3.2
17
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
18
+ *
19
+ * @pixi/settings is licensed under the MIT License.
20
+ * http://www.opensource.org/licenses/mit-license
21
+ */
22
+ var C,w,L,F,B,G,U,X,k,H,j,Y,V,W,z,K,q,$,Z,Q=function isMobile$1(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var r=e.userAgent,i=r.split("[FBAN");void 0!==i[1]&&(r=i[0]),void 0!==(i=r.split("Twitter"))[1]&&(r=i[0]);var n=function createMatch(t){return function(e){return e.test(t)}}(r),o={apple:{phone:n(g)&&!n(A),ipod:n(v),tablet:!n(g)&&(n(T)||isAppleTabletOnIos13(e))&&!n(A),universal:n(E),device:(n(g)||n(v)||n(T)||n(E)||isAppleTabletOnIos13(e))&&!n(A)},amazon:{phone:n(R),tablet:!n(R)&&n(S),device:n(R)||n(S)},android:{phone:!n(A)&&n(R)||!n(A)&&n(x),tablet:!n(A)&&!n(R)&&!n(x)&&(n(S)||n(b)),device:!n(A)&&(n(R)||n(S)||n(x)||n(b))||n(/\bokhttp\b/i)},windows:{phone:n(A),tablet:n(O),device:n(A)||n(O)},other:{blackberry:n(I),blackberry10:n(P),opera:n(M),firefox:n(N),chrome:n(D),device:n(I)||n(P)||n(M)||n(N)||n(D)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(globalThis.navigator);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(C||(C={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(w||(w={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(L||(L={})),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"}(F||(F={})),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"}(B||(B={})),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"}(G||(G={})),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"}(U||(U={})),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"}(X||(X={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(k||(k={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(H||(H={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(j||(j={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(Y||(Y={})),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"}(V||(V={})),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"}(W||(W={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(z||(z={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(K||(K={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(q||(q={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}($||($={})),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"}(Z||(Z={}));var J={MIPMAP_TEXTURES:Y.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:$.NONE,SPRITE_MAX_TEXTURES:function maxRecommendedTextures(t){var e=!0;if(Q.tablet||Q.phone){var r;if(Q.apple.device)if(r=navigator.userAgent.match(/OS (\d+)_(\d+)?/))parseInt(r[1],10)<11&&(e=!1);if(Q.android.device)if(r=navigator.userAgent.match(/Android\s([0-9.]*)/))parseInt(r[1],10)<7&&(e=!1)}return e?t: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:z.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:j.CLAMP,SCALE_MODE:H.LINEAR,PRECISION_VERTEX:K.HIGH,PRECISION_FRAGMENT:Q.apple.device?K.HIGH:K.MEDIUM,CAN_UPLOAD_SAME_BUFFER:function canUploadSameBuffer(){return!Q.apple.device}
23
+ /*!
24
+ * @pixi/constants - v6.3.2
25
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
26
+ *
27
+ * @pixi/constants is licensed under the MIT License.
28
+ * http://www.opensource.org/licenses/mit-license
29
+ */(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},tt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,r="~";function Events(){}function EE(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function addListener(t,e,i,n,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new EE(i,n||t,o),a=r?r+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],s]:t._events[a].push(s):(t._events[a]=s,t._eventsCount++),t}function clearEvent(t,e){0==--t._eventsCount?t._events=new Events:delete t._events[e]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(r=!1)),EventEmitter.prototype.eventNames=function eventNames(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},EventEmitter.prototype.listeners=function listeners(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n<o;n++)s[n]=i[n].fn;return s},EventEmitter.prototype.listenerCount=function listenerCount(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},EventEmitter.prototype.emit=function emit(t,e,i,n,o,s){var a=r?r+t:t;if(!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,n),!0;case 5:return l.fn.call(l.context,e,i,n,o),!0;case 6:return l.fn.call(l.context,e,i,n,o,s),!0}for(u=1,h=new Array(c-1);u<c;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var d,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,i);break;case 4:l[u].fn.call(l[u].context,e,i,n);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];l[u].fn.apply(l[u].context,h)}}return!0},EventEmitter.prototype.on=function on(t,e,r){return addListener(this,t,e,r,!1)},EventEmitter.prototype.once=function once(t,e,r){return addListener(this,t,e,r,!0)},EventEmitter.prototype.removeListener=function removeListener(t,e,i,n){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return clearEvent(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||n&&!s.once||i&&s.context!==i||clearEvent(this,o);else{for(var a=0,h=[],u=s.length;a<u;a++)(s[a].fn!==e||n&&!s[a].once||i&&s[a].context!==i)&&h.push(s[a]);h.length?this._events[o]=1===h.length?h[0]:h:clearEvent(this,o)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(t){var e;return t?(e=r?r+t:t,this._events[e]&&clearEvent(this,e)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=r,EventEmitter.EventEmitter=EventEmitter,t.exports=EventEmitter}(tt);var et=getDefaultExportFromCjs(tt.exports),rt={exports:{}};function earcut(t,e,r){r=r||2;var i,n,o,s,a,h,u,l=e&&e.length,c=l?e[0]*r:t.length,d=linkedList(t,0,c,r,!0),p=[];if(!d||d.next===d.prev)return p;if(l&&(d=function eliminateHoles(t,e,r,i){var n,o,s,a=[];for(n=0,o=e.length;n<o;n++)(s=linkedList(t,e[n]*i,n<o-1?e[n+1]*i:t.length,i,!1))===s.next&&(s.steiner=!0),a.push(getLeftmost(s));for(a.sort(compareX),n=0;n<a.length;n++)r=eliminateHole(a[n],r);return r}(t,e,d,r)),t.length>80*r){i=o=t[0],n=s=t[1];for(var f=r;f<c;f+=r)(a=t[f])<i&&(i=a),(h=t[f+1])<n&&(n=h),a>o&&(o=a),h>s&&(s=h);u=0!==(u=Math.max(o-i,s-n))?32767/u:0}return earcutLinked(d,p,r,i,n,u,0),p}function linkedList(t,e,r,i,n){var o,s;if(n===signedArea(t,e,r,i)>0)for(o=e;o<r;o+=i)s=insertNode(o,t[o],t[o+1],s);else for(o=r-i;o>=e;o-=i)s=insertNode(o,t[o],t[o+1],s);return s&&equals(s,s.next)&&(removeNode(s),s=s.next),s}function filterPoints(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!equals(i,i.next)&&0!==area(i.prev,i,i.next))i=i.next;else{if(removeNode(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function earcutLinked(t,e,r,i,n,o,s){if(t){!s&&o&&function indexCurve(t,e,r,i){var n=t;do{0===n.z&&(n.z=zOrder(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function sortLinked(t){var e,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e<u&&(a++,i=i.nextZ);e++);for(h=u;a>0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1);return t}(n)}(t,i,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?isEarHashed(t,i,n,o):isEar(t))e.push(a.i/r|0),e.push(t.i/r|0),e.push(h.i/r|0),removeNode(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?earcutLinked(t=cureLocalIntersections(filterPoints(t),e,r),e,r,i,n,o,2):2===s&&splitEarcut(t,e,r,i,n,o):earcutLinked(filterPoints(t),e,r,i,n,o,1);break}}}function isEar(t){var e=t.prev,r=t,i=t.next;if(area(e,r,i)>=0)return!1;for(var n=e.x,o=r.x,s=i.x,a=e.y,h=r.y,u=i.y,l=n<o?n<s?n:s:o<s?o:s,c=a<h?a<u?a:u:h<u?h:u,d=n>o?n>s?n:s:o>s?o:s,p=a>h?a>u?a:u:h>u?h:u,f=i.next;f!==e;){if(f.x>=l&&f.x<=d&&f.y>=c&&f.y<=p&&pointInTriangle(n,a,o,h,s,u,f.x,f.y)&&area(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function isEarHashed(t,e,r,i){var n=t.prev,o=t,s=t.next;if(area(n,o,s)>=0)return!1;for(var a=n.x,h=o.x,u=s.x,l=n.y,c=o.y,d=s.y,p=a<h?a<u?a:u:h<u?h:u,f=l<c?l<d?l:d:c<d?c:d,_=a>h?a>u?a:u:h>u?h:u,m=l>c?l>d?l:d:c>d?c:d,y=zOrder(p,f,e,r,i),g=zOrder(_,m,e,r,i),v=t.prevZ,T=t.nextZ;v&&v.z>=y&&T&&T.z<=g;){if(v.x>=p&&v.x<=_&&v.y>=f&&v.y<=m&&v!==n&&v!==s&&pointInTriangle(a,l,h,c,u,d,v.x,v.y)&&area(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,T.x>=p&&T.x<=_&&T.y>=f&&T.y<=m&&T!==n&&T!==s&&pointInTriangle(a,l,h,c,u,d,T.x,T.y)&&area(T.prev,T,T.next)>=0)return!1;T=T.nextZ}for(;v&&v.z>=y;){if(v.x>=p&&v.x<=_&&v.y>=f&&v.y<=m&&v!==n&&v!==s&&pointInTriangle(a,l,h,c,u,d,v.x,v.y)&&area(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;T&&T.z<=g;){if(T.x>=p&&T.x<=_&&T.y>=f&&T.y<=m&&T!==n&&T!==s&&pointInTriangle(a,l,h,c,u,d,T.x,T.y)&&area(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function cureLocalIntersections(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!equals(n,o)&&intersects(n,i,i.next,o)&&locallyInside(n,o)&&locallyInside(o,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(o.i/r|0),removeNode(i),removeNode(i.next),i=t=o),i=i.next}while(i!==t);return filterPoints(i)}function splitEarcut(t,e,r,i,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&isValidDiagonal(s,a)){var h=splitPolygon(s,a);return s=filterPoints(s,s.next),h=filterPoints(h,h.next),earcutLinked(s,e,r,i,n,o,0),void earcutLinked(h,e,r,i,n,o,0)}a=a.next}s=s.next}while(s!==t)}function compareX(t,e){return t.x-e.x}function eliminateHole(t,e){var r=function findHoleBridge(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s&&(s=a,r=i.x<i.next.x?i:i.next,a===n))return r}i=i.next}while(i!==e);if(!r)return null;var h,u=r,l=r.x,c=r.y,d=1/0;i=r;do{n>=i.x&&i.x>=l&&n!==i.x&&pointInTriangle(o<c?n:s,o,l,c,o<c?s:n,o,i.x,i.y)&&(h=Math.abs(o-i.y)/(n-i.x),locallyInside(i,t)&&(h<d||h===d&&(i.x>r.x||i.x===r.x&&sectorContainsSector(r,i)))&&(r=i,d=h)),i=i.next}while(i!==u);return r}(t,e);if(!r)return e;var i=splitPolygon(r,t);return filterPoints(i,i.next),filterPoints(r,r.next)}function sectorContainsSector(t,e){return area(t.prev,t,e.prev)<0&&area(e.next,t,t.next)<0}function zOrder(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function getLeftmost(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function pointInTriangle(t,e,r,i,n,o,s,a){return(n-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(i-a)>=(r-s)*(e-a)&&(r-s)*(o-a)>=(n-s)*(i-a)}function isValidDiagonal(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function intersectsPolygon(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&intersects(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(locallyInside(t,e)&&locallyInside(e,t)&&function middleInside(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(area(t.prev,t,e.prev)||area(t,e.prev,e))||equals(t,e)&&area(t.prev,t,t.next)>0&&area(e.prev,e,e.next)>0)}function area(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function equals(t,e){return t.x===e.x&&t.y===e.y}function intersects(t,e,r,i){var n=sign$1(area(t,e,r)),o=sign$1(area(t,e,i)),s=sign$1(area(r,i,t)),a=sign$1(area(r,i,e));return n!==o&&s!==a||(!(0!==n||!onSegment(t,r,e))||(!(0!==o||!onSegment(t,i,e))||(!(0!==s||!onSegment(r,t,i))||!(0!==a||!onSegment(r,e,i)))))}function onSegment(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function sign$1(t){return t>0?1:t<0?-1:0}function locallyInside(t,e){return area(t.prev,t,t.next)<0?area(t,e,t.next)>=0&&area(t,t.prev,e)>=0:area(t,e,t.prev)<0||area(t,t.next,e)<0}function splitPolygon(t,e){var r=new Node(t.i,t.x,t.y),i=new Node(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function insertNode(t,e,r,i){var n=new Node(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function removeNode(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Node(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(t,e,r,i){for(var n=0,o=e,s=r-i;o<r;o+=i)n+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return n}rt.exports=earcut,rt.exports.default=earcut,earcut.deviation=function(t,e,r,i){var n=e&&e.length,o=n?e[0]*r:t.length,s=Math.abs(signedArea(t,0,o,r));if(n)for(var a=0,h=e.length;a<h;a++){var u=e[a]*r,l=a<h-1?e[a+1]*r:t.length;s-=Math.abs(signedArea(t,u,l,r))}var c=0;for(a=0;a<i.length;a+=3){var d=i[a]*r,p=i[a+1]*r,f=i[a+2]*r;c+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},earcut.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var s=0;s<e;s++)r.vertices.push(t[n][o][s]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r};var it,nt,ot,st,at,ht,ut,lt,ct,dt,pt,ft,_t,mt,yt,gt,vt,Tt,Et,xt=getDefaultExportFromCjs(rt.exports);!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(it||(it={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(nt||(nt={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(ot||(ot={})),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"}(st||(st={})),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"}(at||(at={})),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"}(ht||(ht={})),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"}(ut||(ut={})),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"}(lt||(lt={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(ct||(ct={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(dt||(dt={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(pt||(pt={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(ft||(ft={})),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"}(_t||(_t={})),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"}(mt||(mt={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(yt||(yt={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(gt||(gt={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(vt||(vt={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(Tt||(Tt={})),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"}(Et||(Et={}));
30
+ /*!
31
+ * @pixi/utils - v6.3.2
32
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
33
+ *
34
+ * @pixi/utils is licensed under the MIT License.
35
+ * http://www.opensource.org/licenses/mit-license
36
+ */
37
+ var bt={parse:t,format:e,resolve:r};J.RETINA_PREFIX=/@([0-9\.]+)x/,J.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Rt,St=!1;var At={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 hex2rgb(t,e){return void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function hex2string(t){var e=t.toString(16);return"#"+(e="000000".substring(0,6-e.length)+e)}function string2hex(t){return"string"==typeof t&&"#"===(t=At[t.toLowerCase()]||t)[0]&&(t=t.slice(1)),parseInt(t,16)}var Ot=function mapPremultipliedBlendModes(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[st.NORMAL_NPM]=st.NORMAL,t[st.ADD_NPM]=st.ADD,t[st.SCREEN_NPM]=st.SCREEN,e[st.NORMAL]=st.NORMAL_NPM,e[st.ADD]=st.ADD_NPM,e[st.SCREEN]=st.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i}();function correctBlendMode(t,e){return Ot[e?1:0][t]}function premultiplyTint(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)}function premultiplyTintToRgba(t,e,r,i){return(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function getBufferType(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}function nextPow2(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function isPow2(t){return!(t&t-1||!t)}function log2(t){var e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,e|=r=((t>>>=r)>15?1:0)<<2,(e|=r=((t>>>=r)>3?1:0)<<1)|(t>>>=r)>>1}function removeItems(t,e,r){var i,n=t.length;if(!(e>=n||0===r)){var o=n-(r=e+r>n?n-e:r);for(i=e;i<o;++i)t[i]=t[i+r];t.length=o}}function sign(t){return 0===t?0:t<0?-1:1}var It=0;function uid(){return++It}var Pt={};function deprecation(t,e,r){if(void 0===r&&(r=3),!Pt[e]){var i=(new Error).stack;void 0===i?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(i=i.split("\n").splice(r).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(i))),Pt[e]=!0}}var Mt,Dt={},Nt=Object.create(null),Ct=Object.create(null),wt=function(){function CanvasRenderTarget(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||J.RESOLUTION,this.resize(t,e)}return CanvasRenderTarget.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},CanvasRenderTarget.prototype.resize=function(t,e){this.canvas.width=Math.round(t*this.resolution),this.canvas.height=Math.round(e*this.resolution)},CanvasRenderTarget.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(CanvasRenderTarget.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=Math.round(t)},enumerable:!1,configurable:!0}),Object.defineProperty(CanvasRenderTarget.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=Math.round(t)},enumerable:!1,configurable:!0}),CanvasRenderTarget}();function determineCrossOrigin(t,e){if(void 0===e&&(e=globalThis.location),0===t.indexOf("data:"))return"";e=e||globalThis.location,Mt||(Mt=document.createElement("a")),Mt.href=t;var r=bt.parse(Mt.href),i=!r.port&&""===e.port||r.port===e.port;return r.hostname===e.hostname&&i&&r.protocol===e.protocol?"":"anonymous"}function getResolutionOfUrl(t,e){var r=J.RETINA_PREFIX.exec(t);return r?parseFloat(r[1]):void 0!==e?e:1}
38
+ /*!
39
+ * @pixi/math - v6.3.2
40
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
41
+ *
42
+ * @pixi/math is licensed under the MIT License.
43
+ * http://www.opensource.org/licenses/mit-license
44
+ */var Lt,Ft=2*Math.PI,Bt=180/Math.PI,Gt=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(Lt||(Lt={}));var Ut=function(){function Point(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return Point.prototype.clone=function(){return new Point(this.x,this.y)},Point.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},Point.prototype.copyTo=function(t){return t.set(this.x,this.y),t},Point.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},Point.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},Point.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},Point}(),Xt=[new Ut,new Ut,new Ut,new Ut],kt=function(){function Rectangle(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=Lt.RECT}return Object.defineProperty(Rectangle.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(Rectangle.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(Rectangle.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(Rectangle,"EMPTY",{get:function(){return new Rectangle(0,0,0,0)},enumerable:!1,configurable:!0}),Rectangle.prototype.clone=function(){return new Rectangle(this.x,this.y,this.width,this.height)},Rectangle.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},Rectangle.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},Rectangle.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)},Rectangle.prototype.intersects=function(t,e){if(!e){var r=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=r)return!1;var i=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>i}var n=this.left,o=this.right,s=this.top,a=this.bottom;if(o<=n||a<=s)return!1;var h=Xt[0].set(t.left,t.top),u=Xt[1].set(t.left,t.bottom),l=Xt[2].set(t.right,t.top),c=Xt[3].set(t.right,t.bottom);if(l.x<=h.x||u.y<=h.y)return!1;var d=Math.sign(e.a*e.d-e.b*e.c);if(0===d)return!1;if(e.apply(h,h),e.apply(u,u),e.apply(l,l),e.apply(c,c),Math.max(h.x,u.x,l.x,c.x)<=n||Math.min(h.x,u.x,l.x,c.x)>=o||Math.max(h.y,u.y,l.y,c.y)<=s||Math.min(h.y,u.y,l.y,c.y)>=a)return!1;var p=d*(u.y-h.y),f=d*(h.x-u.x),_=p*n+f*s,m=p*o+f*s,y=p*n+f*a,g=p*o+f*a;if(Math.max(_,m,y,g)<=p*h.x+f*h.y||Math.min(_,m,y,g)>=p*c.x+f*c.y)return!1;var v=d*(h.y-l.y),T=d*(l.x-h.x),E=v*n+T*s,x=v*o+T*s,b=v*n+T*a,R=v*o+T*a;return!(Math.max(E,x,b,R)<=v*h.x+T*h.y||Math.min(E,x,b,R)>=v*c.x+T*c.y)},Rectangle.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},Rectangle.prototype.fit=function(t){var e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=i,this.height=Math.max(n-i,0),this},Rectangle.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var r=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=i-this.y,this},Rectangle.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=i,this.height=n-i,this},Rectangle.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},Rectangle}(),Ht=function(){function Circle(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),this.x=t,this.y=e,this.radius=r,this.type=Lt.CIRC}return Circle.prototype.clone=function(){return new Circle(this.x,this.y,this.radius)},Circle.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.radius*this.radius,i=this.x-t,n=this.y-e;return(i*=i)+(n*=n)<=r},Circle.prototype.getBounds=function(){return new kt(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},Circle.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},Circle}(),jt=function(){function Ellipse(t,e,r,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),this.x=t,this.y=e,this.width=r,this.height=i,this.type=Lt.ELIP}return Ellipse.prototype.clone=function(){return new Ellipse(this.x,this.y,this.width,this.height)},Ellipse.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return(r*=r)+(i*=i)<=1},Ellipse.prototype.getBounds=function(){return new kt(this.x-this.width,this.y-this.height,this.width,this.height)},Ellipse.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},Ellipse}(),Yt=function(){function Polygon(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];var i=Array.isArray(e[0])?e[0]:e;if("number"!=typeof i[0]){for(var n=[],o=0,s=i.length;o<s;o++)n.push(i[o].x,i[o].y);i=n}this.points=i,this.type=Lt.POLY,this.closeStroke=!0}return Polygon.prototype.clone=function(){var t=new Polygon(this.points.slice());return t.closeStroke=this.closeStroke,t},Polygon.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;n<i;o=n++){var s=this.points[2*n],a=this.points[2*n+1],h=this.points[2*o],u=this.points[2*o+1];a>e!=u>e&&t<(e-a)/(u-a)*(h-s)+s&&(r=!r)}return r},Polygon.prototype.toString=function(){return"[@pixi/math:PolygoncloseStroke="+this.closeStroke+"points="+this.points.reduce((function(t,e){return t+", "+e}),"")+"]"},Polygon}(),Vt=function(){function RoundedRectangle(t,e,r,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=Lt.RREC}return RoundedRectangle.prototype.clone=function(){return new RoundedRectangle(this.x,this.y,this.width,this.height,this.radius)},RoundedRectangle.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){var r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;var i=t-(this.x+r),n=e-(this.y+r),o=r*r;if(i*i+n*n<=o)return!0;if((i=t-(this.x+this.width-r))*i+n*n<=o)return!0;if(i*i+(n=e-(this.y+this.height-r))*n<=o)return!0;if((i=t-(this.x+r))*i+n*n<=o)return!0}return!1},RoundedRectangle.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+"width="+this.width+" height="+this.height+" radius="+this.radius+"]"},RoundedRectangle}(),Wt=function(){function ObservablePoint(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),this._x=r,this._y=i,this.cb=t,this.scope=e}return ObservablePoint.prototype.clone=function(t,e){return void 0===t&&(t=this.cb),void 0===e&&(e=this.scope),new ObservablePoint(t,e,this._x,this._y)},ObservablePoint.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},ObservablePoint.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},ObservablePoint.prototype.copyTo=function(t){return t.set(this._x,this._y),t},ObservablePoint.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},ObservablePoint.prototype.toString=function(){return"[@pixi/math:ObservablePoint x=0 y=0 scope="+this.scope+"]"},Object.defineProperty(ObservablePoint.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(ObservablePoint.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}),ObservablePoint}(),zt=function(){function Matrix(t,e,r,i,n,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o}return Matrix.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]},Matrix.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},Matrix.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},Matrix.prototype.apply=function(t,e){e=e||new Ut;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},Matrix.prototype.applyInverse=function(t,e){e=e||new Ut;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,n=t.y;return e.x=this.d*r*i+-this.c*r*n+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*n+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},Matrix.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},Matrix.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},Matrix.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},Matrix.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},Matrix.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return this.a=Math.cos(s+h)*n,this.b=Math.sin(s+h)*n,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this},Matrix.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},Matrix.prototype.decompose=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=t.pivot,s=-Math.atan2(-i,n),a=Math.atan2(r,e),h=Math.abs(s+a);return h<1e-5||Math.abs(Ft-h)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=s,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*r+o.y*n),t},Matrix.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},Matrix.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},Matrix.prototype.clone=function(){var t=new Matrix;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},Matrix.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},Matrix.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},Matrix.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(Matrix,"IDENTITY",{get:function(){return new Matrix},enumerable:!1,configurable:!0}),Object.defineProperty(Matrix,"TEMP_MATRIX",{get:function(){return new Matrix},enumerable:!1,configurable:!0}),Matrix}(),Kt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],qt=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],$t=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Zt=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Qt=[],Jt=[],te=Math.sign;!function init(){for(var t=0;t<16;t++){var e=[];Qt.push(e);for(var r=0;r<16;r++)for(var i=te(Kt[t]*Kt[r]+$t[t]*qt[r]),n=te(qt[t]*Kt[r]+Zt[t]*qt[r]),o=te(Kt[t]*$t[r]+$t[t]*Zt[r]),s=te(qt[t]*$t[r]+Zt[t]*Zt[r]),a=0;a<16;a++)if(Kt[a]===i&&qt[a]===n&&$t[a]===o&&Zt[a]===s){e.push(a);break}}for(t=0;t<16;t++){var h=new zt;h.set(Kt[t],qt[t],$t[t],Zt[t],0,0),Jt.push(h)}}();var ee={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 Kt[t]},uY:function(t){return qt[t]},vX:function(t){return $t[t]},vY:function(t){return Zt[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return Qt[t][e]},sub:function(t,e){return Qt[t][ee.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?ee.S:ee.N:2*Math.abs(e)<=Math.abs(t)?t>0?ee.E:ee.W:e>0?t>0?ee.SE:ee.SW:t>0?ee.NE:ee.NW},matrixAppendRotationInv:function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0);var n=Jt[ee.inv(e)];n.tx=r,n.ty=i,t.append(n)}},re=function(){function Transform(){this.worldTransform=new zt,this.localTransform=new zt,this.position=new Wt(this.onChange,this,0,0),this.scale=new Wt(this.onChange,this,1,1),this.pivot=new Wt(this.onChange,this,0,0),this.skew=new Wt(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 Transform.prototype.onChange=function(){this._localID++},Transform.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++},Transform.prototype.toString=function(){return"[@pixi/math:Transform position=("+this.position.x+", "+this.position.y+") rotation="+this.rotation+" scale=("+this.scale.x+", "+this.scale.y+") skew=("+this.skew.x+", "+this.skew.y+") ]"},Transform.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)},Transform.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},Transform.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(Transform.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),Transform.IDENTITY=new Transform,Transform}();
45
+ /*!
46
+ * @pixi/display - v6.3.2
47
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
48
+ *
49
+ * @pixi/display is licensed under the MIT License.
50
+ * http://www.opensource.org/licenses/mit-license
51
+ */
52
+ J.SORTABLE_CHILDREN=!1;var ie=function(){function Bounds(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return Bounds.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Bounds.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Bounds.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?kt.EMPTY:((t=t||new kt(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Bounds.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)},Bounds.prototype.addPointMatrix=function(t,e){var r=t.a,i=t.b,n=t.c,o=t.d,s=t.tx,a=t.ty,h=r*e.x+n*e.y+s,u=i*e.x+o*e.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,u),this.maxY=Math.max(this.maxY,u)},Bounds.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=o<e?o:e,r=s<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[2])<e?o:e,r=(s=t[3])<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[4])<e?o:e,r=(s=t[5])<r?s:r,i=o>i?o:i,n=s>n?s:n,e=(o=t[6])<e?o:e,r=(s=t[7])<r?s:r,i=o>i?o:i,n=s>n?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},Bounds.prototype.addFrame=function(t,e,r,i,n){this.addFrameMatrix(t.worldTransform,e,r,i,n)},Bounds.prototype.addFrameMatrix=function(t,e,r,i,n){var o=t.a,s=t.b,a=t.c,h=t.d,u=t.tx,l=t.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,_=o*e+a*r+u,m=s*e+h*r+l;c=_<c?_:c,d=m<d?m:d,p=_>p?_:p,f=m>f?m:f,c=(_=o*i+a*r+u)<c?_:c,d=(m=s*i+h*r+l)<d?m:d,p=_>p?_:p,f=m>f?m:f,c=(_=o*e+a*n+u)<c?_:c,d=(m=s*e+h*n+l)<d?m:d,p=_>p?_:p,f=m>f?m:f,c=(_=o*i+a*n+u)<c?_:c,d=(m=s*i+h*n+l)<d?m:d,p=_>p?_:p,f=m>f?m:f,this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},Bounds.prototype.addVertexData=function(t,e,r){for(var i=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;a<r;a+=2){var h=t[a],u=t[a+1];i=h<i?h:i,n=u<n?u:n,o=h>o?h:o,s=u>s?u:s}this.minX=i,this.minY=n,this.maxX=o,this.maxY=s},Bounds.prototype.addVertices=function(t,e,r,i){this.addVerticesMatrix(t.worldTransform,e,r,i)},Bounds.prototype.addVerticesMatrix=function(t,e,r,i,n,o){void 0===n&&(n=0),void 0===o&&(o=n);for(var s=t.a,a=t.b,h=t.c,u=t.d,l=t.tx,c=t.ty,d=this.minX,p=this.minY,f=this.maxX,_=this.maxY,m=r;m<i;m+=2){var y=e[m],g=e[m+1],v=s*y+h*g+l,T=u*g+a*y+c;d=Math.min(d,v-n),f=Math.max(f,v+n),p=Math.min(p,T-o),_=Math.max(_,T+o)}this.minX=d,this.minY=p,this.maxX=f,this.maxY=_},Bounds.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<r?t.minY:r,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},Bounds.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxX<e.maxX?t.maxX:e.maxX,o=t.maxY<e.maxY?t.maxY:e.maxY;if(r<=n&&i<=o){var s=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=n>h?n:h,this.maxY=o>u?o:u}},Bounds.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},Bounds.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxX<e.x+e.width?t.maxX:e.x+e.width,o=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(r<=n&&i<=o){var s=this.minX,a=this.minY,h=this.maxX,u=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=n>h?n:h,this.maxY=o>u?o:u}},Bounds.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},Bounds.prototype.addFramePad=function(t,e,r,i,n,o){t-=n,e-=o,r+=n,i+=o,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>r?this.maxX:r,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>i?this.maxY:i},Bounds}(),extendStatics$j=function(t,e){return extendStatics$j=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])},extendStatics$j(t,e)};
53
+ /*! *****************************************************************************
54
+ Copyright (c) Microsoft Corporation. All rights reserved.
55
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
56
+ this file except in compliance with the License. You may obtain a copy of the
57
+ License at http://www.apache.org/licenses/LICENSE-2.0
58
+
59
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
60
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
61
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
62
+ MERCHANTABLITY OR NON-INFRINGEMENT.
63
+
64
+ See the Apache Version 2.0 License for specific language governing permissions
65
+ and limitations under the License.
66
+ ***************************************************************************** */function __extends$j(t,e){function __(){this.constructor=t}extendStatics$j(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}var ne,oe,se,ae,he,ue,le,ce,de,pe,fe,_e,me,ye,ge,ve,Te,Ee,xe,be=function(t){function DisplayObject(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new re,e.alpha=1,e.visible=!0,e.renderable=!0,e.cullable=!1,e.cullArea=null,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new ie,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._maskRefCount=0,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return __extends$j(DisplayObject,t),DisplayObject.mixin=function(t){for(var e=Object.keys(t),r=0;r<e.length;++r){var i=e[r];Object.defineProperty(DisplayObject.prototype,i,Object.getOwnPropertyDescriptor(t,i))}},Object.defineProperty(DisplayObject.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),DisplayObject.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},DisplayObject.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},DisplayObject.prototype.getBounds=function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new kt),e=this._boundsRect),this._bounds.getRectangle(e)},DisplayObject.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new kt),t=this._localBoundsRect),this._localBounds||(this._localBounds=new ie);var e=this.transform,r=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var i=this._bounds,n=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,t);return this.parent=r,this.transform=e,this._bounds=i,this._bounds.updateID+=this._boundsID-n,o},DisplayObject.prototype.toGlobal=function(t,e,r){return void 0===r&&(r=!1),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},DisplayObject.prototype.toLocal=function(t,e,r,i){return e&&(t=e.toGlobal(t,r,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)},DisplayObject.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},DisplayObject.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=1),void 0===i&&(i=1),void 0===n&&(n=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===h&&(h=0),this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=i||1,this.rotation=n,this.skew.x=o,this.skew.y=s,this.pivot.x=a,this.pivot.y=h,this},DisplayObject.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),this.emit("destroyed"),this.removeAllListeners(),this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},Object.defineProperty(DisplayObject.prototype,"_tempDisplayObjectParent",{get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new Re),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),DisplayObject.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},DisplayObject.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(DisplayObject.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"angle",{get:function(){return this.transform.rotation*Bt},set:function(t){this.transform.rotation=t*Gt},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(t){if(this._mask!==t){var e;if(this._mask)(e=this._mask.maskObject||this._mask)._maskRefCount--,0===e._maskRefCount&&(e.renderable=!0,e.isMask=!1);if(this._mask=t,this._mask)0===(e=this._mask.maskObject||this._mask)._maskRefCount&&(e.renderable=!1,e.isMask=!0),e._maskRefCount++}},enumerable:!1,configurable:!0}),DisplayObject}(et),Re=function(t){function TemporaryDisplayObject(){var e=null!==t&&t.apply(this,arguments)||this;return e.sortDirty=null,e}return __extends$j(TemporaryDisplayObject,t),TemporaryDisplayObject}(be);function sortChildren(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}be.prototype.displayObjectUpdateTransform=be.prototype.updateTransform,function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(ne||(ne={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(oe||(oe={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(se||(se={})),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"}(ae||(ae={})),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"}(he||(he={})),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"}(ue||(ue={})),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"}(le||(le={})),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"}(ce||(ce={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(de||(de={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(pe||(pe={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(fe||(fe={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(_e||(_e={})),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"}(me||(me={})),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"}(ye||(ye={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(ge||(ge={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(ve||(ve={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(Te||(Te={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(Ee||(Ee={})),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"}(xe||(xe={}));var Se=function(t){function Container(){var e=t.call(this)||this;return e.children=[],e.sortableChildren=J.SORTABLE_CHILDREN,e.sortDirty=!1,e}return __extends$j(Container,t),Container.prototype.onChildrenChange=function(t){},Container.prototype.addChild=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];if(e.length>1)for(var i=0;i<e.length;i++)this.addChild(e[i]);else{var n=e[0];n.parent&&n.parent.removeChild(n),n.parent=this,this.sortDirty=!0,n.transform._parentID=-1,this.children.push(n),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this)}return e[0]},Container.prototype.addChildAt=function(t,e){if(e<0||e>this.children.length)throw new Error(t+"addChildAt: The index "+e+" 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(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},Container.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}},Container.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},Container.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);removeItems(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},Container.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},Container.prototype.removeChild=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];if(e.length>1)for(var i=0;i<e.length;i++)this.removeChild(e[i]);else{var n=e[0],o=this.children.indexOf(n);if(-1===o)return null;n.parent=null,n.transform._parentID=-1,removeItems(this.children,o,1),this._boundsID++,this.onChildrenChange(o),n.emit("removed",this),this.emit("childRemoved",n,this,o)}return e[0]},Container.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,removeItems(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e},Container.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var r,i=t,n=e-i;if(n>0&&n<=e){r=this.children.splice(i,n);for(var o=0;o<r.length;++o)r[o].parent=null,r[o].transform&&(r[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(o=0;o<r.length;++o)r[o].emit("removed",this),this.emit("childRemoved",r[o],this,o);return r}if(0===n&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},Container.prototype.sortChildren=function(){for(var t=!1,e=0,r=this.children.length;e<r;++e){var i=this.children[e];i._lastSortedIndex=e,t||0===i.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(sortChildren),this.sortDirty=!1},Container.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,e=this.children.length;t<e;++t){var r=this.children[t];r.visible&&r.updateTransform()}},Container.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){var r=e._mask.maskObject||e._mask;r.calculateBounds(),this._bounds.addBoundsMask(e._bounds,r._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID},Container.prototype.getLocalBounds=function(e,r){void 0===r&&(r=!1);var i=t.prototype.getLocalBounds.call(this,e);if(!r)for(var n=0,o=this.children.length;n<o;++n){var s=this.children[n];s.visible&&s.updateTransform()}return i},Container.prototype._calculateBounds=function(){},Container.prototype._renderWithCulling=function(t){var e=t.renderTexture.sourceFrame;if(e.width>0&&e.height>0){var r,i;if(this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==Container.prototype._render&&(r=this.getBounds(!0)),r&&e.intersects(r,i))this._render(t);else if(this.cullArea)return;for(var n=0,o=this.children.length;n<o;++n){var s=this.children[n],a=s.cullable;s.cullable=a||!this.cullArea,s.render(t),s.cullable=a}}},Container.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}},Container.prototype.renderAdvanced=function(t){var e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var i=0;i<e.length;i++)e[i].enabled&&this._enabledFilters.push(e[i])}var n=e&&this._enabledFilters&&this._enabledFilters.length||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==Te.NONE));if(n&&t.batch.flush(),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.push(this,this._enabledFilters),r&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);i=0;for(var o=this.children.length;i<o;++i)this.children[i].render(t)}n&&t.batch.flush(),r&&t.mask.pop(this),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},Container.prototype._render=function(t){},Container.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var r="boolean"==typeof e?e:e&&e.children,i=this.removeChildren(0,this.children.length);if(r)for(var n=0;n<i.length;++n)i[n].destroy(e)},Object.defineProperty(Container.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(Container.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t},enumerable:!1,configurable:!0}),Container}(be);Se.prototype.containerUpdateTransform=Se.prototype.updateTransform;be.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});var Ae,Oe=100,Ie=function(){function AccessibilityManager(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Q.tablet||Q.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width=Oe+"px",e.style.height=Oe+"px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2..toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(AccessibilityManager.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(AccessibilityManager.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),AccessibilityManager.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2..toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",(function(){t._isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()})),document.body.appendChild(e),this._hookDiv=e},AccessibilityManager.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},AccessibilityManager.prototype.activate=function(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),null===(t=this.renderer.view.parentNode)||void 0===t||t.appendChild(this.div))},AccessibilityManager.prototype.deactivate=function(){var t;this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),null===(t=this.div.parentNode)||void 0===t||t.removeChild(this.div))},AccessibilityManager.prototype.updateAccessibleObjects=function(t){if(t.visible&&t.accessibleChildren){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);var e=t.children;if(e)for(var r=0;r<e.length;r++)this.updateAccessibleObjects(e[r])}},AccessibilityManager.prototype.update=function(){var t=performance.now();if(!(Q.android.device&&t<this.androidUpdateCount)&&(this.androidUpdateCount=t+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var e=this.renderer.view.getBoundingClientRect(),r=e.left,i=e.top,n=e.width,o=e.height,s=this.renderer,a=s.width,h=s.height,u=s.resolution,l=n/a*u,c=o/h*u,d=this.div;d.style.left=r+"px",d.style.top=i+"px",d.style.width=a+"px",d.style.height=h+"px";for(var p=0;p<this.children.length;p++){var f=this.children[p];if(f.renderId!==this.renderId)f._accessibleActive=!1,removeItems(this.children,p,1),this.div.removeChild(f._accessibleDiv),this.pool.push(f._accessibleDiv),f._accessibleDiv=null,p--;else{d=f._accessibleDiv;var _=f.hitArea,m=f.worldTransform;f.hitArea?(d.style.left=(m.tx+_.x*m.a)*l+"px",d.style.top=(m.ty+_.y*m.d)*c+"px",d.style.width=_.width*m.a*l+"px",d.style.height=_.height*m.d*c+"px"):(_=f.getBounds(),this.capHitArea(_),d.style.left=_.x*l+"px",d.style.top=_.y*c+"px",d.style.width=_.width*l+"px",d.style.height=_.height*c+"px",d.title!==f.accessibleTitle&&null!==f.accessibleTitle&&(d.title=f.accessibleTitle),d.getAttribute("aria-label")!==f.accessibleHint&&null!==f.accessibleHint&&d.setAttribute("aria-label",f.accessibleHint)),f.accessibleTitle===d.title&&f.tabIndex===d.tabIndex||(d.title=f.accessibleTitle,d.tabIndex=f.tabIndex,this.debug&&this.updateDebugHTML(d))}}this.renderId++}},AccessibilityManager.prototype.updateDebugHTML=function(t){t.innerHTML="type: "+t.type+"</br> title : "+t.title+"</br> tabIndex: "+t.tabIndex},AccessibilityManager.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);var e=this.renderer,r=e.width,i=e.height;t.x+t.width>r&&(t.width=r-t.x),t.y+t.height>i&&(t.height=i-t.y)},AccessibilityManager.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width=Oe+"px",e.style.height=Oe+"px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},AccessibilityManager.prototype._onClick=function(t){var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"click",i),e.dispatchEvent(r,"pointertap",i),e.dispatchEvent(r,"tap",i)},AccessibilityManager.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"mouseover",i)},AccessibilityManager.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction,r=t.target.displayObject,i=e.eventData;e.dispatchEvent(r,"mouseout",i)},AccessibilityManager.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},AccessibilityManager.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},AccessibilityManager.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},AccessibilityManager}();
67
+ /*!
68
+ * @pixi/ticker - v6.3.2
69
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
70
+ *
71
+ * @pixi/ticker is licensed under the MIT License.
72
+ * http://www.opensource.org/licenses/mit-license
73
+ */
74
+ J.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"}(Ae||(Ae={}));var Pe=function(){function TickerListener(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=0),void 0===i&&(i=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=i}return TickerListener.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},TickerListener.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},TickerListener.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},TickerListener.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},TickerListener}(),Me=function(){function Ticker(){var t=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 Pe(null,null,1/0),this.deltaMS=1/J.TARGET_FPMS,this.elapsedMS=1/J.TARGET_FPMS,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return Ticker.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},Ticker.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},Ticker.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},Ticker.prototype.add=function(t,e,r){return void 0===r&&(r=Ae.NORMAL),this._addListener(new Pe(t,e,r))},Ticker.prototype.addOnce=function(t,e,r){return void 0===r&&(r=Ae.NORMAL),this._addListener(new Pe(t,e,r,!0))},Ticker.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},Ticker.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(Ticker.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}),Ticker.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},Ticker.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},Ticker.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}},Ticker.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r<this._minElapsedMS)return;this._lastFrame=t-r%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*J.TARGET_FPMS;for(var i=this._head,n=i.next;n;)n=n.emit(this.deltaTime);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(Ticker.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(Ticker.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),r=Math.min(Math.max(0,e)/1e3,J.TARGET_FPMS);this._maxElapsedMS=1/r},enumerable:!1,configurable:!0}),Object.defineProperty(Ticker.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(Ticker,"shared",{get:function(){if(!Ticker._shared){var t=Ticker._shared=new Ticker;t.autoStart=!0,t._protected=!0}return Ticker._shared},enumerable:!1,configurable:!0}),Object.defineProperty(Ticker,"system",{get:function(){if(!Ticker._system){var t=Ticker._system=new Ticker;t.autoStart=!0,t._protected=!0}return Ticker._system},enumerable:!1,configurable:!0}),Ticker}(),De=function(){function TickerPlugin(){}return TickerPlugin.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ae.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Me.shared:new Me,t.autoStart&&this.start()},TickerPlugin.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},TickerPlugin}(),Ne=function(){function InteractionData(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new Ut,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(InteractionData.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),InteractionData.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)},InteractionData.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},InteractionData.prototype.reset=function(){this.isPrimary=!1},InteractionData}(),extendStatics$i=function(t,e){return extendStatics$i=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])},extendStatics$i(t,e)};var Ce=function(){function InteractionEvent(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return InteractionEvent.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},InteractionEvent.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},InteractionEvent}(),we=function(){function InteractionTrackingData(t){this._pointerId=t,this._flags=InteractionTrackingData.FLAGS.NONE}return InteractionTrackingData.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Object.defineProperty(InteractionTrackingData.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(InteractionTrackingData.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(InteractionTrackingData.prototype,"none",{get:function(){return this._flags===InteractionTrackingData.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(InteractionTrackingData.prototype,"over",{get:function(){return!!(this._flags&InteractionTrackingData.FLAGS.OVER)},set:function(t){this._doSet(InteractionTrackingData.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(InteractionTrackingData.prototype,"rightDown",{get:function(){return!!(this._flags&InteractionTrackingData.FLAGS.RIGHT_DOWN)},set:function(t){this._doSet(InteractionTrackingData.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(InteractionTrackingData.prototype,"leftDown",{get:function(){return!!(this._flags&InteractionTrackingData.FLAGS.LEFT_DOWN)},set:function(t){this._doSet(InteractionTrackingData.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),InteractionTrackingData.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),InteractionTrackingData}(),Le=function(){function TreeSearch(){this._tempPoint=new Ut}return TreeSearch.prototype.recursiveFindHit=function(t,e,r,i,n){if(!e||!e.visible)return!1;var o=t.data.global,s=!1,a=n=e.interactive||n,h=!0;if(e.hitArea?(i&&(e.worldTransform.applyInverse(o,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?s=!0:(i=!1,h=!1)),a=!1):e._mask&&i&&(e._mask.containsPoint&&e._mask.containsPoint(o)||(i=!1)),h&&e.interactiveChildren&&e.children)for(var u=e.children,l=u.length-1;l>=0;l--){var c=u[l],d=this.recursiveFindHit(t,c,r,i,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},TreeSearch.prototype.findHit=function(t,e,r,i){this.recursiveFindHit(t,e,r,i,!1)},TreeSearch}(),Fe={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};be.mixin(Fe);var Be={target:null,data:{global:null}},Ge=function(t){function InteractionManager(e,r){var i=t.call(this)||this;return r=r||{},i.renderer=e,i.autoPreventDefault=void 0===r.autoPreventDefault||r.autoPreventDefault,i.interactionFrequency=r.interactionFrequency||10,i.mouse=new Ne,i.mouse.identifier=1,i.mouse.global.set(-999999),i.activeInteractionData={},i.activeInteractionData[1]=i.mouse,i.interactionDataPool=[],i.eventData=new Ce,i.interactionDOMElement=null,i.moveWhenInside=!1,i.eventsAdded=!1,i.tickerAdded=!1,i.mouseOverRenderer=!("PointerEvent"in globalThis),i.supportsTouchEvents="ontouchstart"in globalThis,i.supportsPointerEvents=!!globalThis.PointerEvent,i.onPointerUp=i.onPointerUp.bind(i),i.processPointerUp=i.processPointerUp.bind(i),i.onPointerCancel=i.onPointerCancel.bind(i),i.processPointerCancel=i.processPointerCancel.bind(i),i.onPointerDown=i.onPointerDown.bind(i),i.processPointerDown=i.processPointerDown.bind(i),i.onPointerMove=i.onPointerMove.bind(i),i.processPointerMove=i.processPointerMove.bind(i),i.onPointerOut=i.onPointerOut.bind(i),i.processPointerOverOut=i.processPointerOverOut.bind(i),i.onPointerOver=i.onPointerOver.bind(i),i.cursorStyles={default:"inherit",pointer:"pointer"},i.currentCursorMode=null,i.cursor=null,i.resolution=1,i.delayedEvents=[],i.search=new Le,i._tempDisplayObject=new Re,i._eventListenerOptions={capture:!0,passive:!1},i._useSystemTicker=void 0===r.useSystemTicker||r.useSystemTicker,i.setTargetElement(i.renderer.view,i.renderer.resolution),i}return function __extends$i(t,e){function __(){this.constructor=t}extendStatics$i(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}(InteractionManager,t),Object.defineProperty(InteractionManager.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(InteractionManager.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),InteractionManager.prototype.hitTest=function(t,e){return Be.target=null,Be.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(Be,e,null,!0),Be.target},InteractionManager.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},InteractionManager.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(Me.system.add(this.tickerUpdate,this,Ae.INTERACTION),this.tickerAdded=!0)},InteractionManager.prototype.removeTickerListener=function(){this.tickerAdded&&(Me.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},InteractionManager.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}},InteractionManager.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}},InteractionManager.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this.update())},InteractionManager.prototype.update=function(){if(this.interactionDOMElement)if(this._didMove)this._didMove=!1;else{for(var t in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var e=this.activeInteractionData[t];if(e.originalEvent&&"touch"!==e.pointerType){var r=this.configureInteractionEventForDOMEvent(this.eventData,e.originalEvent,e);this.processInteractive(r,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},InteractionManager.prototype.setCursorMode=function(t){t=t||"default";var e=!0;if(globalThis.OffscreenCanvas&&this.interactionDOMElement instanceof OffscreenCanvas&&(e=!1),this.currentCursorMode!==t){this.currentCursorMode=t;var r=this.cursorStyles[t];if(r)switch(typeof r){case"string":e&&(this.interactionDOMElement.style.cursor=r);break;case"function":r(t);break;case"object":e&&Object.assign(this.interactionDOMElement.style,r)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.interactionDOMElement.style.cursor=t)}},InteractionManager.prototype.dispatchEvent=function(t,e,r){r.stopPropagationHint&&t!==r.stopsPropagatingAt||(r.currentTarget=t,r.type=e,t.emit(e,r),t[e]&&t[e](r))},InteractionManager.prototype.delayDispatchEvent=function(t,e,r){this.delayedEvents.push({displayObject:t,eventString:e,eventData:r})},InteractionManager.prototype.mapPositionToPoint=function(t,e,r){var i;i=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:this.interactionDOMElement.width,height:this.interactionDOMElement.height,left:0,top:0};var n=1/this.resolution;t.x=(e-i.left)*(this.interactionDOMElement.width/i.width)*n,t.y=(r-i.top)*(this.interactionDOMElement.height/i.height)*n},InteractionManager.prototype.processInteractive=function(t,e,r,i){var n=this.search.findHit(t,e,r,i),o=this.delayedEvents;if(!o.length)return n;t.stopPropagationHint=!1;var s=o.length;this.delayedEvents=[];for(var a=0;a<s;a++){var h=o[a],u=h.displayObject,l=h.eventString,c=h.eventData;c.stopsPropagatingAt===u&&(c.stopPropagationHint=!0),this.dispatchEvent(u,l,c)}return n},InteractionManager.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r=e.length,i=0;i<r;i++){var n=e[i],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);if(s.data.originalEvent=t,this.processInteractive(s,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",s),"touch"===n.pointerType)this.emit("touchstart",s);else if("mouse"===n.pointerType||"pen"===n.pointerType){var a=2===n.button;this.emit(a?"rightdown":"mousedown",this.eventData)}}}},InteractionManager.prototype.processPointerDown=function(t,e,r){var i=t.data,n=t.data.identifier;if(r)if(e.trackedPointers[n]||(e.trackedPointers[n]=new we(n)),this.dispatchEvent(e,"pointerdown",t),"touch"===i.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;o?e.trackedPointers[n].rightDown=!0:e.trackedPointers[n].leftDown=!0,this.dispatchEvent(e,o?"rightdown":"mousedown",t)}},InteractionManager.prototype.onPointerComplete=function(t,e,r){for(var i=this.normalizeToPointerData(t),n=i.length,o=t.target!==this.interactionDOMElement?"outside":"",s=0;s<n;s++){var a=i[s],h=this.getInteractionDataForPointerId(a),u=this.configureInteractionEventForDOMEvent(this.eventData,a,h);if(u.data.originalEvent=t,this.processInteractive(u,this.lastObjectRendered,r,e||!o),this.emit(e?"pointercancel":"pointerup"+o,u),"mouse"===a.pointerType||"pen"===a.pointerType){var l=2===a.button;this.emit(l?"rightup"+o:"mouseup"+o,u)}else"touch"===a.pointerType&&(this.emit(e?"touchcancel":"touchend"+o,u),this.releaseInteractionDataForPointerId(a.pointerId))}},InteractionManager.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!0,this.processPointerCancel)},InteractionManager.prototype.processPointerCancel=function(t,e){var r=t.data,i=t.data.identifier;void 0!==e.trackedPointers[i]&&(delete e.trackedPointers[i],this.dispatchEvent(e,"pointercancel",t),"touch"===r.pointerType&&this.dispatchEvent(e,"touchcancel",t))},InteractionManager.prototype.onPointerUp=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!1,this.processPointerUp)},InteractionManager.prototype.processPointerUp=function(t,e,r){var i=t.data,n=t.data.identifier,o=e.trackedPointers[n],s="touch"===i.pointerType,a="mouse"===i.pointerType||"pen"===i.pointerType,h=!1;if(a){var u=2===i.button,l=we.FLAGS,c=u?l.RIGHT_DOWN:l.LEFT_DOWN,d=void 0!==o&&o.flags&c;r?(this.dispatchEvent(e,u?"rightup":"mouseup",t),d&&(this.dispatchEvent(e,u?"rightclick":"click",t),h=!0)):d&&this.dispatchEvent(e,u?"rightupoutside":"mouseupoutside",t),o&&(u?o.rightDown=!1:o.leftDown=!1)}r?(this.dispatchEvent(e,"pointerup",t),s&&this.dispatchEvent(e,"touchend",t),o&&(a&&!h||this.dispatchEvent(e,"pointertap",t),s&&(this.dispatchEvent(e,"tap",t),o.over=!1))):o&&(this.dispatchEvent(e,"pointerupoutside",t),s&&this.dispatchEvent(e,"touchendoutside",t)),o&&o.none&&delete e.trackedPointers[n]},InteractionManager.prototype.onPointerMove=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);"mouse"!==e[0].pointerType&&"pen"!==e[0].pointerType||(this._didMove=!0,this.cursor=null);for(var r=e.length,i=0;i<r;i++){var n=e[i],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);s.data.originalEvent=t,this.processInteractive(s,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",s),"touch"===n.pointerType&&this.emit("touchmove",s),"mouse"!==n.pointerType&&"pen"!==n.pointerType||this.emit("mousemove",s)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},InteractionManager.prototype.processPointerMove=function(t,e,r){var i=t.data,n="touch"===i.pointerType,o="mouse"===i.pointerType||"pen"===i.pointerType;o&&this.processPointerOverOut(t,e,r),this.moveWhenInside&&!r||(this.dispatchEvent(e,"pointermove",t),n&&this.dispatchEvent(e,"touchmove",t),o&&this.dispatchEvent(e,"mousemove",t))},InteractionManager.prototype.onPointerOut=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0];"mouse"===e.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var r=this.getInteractionDataForPointerId(e),i=this.configureInteractionEventForDOMEvent(this.eventData,e,r);i.data.originalEvent=e,this.processInteractive(i,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",i),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",i):this.releaseInteractionDataForPointerId(r.identifier)}},InteractionManager.prototype.processPointerOverOut=function(t,e,r){var i=t.data,n=t.data.identifier,o="mouse"===i.pointerType||"pen"===i.pointerType,s=e.trackedPointers[n];r&&!s&&(s=e.trackedPointers[n]=new we(n)),void 0!==s&&(r&&this.mouseOverRenderer?(s.over||(s.over=!0,this.delayDispatchEvent(e,"pointerover",t),o&&this.delayDispatchEvent(e,"mouseover",t)),o&&null===this.cursor&&(this.cursor=e.cursor)):s.over&&(s.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),o&&this.dispatchEvent(e,"mouseout",t),s.none&&delete e.trackedPointers[n]))},InteractionManager.prototype.onPointerOver=function(t){var e=this.normalizeToPointerData(t)[0],r=this.getInteractionDataForPointerId(e),i=this.configureInteractionEventForDOMEvent(this.eventData,e,r);i.data.originalEvent=e,"mouse"===e.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",i),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",i)},InteractionManager.prototype.getInteractionDataForPointerId=function(t){var e,r=t.pointerId;return 1===r||"mouse"===t.pointerType?e=this.mouse:this.activeInteractionData[r]?e=this.activeInteractionData[r]:((e=this.interactionDataPool.pop()||new Ne).identifier=r,this.activeInteractionData[r]=e),e.copyEvent(t),e},InteractionManager.prototype.releaseInteractionDataForPointerId=function(t){var e=this.activeInteractionData[t];e&&(delete this.activeInteractionData[t],e.reset(),this.interactionDataPool.push(e))},InteractionManager.prototype.configureInteractionEventForDOMEvent=function(t,e,r){return t.data=r,this.mapPositionToPoint(r.global,e.clientX,e.clientY),"touch"===e.pointerType&&(e.globalX=r.global.x,e.globalY=r.global.y),r.originalEvent=e,t.reset(),t},InteractionManager.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var r=0,i=t.changedTouches.length;r<i;r++){var n=t.changedTouches[r];void 0===n.button&&(n.button=t.touches.length?1:0),void 0===n.buttons&&(n.buttons=t.touches.length?1:0),void 0===n.isPrimary&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===n.width&&(n.width=n.radiusX||1),void 0===n.height&&(n.height=n.radiusY||1),void 0===n.tiltX&&(n.tiltX=0),void 0===n.tiltY&&(n.tiltY=0),void 0===n.pointerType&&(n.pointerType="touch"),void 0===n.pointerId&&(n.pointerId=n.identifier||0),void 0===n.pressure&&(n.pressure=n.force||.5),void 0===n.twist&&(n.twist=0),void 0===n.tangentialPressure&&(n.tangentialPressure=0),void 0===n.layerX&&(n.layerX=n.offsetX=n.clientX),void 0===n.layerY&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,e.push(n)}else if(globalThis.MouseEvent&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof globalThis.PointerEvent))e.push(t);else{var o=t;void 0===o.isPrimary&&(o.isPrimary=!0),void 0===o.width&&(o.width=1),void 0===o.height&&(o.height=1),void 0===o.tiltX&&(o.tiltX=0),void 0===o.tiltY&&(o.tiltY=0),void 0===o.pointerType&&(o.pointerType="mouse"),void 0===o.pointerId&&(o.pointerId=1),void 0===o.pressure&&(o.pressure=.5),void 0===o.twist&&(o.twist=0),void 0===o.tangentialPressure&&(o.tangentialPressure=0),o.isNormalized=!0,e.push(o)}return e},InteractionManager.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},InteractionManager}(et),Ue=function(){function Runner(t){this.items=[],this._name=t,this._aliasCount=0}return Runner.prototype.emit=function(t,e,r,i,n,o,s,a){if(arguments.length>8)throw new Error("max arguments reached");var h=this.name,u=this.items;this._aliasCount++;for(var l=0,c=u.length;l<c;l++)u[l][h](t,e,r,i,n,o,s,a);return u===this.items&&this._aliasCount--,this},Runner.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},Runner.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},Runner.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},Runner.prototype.contains=function(t){return-1!==this.items.indexOf(t)},Runner.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},Runner.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(Runner.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(Runner.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Runner}();Object.defineProperties(Ue.prototype,{dispatch:{value:Ue.prototype.emit},run:{value:Ue.prototype.emit}}),
75
+ /*!
76
+ * @pixi/core - v6.3.2
77
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
78
+ *
79
+ * @pixi/core is licensed under the MIT License.
80
+ * http://www.opensource.org/licenses/mit-license
81
+ */
82
+ J.PREFER_ENV=Q.any?it.WEBGL:it.WEBGL2,J.STRICT_TEXTURE_CACHE=!1;var Xe=[];function autoDetectResource(t,e){if(!t)return null;var r="";if("string"==typeof t){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);i&&(r=i[1].toLowerCase())}for(var n=Xe.length-1;n>=0;--n){var o=Xe[n];if(o.test&&o.test(t,r))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}
83
+ /*! *****************************************************************************
84
+ Copyright (c) Microsoft Corporation. All rights reserved.
85
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
86
+ this file except in compliance with the License. You may obtain a copy of the
87
+ License at http://www.apache.org/licenses/LICENSE-2.0
88
+
89
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
90
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
91
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
92
+ MERCHANTABLITY OR NON-INFRINGEMENT.
93
+
94
+ See the Apache Version 2.0 License for specific language governing permissions
95
+ and limitations under the License.
96
+ ***************************************************************************** */var extendStatics$h=function(t,e){return extendStatics$h=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])},extendStatics$h(t,e)};function __extends$h(t,e){function __(){this.constructor=t}extendStatics$h(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(t){for(var e,r=arguments,i=1,n=arguments.length;i<n;i++)for(var o in e=r[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},__assign.apply(this,arguments)};var ke=function(){function Resource(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Ue("setRealSize"),this.onUpdate=new Ue("update"),this.onError=new Ue("onError")}return Resource.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},Resource.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},Resource.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(Resource.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),Resource.prototype.update=function(){this.destroyed||this.onUpdate.emit()},Resource.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(Resource.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(Resource.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Resource.prototype.style=function(t,e,r){return!1},Resource.prototype.dispose=function(){},Resource.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},Resource.test=function(t,e){return!1},Resource}(),He=function(t){function BufferResource(e,r){var i=this,n=r||{},o=n.width,s=n.height;if(!o||!s)throw new Error("BufferResource width or height invalid");return(i=t.call(this,o,s)||this).data=e,i}return __extends$h(BufferResource,t),BufferResource.prototype.upload=function(t,e,r){var i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===_t.UNPACK);var n=e.realWidth,o=e.realHeight;return r.width===n&&r.height===o?i.texSubImage2D(e.target,0,0,0,n,o,e.format,r.type,this.data):(r.width=n,r.height=o,i.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,this.data)),!0},BufferResource.prototype.dispose=function(){this.data=null},BufferResource.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},BufferResource}(ke),je={scaleMode:dt.NEAREST,format:ht.RGBA,alphaMode:_t.NPM},Ye=function(t){function BaseTexture(e,r){void 0===e&&(e=null),void 0===r&&(r=null);var i=t.call(this)||this,n=(r=r||{}).alphaMode,o=r.mipmap,s=r.anisotropicLevel,a=r.scaleMode,h=r.width,u=r.height,l=r.wrapMode,c=r.format,d=r.type,p=r.target,f=r.resolution,_=r.resourceOptions;return!e||e instanceof ke||((e=autoDetectResource(e,_)).internal=!0),i.resolution=f||J.RESOLUTION,i.width=Math.round((h||0)*i.resolution)/i.resolution,i.height=Math.round((u||0)*i.resolution)/i.resolution,i._mipmap=void 0!==o?o:J.MIPMAP_TEXTURES,i.anisotropicLevel=void 0!==s?s:J.ANISOTROPIC_LEVEL,i._wrapMode=l||J.WRAP_MODE,i._scaleMode=void 0!==a?a:J.SCALE_MODE,i.format=c||ht.RGBA,i.type=d||lt.UNSIGNED_BYTE,i.target=p||ut.TEXTURE_2D,i.alphaMode=void 0!==n?n:_t.UNPACK,i.uid=uid(),i.touched=0,i.isPowerOfTwo=!1,i._refreshPOT(),i._glTextures={},i.dirtyId=0,i.dirtyStyleId=0,i.cacheId=null,i.valid=h>0&&u>0,i.textureCacheIds=[],i.destroyed=!1,i.resource=null,i._batchEnabled=0,i._batchLocation=0,i.parentTextureArray=null,i.setResource(e),i}return __extends$h(BaseTexture,t),Object.defineProperty(BaseTexture.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(BaseTexture.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(BaseTexture.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(BaseTexture.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(BaseTexture.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),BaseTexture.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},BaseTexture.prototype.setSize=function(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)},BaseTexture.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this},BaseTexture.prototype._refreshPOT=function(){this.isPowerOfTwo=isPow2(this.realWidth)&&isPow2(this.realHeight)},BaseTexture.prototype.setResolution=function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this},BaseTexture.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},BaseTexture.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))},BaseTexture.prototype.onError=function(t){this.emit("error",this,t)},BaseTexture.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Ct[this.cacheId],delete Nt[this.cacheId],this.cacheId=null),this.dispose(),BaseTexture.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},BaseTexture.prototype.dispose=function(){this.emit("dispose",this)},BaseTexture.prototype.castToBaseTexture=function(){return this},BaseTexture.from=function(t,e,r){void 0===r&&(r=J.STRICT_TEXTURE_CACHE);var i="string"==typeof t,n=null;if(i)n=t;else{if(!t._pixiId){var o=e&&e.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+uid()}n=t._pixiId}var s=Ct[n];if(i&&r&&!s)throw new Error('The cacheId "'+n+'" does not exist in BaseTextureCache.');return s||((s=new BaseTexture(t,e)).cacheId=n,BaseTexture.addToCache(s,n)),s},BaseTexture.fromBuffer=function(t,e,r,i){t=t||new Float32Array(e*r*4);var n=new He(t,{width:e,height:r}),o=t instanceof Float32Array?lt.FLOAT:lt.UNSIGNED_BYTE;return new BaseTexture(n,Object.assign(je,i||{width:e,height:r,type:o}))},BaseTexture.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Ct[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),Ct[e]=t)},BaseTexture.removeFromCache=function(t){if("string"==typeof t){var e=Ct[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete Ct[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)delete Ct[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},BaseTexture._globalBatch=0,BaseTexture}(et),Ve=function(t){function AbstractMultiResource(e,r){var i=this,n=r||{},o=n.width,s=n.height;(i=t.call(this,o,s)||this).items=[],i.itemDirtyIds=[];for(var a=0;a<e;a++){var h=new Ye;i.items.push(h),i.itemDirtyIds.push(-2)}return i.length=e,i._load=null,i.baseTexture=null,i}return __extends$h(AbstractMultiResource,t),AbstractMultiResource.prototype.initFromArray=function(t,e){for(var r=0;r<this.length;r++)t[r]&&(t[r].castToBaseTexture?this.addBaseTextureAt(t[r].castToBaseTexture(),r):t[r]instanceof ke?this.addResourceAt(t[r],r):this.addResourceAt(autoDetectResource(t[r],e),r))},AbstractMultiResource.prototype.dispose=function(){for(var t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},AbstractMultiResource.prototype.addResourceAt=function(t,e){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this},AbstractMultiResource.prototype.bind=function(e){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");t.prototype.bind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)},AbstractMultiResource.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)},AbstractMultiResource.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.items.map((function(t){return t.resource})).filter((function(t){return t})).map((function(t){return t.load()}));return this._load=Promise.all(e).then((function(){var e=t.items[0],r=e.realWidth,i=e.realHeight;return t.resize(r,i),Promise.resolve(t)})),this._load},AbstractMultiResource}(ke),We=function(t){function ArrayResource(e,r){var i,n,o=this,s=r||{},a=s.width,h=s.height;return Array.isArray(e)?(i=e,n=e.length):n=e,o=t.call(this,n,{width:a,height:h})||this,i&&o.initFromArray(i,r),o}return __extends$h(ArrayResource,t),ArrayResource.prototype.addBaseTextureAt=function(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this},ArrayResource.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=ut.TEXTURE_2D_ARRAY},ArrayResource.prototype.upload=function(t,e,r){var i=this,n=i.length,o=i.itemDirtyIds,s=i.items,a=t.gl;r.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,n,0,e.format,r.type,null);for(var h=0;h<n;h++){var u=s[h];o[h]<u.dirtyId&&(o[h]=u.dirtyId,u.valid&&a.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,h,u.resource.width,u.resource.height,1,e.format,r.type,u.resource.source))}return!0},ArrayResource}(Ve),ze=function(t){function BaseImageResource(e){var r=this,i=e,n=i.naturalWidth||i.videoWidth||i.width,o=i.naturalHeight||i.videoHeight||i.height;return(r=t.call(this,n,o)||this).source=e,r.noSubImage=!1,r}return __extends$h(BaseImageResource,t),BaseImageResource.crossOrigin=function(t,e,r){void 0===r&&0!==e.indexOf("data:")?t.crossOrigin=determineCrossOrigin(e):!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous")},BaseImageResource.prototype.upload=function(t,e,r,i){var n=t.gl,o=e.realWidth,s=e.realHeight;if((i=i||this.source)instanceof HTMLImageElement){if(!i.complete||0===i.naturalWidth)return!1}else if(i instanceof HTMLVideoElement&&i.readyState<=1)return!1;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===_t.UNPACK),this.noSubImage||e.target!==n.TEXTURE_2D||r.width!==o||r.height!==s?(r.width=o,r.height=s,n.texImage2D(e.target,0,r.internalFormat,e.format,r.type,i)):n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,r.type,i),!0},BaseImageResource.prototype.update=function(){if(!this.destroyed){var e=this.source,r=e.naturalWidth||e.videoWidth||e.width,i=e.naturalHeight||e.videoHeight||e.height;this.resize(r,i),t.prototype.update.call(this)}},BaseImageResource.prototype.dispose=function(){this.source=null},BaseImageResource}(ke),Ke=function(t){function CanvasResource(e){return t.call(this,e)||this}return __extends$h(CanvasResource,t),CanvasResource.test=function(t){var e=globalThis.OffscreenCanvas;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement},CanvasResource}(ze),qe=function(t){function CubeResource(e,r){var i=this,n=r||{},o=n.width,s=n.height,a=n.autoLoad,h=n.linkBaseTexture;if(e&&e.length!==CubeResource.SIDES)throw new Error("Invalid length. Got "+e.length+", expected 6");i=t.call(this,6,{width:o,height:s})||this;for(var u=0;u<CubeResource.SIDES;u++)i.items[u].target=ut.TEXTURE_CUBE_MAP_POSITIVE_X+u;return i.linkBaseTexture=!1!==h,e&&i.initFromArray(e,r),!1!==a&&i.load(),i}return __extends$h(CubeResource,t),CubeResource.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=ut.TEXTURE_CUBE_MAP},CubeResource.prototype.addBaseTextureAt=function(t,e,r){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=ut.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this},CubeResource.prototype.upload=function(t,e,r){for(var i=this.itemDirtyIds,n=0;n<CubeResource.SIDES;n++){var o=this.items[n];i[n]<o.dirtyId&&(o.valid&&o.resource?(o.resource.upload(t,o,r),i[n]=o.dirtyId):i[n]<-1&&(t.gl.texImage2D(o.target,0,r.internalFormat,e.realWidth,e.realHeight,0,e.format,r.type,null),i[n]=-1))}return!0},CubeResource.test=function(t){return Array.isArray(t)&&t.length===CubeResource.SIDES},CubeResource.SIDES=6,CubeResource}(Ve),$e=function(t){function ImageResource(e,r){var i=this;if(r=r||{},!(e instanceof HTMLImageElement)){var n=new Image;ze.crossOrigin(n,e,r.crossorigin),n.src=e,e=n}return i=t.call(this,e)||this,!e.complete&&i._width&&i._height&&(i._width=0,i._height=0),i.url=e.src,i._process=null,i.preserveBitmap=!1,i.createBitmap=(void 0!==r.createBitmap?r.createBitmap:J.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,i.alphaMode="number"==typeof r.alphaMode?r.alphaMode:null,i.bitmap=null,i._load=null,!1!==r.autoLoad&&i.load(),i}return __extends$h(ImageResource,t),ImageResource.prototype.load=function(t){var e=this;return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise((function(t,r){var i=e.source;e.url=i.src;var completed=function(){e.destroyed||(i.onload=null,i.onerror=null,e.resize(i.width,i.height),e._load=null,e.createBitmap?t(e.process()):t(e))};i.complete&&i.src?completed():(i.onload=completed,i.onerror=function(t){r(t),e.onError.emit(t)})}))),this._load},ImageResource.prototype.process=function(){var t=this,e=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);var r=globalThis.createImageBitmap,i=!e.crossOrigin||"anonymous"===e.crossOrigin;return this._process=fetch(e.src,{mode:i?"cors":"no-cors"}).then((function(t){return t.blob()})).then((function(i){return r(i,0,0,e.width,e.height,{premultiplyAlpha:t.alphaMode===_t.UNPACK?"premultiply":"none"})})).then((function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))})),this._process},ImageResource.prototype.upload=function(e,r,i){if("number"==typeof this.alphaMode&&(r.alphaMode=this.alphaMode),!this.createBitmap)return t.prototype.upload.call(this,e,r,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,r,i,this.bitmap),!this.preserveBitmap){var n=!0,o=r._glTextures;for(var s in o){var a=o[s];if(a!==i&&a.dirtyId!==r.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},ImageResource.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},ImageResource.test=function(t){return"string"==typeof t||t instanceof HTMLImageElement},ImageResource}(ze),Ze=function(t){function SVGResource(e,r){var i=this;return r=r||{},(i=t.call(this,document.createElement("canvas"))||this)._width=0,i._height=0,i.svg=e,i.scale=r.scale||1,i._overrideWidth=r.width,i._overrideHeight=r.height,i._resolve=null,i._crossorigin=r.crossorigin,i._load=null,!1!==r.autoLoad&&i.load(),i}return __extends$h(SVGResource,t),SVGResource.prototype.load=function(){var t=this;return this._load||(this._load=new Promise((function(e){if(t._resolve=function(){t.resize(t.source.width,t.source.height),e(t)},SVGResource.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}))),this._load},SVGResource.prototype._loadSvg=function(){var t=this,e=new Image;ze.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=function(r){t._resolve&&(e.onerror=null,t.onError.emit(r))},e.onload=function(){if(t._resolve){var r=e.width,i=e.height;if(!r||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var n=r*t.scale,o=i*t.scale;(t._overrideWidth||t._overrideHeight)&&(n=t._overrideWidth||t._overrideHeight/i*r,o=t._overrideHeight||t._overrideWidth/r*i),n=Math.round(n),o=Math.round(o);var s=t.source;s.width=n,s.height=o,s._pixiId="canvas_"+uid(),s.getContext("2d").drawImage(e,0,0,r,i,0,0,n,o),t._resolve(),t._resolve=null}}},SVGResource.getSize=function(t){var e=SVGResource.SVG_SIZE.exec(t),r={};return e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7]))),r},SVGResource.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},SVGResource.test=function(t,e){return"svg"===e||"string"==typeof t&&/^data:image\/svg\+xml(;(charset=utf8|utf8))?;base64/.test(t)||"string"==typeof t&&SVGResource.SVG_XML.test(t)},SVGResource.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,SVGResource.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,SVGResource}(ze),Qe=function(t){function VideoResource(e,r){var i=this;if(r=r||{},!(e instanceof HTMLVideoElement)){var n=document.createElement("video");n.setAttribute("preload","auto"),n.setAttribute("webkit-playsinline",""),n.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]);var o=e[0].src||e[0];ze.crossOrigin(n,o,r.crossorigin);for(var s=0;s<e.length;++s){var a=document.createElement("source"),h=e[s],u=h.src,l=h.mime,c=(u=u||e[s]).split("?").shift().toLowerCase(),d=c.slice(c.lastIndexOf(".")+1);l=l||VideoResource.MIME_TYPES[d]||"video/"+d,a.src=u,a.type=l,n.appendChild(a)}e=n}return(i=t.call(this,e)||this).noSubImage=!0,i._autoUpdate=!0,i._isConnectedToTicker=!1,i._updateFPS=r.updateFPS||0,i._msToNextUpdate=0,i.autoPlay=!1!==r.autoPlay,i._load=null,i._resolve=null,i._onCanPlay=i._onCanPlay.bind(i),i._onError=i._onError.bind(i),!1!==r.autoLoad&&i.load(),i}return __extends$h(VideoResource,t),VideoResource.prototype.update=function(e){if(!this.destroyed){var r=Me.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-r),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},VideoResource.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((function(r){t.valid?r(t):(t._resolve=r,e.load())})),this._load},VideoResource.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},VideoResource.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&!1===t.paused&&!1===t.ended&&t.readyState>2},VideoResource.prototype._isSourceReady=function(){var t=this.source;return 3===t.readyState||4===t.readyState},VideoResource.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Me.shared.add(this.update,this),this._isConnectedToTicker=!0)},VideoResource.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Me.shared.remove(this.update,this),this._isConnectedToTicker=!1)},VideoResource.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},VideoResource.prototype.dispose=function(){this._isConnectedToTicker&&(Me.shared.remove(this.update,this),this._isConnectedToTicker=!1);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(VideoResource.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Me.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Me.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(VideoResource.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),VideoResource.test=function(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||VideoResource.TYPES.indexOf(e)>-1},VideoResource.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],VideoResource.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},VideoResource}(ze),Je=function(t){function ImageBitmapResource(e){return t.call(this,e)||this}return __extends$h(ImageBitmapResource,t),ImageBitmapResource.test=function(t){return!!globalThis.createImageBitmap&&t instanceof ImageBitmap},ImageBitmapResource}(ze);Xe.push($e,Je,Ke,Qe,Ze,He,qe,We);var tr=function(t){function DepthResource(){return null!==t&&t.apply(this,arguments)||this}return __extends$h(DepthResource,t),DepthResource.prototype.upload=function(t,e,r){var i=t.gl;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===_t.UNPACK);var n=e.realWidth,o=e.realHeight;return r.width===n&&r.height===o?i.texSubImage2D(e.target,0,0,0,n,o,e.format,r.type,this.data):(r.width=n,r.height=o,i.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,this.data)),!0},DepthResource}(He),er=function(){function Framebuffer(t,e){this.width=Math.round(t||100),this.height=Math.round(e||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 Ue("disposeFramebuffer"),this.multisample=Tt.NONE}return Object.defineProperty(Framebuffer.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),Framebuffer.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new Ye(null,{scaleMode:dt.NEAREST,resolution:1,mipmap:ft.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},Framebuffer.prototype.addDepthTexture=function(t){return this.depthTexture=t||new Ye(new tr(null,{width:this.width,height:this.height}),{scaleMode:dt.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:ft.OFF,format:ht.DEPTH_COMPONENT,type:lt.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},Framebuffer.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},Framebuffer.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},Framebuffer.prototype.resize=function(t,e){if(t=Math.round(t),e=Math.round(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r<this.colorTextures.length;r++){var i=this.colorTextures[r],n=i.resolution;i.setSize(t/n,e/n)}if(this.depthTexture){n=this.depthTexture.resolution;this.depthTexture.setSize(t/n,e/n)}}},Framebuffer.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},Framebuffer.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},Framebuffer}(),rr=function(t){function BaseRenderTexture(e){void 0===e&&(e={});var r=this;"number"==typeof e&&(e={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]});return e.width=e.width||100,e.height=e.height||100,e.multisample=void 0!==e.multisample?e.multisample:Tt.NONE,(r=t.call(this,null,e)||this).mipmap=ft.OFF,r.valid=!0,r.clearColor=[0,0,0,0],r.framebuffer=new er(r.realWidth,r.realHeight).addColorTexture(0,r),r.framebuffer.multisample=e.multisample,r.maskStack=[],r.filterStack=[{}],r}return __extends$h(BaseRenderTexture,t),BaseRenderTexture.prototype.resize=function(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},BaseRenderTexture.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},BaseRenderTexture.prototype.destroy=function(){t.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},BaseRenderTexture}(Ye),ir=function(){function TextureUvs(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return TextureUvs.prototype.set=function(t,e,r){var i=e.width,n=e.height;if(r){var o=t.width/2/i,s=t.height/2/n,a=t.x/i+o,h=t.y/n+s;r=ee.add(r,ee.NW),this.x0=a+o*ee.uX(r),this.y0=h+s*ee.uY(r),r=ee.add(r,2),this.x1=a+o*ee.uX(r),this.y1=h+s*ee.uY(r),r=ee.add(r,2),this.x2=a+o*ee.uX(r),this.y2=h+s*ee.uY(r),r=ee.add(r,2),this.x3=a+o*ee.uX(r),this.y3=h+s*ee.uY(r)}else this.x0=t.x/i,this.y0=t.y/n,this.x1=(t.x+t.width)/i,this.y1=t.y/n,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/n,this.x3=t.x/i,this.y3=(t.y+t.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},TextureUvs.prototype.toString=function(){return"[@pixi/core:TextureUvs x0="+this.x0+" y0="+this.y0+" x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+" x3="+this.x3+" y3="+this.y3+"]"},TextureUvs}(),nr=new ir;function removeAllHandlers(t){t.destroy=function _emptyDestroy(){},t.on=function _emptyOn(){},t.once=function _emptyOnce(){},t.emit=function _emptyEmit(){}}var or=function(t){function Texture(e,r,i,n,o,s){var a=t.call(this)||this;if(a.noFrame=!1,r||(a.noFrame=!0,r=new kt(0,0,1,1)),e instanceof Texture&&(e=e.baseTexture),a.baseTexture=e,a._frame=r,a.trim=n,a.valid=!1,a._uvs=nr,a.uvMatrix=null,a.orig=i||r,a._rotate=Number(o||0),!0===o)a._rotate=2;else if(a._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return a.defaultAnchor=s?new Ut(s.x,s.y):new Ut(0,0),a._updateID=0,a.textureCacheIds=[],e.valid?a.noFrame?e.valid&&a.onBaseTextureUpdated(e):a.frame=r:e.once("loaded",a.onBaseTextureUpdated,a),a.noFrame&&e.on("update",a.onBaseTextureUpdated,a),a}return __extends$h(Texture,t),Texture.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},Texture.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},Texture.prototype.destroy=function(t){if(this.baseTexture){if(t){var e=this.baseTexture.resource;e&&e.url&&Nt[e.url]&&Texture.removeFromCache(e.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,Texture.removeFromCache(this),this.textureCacheIds=null},Texture.prototype.clone=function(){var t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),r=new Texture(this.baseTexture,!this.noFrame&&t,e,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(r._frame=t),r},Texture.prototype.updateUvs=function(){this._uvs===nr&&(this._uvs=new ir),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},Texture.from=function(t,e,r){void 0===e&&(e={}),void 0===r&&(r=J.STRICT_TEXTURE_CACHE);var i="string"==typeof t,n=null;if(i)n=t;else if(t instanceof Ye){if(!t.cacheId){var o=e&&e.pixiIdPrefix||"pixiid";t.cacheId=o+"-"+uid(),Ye.addToCache(t,t.cacheId)}n=t.cacheId}else{if(!t._pixiId){o=e&&e.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+uid()}n=t._pixiId}var s=Nt[n];if(i&&r&&!s)throw new Error('The cacheId "'+n+'" does not exist in TextureCache.');return s||t instanceof Ye?!s&&t instanceof Ye&&(s=new Texture(t),Texture.addToCache(s,n)):(e.resolution||(e.resolution=getResolutionOfUrl(t)),(s=new Texture(new Ye(t,e))).baseTexture.cacheId=n,Ye.addToCache(s.baseTexture,n),Texture.addToCache(s,n)),s},Texture.fromURL=function(t,e){var r=Object.assign({autoLoad:!1},null==e?void 0:e.resourceOptions),i=Texture.from(t,Object.assign({resourceOptions:r},e),!1),n=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):n.load().then((function(){return Promise.resolve(i)}))},Texture.fromBuffer=function(t,e,r,i){return new Texture(Ye.fromBuffer(t,e,r,i))},Texture.fromLoader=function(t,e,r,i){var n=new Ye(t,Object.assign({scaleMode:J.SCALE_MODE,resolution:getResolutionOfUrl(e)},i)),o=n.resource;o instanceof $e&&(o.url=e);var s=new Texture(n);return r||(r=e),Ye.addToCache(s.baseTexture,r),Texture.addToCache(s,r),r!==e&&(Ye.addToCache(s.baseTexture,e),Texture.addToCache(s,e)),s.baseTexture.valid?Promise.resolve(s):new Promise((function(t){s.baseTexture.once("loaded",(function(){return t(s)}))}))},Texture.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),Nt[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),Nt[e]=t)},Texture.removeFromCache=function(t){if("string"==typeof t){var e=Nt[t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete Nt[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)Nt[t.textureCacheIds[i]]===t&&delete Nt[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(Texture.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(Texture.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,r=t.y,i=t.width,n=t.height,o=e+i>this.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(Texture.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(Texture.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(Texture.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),Texture.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(Texture,"EMPTY",{get:function(){return Texture._EMPTY||(Texture._EMPTY=new Texture(new Ye),removeAllHandlers(Texture._EMPTY),removeAllHandlers(Texture._EMPTY.baseTexture)),Texture._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(Texture,"WHITE",{get:function(){if(!Texture._WHITE){var t=document.createElement("canvas"),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),Texture._WHITE=new Texture(new Ye(new Ke(t))),removeAllHandlers(Texture._WHITE),removeAllHandlers(Texture._WHITE.baseTexture)}return Texture._WHITE},enumerable:!1,configurable:!0}),Texture}(et),sr=function(t){function RenderTexture(e,r){var i=t.call(this,e,r)||this;return i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}return __extends$h(RenderTexture,t),Object.defineProperty(RenderTexture.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(RenderTexture.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),RenderTexture.prototype.resize=function(t,e,r){void 0===r&&(r=!0);var i=this.baseTexture.resolution,n=Math.round(t*i)/i,o=Math.round(e*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()},RenderTexture.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},RenderTexture.create=function(t){for(var e=arguments,r=[],i=1;i<arguments.length;i++)r[i-1]=e[i];return"number"==typeof t&&(deprecation("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:r[0],scaleMode:r[1],resolution:r[2]}),new RenderTexture(new rr(t))},RenderTexture}(or),ar=function(){function RenderTexturePool(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return RenderTexturePool.prototype.createTexture=function(t,e,r){void 0===r&&(r=Tt.NONE);var i=new rr(Object.assign({width:t,height:e,resolution:1,multisample:r},this.textureOptions));return new sr(i)},RenderTexturePool.prototype.getOptimalTexture=function(t,e,r,i){var n;void 0===r&&(r=1),void 0===i&&(i=Tt.NONE),t=Math.ceil(t*r-1e-6),e=Math.ceil(e*r-1e-6),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?n=i>1?-i:-1:(n=((65535&(t=nextPow2(t)))<<16|65535&(e=nextPow2(e)))>>>0,i>1&&(n+=4294967296*i)),this.texturePool[n]||(this.texturePool[n]=[]);var o=this.texturePool[n].pop();return o||(o=this.createTexture(t,e,i)),o.filterPoolKey=n,o.setResolution(r),o},RenderTexturePool.prototype.getFilterTexture=function(t,e,r){var i=this.getOptimalTexture(t.width,t.height,e||t.resolution,r||Tt.NONE);return i.filterFrame=t.filterFrame,i},RenderTexturePool.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},RenderTexturePool.prototype.returnFilterTexture=function(t){this.returnTexture(t)},RenderTexturePool.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var i=0;i<r.length;i++)r[i].destroy(!0)}this.texturePool={}},RenderTexturePool.prototype.setScreenSize=function(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){for(var e in this.enableFullScreen=t.width>0&&t.height>0,this.texturePool)if(Number(e)<0){var r=this.texturePool[e];if(r)for(var i=0;i<r.length;i++)r[i].destroy(!0);this.texturePool[e]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}},RenderTexturePool.SCREEN_KEY=-1,RenderTexturePool}(),hr=function(){function Attribute(t,e,r,i,n,o,s){void 0===e&&(e=0),void 0===r&&(r=!1),void 0===i&&(i=lt.FLOAT),this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=n,this.start=o,this.instance=s}return Attribute.prototype.destroy=function(){this.buffer=null},Attribute.from=function(t,e,r,i,n){return new Attribute(t,e,r,i,n)},Attribute}(),ur=0,lr=function(){function Buffer(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=ur++,this.disposeRunner=new Ue("disposeBuffer")}return Buffer.prototype.update=function(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++},Buffer.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},Buffer.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(Buffer.prototype,"index",{get:function(){return this.type===Et.ELEMENT_ARRAY_BUFFER},set:function(t){this.type=t?Et.ELEMENT_ARRAY_BUFFER:Et.ARRAY_BUFFER},enumerable:!1,configurable:!0}),Buffer.from=function(t){return t instanceof Array&&(t=new Float32Array(t)),new Buffer(t)},Buffer}(),cr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var dr={5126:4,5123:2,5121:1},pr=0,fr={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},_r=function(){function Geometry(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=pr++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Ue("disposeGeometry"),this.refCount=0}return Geometry.prototype.addAttribute=function(t,e,r,i,n,o,s,a){if(void 0===r&&(r=0),void 0===i&&(i=!1),void 0===a&&(a=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof lr||(e instanceof Array&&(e=new Float32Array(e)),e=new lr(e));var h=t.split("|");if(h.length>1){for(var u=0;u<h.length;u++)this.addAttribute(h[u],e,r,i,n);return this}var l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new hr(l,r,i,n,o,s,a),this.instanced=this.instanced||a,this},Geometry.prototype.getAttribute=function(t){return this.attributes[t]},Geometry.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},Geometry.prototype.addIndex=function(t){return t instanceof lr||(t instanceof Array&&(t=new Uint16Array(t)),t=new lr(t)),t.type=Et.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},Geometry.prototype.getIndex=function(){return this.indexBuffer},Geometry.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],r=[],i=new lr;for(t in this.attributes){var n=this.attributes[t],o=this.buffers[n.buffer];e.push(o.data),r.push(n.size*dr[n.type]/4),n.buffer=0}for(i.data=function interleaveTypedArrays(t,e){for(var r=0,i=0,n={},o=0;o<t.length;o++)i+=e[o],r+=t[o].length;var s=new ArrayBuffer(4*r),a=null,h=0;for(o=0;o<t.length;o++){var u=e[o],l=t[o],c=getBufferType(l);n[c]||(n[c]=new cr[c](s)),a=n[c];for(var d=0;d<l.length;d++)a[(d/u|0)*i+h+d%u]=l[d];h+=u}return new Float32Array(s)}(e,r),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},Geometry.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0},Geometry.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},Geometry.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},Geometry.prototype.clone=function(){for(var t=new Geometry,e=0;e<this.buffers.length;e++)t.buffers[e]=new lr(this.buffers[e].data.slice(0));for(var e in this.attributes){var r=this.attributes[e];t.attributes[e]=new hr(r.buffer,r.size,r.normalized,r.type,r.stride,r.start,r.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=Et.ELEMENT_ARRAY_BUFFER),t},Geometry.merge=function(t){for(var e,r=new Geometry,i=[],n=[],o=[],s=0;s<t.length;s++){e=t[s];for(var a=0;a<e.buffers.length;a++)n[a]=n[a]||0,n[a]+=e.buffers[a].data.length,o[a]=0}for(s=0;s<e.buffers.length;s++)i[s]=new(fr[getBufferType(e.buffers[s].data)])(n[s]),r.buffers[s]=new lr(i[s]);for(s=0;s<t.length;s++){e=t[s];for(a=0;a<e.buffers.length;a++)i[a].set(e.buffers[a].data,o[a]),o[a]+=e.buffers[a].data.length}if(r.attributes=e.attributes,e.indexBuffer){r.indexBuffer=r.buffers[e.buffers.indexOf(e.indexBuffer)],r.indexBuffer.type=Et.ELEMENT_ARRAY_BUFFER;var h=0,u=0,l=0,c=0;for(s=0;s<e.buffers.length;s++)if(e.buffers[s]!==e.indexBuffer){c=s;break}for(var s in e.attributes){var d=e.attributes[s];(0|d.buffer)===c&&(u+=d.size*dr[d.type]/4)}for(s=0;s<t.length;s++){var p=t[s].indexBuffer.data;for(a=0;a<p.length;a++)r.indexBuffer.data[a+l]+=h;h+=t[s].buffers[c].data.length/u,l+=p.length}}return r},Geometry}(),mr=function(t){function Quad(){var e=t.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return __extends$h(Quad,t),Quad}(_r),yr=function(t){function QuadUv(){var e=t.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new lr(e.vertices),e.uvBuffer=new lr(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return __extends$h(QuadUv,t),QuadUv.prototype.map=function(t,e){var r=0,i=0;return this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this.invalidate(),this},QuadUv.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},QuadUv}(_r),gr=0,vr=function(){function UniformGroup(t,e,r){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=gr++,this.static=!!e,this.ubo=!!r,t instanceof lr?(this.buffer=t,this.buffer.type=Et.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new lr(new Float32Array(1)),this.buffer.type=Et.UNIFORM_BUFFER,this.autoManage=!0))}return UniformGroup.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},UniformGroup.prototype.add=function(t,e,r){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[t]=new UniformGroup(e,r)},UniformGroup.from=function(t,e,r){return new UniformGroup(t,e,r)},UniformGroup.uboFrom=function(t,e){return new UniformGroup(t,null==e||e,!0)},UniformGroup}(),Tr=function(){function FilterState(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Tt.NONE,this.sourceFrame=new kt,this.destinationFrame=new kt,this.bindingSourceFrame=new kt,this.bindingDestinationFrame=new kt,this.filters=[],this.transform=null}return FilterState.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},FilterState}(),Er=[new Ut,new Ut,new Ut,new Ut],xr=new zt,br=function(){function FilterSystem(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new ar,this.texturePool.setScreenSize(t.view),this.statePool=[],this.quad=new mr,this.quadUv=new yr,this.tempRect=new kt,this.activeState={},this.globalUniforms=new vr({outputFrame:new kt,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return FilterSystem.prototype.push=function(t,e){for(var r,i,n=this.renderer,o=this.defaultFilterStack,s=this.statePool.pop()||new Tr,a=this.renderer.renderTexture,h=e[0].resolution,u=e[0].multisample,l=e[0].padding,c=e[0].autoFit,d=null===(r=e[0].legacy)||void 0===r||r,p=1;p<e.length;p++){var f=e[p];h=Math.min(h,f.resolution),u=Math.min(u,f.multisample),l=this.useMaxPadding?Math.max(l,f.padding):l+f.padding,c=c&&f.autoFit,d=d||null===(i=f.legacy)||void 0===i||i}1===o.length&&(this.defaultFilterStack[0].renderTexture=a.current),o.push(s),s.resolution=h,s.multisample=u,s.legacy=d,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(l);var _=this.tempRect.copyFrom(a.sourceFrame);n.projection.transform&&this.transformAABB(xr.copyFrom(n.projection.transform).invert(),_),c?(s.sourceFrame.fit(_),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(_)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,a.current?a.current.resolution:n.resolution,a.sourceFrame,a.destinationFrame,n.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,h,u),s.filters=e,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;var m=this.tempRect;m.x=0,m.y=0,m.width=s.sourceFrame.width,m.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(a.sourceFrame),s.bindingDestinationFrame.copyFrom(a.destinationFrame),s.transform=n.projection.transform,n.projection.transform=null,a.bind(s.renderTexture,s.sourceFrame,m),n.framebuffer.clear(0,0,0,0)},FilterSystem.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),r=e.filters;this.activeState=e;var i=this.globalUniforms.uniforms;i.outputFrame=e.sourceFrame,i.resolution=e.resolution;var n=i.inputSize,o=i.inputPixel,s=i.inputClamp;if(n[0]=e.destinationFrame.width,n[1]=e.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],o[0]=Math.round(n[0]*e.resolution),o[1]=Math.round(n[1]*e.resolution),o[2]=1/o[0],o[3]=1/o[1],s[0]=.5*o[2],s[1]=.5*o[3],s[2]=e.sourceFrame.width*n[2]-.5*o[2],s[3]=e.sourceFrame.height*n[3]-.5*o[3],e.legacy){var a=i.filterArea;a[0]=e.destinationFrame.width,a[1]=e.destinationFrame.height,a[2]=e.sourceFrame.x,a[3]=e.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();var h=t[t.length-1];if(this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,e.renderTexture,h.renderTexture,mt.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var u=e.renderTexture,l=this.getOptimalFilterTexture(u.width,u.height,e.resolution);l.filterFrame=u.filterFrame;var c=0;for(c=0;c<r.length-1;++c){1===c&&e.multisample>1&&((l=this.getOptimalFilterTexture(u.width,u.height,e.resolution)).filterFrame=u.filterFrame),r[c].apply(this,u,l,mt.CLEAR,e);var d=u;u=l,l=d}r[c].apply(this,u,h.renderTexture,mt.BLEND,e),c>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(u),this.returnFilterTexture(l)}e.clear(),this.statePool.push(e)},FilterSystem.prototype.bindAndClear=function(t,e){void 0===e&&(e=mt.CLEAR);var r=this.renderer,i=r.renderTexture,n=r.state;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t&&t.filterFrame){var o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,i.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var s=1&n.stateId||this.forceClear;(e===mt.CLEAR||e===mt.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)},FilterSystem.prototype.applyFilter=function(t,e,r,i){var n=this.renderer;n.state.set(t.state),this.bindAndClear(r,i),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(at.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(at.TRIANGLE_STRIP))},FilterSystem.prototype.calculateSpriteMatrix=function(t,e){var r=this.activeState,i=r.sourceFrame,n=r.destinationFrame,o=e._texture.orig,s=t.set(n.width,0,0,n.height,i.x,i.y),a=e.worldTransform.copyTo(zt.TEMP_MATRIX);return a.invert(),s.prepend(a),s.scale(1/o.width,1/o.height),s.translate(e.anchor.x,e.anchor.y),s},FilterSystem.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},FilterSystem.prototype.getOptimalFilterTexture=function(t,e,r,i){return void 0===r&&(r=1),void 0===i&&(i=Tt.NONE),this.texturePool.getOptimalTexture(t,e,r,i)},FilterSystem.prototype.getFilterTexture=function(t,e,r){if("number"==typeof t){var i=t;t=e,e=i}t=t||this.activeState.renderTexture;var n=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,r||Tt.NONE);return n.filterFrame=t.filterFrame,n},FilterSystem.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},FilterSystem.prototype.emptyPool=function(){this.texturePool.clear(!0)},FilterSystem.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},FilterSystem.prototype.transformAABB=function(t,e){var r=Er[0],i=Er[1],n=Er[2],o=Er[3];r.set(e.left,e.top),i.set(e.left,e.bottom),n.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(r,r),t.apply(i,i),t.apply(n,n),t.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),h=Math.max(r.x,i.x,n.x,o.x),u=Math.max(r.y,i.y,n.y,o.y);e.x=s,e.y=a,e.width=h-s,e.height=u-a},FilterSystem.prototype.roundFrame=function(t,e,r,i,n){if(!(t.width<=0||t.height<=0||r.width<=0||r.height<=0)){if(n){var o=n.a,s=n.b,a=n.c,h=n.d;if((Math.abs(s)>1e-4||Math.abs(a)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(h)>1e-4))return}(n=n?xr.copyFrom(n):xr.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(n,t),t.ceil(e),this.transformAABB(n.invert(),t)}},FilterSystem}(),Rr=function(){function ObjectRenderer(t){this.renderer=t}return ObjectRenderer.prototype.flush=function(){},ObjectRenderer.prototype.destroy=function(){this.renderer=null},ObjectRenderer.prototype.start=function(){},ObjectRenderer.prototype.stop=function(){this.flush()},ObjectRenderer.prototype.render=function(t){},ObjectRenderer}(),Sr=function(){function BatchSystem(t){this.renderer=t,this.emptyRenderer=new Rr(t),this.currentRenderer=this.emptyRenderer}return BatchSystem.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},BatchSystem.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},BatchSystem.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},BatchSystem.prototype.copyBoundTextures=function(t,e){for(var r=this.renderer.texture.boundTextures,i=e-1;i>=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)},BatchSystem.prototype.boundArray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,h=0;h<s;h++){var u=n[h],l=u._batchLocation;if(l>=0&&l<i&&e[l]===u)o[h]=l;else for(;a<i;){var c=e[a];if(!c||c._batchEnabled!==r||c._batchLocation!==a){o[h]=a,u._batchLocation=a,e[a]=u;break}a++}}},BatchSystem.prototype.destroy=function(){this.renderer=null},BatchSystem}(),Ar=0,Or=function(){function ContextSystem(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),t.view.addEventListener("webglcontextlost",this.handleContextLost,!1),t.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(ContextSystem.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),ContextSystem.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=Ar++,t.isContextLost()&&t.getExtension("WEBGL_lose_context")&&t.getExtension("WEBGL_lose_context").restoreContext()},ContextSystem.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=Ar++,this.renderer.runners.contextChange.emit(t)},ContextSystem.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},ContextSystem.prototype.createContext=function(t,e){var r;if(J.PREFER_ENV>=it.WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,!(r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl},ContextSystem.prototype.getExtensions=function(){var t=this.gl,e={anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})},ContextSystem.prototype.handleContextLost=function(t){t.preventDefault()},ContextSystem.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},ContextSystem.prototype.destroy=function(){var t=this.renderer.view;this.renderer=null,t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},ContextSystem.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},ContextSystem.prototype.validateContext=function(t){var e=t.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),e.stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=r||!!t.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")},ContextSystem}(),Ir=function Ir(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Tt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0},Pr=new kt,Mr=function(){function FramebufferSystem(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new er(10,10),this.msaaSamples=null}return FramebufferSystem.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new kt,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;J.PREFER_ENV===it.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},FramebufferSystem.prototype.bind=function(t,e,r){void 0===r&&(r=0);var i=this.gl;if(t){var n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,n.framebuffer)),n.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,n.mipLevel=r),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,n.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var o=0;o<t.colorTextures.length;o++){var s=t.colorTextures[o];this.renderer.texture.unbind(s.parentTextureArray||s)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){var a=e.width>>r,h=e.height>>r,u=a/e.width;this.setViewport(e.x*u,e.y*u,a,h)}else{a=t.width>>r,h=t.height>>r;this.setViewport(0,0,a,h)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},FramebufferSystem.prototype.setViewport=function(t,e,r,i){var n=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),n.width===r&&n.height===i&&n.x===t&&n.y===e||(n.x=t,n.y=e,n.width=r,n.height=i,this.gl.viewport(t,e,r,i))},Object.defineProperty(FramebufferSystem.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}),FramebufferSystem.prototype.clear=function(t,e,r,i,n){void 0===n&&(n=ot.COLOR|ot.DEPTH);var o=this.gl;o.clearColor(t,e,r,i),o.clear(n)},FramebufferSystem.prototype.initFramebuffer=function(t){var e=this.gl,r=new Ir(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r},FramebufferSystem.prototype.resizeFramebuffer=function(t){var e=this.gl,r=t.glFramebuffers[this.CONTEXT_UID];r.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.RGBA8,t.width,t.height)),r.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),r.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.DEPTH24_STENCIL8,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));var i=t.colorTextures,n=i.length;e.drawBuffers||(n=Math.min(n,1));for(var o=0;o<n;o++){var s=i[o],a=s.parentTextureArray||s;this.renderer.texture.bind(a,0)}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)},FramebufferSystem.prototype.updateFramebuffer=function(t,e){var r=this.gl,i=t.glFramebuffers[this.CONTEXT_UID],n=t.colorTextures,o=n.length;r.drawBuffers||(o=Math.min(o,1)),i.multisample>1&&this.canMultisampleFramebuffer(t)?(i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,r.RGBA8,t.width,t.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;a<o;a++){var h=n[a],u=h.parentTextureArray||h;this.renderer.texture.bind(u,0),0===a&&i.msaaBuffer||(r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+a,h.target,u._glTextures[this.CONTEXT_UID].texture,e),s.push(r.COLOR_ATTACHMENT0+a))}if((s.length>1&&r.drawBuffers(s),t.depthTexture)&&this.writeDepthTexture){var l=t.depthTexture;this.renderer.texture.bind(l,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,e)}!t.stencil&&!t.depth||t.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,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,i.stencil))},FramebufferSystem.prototype.canMultisampleFramebuffer=function(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture},FramebufferSystem.prototype.detectSamples=function(t){var e=this.msaaSamples,r=Tt.NONE;if(t<=1||null===e)return r;for(var i=0;i<e.length;i++)if(e[i]<=t){r=e[i];break}return 1===r&&(r=Tt.NONE),r},FramebufferSystem.prototype.blit=function(t,e,r){var i=this,n=i.current,o=i.renderer,s=i.gl,a=i.CONTEXT_UID;if(2===o.context.webGLVersion&&n){var h=n.glFramebuffers[a];if(h){if(!t){if(!h.msaaBuffer)return;var u=n.colorTextures[0];if(!u)return;h.blitFramebuffer||(h.blitFramebuffer=new er(n.width,n.height),h.blitFramebuffer.addColorTexture(0,u)),(t=h.blitFramebuffer).colorTextures[0]!==u&&(t.colorTextures[0]=u,t.dirtyId++,t.dirtyFormat++),t.width===n.width&&t.height===n.height||(t.width=n.width,t.height=n.height,t.dirtyId++,t.dirtySize++)}e||((e=Pr).width=n.width,e.height=n.height),r||(r=e);var l=e.width===r.width&&e.height===r.height;this.bind(t),s.bindFramebuffer(s.READ_FRAMEBUFFER,h.framebuffer),s.blitFramebuffer(e.left,e.top,e.right,e.bottom,r.left,r.top,r.right,r.bottom,s.COLOR_BUFFER_BIT,l?s.NEAREST:s.LINEAR)}}},FramebufferSystem.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&r.blitFramebuffer.dispose()}},FramebufferSystem.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r<e.length;r++)this.disposeFramebuffer(e[r],t)},FramebufferSystem.prototype.forceStencil=function(){var t=this.current;if(t){var e=t.glFramebuffers[this.CONTEXT_UID];if(e&&!e.stencil){t.stencil=!0;var r=t.width,i=t.height,n=this.gl,o=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,o),e.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,e.multisample,n.DEPTH24_STENCIL8,r,i):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,r,i),e.stencil=o,n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,o)}}},FramebufferSystem.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new kt},FramebufferSystem.prototype.destroy=function(){this.renderer=null},FramebufferSystem}(),Dr={5126:4,5123:2,5121:1},Nr=function(){function GeometrySystem(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return GeometrySystem.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){var r=this.renderer.context.extensions.vertexArrayObject;J.PREFER_ENV===it.WEBGL_LEGACY&&(r=null),r?(t.createVertexArray=function(){return r.createVertexArrayOES()},t.bindVertexArray=function(t){return r.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return r.deleteVertexArrayOES(t)}):(this.hasVao=!1,t.createVertexArray=function(){return null},t.bindVertexArray=function(){return null},t.deleteVertexArray=function(){return null})}if(2!==e.webGLVersion){var i=t.getExtension("ANGLE_instanced_arrays");i?(t.vertexAttribDivisor=function(t,e){return i.vertexAttribDivisorANGLE(t,e)},t.drawElementsInstanced=function(t,e,r,n,o){return i.drawElementsInstancedANGLE(t,e,r,n,o)},t.drawArraysInstanced=function(t,e,r,n){return i.drawArraysInstancedANGLE(t,e,r,n)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex},GeometrySystem.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var r=this.gl,i=t.glVertexArrayObjects[this.CONTEXT_UID],n=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},n=!0);var o=i[e.program.id]||this.initGeometryVao(t,e,n);this._activeGeometry=t,this._activeVao!==o&&(this._activeVao=o,this.hasVao?r.bindVertexArray(o):this.activateVao(t,e.program)),this.updateBuffers()},GeometrySystem.prototype.reset=function(){this.unbind()},GeometrySystem.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.renderer.buffer,r=0;r<t.buffers.length;r++){var i=t.buffers[r];e.update(i)}},GeometrySystem.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},GeometrySystem.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o,i[o].location);return n.join("-")},GeometrySystem.prototype.initGeometryVao=function(t,e,r){void 0===r&&(r=!0);var i=this.gl,n=this.CONTEXT_UID,o=this.renderer.buffer,s=e.program;s.glPrograms[n]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,s);var a=this.getSignature(t,s),h=t.glVertexArrayObjects[this.CONTEXT_UID],u=h[a];if(u)return h[s.id]=u,u;var l=t.buffers,c=t.attributes,d={},p={};for(var f in l)d[f]=0,p[f]=0;for(var f in c)!c[f].size&&s.attributeData[f]?c[f].size=s.attributeData[f].size:c[f].size||console.warn("PIXI Geometry attribute '"+f+"' size cannot be determined (likely the bound shader does not have the attribute)"),d[c[f].buffer]+=c[f].size*Dr[c[f].type];for(var f in c){var _=c[f],m=_.size;void 0===_.stride&&(d[_.buffer]===m*Dr[_.type]?_.stride=0:_.stride=d[_.buffer]),void 0===_.start&&(_.start=p[_.buffer],p[_.buffer]+=m*Dr[_.type])}u=i.createVertexArray(),i.bindVertexArray(u);for(var y=0;y<l.length;y++){var g=l[y];o.bind(g),r&&g._glBuffers[n].refCount++}return this.activateVao(t,s),this._activeVao=u,h[s.id]=u,h[a]=u,u},GeometrySystem.prototype.disposeGeometry=function(t,e){var r;if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var i=t.glVertexArrayObjects[this.CONTEXT_UID],n=this.gl,o=t.buffers,s=null===(r=this.renderer)||void 0===r?void 0:r.buffer;if(t.disposeRunner.remove(this),i){if(s)for(var a=0;a<o.length;a++){var h=o[a]._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,0!==h.refCount||e||s.dispose(o[a],e))}if(!e)for(var u in i)if("g"===u[0]){var l=i[u];this._activeVao===l&&this.unbind(),n.deleteVertexArray(l)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},GeometrySystem.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),r=0;r<e.length;r++)this.disposeGeometry(this.managedGeometries[e[r]],t)},GeometrySystem.prototype.activateVao=function(t,e){var r=this.gl,i=this.CONTEXT_UID,n=this.renderer.buffer,o=t.buffers,s=t.attributes;t.indexBuffer&&n.bind(t.indexBuffer);var a=null;for(var h in s){var u=s[h],l=o[u.buffer],c=l._glBuffers[i];if(e.attributeData[h]){a!==c&&(n.bind(l),a=c);var d=e.attributeData[h].location;if(r.enableVertexAttribArray(d),r.vertexAttribPointer(d,u.size,u.type||r.FLOAT,u.normalized,u.stride,u.start),u.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");r.vertexAttribDivisor(d,1)}}}},GeometrySystem.prototype.draw=function(t,e,r,i){var n=this.gl,o=this._activeGeometry;if(o.indexBuffer){var s=o.indexBuffer.data.BYTES_PER_ELEMENT,a=2===s?n.UNSIGNED_SHORT:n.UNSIGNED_INT;2===s||4===s&&this.canUseUInt32ElementIndex?o.instanced?n.drawElementsInstanced(t,e||o.indexBuffer.data.length,a,(r||0)*s,i||1):n.drawElements(t,e||o.indexBuffer.data.length,a,(r||0)*s):console.warn("unsupported index buffer type: uint32")}else o.instanced?n.drawArraysInstanced(t,r,e||o.getSize(),i||1):n.drawArrays(t,r,e||o.getSize());return this},GeometrySystem.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},GeometrySystem.prototype.destroy=function(){this.renderer=null},GeometrySystem}(),Cr=function(){function MaskData(t){void 0===t&&(t=null),this.type=vt.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=J.FILTER_MULTISAMPLE,this.enabled=!0,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._target=null}return Object.defineProperty(MaskData.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null},enumerable:!1,configurable:!0}),MaskData.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=vt.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},MaskData.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},MaskData}();function compileShader(t,e,r){var i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function logPrettyShaderError(t,e){var r=t.getShaderSource(e).split("\n").map((function(t,e){return e+": "+t})),i=t.getShaderInfoLog(e),n=i.split("\n"),o={},s=n.map((function(t){return parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))})).filter((function(t){return!(!t||o[t])&&(o[t]=!0,!0)})),a=[""];s.forEach((function(t){r[t-1]="%c"+r[t-1]+"%c",a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));var h=r.join("\n");a[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,a),console.groupEnd()}function booleanArray(t){for(var e=new Array(t),r=0;r<e.length;r++)e[r]=!1;return e}function defaultValue(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return booleanArray(2*e);case"bvec3":return booleanArray(3*e);case"bvec4":return booleanArray(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var wr,Lr={},Fr=Lr;function getMaxFragmentPrecision(){if(!wr){wr=gt.MEDIUM;var t=function getTestContext(){if(Fr===Lr||Fr&&Fr.isContextLost()){var t=document.createElement("canvas"),e=void 0;J.PREFER_ENV>=it.WEBGL2&&(e=t.getContext("webgl2",{})),e||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),Fr=e}return Fr}();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);wr=e.precision?gt.HIGH:gt.MEDIUM}}return wr}function setPrecision(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===gt.HIGH&&r!==gt.HIGH&&(i=gt.MEDIUM),"precision "+i+" float;\n"+t}return r!==gt.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var Br={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 mapSize(t){return Br[t]}var Gr=null,Ur={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 mapType(t,e){if(!Gr){var r=Object.keys(Ur);Gr={};for(var i=0;i<r.length;++i){var n=r[i];Gr[t[n]]=Ur[n]}}return Gr[e]}var Xr=[{test:function(t){return"float"===t.type&&1===t.size},code:function(t){return'\n if(uv["'+t+'"] !== ud["'+t+'"].value)\n {\n ud["'+t+'"].value = uv["'+t+'"]\n gl.uniform1f(ud["'+t+'"].location, uv["'+t+'"])\n }\n '}},{test:function(t){return("sampler2D"===t.type||"samplerCube"===t.type||"sampler2DArray"===t.type)&&1===t.size&&!t.isArray},code:function(t){return't = syncData.textureCount++;\n\n renderer.texture.bind(uv["'+t+'"], t);\n\n if(ud["'+t+'"].value !== t)\n {\n ud["'+t+'"].value = t;\n gl.uniform1i(ud["'+t+'"].location, t);\n; // eslint-disable-line max-len\n }'}},{test:function(t,e){return"mat3"===t.type&&1===t.size&&void 0!==e.a},code:function(t){return'\n gl.uniformMatrix3fv(ud["'+t+'"].location, false, uv["'+t+'"].toArray(true));\n '},codeUbo:function(t){return"\n var "+t+"_matrix = uv."+t+".toArray(true);\n\n data[offset] = "+t+"_matrix[0];\n data[offset+1] = "+t+"_matrix[1];\n data[offset+2] = "+t+"_matrix[2];\n \n data[offset + 4] = "+t+"_matrix[3];\n data[offset + 5] = "+t+"_matrix[4];\n data[offset + 6] = "+t+"_matrix[5];\n \n data[offset + 8] = "+t+"_matrix[6];\n data[offset + 9] = "+t+"_matrix[7];\n data[offset + 10] = "+t+"_matrix[8];\n "}},{test:function(t,e){return"vec2"===t.type&&1===t.size&&void 0!==e.x},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud["'+t+'"].location, v.x, v.y);\n }'},codeUbo:function(t){return"\n v = uv."+t+";\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n "}},{test:function(t){return"vec2"===t.type&&1===t.size},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud["'+t+'"].location, v[0], v[1]);\n }\n '}},{test:function(t,e){return"vec4"===t.type&&1===t.size&&void 0!==e.width},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud["'+t+'"].location, v.x, v.y, v.width, v.height)\n }'},codeUbo:function(t){return"\n v = uv."+t+";\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n data[offset+2] = v.width;\n data[offset+3] = v.height;\n "}},{test:function(t){return"vec4"===t.type&&1===t.size},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud["'+t+'"].location, v[0], v[1], v[2], v[3])\n }'}}],kr={float:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1f(location, v);\n }",vec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\n }",vec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }",vec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",int:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",ivec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",ivec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",ivec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",uint:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1ui(location, v);\n }",uvec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0], v[1]);\n }",uvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }",uvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",bool:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1i(location, v);\n }",bvec2:"\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",bvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",bvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"gl.uniform1i(location, v)",samplerCube:"gl.uniform1i(location, v)",sampler2DArray:"gl.uniform1i(location, v)"},Hr={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};var jr,Yr=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function generateIfTestSrc(t){for(var e="",r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+="if(test == "+r+".0){}");return e}var Vr=0,Wr={},zr=function(){function Program(t,e,r){void 0===r&&(r="pixi-shader"),this.id=Vr++,this.vertexSrc=t||Program.defaultVertexSrc,this.fragmentSrc=e||Program.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(r=r.replace(/\s+/g,"-"),Wr[r]?(Wr[r]++,r+="-"+Wr[r]):Wr[r]=1,this.vertexSrc="#define SHADER_NAME "+r+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+r+"\n"+this.fragmentSrc,this.vertexSrc=setPrecision(this.vertexSrc,J.PRECISION_VERTEX,gt.HIGH),this.fragmentSrc=setPrecision(this.fragmentSrc,J.PRECISION_FRAGMENT,getMaxFragmentPrecision())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(Program,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(Program,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),Program.from=function(t,e,r){var i=t+e,n=Dt[i];return n||(Dt[i]=n=new Program(t,e,r)),n},Program}(),Kr=function(){function Shader(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof vr?e:new vr(e):new vr({})}return Shader.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var r in e.uniforms){var i=e.uniforms[r];if(i.group&&this.checkUniformExists(t,i))return!0}return!1},Shader.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(Shader.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),Shader.from=function(t,e,r){return new Shader(zr.from(t,e),r)},Shader}(),qr=function(){function State(){this.data=0,this.blendMode=st.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(State.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(t){!!(1&this.data)!==t&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(State.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(t){!!(2&this.data)!==t&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(State.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(t){!!(4&this.data)!==t&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(State.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(t){!!(8&this.data)!==t&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(State.prototype,"depthMask",{get:function(){return!!(32&this.data)},set:function(t){!!(32&this.data)!==t&&(this.data^=32)},enumerable:!1,configurable:!0}),Object.defineProperty(State.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(t){!!(16&this.data)!==t&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(State.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blend=t!==st.NONE,this._blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(State.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),State.prototype.toString=function(){return"[@pixi/core:State blendMode="+this.blendMode+" clockwiseFrontFace="+this.clockwiseFrontFace+" culling="+this.culling+" depthMask="+this.depthMask+" polygonOffset="+this.polygonOffset+"]"},State.for2d=function(){var t=new State;return t.depthTest=!1,t.blend=!0,t},State}(),$r=function(t){function Filter(e,r,i){var n=this,o=zr.from(e||Filter.defaultVertexSrc,r||Filter.defaultFragmentSrc);return(n=t.call(this,o,i)||this).padding=0,n.resolution=J.FILTER_RESOLUTION,n.multisample=J.FILTER_MULTISAMPLE,n.enabled=!0,n.autoFit=!0,n.state=new qr,n}return __extends$h(Filter,t),Filter.prototype.apply=function(t,e,r,i,n){t.applyFilter(this,e,r,i)},Object.defineProperty(Filter.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(Filter.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t},enumerable:!1,configurable:!0}),Object.defineProperty(Filter,"defaultVertexSrc",{get:function(){return"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"},enumerable:!1,configurable:!0}),Object.defineProperty(Filter,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),Filter}(Kr),Zr=new zt,Qr=function(){function TextureMatrix(t,e){this._texture=t,this.mapCoord=new zt,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1}return Object.defineProperty(TextureMatrix.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),TextureMatrix.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var r=this.mapCoord,i=0;i<t.length;i+=2){var n=t[i],o=t[i+1];e[i]=n*r.a+o*r.c+r.tx,e[i+1]=n*r.b+o*r.d+r.ty}return e},TextureMatrix.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var r=e._uvs;this.mapCoord.set(r.x1-r.x0,r.y1-r.y0,r.x3-r.x0,r.y3-r.y0,r.x0,r.y0);var i=e.orig,n=e.trim;n&&(Zr.set(i.width/n.width,0,0,i.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(Zr));var o=e.baseTexture,s=this.uClampFrame,a=this.clampMargin/o.resolution,h=this.clampOffset;return s[0]=(e._frame.x+a+h)/o.width,s[1]=(e._frame.y+a+h)/o.height,s[2]=(e._frame.x+e._frame.width-a+h)/o.width,s[3]=(e._frame.y+e._frame.height-a+h)/o.height,this.uClampOffset[0]=h/o.realWidth,this.uClampOffset[1]=h/o.realHeight,this.isSimple=e._frame.width===o.width&&e._frame.height===o.height&&0===e.rotate,!0},TextureMatrix}(),Jr=function(t){function SpriteMaskFilter(e,r,i){var n=this,o=null;return"string"!=typeof e&&void 0===r&&void 0===i&&(o=e,e=void 0,r=void 0,i=void 0),(n=t.call(this,e||"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n",r||"varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n",i)||this).maskSprite=o,n.maskMatrix=new zt,n}return __extends$h(SpriteMaskFilter,t),Object.defineProperty(SpriteMaskFilter.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),SpriteMaskFilter.prototype.apply=function(t,e,r,i){var n=this._maskSprite,o=n._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new Qr(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,t.applyFilter(this,e,r,i))},SpriteMaskFilter}($r),ti=function(){function MaskSystem(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return MaskSystem.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},MaskSystem.prototype.push=function(t,e){var r=e;if(!r.isMaskData){var i=this.maskDataPool.pop()||new Cr;i.pooled=!0,i.maskObject=e,r=i}var n=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(r.copyCountersOrReset(n),r.autoDetect&&this.detect(r),r._target=t,r.type!==vt.SPRITE&&this.maskStack.push(r),r.enabled)switch(r.type){case vt.SCISSOR:this.renderer.scissor.push(r);break;case vt.STENCIL:this.renderer.stencil.push(r);break;case vt.SPRITE:r.copyCountersOrReset(null),this.pushSpriteMask(r)}r.type===vt.SPRITE&&this.maskStack.push(r)},MaskSystem.prototype.pop=function(t){var e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case vt.SCISSOR:this.renderer.scissor.pop();break;case vt.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case vt.SPRITE:this.popSpriteMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){var r=this.maskStack[this.maskStack.length-1];r.type===vt.SPRITE&&r._filters&&(r._filters[0].maskSprite=r.maskObject)}}},MaskSystem.prototype.detect=function(t){t.maskObject.isSprite?t.type=vt.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=vt.SCISSOR:t.type=vt.STENCIL},MaskSystem.prototype.pushSpriteMask=function(t){var e,r,i=t.maskObject,n=t._target,o=t._filters;o||(o=this.alphaMaskPool[this.alphaMaskIndex])||(o=this.alphaMaskPool[this.alphaMaskIndex]=[new Jr]);var s,a,h=this.renderer,u=h.renderTexture;if(u.current){var l=u.current;s=t.resolution||l.resolution,a=null!==(e=t.multisample)&&void 0!==e?e:l.multisample}else s=t.resolution||h.resolution,a=null!==(r=t.multisample)&&void 0!==r?r:h.multisample;o[0].resolution=s,o[0].multisample=a,o[0].maskSprite=i;var c=n.filterArea;n.filterArea=i.getBounds(!0),h.filter.push(n,o),n.filterArea=c,t._filters||this.alphaMaskIndex++},MaskSystem.prototype.popSpriteMask=function(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},MaskSystem.prototype.destroy=function(){this.renderer=null},MaskSystem}(),ei=function(){function AbstractMaskSystem(t){this.renderer=t,this.maskStack=[],this.glConst=0}return AbstractMaskSystem.prototype.getStackLength=function(){return this.maskStack.length},AbstractMaskSystem.prototype.setMaskStack=function(t){var e=this.renderer.gl,r=this.getStackLength();this.maskStack=t;var i=this.getStackLength();i!==r&&(0===i?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},AbstractMaskSystem.prototype._useCurrent=function(){},AbstractMaskSystem.prototype.destroy=function(){this.renderer=null,this.maskStack=null},AbstractMaskSystem}(),ri=new zt,ii=function(t){function ScissorSystem(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.SCISSOR_TEST,r}return __extends$h(ScissorSystem,t),ScissorSystem.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},ScissorSystem.prototype.calcScissorRect=function(t){if(!t._scissorRectLocal){var e=t._scissorRect,r=t.maskObject,i=this.renderer,n=i.renderTexture;r.renderable=!0;var o=r.getBounds();this.roundFrameToPixels(o,n.current?n.current.resolution:i.resolution,n.sourceFrame,n.destinationFrame,i.projection.transform),r.renderable=!1,e&&o.fit(e),t._scissorRectLocal=o}},ScissorSystem.isMatrixRotated=function(t){if(!t)return!1;var e=t.a,r=t.b,i=t.c,n=t.d;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(n)>1e-4)},ScissorSystem.prototype.testScissor=function(t){var e=t.maskObject;if(!e.isFastRect||!e.isFastRect())return!1;if(ScissorSystem.isMatrixRotated(e.worldTransform))return!1;if(ScissorSystem.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var r=t._scissorRectLocal;return r.width>0&&r.height>0},ScissorSystem.prototype.roundFrameToPixels=function(t,e,r,i,n){ScissorSystem.isMatrixRotated(n)||((n=n?ri.copyFrom(n):ri.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.renderer.filter.transformAABB(n,t),t.fit(i),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))},ScissorSystem.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var e=this.renderer.gl;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},ScissorSystem.prototype.pop=function(){var t=this.renderer.gl;this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},ScissorSystem.prototype._useCurrent=function(){var t,e=this.maskStack[this.maskStack.length-1]._scissorRect;t=this.renderer.renderTexture.current?e.y:this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,t,e.width,e.height)},ScissorSystem}(ei),ni=function(t){function StencilSystem(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}return __extends$h(StencilSystem,t),StencilSystem.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},StencilSystem.prototype.push=function(t){var e=t.maskObject,r=this.renderer.gl,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.clearStencil(0),r.clear(r.STENCIL_BUFFER_BIT),r.enable(r.STENCIL_TEST)),t._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,i,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},StencilSystem.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?e.disable(e.STENCIL_TEST):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},StencilSystem.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},StencilSystem}(ei),oi=function(){function ProjectionSystem(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new zt,this.transform=null}return ProjectionSystem.prototype.update=function(t,e,r,i){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,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)},ProjectionSystem.prototype.calculateProjection=function(t,e,r,i){var n=this.projectionMatrix,o=i?-1:1;n.identity(),n.a=1/e.width*2,n.d=o*(1/e.height*2),n.tx=-1-e.x*n.a,n.ty=-o-e.y*n.d},ProjectionSystem.prototype.setTransform=function(t){},ProjectionSystem.prototype.destroy=function(){this.renderer=null},ProjectionSystem}(),si=new kt,ai=new kt,hi=function(){function RenderTextureSystem(t){this.renderer=t,this.clearColor=t._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new kt,this.destinationFrame=new kt,this.viewportFrame=new kt}return RenderTextureSystem.prototype.bind=function(t,e,r){void 0===t&&(t=null);var i,n,o,s=this.renderer;this.current=t,t?(o=(i=t.baseTexture).resolution,e||(si.width=t.frame.width,si.height=t.frame.height,e=si),r||(ai.x=t.frame.x,ai.y=t.frame.y,ai.width=e.width,ai.height=e.height,r=ai),n=i.framebuffer):(o=s.resolution,e||(si.width=s.screen.width,si.height=s.screen.height,e=si),r||((r=si).width=e.width,r.height=e.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,t||(a.y=s.view.height-(a.y+a.height)),a.ceil(),this.renderer.framebuffer.bind(n,a),this.renderer.projection.update(r,e,o,!n),t?this.renderer.mask.setMaskStack(i.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(r)},RenderTextureSystem.prototype.clear=function(t,e){t=this.current?t||this.current.baseTexture.clearColor:t||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,h=o.width,u=o.height;s=Math.round(s),a=Math.round(a),h=Math.round(h),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(s,a,h,u)}this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e),n&&this.renderer.scissor.pop()},RenderTextureSystem.prototype.resize=function(){this.bind(null)},RenderTextureSystem.prototype.reset=function(){this.bind(null)},RenderTextureSystem.prototype.destroy=function(){this.renderer=null},RenderTextureSystem}();function uboUpdate(t,e,r,i,n){r.buffer.update(n)}var ui={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 "},li={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 generateUniformBufferSync(t,e){if(!t.autoManage)return{size:0,syncFunc:uboUpdate};for(var r=function getUBOData(t,e){var r=[];for(var i in t)e[i]&&r.push(e[i]);return r.sort((function(t,e){return t.index-e.index})),r}(t.uniforms,e),i=function createUBOElements(t){for(var e=t.map((function(t){return{data:t,offset:0,dataLen:0,dirty:0}})),r=0,i=0,n=0,o=0;o<e.length;o++){var s=e[o];if(r=li[s.data.type],s.data.size>1&&(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:e,size:n=16*Math.ceil(n/16)}}(r),n=i.uboElements,o=i.size,s=["\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 "],a=0;a<n.length;a++){for(var h=n[a],u=t.uniforms[h.data.name],l=h.data.name,c=!1,d=0;d<Xr.length;d++){var p=Xr[d];if(p.codeUbo&&p.test(h.data,u)){s.push("offset = "+h.offset/4+";",Xr[d].codeUbo(h.data.name,u)),c=!0;break}}if(!c)if(h.data.size>1){var f=mapSize(h.data.type),_=Math.max(li[h.data.type]/16,1),m=f/_,y=(4-m%4)%4;s.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+h.offset/4+";\n\n t = 0;\n\n for(var i=0; i < "+h.data.size*_+"; i++)\n {\n for(var j = 0; j < "+m+"; j++)\n {\n data[offset++] = v[t++];\n }\n offset += "+y+";\n }\n\n ")}else{var g=ui[h.data.type];s.push("\n cv = ud."+l+".value;\n v = uv."+l+";\n offset = "+h.offset/4+";\n "+g+";\n ")}}return s.push("\n renderer.buffer.update(buffer);\n "),{size:o,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join("\n"))}}var ci=function(){function GLProgram(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return GLProgram.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},GLProgram}();function generateProgram(t,e){var r=compileShader(t,t.VERTEX_SHADER,e.vertexSrc),i=compileShader(t,t.FRAGMENT_SHADER,e.fragmentSrc),n=t.createProgram();if(t.attachShader(n,r),t.attachShader(n,i),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS)||function logProgramError(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||logPrettyShaderError(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||logPrettyShaderError(t,i),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,n,r,i),e.attributeData=function getAttributeData(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=0;n<i;n++){var o=e.getActiveAttrib(t,n);if(0!==o.name.indexOf("gl_")){var s=mapType(e,o.type),a={type:s,name:o.name,size:mapSize(s),location:e.getAttribLocation(t,o.name)};r[o.name]=a}}return r}(n,t),e.uniformData=function getUniformData(t,e){for(var r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=0;n<i;n++){var o=e.getActiveUniform(t,n),s=o.name.replace(/\[.*?\]$/,""),a=!!o.name.match(/\[.*?\]$/),h=mapType(e,o.type);r[s]={name:s,index:n,type:h,size:o.size,isArray:a,value:defaultValue(h,o.size)}}return r}(n,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){var o=Object.keys(e.attributeData);o.sort((function(t,e){return t>e?1:-1}));for(var s=0;s<o.length;s++)e.attributeData[o[s]].location=s,t.bindAttribLocation(n,s,o[s]);t.linkProgram(n)}t.deleteShader(r),t.deleteShader(i);var a={};for(var s in e.uniformData){var h=e.uniformData[s];a[s]={location:t.getUniformLocation(n,s),value:defaultValue(h.type,h.size)}}return new ci(n,a)}var di=0,pi={textureCount:0,uboCount:0},fi=function(){function ShaderSystem(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=di++}return ShaderSystem.prototype.systemCheck=function(){if(!function unsafeEvalSupported(){if("boolean"==typeof jr)return jr;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");jr=!0===t({a:"b"},"a","b")}catch(t){jr=!1}return jr}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},ShaderSystem.prototype.contextChange=function(t){this.gl=t,this.reset()},ShaderSystem.prototype.bind=function(t,e){t.uniforms.globals=this.renderer.globalUniforms;var r=t.program,i=r.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==r&&(this.program=r,this.gl.useProgram(i.program)),e||(pi.textureCount=0,pi.uboCount=0,this.syncUniformGroup(t.uniformGroup,pi)),i},ShaderSystem.prototype.setUniforms=function(t){var e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)},ShaderSystem.prototype.syncUniformGroup=function(t,e){var r=this.getGlProgram();t.static&&t.dirtyId===r.uniformDirtyGroups[t.id]||(r.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,r,e))},ShaderSystem.prototype.syncUniforms=function(t,e,r){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,r)},ShaderSystem.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function generateUniformsSync(t,e){var r,i=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(var n in t.uniforms){var o=e[n];if(o){for(var s=t.uniforms[n],a=!1,h=0;h<Xr.length;h++)if(Xr[h].test(o,s)){i.push(Xr[h].code(n,s)),a=!0;break}if(!a){var u=(1===o.size?kr:Hr)[o.type].replace("location",'ud["'+n+'"].location');i.push('\n cu = ud["'+n+'"];\n cv = cu.value;\n v = uv["'+n+'"];\n '+u+";")}}else(null===(r=t.uniforms[n])||void 0===r?void 0:r.group)&&(t.uniforms[n].ubo?i.push("\n renderer.shader.syncUniformBufferGroup(uv."+n+", '"+n+"');\n "):i.push("\n renderer.shader.syncUniformGroup(uv."+n+", syncData);\n "))}return new Function("ud","uv","renderer","syncData",i.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},ShaderSystem.prototype.syncUniformBufferGroup=function(t,e){var r=this.getGlProgram();if(!t.static||0!==t.dirtyId||!r.uniformGroups[t.id]){t.dirtyId=0;var i=r.uniformGroups[t.id]||this.createSyncBufferGroup(t,r,e);t.buffer.update(),i(r.uniformData,t.uniforms,this.renderer,pi,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,r.uniformBufferBindings[e])},ShaderSystem.prototype.createSyncBufferGroup=function(t,e,r){var i=this.renderer.gl;this.renderer.buffer.bind(t.buffer);var n=this.gl.getUniformBlockIndex(e.program,r);e.uniformBufferBindings[r]=this.shader.uniformBindCount,i.uniformBlockBinding(e.program,n,this.shader.uniformBindCount),this.shader.uniformBindCount++;var o=this.getSignature(t,this.shader.program.uniformData,"ubo"),s=this._uboCache[o];if(s||(s=this._uboCache[o]=generateUniformBufferSync(t,this.shader.program.uniformData)),t.autoManage){var a=new Float32Array(s.size/4);t.buffer.update(a)}return e.uniformGroups[t.id]=s.syncFunc,e.uniformGroups[t.id]},ShaderSystem.prototype.getSignature=function(t,e,r){var i=t.uniforms,n=[r+"-"];for(var o in i)n.push(o),e[o]&&n.push(e[o].type);return n.join("-")},ShaderSystem.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},ShaderSystem.prototype.generateProgram=function(t){var e=this.gl,r=t.program,i=generateProgram(e,r);return r.glPrograms[this.renderer.CONTEXT_UID]=i,i},ShaderSystem.prototype.reset=function(){this.program=null,this.shader=null},ShaderSystem.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},ShaderSystem}();var _i=function(){function StateSystem(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=st.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new qr,this.defaultState.blend=!0}return StateSystem.prototype.contextChange=function(t){this.gl=t,this.blendModes=function mapWebGLBlendModesToPixi(t,e){return void 0===e&&(e=[]),e[st.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.ADD]=[t.ONE,t.ONE],e[st.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.NONE]=[0,0],e[st.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[st.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[st.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[st.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[st.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[st.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[st.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[st.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[st.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[st.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[st.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()},StateSystem.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,r=0;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(r=0;r<this.checks.length;r++)this.checks[r](this,t)},StateSystem.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data},StateSystem.prototype.setBlend=function(t){this.updateCheck(StateSystem.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)},StateSystem.prototype.setOffset=function(t){this.updateCheck(StateSystem.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},StateSystem.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},StateSystem.prototype.setDepthMask=function(t){this.gl.depthMask(t)},StateSystem.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},StateSystem.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},StateSystem.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],r=this.gl;2===e.length?r.blendFunc(e[0],e[1]):r.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,r.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}},StateSystem.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},StateSystem.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},StateSystem.prototype.updateCheck=function(t,e){var r=this.checks.indexOf(t);e&&-1===r?this.checks.push(t):e||-1===r||this.checks.splice(r,1)},StateSystem.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},StateSystem.checkPolygonOffset=function(t,e){t.setPolygonOffset(1,e.polygonOffset)},StateSystem.prototype.destroy=function(){this.gl=null},StateSystem}(),mi=function(){function TextureGCSystem(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=J.GC_MAX_IDLE,this.checkCountMax=J.GC_MAX_CHECK_COUNT,this.mode=J.GC_MODE}return TextureGCSystem.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==yt.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},TextureGCSystem.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;i<e.length;i++){var n=e[i];!n.framebuffer&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){var o=0;for(i=0;i<e.length;i++)null!==e[i]&&(e[o++]=e[i]);e.length=o}},TextureGCSystem.prototype.unload=function(t){var e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(var i=t.children.length-1;i>=0;i--)this.unload(t.children[i])},TextureGCSystem.prototype.destroy=function(){this.renderer=null},TextureGCSystem}();var yi=function yi(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=lt.UNSIGNED_BYTE,this.internalFormat=ht.RGBA,this.samplerType=0},gi=function(){function TextureSystem(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Ye,this.hasIntegerTextures=!1}return TextureSystem.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function mapTypeAndFormatToInternalFormat(t){var e,r,i,n,o,s,a,h,u,l,c,d,p,f,_,m,y,g,v,T,E,x,b;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?((e={})[lt.UNSIGNED_BYTE]=((r={})[ht.RGBA]=t.RGBA8,r[ht.RGB]=t.RGB8,r[ht.RG]=t.RG8,r[ht.RED]=t.R8,r[ht.RGBA_INTEGER]=t.RGBA8UI,r[ht.RGB_INTEGER]=t.RGB8UI,r[ht.RG_INTEGER]=t.RG8UI,r[ht.RED_INTEGER]=t.R8UI,r[ht.ALPHA]=t.ALPHA,r[ht.LUMINANCE]=t.LUMINANCE,r[ht.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,r),e[lt.BYTE]=((i={})[ht.RGBA]=t.RGBA8_SNORM,i[ht.RGB]=t.RGB8_SNORM,i[ht.RG]=t.RG8_SNORM,i[ht.RED]=t.R8_SNORM,i[ht.RGBA_INTEGER]=t.RGBA8I,i[ht.RGB_INTEGER]=t.RGB8I,i[ht.RG_INTEGER]=t.RG8I,i[ht.RED_INTEGER]=t.R8I,i),e[lt.UNSIGNED_SHORT]=((n={})[ht.RGBA_INTEGER]=t.RGBA16UI,n[ht.RGB_INTEGER]=t.RGB16UI,n[ht.RG_INTEGER]=t.RG16UI,n[ht.RED_INTEGER]=t.R16UI,n[ht.DEPTH_COMPONENT]=t.DEPTH_COMPONENT16,n),e[lt.SHORT]=((o={})[ht.RGBA_INTEGER]=t.RGBA16I,o[ht.RGB_INTEGER]=t.RGB16I,o[ht.RG_INTEGER]=t.RG16I,o[ht.RED_INTEGER]=t.R16I,o),e[lt.UNSIGNED_INT]=((s={})[ht.RGBA_INTEGER]=t.RGBA32UI,s[ht.RGB_INTEGER]=t.RGB32UI,s[ht.RG_INTEGER]=t.RG32UI,s[ht.RED_INTEGER]=t.R32UI,s[ht.DEPTH_COMPONENT]=t.DEPTH_COMPONENT24,s),e[lt.INT]=((a={})[ht.RGBA_INTEGER]=t.RGBA32I,a[ht.RGB_INTEGER]=t.RGB32I,a[ht.RG_INTEGER]=t.RG32I,a[ht.RED_INTEGER]=t.R32I,a),e[lt.FLOAT]=((h={})[ht.RGBA]=t.RGBA32F,h[ht.RGB]=t.RGB32F,h[ht.RG]=t.RG32F,h[ht.RED]=t.R32F,h[ht.DEPTH_COMPONENT]=t.DEPTH_COMPONENT32F,h),e[lt.HALF_FLOAT]=((u={})[ht.RGBA]=t.RGBA16F,u[ht.RGB]=t.RGB16F,u[ht.RG]=t.RG16F,u[ht.RED]=t.R16F,u),e[lt.UNSIGNED_SHORT_5_6_5]=((l={})[ht.RGB]=t.RGB565,l),e[lt.UNSIGNED_SHORT_4_4_4_4]=((c={})[ht.RGBA]=t.RGBA4,c),e[lt.UNSIGNED_SHORT_5_5_5_1]=((d={})[ht.RGBA]=t.RGB5_A1,d),e[lt.UNSIGNED_INT_2_10_10_10_REV]=((p={})[ht.RGBA]=t.RGB10_A2,p[ht.RGBA_INTEGER]=t.RGB10_A2UI,p),e[lt.UNSIGNED_INT_10F_11F_11F_REV]=((f={})[ht.RGB]=t.R11F_G11F_B10F,f),e[lt.UNSIGNED_INT_5_9_9_9_REV]=((_={})[ht.RGB]=t.RGB9_E5,_),e[lt.UNSIGNED_INT_24_8]=((m={})[ht.DEPTH_STENCIL]=t.DEPTH24_STENCIL8,m),e[lt.FLOAT_32_UNSIGNED_INT_24_8_REV]=((y={})[ht.DEPTH_STENCIL]=t.DEPTH32F_STENCIL8,y),b=e):((g={})[lt.UNSIGNED_BYTE]=((v={})[ht.RGBA]=t.RGBA,v[ht.RGB]=t.RGB,v[ht.ALPHA]=t.ALPHA,v[ht.LUMINANCE]=t.LUMINANCE,v[ht.LUMINANCE_ALPHA]=t.LUMINANCE_ALPHA,v),g[lt.UNSIGNED_SHORT_5_6_5]=((T={})[ht.RGB]=t.RGB,T),g[lt.UNSIGNED_SHORT_4_4_4_4]=((E={})[ht.RGBA]=t.RGBA,E),g[lt.UNSIGNED_SHORT_5_5_5_1]=((x={})[ht.RGBA]=t.RGBA,x),b=g),b}(t);var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r<e;r++)this.boundTextures[r]=null;this.emptyTextures={};var i=new yi(t.createTexture());t.bindTexture(t.TEXTURE_2D,i.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=i,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new yi(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(r=0;r<6;r++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(r=0;r<this.boundTextures.length;r++)this.bind(null,r)},TextureSystem.prototype.bind=function(t,e){void 0===e&&(e=0);var r=this.gl;if((t=null==t?void 0:t.castToBaseTexture())&&t.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;var i=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(t.target,i.texture)),i.dirtyId!==t.dirtyId&&(this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),this.updateTexture(t)),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,r.activeTexture(r.TEXTURE0+e)),r.bindTexture(r.TEXTURE_2D,this.emptyTextures[r.TEXTURE_2D].texture),this.boundTextures[e]=null},TextureSystem.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},TextureSystem.prototype.unbind=function(t){var e=this.gl,r=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var i=0;i<r.length;i++)r[i]===this.unknownTexture&&this.bind(null,i)}for(i=0;i<r.length;i++)r[i]===t&&(this.currentLocation!==i&&(e.activeTexture(e.TEXTURE0+i),this.currentLocation=i),e.bindTexture(t.target,this.emptyTextures[t.target].texture),r[i]=null)},TextureSystem.prototype.ensureSamplerType=function(t){var e=this,r=e.boundTextures,i=e.hasIntegerTextures,n=e.CONTEXT_UID;if(i)for(var o=t-1;o>=0;--o){var s=r[o];if(s)s._glTextures[n].samplerType!==ct.FLOAT&&this.renderer.texture.unbind(s)}},TextureSystem.prototype.initTexture=function(t){var e=new yi(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},TextureSystem.prototype.initTextureType=function(t,e){var r,i;e.internalFormat=null!==(i=null===(r=this.internalFormats[t.type])||void 0===r?void 0:r[t.format])&&void 0!==i?i:t.format,2===this.webGLVersion&&t.type===lt.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type},TextureSystem.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var r=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(r,t,e))e.samplerType!==ct.FLOAT&&(this.hasIntegerTextures=!0);else{var i=t.realWidth,n=t.realHeight,o=r.gl;(e.width!==i||e.height!==n||e.dirtyId<0)&&(e.width=i,e.height=n,o.texImage2D(t.target,0,e.internalFormat,i,n,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},TextureSystem.prototype.destroyTexture=function(t,e){var r=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var i=this.managedTextures.indexOf(t);-1!==i&&removeItems(this.managedTextures,i,1)}},TextureSystem.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==ft.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=pt.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},TextureSystem.prototype.setStyle=function(t,e){var r=this.gl;if(e.mipmap&&t.mipmap!==ft.ON_MANUAL&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===dt.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===dt.LINEAR){var n=Math.min(t.anisotropicLevel,r.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY_EXT,n)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===dt.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===dt.LINEAR?r.LINEAR:r.NEAREST)},TextureSystem.prototype.destroy=function(){this.renderer=null},TextureSystem}(),vi=new zt,Ti=function(t){function AbstractRenderer(e,r){void 0===e&&(e=nt.UNKNOWN);var i=t.call(this)||this;return r=Object.assign({},J.RENDER_OPTIONS,r),i.options=r,i.type=e,i.screen=new kt(0,0,r.width,r.height),i.view=r.view||document.createElement("canvas"),i.resolution=r.resolution||J.RESOLUTION,i.useContextAlpha=r.useContextAlpha,i.autoDensity=!!r.autoDensity,i.preserveDrawingBuffer=r.preserveDrawingBuffer,i.clearBeforeRender=r.clearBeforeRender,i._backgroundColor=0,i._backgroundColorRgba=[0,0,0,1],i._backgroundColorString="#000000",i.backgroundColor=r.backgroundColor||i._backgroundColor,i.backgroundAlpha=r.backgroundAlpha,void 0!==r.transparent&&(deprecation("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),i.useContextAlpha=r.transparent,i.backgroundAlpha=r.transparent?0:1),i._lastObjectRendered=null,i.plugins={},i}return __extends$h(AbstractRenderer,t),AbstractRenderer.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(AbstractRenderer.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(AbstractRenderer.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),AbstractRenderer.prototype.resize=function(t,e){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(e*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)},AbstractRenderer.prototype.generateTexture=function(t,e,r,i){void 0===e&&(e={}),"number"==typeof e&&(deprecation("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),e={scaleMode:e,resolution:r,region:i});var n=e.region,o=function __rest(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&(r[i[n]]=t[i[n]])}return r}(e,["region"]);0===(i=n||t.getLocalBounds(null,!0)).width&&(i.width=1),0===i.height&&(i.height=1);var s=sr.create(__assign({width:i.width,height:i.height},o));return vi.tx=-i.x,vi.ty=-i.y,this.render(t,{renderTexture:s,clear:!1,transform:vi,skipUpdateTransform:!!t.parent}),s},AbstractRenderer.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var r=this;r.plugins=null,r.type=nt.UNKNOWN,r.view=null,r.screen=null,r._tempDisplayObjectParent=null,r.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(AbstractRenderer.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=hex2string(t),hex2rgb(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(AbstractRenderer.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),AbstractRenderer}(et),Ei=function Ei(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},xi=function(){function BufferSystem(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}return BufferSystem.prototype.destroy=function(){this.renderer=null},BufferSystem.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},BufferSystem.prototype.bind=function(t){var e=this.gl,r=this.CONTEXT_UID,i=t._glBuffers[r]||this.createGLBuffer(t);e.bindBuffer(t.type,i.buffer)},BufferSystem.prototype.bindBufferBase=function(t,e){var r=this.gl,i=this.CONTEXT_UID;if(this.boundBufferBases[e]!==t){var n=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,n.buffer)}},BufferSystem.prototype.bindBufferRange=function(t,e,r){var i=this.gl,n=this.CONTEXT_UID;r=r||0;var o=t._glBuffers[n]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,e||0,o.buffer,256*r,256)},BufferSystem.prototype.update=function(t){var e=this.gl,r=this.CONTEXT_UID,i=t._glBuffers[r];if(t._updateID!==i.updateID)if(i.updateID=t._updateID,e.bindBuffer(t.type,i.buffer),i.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{var n=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,n)}},BufferSystem.prototype.dispose=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var r=t._glBuffers[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this),r&&(e||i.deleteBuffer(r.buffer),delete t._glBuffers[this.CONTEXT_UID])}},BufferSystem.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedBuffers),r=0;r<e.length;r++)this.dispose(this.managedBuffers[e[r]],t)},BufferSystem.prototype.createGLBuffer=function(t){var e=this.CONTEXT_UID,r=this.gl;return t._glBuffers[e]=new Ei(r.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]},BufferSystem}(),bi=function(t){function Renderer(e){var r=t.call(this,nt.WEBGL,e)||this;return e=r.options,r.gl=null,r.CONTEXT_UID=0,r.runners={destroy:new Ue("destroy"),contextChange:new Ue("contextChange"),reset:new Ue("reset"),update:new Ue("update"),postrender:new Ue("postrender"),prerender:new Ue("prerender"),resize:new Ue("resize")},r.runners.contextChange.add(r),r.globalUniforms=new vr({projectionMatrix:new zt},!0),r.addSystem(ti,"mask").addSystem(Or,"context").addSystem(_i,"state").addSystem(fi,"shader").addSystem(gi,"texture").addSystem(xi,"buffer").addSystem(Nr,"geometry").addSystem(Mr,"framebuffer").addSystem(ii,"scissor").addSystem(ni,"stencil").addSystem(oi,"projection").addSystem(mi,"textureGC").addSystem(br,"filter").addSystem(hi,"renderTexture").addSystem(Sr,"batch"),r.initPlugins(Renderer.__plugins),r.multisample=void 0,e.context?r.context.initFromContext(e.context):r.context.initFromOptions({alpha:!!r.useContextAlpha,antialias:e.antialias,premultipliedAlpha:r.useContextAlpha&&"notMultiplied"!==r.useContextAlpha,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:r.options.powerPreference}),r.renderingToScreen=!0,function sayHello(t){var e;if(!St){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var r=["\n %c %c %c PixiJS 6.3.2 - ✰ "+t+" ✰ %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;"];(e=globalThis.console).log.apply(e,r)}else globalThis.console&&globalThis.console.log("PixiJS 6.3.2 - "+t+" - http://www.pixijs.com/");St=!0}}(2===r.context.webGLVersion?"WebGL 2":"WebGL 1"),r.resize(r.options.width,r.options.height),r}return __extends$h(Renderer,t),Renderer.create=function(t){if(function isWebGLSupported(){return void 0===Rt&&(Rt=function supported(){var t={stencil:!0,failIfMajorPerformanceCaveat:J.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}}()),Rt}())return new Renderer(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},Renderer.prototype.contextChange=function(){var t,e=this.gl;if(1===this.context.webGLVersion){var r=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,r)}else{r=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),t=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,r)}t>=Tt.HIGH?this.multisample=Tt.HIGH:t>=Tt.MEDIUM?this.multisample=Tt.MEDIUM:t>=Tt.LOW?this.multisample=Tt.LOW:this.multisample=Tt.NONE},Renderer.prototype.addSystem=function(t,e){var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},Renderer.prototype.render=function(t,e){var r,i,n,o;if(e&&(e instanceof sr?(deprecation("6.0.0","Renderer#render arguments changed, use options instead."),r=e,i=arguments[2],n=arguments[3],o=arguments[4]):(r=e.renderTexture,i=e.clear,n=e.transform,o=e.skipUpdateTransform)),this.renderingToScreen=!r,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,!this.context.isLost){if(r||(this._lastObjectRendered=t),!o){var s=t.enableTempParent();t.updateTransform(),t.disableTempParent(s)}this.renderTexture.bind(r),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),r&&r.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},Renderer.prototype.generateTexture=function(e,r,i,n){void 0===r&&(r={});var o=t.prototype.generateTexture.call(this,e,r,i,n);return this.framebuffer.blit(),o},Renderer.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.runners.resize.emit(this.screen.height,this.screen.width)},Renderer.prototype.reset=function(){return this.runners.reset.emit(),this},Renderer.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},Renderer.prototype.destroy=function(e){for(var r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();t.prototype.destroy.call(this,e),this.gl=null},Object.defineProperty(Renderer.prototype,"extract",{get:function(){return deprecation("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),Renderer.registerPlugin=function(t,e){Renderer.__plugins=Renderer.__plugins||{},Renderer.__plugins[t]=e},Renderer}(Ti);var Ri="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",Si=function Si(){this.texArray=null,this.blend=0,this.type=at.TRIANGLES,this.start=0,this.size=0,this.data=null},Ai=function(){function BatchTextureArray(){this.elements=[],this.ids=[],this.count=0}return BatchTextureArray.prototype.clear=function(){for(var t=0;t<this.count;t++)this.elements[t]=null;this.count=0},BatchTextureArray}(),Oi=function(){function ViewableBuffer(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(ViewableBuffer.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(ViewableBuffer.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(ViewableBuffer.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(ViewableBuffer.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(ViewableBuffer.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),ViewableBuffer.prototype.view=function(t){return this[t+"View"]},ViewableBuffer.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},ViewableBuffer.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},ViewableBuffer}(),Ii=function(t){function AbstractBatchRenderer(e){var r=t.call(this,e)||this;return r.shaderGenerator=null,r.geometryClass=null,r.vertexSize=null,r.state=qr.for2d(),r.size=4*J.SPRITE_BATCH_SIZE,r._vertexCount=0,r._indexCount=0,r._bufferedElements=[],r._bufferedTextures=[],r._bufferSize=0,r._shader=null,r._packedGeometries=[],r._packedGeometryPoolSize=2,r._flushId=0,r._aBuffers={},r._iBuffers={},r.MAX_TEXTURES=1,r.renderer.on("prerender",r.onPrerender,r),e.runners.contextChange.add(r),r._dcIndex=0,r._aIndex=0,r._iIndex=0,r._attributeBuffer=null,r._indexBuffer=null,r._tempBoundTextures=[],r}return __extends$h(AbstractBatchRenderer,t),AbstractBatchRenderer.prototype.contextChange=function(){var t=this.renderer.gl;J.PREFER_ENV===it.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),J.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=function checkMaxIfStatementsInShader(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var r=e.createShader(e.FRAGMENT_SHADER);;){var i=Yr.replace(/%forloop%/gi,generateIfTestSrc(t));if(e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()},AbstractBatchRenderer.prototype.initFlushBuffers=function(){for(var t=AbstractBatchRenderer._drawCallPool,e=AbstractBatchRenderer._textureArrayPool,r=this.size/4,i=Math.floor(r/this.MAX_TEXTURES)+1;t.length<r;)t.push(new Si);for(;e.length<i;)e.push(new Ai);for(var n=0;n<this.MAX_TEXTURES;n++)this._tempBoundTextures[n]=null},AbstractBatchRenderer.prototype.onPrerender=function(){this._flushId=0},AbstractBatchRenderer.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},AbstractBatchRenderer.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,e=this.MAX_TEXTURES,r=AbstractBatchRenderer._textureArrayPool,i=this.renderer.batch,n=this._tempBoundTextures,o=this.renderer.textureGC.count,s=++Ye._globalBatch,a=0,h=r[0],u=0;i.copyBoundTextures(n,e);for(var l=0;l<this._bufferSize;++l){var c=t[l];t[l]=null,c._batchEnabled!==s&&(h.count>=e&&(i.boundArray(h,n,s,e),this.buildDrawCalls(h,u,l),u=l,h=r[++a],++s),c._batchEnabled=s,c.touched=o,h.elements[h.count++]=c)}h.count>0&&(i.boundArray(h,n,s,e),this.buildDrawCalls(h,u,this._bufferSize),++a,++s);for(l=0;l<n.length;l++)n[l]=null;Ye._globalBatch=s},AbstractBatchRenderer.prototype.buildDrawCalls=function(t,e,r){var i=this,n=i._bufferedElements,o=i._attributeBuffer,s=i._indexBuffer,a=i.vertexSize,h=AbstractBatchRenderer._drawCallPool,u=this._dcIndex,l=this._aIndex,c=this._iIndex,d=h[u];d.start=this._iIndex,d.texArray=t;for(var p=e;p<r;++p){var f=n[p],_=f._texture.baseTexture,m=Ot[_.alphaMode?1:0][f.blendMode];n[p]=null,e<p&&d.blend!==m&&(d.size=c-d.start,e=p,(d=h[++u]).texArray=t,d.start=c),this.packInterleavedGeometry(f,o,s,l,c),l+=f.vertexData.length/2*a,c+=f.indices.length,d.blend=m}e<r&&(d.size=c-d.start,++u),this._dcIndex=u,this._aIndex=l,this._iIndex=c},AbstractBatchRenderer.prototype.bindAndClearTexArray=function(t){for(var e=this.renderer.texture,r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0},AbstractBatchRenderer.prototype.updateGeometry=function(){var t=this,e=t._packedGeometries,r=t._attributeBuffer,i=t._indexBuffer;J.CAN_UPLOAD_SAME_BUFFER?(e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(i),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(i),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},AbstractBatchRenderer.prototype.drawBatches=function(){for(var t=this._dcIndex,e=this.renderer,r=e.gl,i=e.state,n=AbstractBatchRenderer._drawCallPool,o=null,s=0;s<t;s++){var a=n[s],h=a.texArray,u=a.type,l=a.size,c=a.start,d=a.blend;o!==h&&(o=h,this.bindAndClearTexArray(h)),this.state.blendMode=d,i.set(this.state),r.drawElements(u,l,r.UNSIGNED_SHORT,2*c)}},AbstractBatchRenderer.prototype.flush=function(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},AbstractBatchRenderer.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),J.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},AbstractBatchRenderer.prototype.stop=function(){this.flush()},AbstractBatchRenderer.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),t.prototype.destroy.call(this)},AbstractBatchRenderer.prototype.getAttributeBuffer=function(t){var e=nextPow2(Math.ceil(t/8)),r=log2(e),i=8*e;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);var n=this._aBuffers[i];return n||(this._aBuffers[i]=n=new Oi(i*this.vertexSize*4)),n},AbstractBatchRenderer.prototype.getIndexBuffer=function(t){var e=nextPow2(Math.ceil(t/12)),r=log2(e),i=12*e;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);var n=this._iBuffers[r];return n||(this._iBuffers[r]=n=new Uint16Array(i)),n},AbstractBatchRenderer.prototype.packInterleavedGeometry=function(t,e,r,i,n){for(var o=e.uint32View,s=e.float32View,a=i/this.vertexSize,h=t.uvs,u=t.indices,l=t.vertexData,c=t._texture.baseTexture._batchLocation,d=Math.min(t.worldAlpha,1),p=d<1&&t._texture.baseTexture.alphaMode?premultiplyTint(t._tintRGB,d):t._tintRGB+(255*d<<24),f=0;f<l.length;f+=2)s[i++]=l[f],s[i++]=l[f+1],s[i++]=h[f],s[i++]=h[f+1],o[i++]=p,s[i++]=c;for(f=0;f<u.length;f++)r[n++]=a+u[f]},AbstractBatchRenderer._drawCallPool=[],AbstractBatchRenderer._textureArrayPool=[],AbstractBatchRenderer}(Rr),Pi=function(){function BatchShaderGenerator(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return BatchShaderGenerator.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),r=0;r<t;r++)e[r]=r;this.defaultGroupCache[t]=vr.from({uSamplers:e},!0);var i=this.fragTemplate;i=(i=i.replace(/%count%/gi,""+t)).replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new zr(this.vertexSrc,i)}var n={tint:new Float32Array([1,1,1,1]),translationMatrix:new zt,default:this.defaultGroupCache[t]};return new Kr(this.programCache[t],n)},BatchShaderGenerator.prototype.generateSampleSrc=function(t){var e="";e+="\n",e+="\n";for(var r=0;r<t;r++)r>0&&(e+="\nelse "),r<t-1&&(e+="if(vTextureId < "+r+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+r+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"},BatchShaderGenerator}(),Mi=function(t){function BatchGeometry(e){void 0===e&&(e=!1);var r=t.call(this)||this;return r._buffer=new lr(null,e,!1),r._indexBuffer=new lr(null,e,!0),r.addAttribute("aVertexPosition",r._buffer,2,!1,lt.FLOAT).addAttribute("aTextureCoord",r._buffer,2,!1,lt.FLOAT).addAttribute("aColor",r._buffer,4,!0,lt.UNSIGNED_BYTE).addAttribute("aTextureId",r._buffer,1,!0,lt.FLOAT).addIndex(r._indexBuffer),r}return __extends$h(BatchGeometry,t),BatchGeometry}(_r),Di="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",Ni="varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\n",Ci=function(){function BatchPluginFactory(){}return BatchPluginFactory.create=function(t){var e=Object.assign({vertex:Di,fragment:Ni,geometryClass:Mi,vertexSize:6},t),r=e.vertex,i=e.fragment,n=e.vertexSize,o=e.geometryClass;return function(t){function BatchPlugin(e){var s=t.call(this,e)||this;return s.shaderGenerator=new Pi(r,i),s.geometryClass=o,s.vertexSize=n,s}return __extends$h(BatchPlugin,t),BatchPlugin}(Ii)},Object.defineProperty(BatchPluginFactory,"defaultVertexSrc",{get:function(){return Di},enumerable:!1,configurable:!0}),Object.defineProperty(BatchPluginFactory,"defaultFragmentTemplate",{get:function(){return Ni},enumerable:!1,configurable:!0}),BatchPluginFactory}(),wi=Ci.create(),Li=function(){function Application(t){var e=this;this.stage=new Se,t=Object.assign({forceCanvas:!1},t),this.renderer=function autoDetectRenderer(t){return bi.create(t)}(t),Application._plugins.forEach((function(r){r.init.call(e,t)}))}return Application.registerPlugin=function(t){Application._plugins.push(t)},Application.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(Application.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(Application.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),Application.prototype.destroy=function(t,e){var r=this,i=Application._plugins.slice(0);i.reverse(),i.forEach((function(t){t.destroy.call(r)})),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null},Application._plugins=[],Application}(),Fi=function(){function ResizePlugin(){}return ResizePlugin.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){e._resizeTo&&(e.cancelResize(),e._resizeId=requestAnimationFrame((function(){return e.resize()})))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(e._resizeTo){var t,r;if(e.cancelResize(),e._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{var i=e._resizeTo;t=i.clientWidth,r=i.clientHeight}e.renderer.resize(t,r)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null},ResizePlugin.destroy=function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},ResizePlugin}();Li.registerPlugin(Fi);
97
+ /*!
98
+ * @pixi/extract - v6.3.2
99
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
100
+ *
101
+ * @pixi/extract is licensed under the MIT License.
102
+ * http://www.opensource.org/licenses/mit-license
103
+ */
104
+ var Bi=new kt,Gi=function(){function Extract(t){this.renderer=t}return Extract.prototype.image=function(t,e,r){var i=new Image;return i.src=this.base64(t,e,r),i},Extract.prototype.base64=function(t,e,r){return this.canvas(t).toDataURL(e,r)},Extract.prototype.canvas=function(t){var e,r,i,n=this.renderer,o=!1,s=!1;t&&(t instanceof sr?i=t:(i=this.renderer.generateTexture(t),s=!0)),i?(e=i.baseTexture.resolution,r=i.frame,o=!1,n.renderTexture.bind(i)):(e=this.renderer.resolution,o=!0,(r=Bi).width=this.renderer.width,r.height=this.renderer.height,n.renderTexture.bind(null));var a=Math.floor(r.width*e+1e-4),h=Math.floor(r.height*e+1e-4),u=new wt(a,h,1),l=new Uint8Array(4*a*h),c=n.gl;c.readPixels(r.x*e,r.y*e,a,h,c.RGBA,c.UNSIGNED_BYTE,l);var d=u.context.getImageData(0,0,a,h);if(Extract.arrayPostDivide(l,d.data),u.context.putImageData(d,0,0),o){var p=new wt(u.width,u.height,1);p.context.scale(1,-1),p.context.drawImage(u.canvas,0,-h),u.destroy(),u=p}return s&&i.destroy(!0),u.canvas},Extract.prototype.pixels=function(t){var e,r,i,n=this.renderer,o=!1;t&&(t instanceof sr?i=t:(i=this.renderer.generateTexture(t),o=!0)),i?(e=i.baseTexture.resolution,r=i.frame,n.renderTexture.bind(i)):(e=n.resolution,(r=Bi).width=n.width,r.height=n.height,n.renderTexture.bind(null));var s=r.width*e,a=r.height*e,h=new Uint8Array(4*s*a),u=n.gl;return u.readPixels(r.x*e,r.y*e,s,a,u.RGBA,u.UNSIGNED_BYTE,h),o&&i.destroy(!0),Extract.arrayPostDivide(h,h),h},Extract.prototype.destroy=function(){this.renderer=null},Extract.arrayPostDivide=function(t,e){for(var r=0;r<t.length;r+=4){var i=e[r+3]=t[r+3];0!==i?(e[r]=Math.round(Math.min(255*t[r]/i,255)),e[r+1]=Math.round(Math.min(255*t[r+1]/i,255)),e[r+2]=Math.round(Math.min(255*t[r+2]/i,255))):(e[r]=t[r],e[r+1]=t[r+1],e[r+2]=t[r+2])}},Extract}(),Ui=function(){function SignalBinding(t,e,r){void 0===e&&(e=!1),this._fn=t,this._once=e,this._thisArg=r,this._next=this._prev=this._owner=null}return SignalBinding.prototype.detach=function(){return null!==this._owner&&(this._owner.detach(this),!0)},SignalBinding}();function _addSignalBinding(t,e){return t._head?(t._tail._next=e,e._prev=t._tail,t._tail=e):(t._head=e,t._tail=e),e._owner=t,e}var Xi,ki=function(){function Signal(){this._head=this._tail=void 0}return Signal.prototype.handlers=function(t){void 0===t&&(t=!1);var e=this._head;if(t)return!!e;for(var r=[];e;)r.push(e),e=e._next;return r},Signal.prototype.has=function(t){if(!(t instanceof Ui))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return t._owner===this},Signal.prototype.dispatch=function(){for(var t=arguments,e=[],r=0;r<arguments.length;r++)e[r]=t[r];var i=this._head;if(!i)return!1;for(;i;)i._once&&this.detach(i),i._fn.apply(i._thisArg,e),i=i._next;return!0},Signal.prototype.add=function(t,e){if(void 0===e&&(e=null),"function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return _addSignalBinding(this,new Ui(t,!1,e))},Signal.prototype.once=function(t,e){if(void 0===e&&(e=null),"function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return _addSignalBinding(this,new Ui(t,!0,e))},Signal.prototype.detach=function(t){if(!(t instanceof Ui))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return t._owner!==this||(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null),this},Signal.prototype.detachAll=function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this},Signal}();function parseUri(t,e){e=e||{};for(var r={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=r.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=14;o--;)n[r.key[o]]=i[o]||"";return n[r.q.name]={},n[r.key[12]].replace(r.q.parser,(function(t,e,i){e&&(n[r.q.name][e]=i)})),n}var Hi=null;function _noop$1(){}function setExtMap(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function reqType(t){return t.toString().replace("object ","")}var ji=function(){function LoaderResource(t,e,r){if(this._dequeue=_noop$1,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,"string"!=typeof t||"string"!=typeof e)throw new Error("Both name and url are required for constructing a resource.");r=r||{},this._flags=0,this._setFlag(LoaderResource.STATUS_FLAGS.DATA_URL,0===e.indexOf("data:")),this.name=t,this.url=e,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===r.crossOrigin?"anonymous":r.crossOrigin,this.timeout=r.timeout||0,this.loadType=r.loadType||this._determineLoadType(),this.xhrType=r.xhrType,this.metadata=r.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=LoaderResource.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=_noop$1,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new ki,this.onProgress=new ki,this.onComplete=new ki,this.onAfterMiddleware=new ki}return LoaderResource.setExtensionLoadType=function(t,e){setExtMap(LoaderResource._loadTypeMap,t,e)},LoaderResource.setExtensionXhrType=function(t,e){setExtMap(LoaderResource._xhrTypeMap,t,e)},Object.defineProperty(LoaderResource.prototype,"isDataUrl",{get:function(){return this._hasFlag(LoaderResource.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(LoaderResource.prototype,"isComplete",{get:function(){return this._hasFlag(LoaderResource.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(LoaderResource.prototype,"isLoading",{get:function(){return this._hasFlag(LoaderResource.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),LoaderResource.prototype.complete=function(){this._clearEvents(),this._finish()},LoaderResource.prototype.abort=function(t){if(!this.error){if(this.error=new Error(t),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=LoaderResource.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},LoaderResource.prototype.load=function(t){var e=this;if(!this.isLoading)if(this.isComplete)t&&setTimeout((function(){return t(e)}),1);else switch(t&&this.onComplete.once(t),this._setFlag(LoaderResource.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case LoaderResource.LOAD_TYPE.IMAGE:this.type=LoaderResource.TYPE.IMAGE,this._loadElement("image");break;case LoaderResource.LOAD_TYPE.AUDIO:this.type=LoaderResource.TYPE.AUDIO,this._loadSourceElement("audio");break;case LoaderResource.LOAD_TYPE.VIDEO:this.type=LoaderResource.TYPE.VIDEO,this._loadSourceElement("video");break;case LoaderResource.LOAD_TYPE.XHR:default:void 0===Xi&&(Xi=!(!globalThis.XDomainRequest||"withCredentials"in new XMLHttpRequest)),Xi&&this.crossOrigin?this._loadXdr():this._loadXhr()}},LoaderResource.prototype._hasFlag=function(t){return!!(this._flags&t)},LoaderResource.prototype._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},LoaderResource.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},LoaderResource.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(LoaderResource.STATUS_FLAGS.COMPLETE,!0),this._setFlag(LoaderResource.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},LoaderResource.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==globalThis.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},LoaderResource.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==globalThis.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,r=0;r<this.url.length;++r)this.data.appendChild(this._createSource(t,this.url[r],Array.isArray(e)?e[r]:e));else{e=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(e)?e[0]:e))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},LoaderResource.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XMLHttpRequest;"use-credentials"===this.crossOrigin&&(t.withCredentials=!0),t.open("GET",this.url,!0),t.timeout=this.timeout,this.xhrType===LoaderResource.XHR_RESPONSE_TYPE.JSON||this.xhrType===LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT?t.responseType=LoaderResource.XHR_RESPONSE_TYPE.TEXT:t.responseType=this.xhrType,t.addEventListener("error",this._boundXhrOnError,!1),t.addEventListener("timeout",this._boundXhrOnTimeout,!1),t.addEventListener("abort",this._boundXhrOnAbort,!1),t.addEventListener("progress",this._boundOnProgress,!1),t.addEventListener("load",this._boundXhrOnLoad,!1),t.send()},LoaderResource.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new globalThis.XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout((function(){return t.send()}),1)},LoaderResource.prototype._createSource=function(t,e,r){r||(r=t+"/"+this._getExtension(e));var i=document.createElement("source");return i.src=e,i.type=r,i},LoaderResource.prototype._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},LoaderResource.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},LoaderResource.prototype._onTimeout=function(){this.abort("Load timed out.")},LoaderResource.prototype._xhrOnError=function(){var t=this.xhr;this.abort(reqType(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},LoaderResource.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(reqType(t)+" Request timed out.")},LoaderResource.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(reqType(t)+" Request was aborted by the user.")},LoaderResource.prototype._xhrOnLoad=function(){var t=this.xhr,e="",r=void 0===t.status?200:t.status;if(""!==t.responseType&&"text"!==t.responseType&&void 0!==t.responseType||(e=t.responseText),0===r&&(e.length>0||t.responseType===LoaderResource.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===LoaderResource.XHR_RESPONSE_TYPE.TEXT)this.data=e,this.type=LoaderResource.TYPE.TEXT;else if(this.xhrType===LoaderResource.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(e),this.type=LoaderResource.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var i=new DOMParser;this.data=i.parseFromString(e,"text/xml")}else{var n=document.createElement("div");n.innerHTML=e,this.data=n}this.type=LoaderResource.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=t.response||e;this.complete()}else this.abort("["+t.status+"] "+t.statusText+": "+t.responseURL)},LoaderResource.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";e=e||globalThis.location,Hi||(Hi=document.createElement("a")),Hi.href=t;var r=parseUri(Hi.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"},LoaderResource.prototype._determineXhrType=function(){return LoaderResource._xhrTypeMap[this.extension]||LoaderResource.XHR_RESPONSE_TYPE.TEXT},LoaderResource.prototype._determineLoadType=function(){return LoaderResource._loadTypeMap[this.extension]||LoaderResource.LOAD_TYPE.XHR},LoaderResource.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("#"),o=Math.min(i>-1?i:t.length,n>-1?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},LoaderResource.prototype._getMimeFromXhrType=function(t){switch(t){case LoaderResource.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case LoaderResource.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case LoaderResource.XHR_RESPONSE_TYPE.JSON:return"application/json";case LoaderResource.XHR_RESPONSE_TYPE.DEFAULT:case LoaderResource.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},LoaderResource}();function _noop(){}function onlyOnce(t){return function onceWrapper(){for(var e=arguments,r=[],i=0;i<arguments.length;i++)r[i]=e[i];if(null===t)throw new Error("Callback was already called.");var n=t;t=null,n.apply(this,r)}}!function(t){var e,r,i,n;(e=t.STATUS_FLAGS||(t.STATUS_FLAGS={}))[e.NONE=0]="NONE",e[e.DATA_URL=1]="DATA_URL",e[e.COMPLETE=2]="COMPLETE",e[e.LOADING=4]="LOADING",(r=t.TYPE||(t.TYPE={}))[r.UNKNOWN=0]="UNKNOWN",r[r.JSON=1]="JSON",r[r.XML=2]="XML",r[r.IMAGE=3]="IMAGE",r[r.AUDIO=4]="AUDIO",r[r.VIDEO=5]="VIDEO",r[r.TEXT=6]="TEXT",(i=t.LOAD_TYPE||(t.LOAD_TYPE={}))[i.XHR=1]="XHR",i[i.IMAGE=2]="IMAGE",i[i.AUDIO=3]="AUDIO",i[i.VIDEO=4]="VIDEO",(n=t.XHR_RESPONSE_TYPE||(t.XHR_RESPONSE_TYPE={})).DEFAULT="text",n.BUFFER="arraybuffer",n.BLOB="blob",n.DOCUMENT="document",n.JSON="json",n.TEXT="text",t._loadTypeMap={gif:t.LOAD_TYPE.IMAGE,png:t.LOAD_TYPE.IMAGE,bmp:t.LOAD_TYPE.IMAGE,jpg:t.LOAD_TYPE.IMAGE,jpeg:t.LOAD_TYPE.IMAGE,tif:t.LOAD_TYPE.IMAGE,tiff:t.LOAD_TYPE.IMAGE,webp:t.LOAD_TYPE.IMAGE,tga:t.LOAD_TYPE.IMAGE,svg:t.LOAD_TYPE.IMAGE,"svg+xml":t.LOAD_TYPE.IMAGE,mp3:t.LOAD_TYPE.AUDIO,ogg:t.LOAD_TYPE.AUDIO,wav:t.LOAD_TYPE.AUDIO,mp4:t.LOAD_TYPE.VIDEO,webm:t.LOAD_TYPE.VIDEO},t._xhrTypeMap={xhtml:t.XHR_RESPONSE_TYPE.DOCUMENT,html:t.XHR_RESPONSE_TYPE.DOCUMENT,htm:t.XHR_RESPONSE_TYPE.DOCUMENT,xml:t.XHR_RESPONSE_TYPE.DOCUMENT,tmx:t.XHR_RESPONSE_TYPE.DOCUMENT,svg:t.XHR_RESPONSE_TYPE.DOCUMENT,tsx:t.XHR_RESPONSE_TYPE.DOCUMENT,gif:t.XHR_RESPONSE_TYPE.BLOB,png:t.XHR_RESPONSE_TYPE.BLOB,bmp:t.XHR_RESPONSE_TYPE.BLOB,jpg:t.XHR_RESPONSE_TYPE.BLOB,jpeg:t.XHR_RESPONSE_TYPE.BLOB,tif:t.XHR_RESPONSE_TYPE.BLOB,tiff:t.XHR_RESPONSE_TYPE.BLOB,webp:t.XHR_RESPONSE_TYPE.BLOB,tga:t.XHR_RESPONSE_TYPE.BLOB,json:t.XHR_RESPONSE_TYPE.JSON,text:t.XHR_RESPONSE_TYPE.TEXT,txt:t.XHR_RESPONSE_TYPE.TEXT,ttf:t.XHR_RESPONSE_TYPE.BUFFER,otf:t.XHR_RESPONSE_TYPE.BUFFER},t.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="}(ji);var Yi=function Yi(t,e){this.data=t,this.callback=e},Vi=function(){function AsyncQueue(t,e){var r=this;if(void 0===e&&(e=1),this.workers=0,this.saturated=_noop,this.unsaturated=_noop,this.empty=_noop,this.drain=_noop,this.error=_noop,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(t,e,i){if(i&&"function"!=typeof i)throw new Error("task callback must be a function");if(r.started=!0,null==t&&r.idle())setTimeout((function(){return r.drain()}),1);else{var n=new Yi(t,"function"==typeof i?i:_noop);e?r._tasks.unshift(n):r._tasks.push(n),setTimeout(r.process,1)}},this.process=function(){for(;!r.paused&&r.workers<r.concurrency&&r._tasks.length;){var t=r._tasks.shift();0===r._tasks.length&&r.empty(),r.workers+=1,r.workers===r.concurrency&&r.saturated(),r._worker(t.data,onlyOnce(r._next(t)))}},this._worker=t,0===e)throw new Error("Concurrency must not be zero");this.concurrency=e,this.buffer=e/4}return AsyncQueue.prototype._next=function(t){var e=this;return function(){for(var r=arguments,i=[],n=0;n<arguments.length;n++)i[n]=r[n];e.workers-=1,t.callback.apply(t,i),null!=i[0]&&e.error(i[0],t.data),e.workers<=e.concurrency-e.buffer&&e.unsaturated(),e.idle()&&e.drain(),e.process()}},AsyncQueue.prototype.push=function(t,e){this._insert(t,!1,e)},AsyncQueue.prototype.kill=function(){this.workers=0,this.drain=_noop,this.started=!1,this._tasks=[]},AsyncQueue.prototype.unshift=function(t,e){this._insert(t,!0,e)},AsyncQueue.prototype.length=function(){return this._tasks.length},AsyncQueue.prototype.running=function(){return this.workers},AsyncQueue.prototype.idle=function(){return this._tasks.length+this.workers===0},AsyncQueue.prototype.pause=function(){!0!==this.paused&&(this.paused=!0)},AsyncQueue.prototype.resume=function(){if(!1!==this.paused){this.paused=!1;for(var t=1;t<=this.concurrency;t++)this.process()}},AsyncQueue.eachSeries=function(t,e,r,i){var n=0,o=t.length;!function next(s){s||n===o?r&&r(s):i?setTimeout((function(){e(t[n++],next)}),1):e(t[n++],next)}()},AsyncQueue.queue=function(t,e){return new AsyncQueue(t,e)},AsyncQueue}(),Wi=/(#[\w-]+)?$/,zi=function(){function Loader(t,e){var r=this;void 0===t&&(t=""),void 0===e&&(e=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return r._loadResource(t,e)},this.resources={},this.baseUrl=t,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return r._loadResource(t,e)},this._queue=Vi.queue(this._boundLoadResource,e),this._queue.pause(),this.resources={},this.onProgress=new ki,this.onError=new ki,this.onLoad=new ki,this.onStart=new ki,this.onComplete=new ki;for(var i=0;i<Loader._plugins.length;++i){var n=Loader._plugins[i],o=n.pre,s=n.use;o&&this.pre(o),s&&this.use(s)}this._protected=!1}return Loader.prototype._add=function(t,e,r,i){if(this.loading&&(!r||!r.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new ji(t,e,r),"function"==typeof i&&this.resources[t].onAfterMiddleware.once(i),this.loading){for(var n=r.parentResource,o=[],s=0;s<n.children.length;++s)n.children[s].isComplete||o.push(n.children[s]);var a=n.progressChunk*(o.length+1)/(o.length+2);n.children.push(this.resources[t]),n.progressChunk=a;for(s=0;s<o.length;++s)o[s].progressChunk=a;this.resources[t].progressChunk=a}return this._queue.push(this.resources[t]),this},Loader.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},Loader.prototype.use=function(t){return this._afterMiddleware.push(t),this},Loader.prototype.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort("loader reset")}return this.resources={},this},Loader.prototype.load=function(t){if("function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=100/this._queue._tasks.length,r=0;r<this._queue._tasks.length;++r)this._queue._tasks[r].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},Object.defineProperty(Loader.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t},enumerable:!1,configurable:!0}),Loader.prototype._prepareUrl=function(t){var e,r=parseUri(t,{strictMode:!0});if(e=r.protocol||!r.path||0===t.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t,this.defaultQueryString){var i=Wi.exec(e)[0];-1!==(e=e.slice(0,e.length-i.length)).indexOf("?")?e+="&"+this.defaultQueryString:e+="?"+this.defaultQueryString,e+=i}return e},Loader.prototype._loadResource=function(t,e){var r=this;t._dequeue=e,Vi.eachSeries(this._beforeMiddleware,(function(e,i){e.call(r,t,(function(){i(t.isComplete?{}:null)}))}),(function(){t.isComplete?r._onLoad(t):(t._onLoadBinding=t.onComplete.once(r._onLoad,r),t.load())}),!0)},Loader.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},Loader.prototype._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},Loader.prototype._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),Vi.eachSeries(this._afterMiddleware,(function(r,i){r.call(e,t,i)}),(function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(100,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&0===e._resourcesParsing.length&&e._onComplete()}),!0)},Loader.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(Loader,"shared",{get:function(){var t=Loader._shared;return t||((t=new Loader)._protected=!0,Loader._shared=t),t},enumerable:!1,configurable:!0}),Loader.registerPlugin=function(t){return Loader._plugins.push(t),t.add&&t.add(),Loader},Loader._plugins=[],Loader}();zi.prototype.add=function add(t,e,r,i){if(Array.isArray(t)){for(var n=0;n<t.length;++n)this.add(t[n]);return this}if("object"==typeof t&&(r=t,i=e||r.callback||r.onComplete,e=r.url,t=r.name||r.key||r.url),"string"!=typeof e&&(i=r,r=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");return"function"==typeof r&&(i=r,r=null),this._add(t,e,r,i)};var Ki,qi,$i=function(){function AppLoaderPlugin(){}return AppLoaderPlugin.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?zi.shared:new zi},AppLoaderPlugin.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},AppLoaderPlugin}(),Zi=function(){function TextureLoader(){}return TextureLoader.add=function(){ji.setExtensionLoadType("svg",ji.LOAD_TYPE.XHR),ji.setExtensionXhrType("svg",ji.XHR_RESPONSE_TYPE.TEXT)},TextureLoader.use=function(t,e){if(!t.data||t.type!==ji.TYPE.IMAGE&&"svg"!==t.extension)e();else{var r=t.data,i=t.url,n=t.name,o=t.metadata;or.fromLoader(r,i,n,o).then((function(r){t.texture=r,e()})).catch(e)}},TextureLoader}(),Qi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";zi.registerPlugin({use:function parsing(t,e){if(t.data){if(t.xhr&&t.xhrType===ji.XHR_RESPONSE_TYPE.BLOB)if(self.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var r=globalThis.URL||globalThis.webkitURL,i=r.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=i,t.type=ji.TYPE.IMAGE,void(t.data.onload=function(){r.revokeObjectURL(i),t.data.onload=null,e()})}}else{var n=t.xhr.getResponseHeader("content-type");if(n&&0===n.indexOf("image"))return t.data=new Image,t.data.src="data:"+n+";base64,"+function encodeBinary(t){for(var e="",r=0;r<t.length;){for(var i=[0,0,0],n=[0,0,0,0],o=0;o<i.length;++o)r<t.length?i[o]=255&t.charCodeAt(r++):i[o]=0;switch(n[0]=i[0]>>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(o=0;o<n.length;++o)e+=Qi.charAt(n[o])}return e}(t.xhr.responseText),t.type=ji.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}}),zi.registerPlugin(Zi),function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL"}(qi||(qi={}));var Ji=((Ki={})[qi.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,Ki[qi.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,Ki[qi.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,Ki[qi.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,Ki[qi.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,Ki[qi.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,Ki[qi.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,Ki[qi.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,Ki[qi.COMPRESSED_R11_EAC]=.5,Ki[qi.COMPRESSED_SIGNED_R11_EAC]=.5,Ki[qi.COMPRESSED_RG11_EAC]=1,Ki[qi.COMPRESSED_SIGNED_RG11_EAC]=1,Ki[qi.COMPRESSED_RGB8_ETC2]=.5,Ki[qi.COMPRESSED_RGBA8_ETC2_EAC]=1,Ki[qi.COMPRESSED_SRGB8_ETC2]=.5,Ki[qi.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,Ki[qi.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,Ki[qi.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,Ki[qi.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,Ki[qi.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,Ki[qi.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,Ki[qi.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,Ki[qi.COMPRESSED_RGB_ETC1_WEBGL]=.5,Ki[qi.COMPRESSED_RGB_ATC_WEBGL]=.5,Ki[qi.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,Ki[qi.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,Ki),extendStatics$g=function(t,e){return extendStatics$g=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])},extendStatics$g(t,e)};
105
+ /*! *****************************************************************************
106
+ Copyright (c) Microsoft Corporation. All rights reserved.
107
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
108
+ this file except in compliance with the License. You may obtain a copy of the
109
+ License at http://www.apache.org/licenses/LICENSE-2.0
110
+
111
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
112
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
113
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
114
+ MERCHANTABLITY OR NON-INFRINGEMENT.
115
+
116
+ See the Apache Version 2.0 License for specific language governing permissions
117
+ and limitations under the License.
118
+ ***************************************************************************** */function __extends$g(t,e){function __(){this.constructor=t}extendStatics$g(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}function __generator(t,e){var r,i,n,o,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(a){return function step(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var tn,en,rn=function(t){function BlobResource(e,r){void 0===r&&(r={width:1,height:1,autoLoad:!0});var i,n,o=this;return"string"==typeof e?(i=e,n=new Uint8Array):(i=null,n=e),(o=t.call(this,n,r)||this).origin=i,o.buffer=n?new Oi(n):null,o.origin&&!1!==r.autoLoad&&o.load(),n&&n.length&&(o.loaded=!0,o.onBlobLoaded(o.buffer.rawBinaryData)),o}return __extends$g(BlobResource,t),BlobResource.prototype.onBlobLoaded=function(t){},BlobResource.prototype.load=function(){return function __awaiter(t,e,r,i){return new(r||(r=Promise))((function(e,n){function fulfilled(t){try{step(i.next(t))}catch(t){n(t)}}function rejected(t){try{step(i.throw(t))}catch(t){n(t)}}function step(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(fulfilled,rejected)}step((i=i.apply(t,[])).next())}))}(this,0,Promise,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,fetch(this.origin)];case 1:return[4,e.sent().blob()];case 2:return[4,e.sent().arrayBuffer()];case 3:return t=e.sent(),this.data=new Uint32Array(t),this.buffer=new Oi(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),[2,this]}}))}))},BlobResource}(He),nn=function(t){function CompressedTextureResource(e,r){var i=t.call(this,e,r)||this;return i.format=r.format,i.levels=r.levels||1,i._width=r.width,i._height=r.height,i._extension=CompressedTextureResource._formatToExtension(i.format),(r.levelBuffers||i.buffer)&&(i._levelBuffers=r.levelBuffers||CompressedTextureResource._createLevelBuffers(e instanceof Uint8Array?e:i.buffer.uint8View,i.format,i.levels,4,4,i.width,i.height)),i}return __extends$g(CompressedTextureResource,t),CompressedTextureResource.prototype.upload=function(t,e,r){var i=t.gl;if(!t.context.extensions[this._extension])throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var n=0,o=this.levels;n<o;n++){var s=this._levelBuffers[n],a=s.levelID,h=s.levelWidth,u=s.levelHeight,l=s.levelBuffer;i.compressedTexImage2D(i.TEXTURE_2D,a,this.format,h,u,0,l)}return!0},CompressedTextureResource.prototype.onBlobLoaded=function(){this._levelBuffers=CompressedTextureResource._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},CompressedTextureResource._formatToExtension=function(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},CompressedTextureResource._createLevelBuffers=function(t,e,r,i,n,o,s){for(var a=new Array(r),h=t.byteOffset,u=o,l=s,c=u+i-1&~(i-1),d=l+n-1&~(n-1),p=c*d*Ji[e],f=0;f<r;f++)a[f]={levelID:f,levelWidth:r>1?u:c,levelHeight:r>1?l:d,levelBuffer:new Uint8Array(t.buffer,h,p)},h+=p,p=(c=(u=u>>1||1)+i-1&~(i-1))*(d=(l=l>>1||1)+n-1&~(n-1))*Ji[e];return a},CompressedTextureResource}(rn),sn=function(){function CompressedTextureLoader(){}return CompressedTextureLoader.use=function(t,e){var r=t.data;if(t.type===ji.TYPE.JSON&&r&&r.cacheID&&r.textures){for(var i=r.textures,n=void 0,o=void 0,s=0,a=i.length;s<a;s++){var h=i[s],u=h.src,l=h.format;if(l||(o=u),CompressedTextureLoader.textureFormats[l]){n=u;break}}if(!(n=n||o))return void e(new Error("Cannot load compressed-textures in "+t.url+", make sure you provide a fallback"));if(n===t.url)return void e(new Error("URL of compressed texture cannot be the same as the manifest's URL"));var c={crossOrigin:t.crossOrigin,metadata:t.metadata.imageMetadata,parentResource:t},d=bt.resolve(t.url.replace(this.baseUrl,""),n),p=r.cacheID;this.add(p,d,c,(function(r){if(r.error)e(r.error);else{var i=r.texture,n=void 0===i?null:i,o=r.textures,s=void 0===o?{}:o;Object.assign(t,{texture:n,textures:s}),e()}}))}else e()},Object.defineProperty(CompressedTextureLoader,"textureExtensions",{get:function(){if(!CompressedTextureLoader._textureExtensions){var t=document.createElement("canvas").getContext("webgl");if(!t)return console.warn("WebGL not available for compressed textures. Silently failing."),{};var e={s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};CompressedTextureLoader._textureExtensions=e}return CompressedTextureLoader._textureExtensions},enumerable:!1,configurable:!0}),Object.defineProperty(CompressedTextureLoader,"textureFormats",{get:function(){if(!CompressedTextureLoader._textureFormats){var t=CompressedTextureLoader.textureExtensions;for(var e in CompressedTextureLoader._textureFormats={},t){var r=t[e];r&&Object.assign(CompressedTextureLoader._textureFormats,Object.getPrototypeOf(r))}}return CompressedTextureLoader._textureFormats},enumerable:!1,configurable:!0}),CompressedTextureLoader}();function registerCompressedTextures(t,e,r){var i={textures:{},texture:null};return e?(e.map((function(t){return new or(new Ye(t,Object.assign({mipmap:ft.OFF,alphaMode:_t.NO_PREMULTIPLIED_ALPHA},r)))})).forEach((function(e,r){var n=e.baseTexture,o=t+"-"+(r+1);Ye.addToCache(n,o),or.addToCache(e,o),0===r&&(Ye.addToCache(n,t),or.addToCache(e,t),i.texture=e),i.textures[o]=e})),i):i}ji.setExtensionXhrType("dds",ji.XHR_RESPONSE_TYPE.BUFFER);var an,hn,un=124,ln=3,cn=4,dn=7,pn=19,fn=2,_n=0,mn=1,yn=2,gn=3;!function(t){t[t.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",t[t.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",t[t.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",t[t.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",t[t.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",t[t.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",t[t.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",t[t.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",t[t.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",t[t.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",t[t.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",t[t.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",t[t.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",t[t.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",t[t.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",t[t.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",t[t.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",t[t.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",t[t.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",t[t.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",t[t.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",t[t.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",t[t.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",t[t.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",t[t.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",t[t.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",t[t.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",t[t.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",t[t.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",t[t.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",t[t.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",t[t.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",t[t.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",t[t.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",t[t.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",t[t.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",t[t.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",t[t.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",t[t.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",t[t.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",t[t.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",t[t.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",t[t.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",t[t.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",t[t.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",t[t.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",t[t.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",t[t.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",t[t.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",t[t.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",t[t.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",t[t.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",t[t.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",t[t.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",t[t.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",t[t.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",t[t.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",t[t.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",t[t.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",t[t.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",t[t.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",t[t.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",t[t.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",t[t.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",t[t.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",t[t.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",t[t.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",t[t.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",t[t.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",t[t.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",t[t.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",t[t.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",t[t.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",t[t.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",t[t.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",t[t.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",t[t.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",t[t.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",t[t.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",t[t.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",t[t.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",t[t.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",t[t.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",t[t.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",t[t.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",t[t.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",t[t.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",t[t.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",t[t.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",t[t.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",t[t.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",t[t.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",t[t.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",t[t.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",t[t.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",t[t.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",t[t.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",t[t.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",t[t.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",t[t.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",t[t.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",t[t.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",t[t.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",t[t.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",t[t.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",t[t.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",t[t.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",t[t.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",t[t.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",t[t.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",t[t.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",t[t.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",t[t.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",t[t.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",t[t.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",t[t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",t[t.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"}(an||(an={})),function(t){t[t.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",t[t.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",t[t.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"}(hn||(hn={}));var vn,Tn,En,xn=((tn={})[827611204]=qi.COMPRESSED_RGBA_S3TC_DXT1_EXT,tn[861165636]=qi.COMPRESSED_RGBA_S3TC_DXT3_EXT,tn[894720068]=qi.COMPRESSED_RGBA_S3TC_DXT5_EXT,tn),bn=((en={})[an.DXGI_FORMAT_BC1_TYPELESS]=qi.COMPRESSED_RGBA_S3TC_DXT1_EXT,en[an.DXGI_FORMAT_BC1_UNORM]=qi.COMPRESSED_RGBA_S3TC_DXT1_EXT,en[an.DXGI_FORMAT_BC2_TYPELESS]=qi.COMPRESSED_RGBA_S3TC_DXT3_EXT,en[an.DXGI_FORMAT_BC2_UNORM]=qi.COMPRESSED_RGBA_S3TC_DXT3_EXT,en[an.DXGI_FORMAT_BC3_TYPELESS]=qi.COMPRESSED_RGBA_S3TC_DXT5_EXT,en[an.DXGI_FORMAT_BC3_UNORM]=qi.COMPRESSED_RGBA_S3TC_DXT5_EXT,en[an.DXGI_FORMAT_BC1_UNORM_SRGB]=qi.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,en[an.DXGI_FORMAT_BC2_UNORM_SRGB]=qi.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,en[an.DXGI_FORMAT_BC3_UNORM_SRGB]=qi.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,en),Rn=function(){function DDSLoader(){}return DDSLoader.use=function(t,e){if("dds"===t.extension&&t.data)try{Object.assign(t,registerCompressedTextures(t.name||t.url,DDSLoader.parse(t.data),t.metadata))}catch(t){return void e(t)}e()},DDSLoader.parse=function(t){var e=new Uint32Array(t);if(542327876!==e[0])throw new Error("Invalid DDS file magic word");var r=new Uint32Array(t,0,un/Uint32Array.BYTES_PER_ELEMENT),i=r[ln],n=r[cn],o=r[dn],s=new Uint32Array(t,pn*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),a=s[1];if(4&a){var h=s[fn];if(808540228!==h){var u=xn[h],l=new Uint8Array(t,128);return[new nn(l,{format:u,width:n,height:i,levels:o})]}var c=new Uint32Array(e.buffer,128,20/Uint32Array.BYTES_PER_ELEMENT),d=c[_n],p=c[mn],f=c[yn],_=c[gn],m=bn[d];if(void 0===m)throw new Error("DDSLoader cannot parse texture data with DXGI format "+d);if(4===f)throw new Error("DDSLoader does not support cubemap textures");if(p===hn.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSLoader does not supported 3D texture data");var y=new Array;if(1===_)y.push(new Uint8Array(t,148));else{for(var g=Ji[m],v=0,T=n,E=i,x=0;x<o;x++){v+=Math.max(1,T+3&-4)*Math.max(1,E+3&-4)*g,T>>>=1,E>>>=1}var b=148;for(x=0;x<_;x++)y.push(new Uint8Array(t,b,v)),b+=v}return y.map((function(t){return new nn(t,{format:m,width:n,height:i,levels:o})}))}if(64&a)throw new Error("DDSLoader does not support uncompressed texture data.");if(512&a)throw new Error("DDSLoader does not supported YUV uncompressed texture data.");if(131072&a)throw new Error("DDSLoader does not support single-channel (lumninance) texture data!");if(2&a)throw new Error("DDSLoader does not support single-channel (alpha) texture data!");throw new Error("DDSLoader failed to load a texture file due to an unknown reason!")},DDSLoader}();ji.setExtensionXhrType("ktx",ji.XHR_RESPONSE_TYPE.BUFFER);var Sn=[171,75,84,88,32,49,49,187,13,10,26,10],An=12,On=16,In=24,Pn=28,Mn=36,Dn=40,Nn=44,Cn=48,wn=52,Ln=56,Fn=60,Bn=((vn={})[lt.UNSIGNED_BYTE]=1,vn[lt.UNSIGNED_SHORT]=2,vn[lt.INT]=4,vn[lt.UNSIGNED_INT]=4,vn[lt.FLOAT]=4,vn[lt.HALF_FLOAT]=8,vn),Gn=((Tn={})[ht.RGBA]=4,Tn[ht.RGB]=3,Tn[ht.RG]=2,Tn[ht.RED]=1,Tn[ht.LUMINANCE]=1,Tn[ht.LUMINANCE_ALPHA]=2,Tn[ht.ALPHA]=1,Tn),Un=((En={})[lt.UNSIGNED_SHORT_4_4_4_4]=2,En[lt.UNSIGNED_SHORT_5_5_5_1]=2,En[lt.UNSIGNED_SHORT_5_6_5]=2,En),Xn=function(){function KTXLoader(){}return KTXLoader.use=function(t,e){if("ktx"===t.extension&&t.data)try{var r=t.name||t.url,i=KTXLoader.parse(r,t.data),n=i.compressed,o=i.uncompressed;if(n)Object.assign(t,registerCompressedTextures(r,n,t.metadata));else if(o){var s={};o.forEach((function(t,e){var i=new or(new Ye(t.resource,{mipmap:ft.OFF,alphaMode:_t.NO_PREMULTIPLIED_ALPHA,type:t.type,format:t.format})),n=r+"-"+(e+1);Ye.addToCache(i.baseTexture,n),or.addToCache(i,n),0===e&&(s[r]=i,Ye.addToCache(i.baseTexture,r),or.addToCache(i,r)),s[n]=i})),Object.assign(t,{textures:s})}}catch(t){return void e(t)}e()},KTXLoader.parse=function(t,e){var r=new DataView(e);if(!KTXLoader.validate(t,r))return null;var i=67305985===r.getUint32(An,!0),n=r.getUint32(On,i),o=r.getUint32(In,i),s=r.getUint32(Pn,i),a=r.getUint32(Mn,i),h=r.getUint32(Dn,i)||1,u=r.getUint32(Nn,i)||1,l=r.getUint32(Cn,i)||1,c=r.getUint32(wn,i),d=r.getUint32(Ln,i),p=r.getUint32(Fn,i);if(0===h||1!==u)throw new Error("Only 2D textures are supported");if(1!==c)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==l)throw new Error("WebGL does not support array textures");var f,_=a+3&-4,m=h+3&-4,y=new Array(l),g=a*h;if(0===n&&(g=_*m),void 0===(f=0!==n?Bn[n]?Bn[n]*Gn[o]:Un[n]:Ji[s]))throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var v=g*f,T=a,E=h,x=_,b=m,R=64+p,S=0;S<d;S++){for(var A=r.getUint32(R,i),O=R+4,I=0;I<l;I++){var P=y[I];P||(P=y[I]=new Array(d)),P[S]={levelID:S,levelWidth:d>1||0!==n?T:x,levelHeight:d>1||0!==n?E:b,levelBuffer:new Uint8Array(e,O,v)},O+=v}R=(R+=A+4)%4!=0?R+4-R%4:R,v=(x=(T=T>>1||1)+4-1&-4)*(b=(E=E>>1||1)+4-1&-4)*f}return 0!==n?{uncompressed:y.map((function(t){var e=t[0].levelBuffer,r=!1;return n===lt.FLOAT?e=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):n===lt.UNSIGNED_INT?(r=!0,e=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):n===lt.INT&&(r=!0,e=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new He(e,{width:t[0].levelWidth,height:t[0].levelHeight}),type:n,format:r?KTXLoader.convertFormatToInteger(o):o}}))}:{compressed:y.map((function(t){return new nn(null,{format:s,width:a,height:h,levels:d,levelBuffers:t})}))}},KTXLoader.validate=function(t,e){for(var r=0;r<Sn.length;r++)if(e.getUint8(r)!==Sn[r])return console.error(t+" is not a valid *.ktx file!"),!1;return!0},KTXLoader.convertFormatToInteger=function(t){switch(t){case ht.RGBA:return ht.RGBA_INTEGER;case ht.RGB:return ht.RGB_INTEGER;case ht.RG:return ht.RG_INTEGER;case ht.RED:return ht.RED_INTEGER;default:return t}},KTXLoader}(),extendStatics$f=function(t,e){return extendStatics$f=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])},extendStatics$f(t,e)};function __extends$f(t,e){function __(){this.constructor=t}extendStatics$f(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}!function(t){function ParticleContainer(e,r,i,n){void 0===e&&(e=1500),void 0===i&&(i=16384),void 0===n&&(n=!1);var o=t.call(this)||this;return i>16384&&(i=16384),o._properties=[!1,!0,!1,!1,!1],o._maxSize=e,o._batchSize=i,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=st.NORMAL,o.autoResize=n,o.roundPixels=!0,o.baseTexture=null,o.setProperties(r),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}__extends$f(ParticleContainer,t),ParticleContainer.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])},ParticleContainer.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(ParticleContainer.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,hex2rgb(t,this.tintRgb)},enumerable:!1,configurable:!0}),ParticleContainer.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))},ParticleContainer.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},ParticleContainer.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},ParticleContainer.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null}}(Se);var kn,Hn,jn=function(){function ParticleBuffer(t,e,r){this.geometry=new _r,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var i=0;i<t.length;++i){var n=t[i];n={attributeName:n.attributeName,size:n.size,uploadFunction:n.uploadFunction,type:n.type||lt.FLOAT,offset:n.offset},e[i]?this.dynamicProperties.push(n):this.staticProperties.push(n)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return ParticleBuffer.prototype.initBuffers=function(){var t=this.geometry,e=0;this.indexBuffer=new lr(function createIndicesForQuads(t,e){void 0===e&&(e=null);var r=6*t;if((e=e||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+r);for(var i=0,n=0;i<r;i+=6,n+=4)e[i+0]=n+0,e[i+1]=n+1,e[i+2]=n+2,e[i+3]=n+0,e[i+4]=n+2,e[i+5]=n+3;return e}(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var r=0;r<this.dynamicProperties.length;++r){(s=this.dynamicProperties[r]).offset=e,e+=s.size,this.dynamicStride+=s.size}var i=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(i),this.dynamicDataUint32=new Uint32Array(i),this.dynamicBuffer=new lr(this.dynamicData,!1,!1);var n=0;this.staticStride=0;for(r=0;r<this.staticProperties.length;++r){(s=this.staticProperties[r]).offset=n,n+=s.size,this.staticStride+=s.size}var o=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(o),this.staticDataUint32=new Uint32Array(o),this.staticBuffer=new lr(this.staticData,!0,!1);for(r=0;r<this.dynamicProperties.length;++r){var s=this.dynamicProperties[r];t.addAttribute(s.attributeName,this.dynamicBuffer,0,s.type===lt.UNSIGNED_BYTE,s.type,4*this.dynamicStride,4*s.offset)}for(r=0;r<this.staticProperties.length;++r){s=this.staticProperties[r];t.addAttribute(s.attributeName,this.staticBuffer,0,s.type===lt.UNSIGNED_BYTE,s.type,4*this.staticStride,4*s.offset)}},ParticleBuffer.prototype.uploadDynamic=function(t,e,r){for(var i=0;i<this.dynamicProperties.length;i++){var n=this.dynamicProperties[i];n.uploadFunction(t,e,r,n.type===lt.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++},ParticleBuffer.prototype.uploadStatic=function(t,e,r){for(var i=0;i<this.staticProperties.length;i++){var n=this.staticProperties[i];n.uploadFunction(t,e,r,n.type===lt.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++},ParticleBuffer.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},ParticleBuffer}(),Yn=function(t){function ParticleRenderer(e){var r=t.call(this,e)||this;return r.shader=null,r.properties=null,r.tempMatrix=new zt,r.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:r.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:r.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:r.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:r.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:lt.UNSIGNED_BYTE,uploadFunction:r.uploadTint,offset:0}],r.shader=Kr.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",{}),r.state=qr.for2d(),r}return __extends$f(ParticleRenderer,t),ParticleRenderer.prototype.render=function(t){var e=t.children,r=t._maxSize,i=t._batchSize,n=this.renderer,o=e.length;if(0!==o){o>r&&!t.autoResize&&(o=r);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.state.blendMode=correctBlendMode(t.blendMode,a.alphaMode),n.state.set(this.state);var h=n.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=function premultiplyRgba(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.alphaMode),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);for(var l=!1,c=0,d=0;c<o;c+=i,d+=1){var p=o-c;p>i&&(p=i),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var f=s[d];f.uploadDynamic(e,c,p);var _=t._bufferUpdateIDs[d]||0;(l=l||f._updateID<_)&&(f._updateID=t._updateID,f.uploadStatic(e,c,p)),n.geometry.bind(f.geometry),h.drawElements(h.TRIANGLES,6*p,h.UNSIGNED_SHORT,0)}}},ParticleRenderer.prototype.generateBuffers=function(t){for(var e=[],r=t._maxSize,i=t._batchSize,n=t._properties,o=0;o<r;o+=i)e.push(new jn(this.properties,n,i));return e},ParticleRenderer.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,r=t._properties;return new jn(this.properties,r,e)},ParticleRenderer.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s=0,a=0,h=0,u=0,l=0;l<r;++l){var c=t[e+l],d=c._texture,p=c.scale.x,f=c.scale.y,_=d.trim,m=d.orig;_?(s=(a=_.x-c.anchor.x*m.width)+_.width,h=(u=_.y-c.anchor.y*m.height)+_.height):(s=m.width*(1-c.anchor.x),a=m.width*-c.anchor.x,h=m.height*(1-c.anchor.y),u=m.height*-c.anchor.y),i[o]=a*p,i[o+1]=u*f,i[o+n]=s*p,i[o+n+1]=u*f,i[o+2*n]=s*p,i[o+2*n+1]=h*f,i[o+3*n]=a*p,i[o+3*n+1]=h*f,o+=4*n}},ParticleRenderer.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].position;i[o]=a.x,i[o+1]=a.y,i[o+n]=a.x,i[o+n+1]=a.y,i[o+2*n]=a.x,i[o+2*n+1]=a.y,i[o+3*n]=a.x,i[o+3*n+1]=a.y,o+=4*n}},ParticleRenderer.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].rotation;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},ParticleRenderer.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;s<r;++s){var a=t[e+s]._texture._uvs;a?(i[o]=a.x0,i[o+1]=a.y0,i[o+n]=a.x1,i[o+n+1]=a.y1,i[o+2*n]=a.x2,i[o+2*n+1]=a.y2,i[o+3*n]=a.x3,i[o+3*n+1]=a.y3,o+=4*n):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0,o+=4*n)}},ParticleRenderer.prototype.uploadTint=function(t,e,r,i,n,o){for(var s=0;s<r;++s){var a=t[e+s],h=a._texture.baseTexture.alphaMode>0,u=a.alpha,l=u<1&&h?premultiplyTint(a._tintRGB,u):a._tintRGB+(255*u<<24);i[o]=l,i[o+n]=l,i[o+2*n]=l,i[o+3*n]=l,o+=4*n}},ParticleRenderer.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},ParticleRenderer}(Rr);!function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"}(kn||(kn={})),function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"}(Hn||(Hn={}));var Vn={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 r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}},Wn=function(){function FillStyle(){this.color=16777215,this.alpha=1,this.texture=or.WHITE,this.matrix=null,this.visible=!1,this.reset()}return FillStyle.prototype.clone=function(){var t=new FillStyle;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},FillStyle.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=or.WHITE,this.matrix=null,this.visible=!1},FillStyle.prototype.destroy=function(){this.texture=null,this.matrix=null},FillStyle}(),extendStatics$e=function(t,e){return extendStatics$e=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])},extendStatics$e(t,e)};function __extends$e(t,e){function __(){this.constructor=t}extendStatics$e(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}function fixOrientation(t,e){var r,i;void 0===e&&(e=!1);var n=t.length;if(!(n<6)){for(var o=0,s=0,a=t[n-2],h=t[n-1];s<n;s+=2){var u=t[s],l=t[s+1];o+=(u-a)*(l+h),a=u,h=l}if(!e&&o>0||e&&o<=0){var c=n/2;for(s=c+c%2;s<n;s+=2){var d=n-s-2,p=n-s-1,f=s,_=s+1;r=[t[f],t[d]],t[d]=r[0],t[f]=r[1],i=[t[_],t[p]],t[p]=i[0],t[_]=i[1]}}}}var zn={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var r=t.points,i=t.holes,n=e.points,o=e.indices;if(r.length>=6){fixOrientation(r,!1);for(var s=[],a=0;a<i.length;a++){var h=i[a];fixOrientation(h.points,!0),s.push(r.length/2),r=r.concat(h.points)}var u=xt(r,s,2);if(!u)return;var l=n.length/2;for(a=0;a<u.length;a+=3)o.push(u[a]+l),o.push(u[a+1]+l),o.push(u[a+2]+l);for(a=0;a<r.length;a++)n.push(r[a])}}},Kn={build:function(t){var e,r,i,n,o,s,a=t.points;if(t.type===Lt.CIRC){var h=t.shape;e=h.x,r=h.y,o=s=h.radius,i=n=0}else if(t.type===Lt.ELIP){var u=t.shape;e=u.x,r=u.y,o=u.width,s=u.height,i=n=0}else{var l=t.shape,c=l.width/2,d=l.height/2;e=l.x+c,r=l.y+d,i=c-(o=s=Math.max(0,Math.min(l.radius,Math.min(c,d)))),n=d-s}var p=Math.ceil(2.3*Math.sqrt(o+s)),f=8*p+(i?4:0)+(n?4:0);if(a.length=f,0!==f){if(0===p)return a.length=8,a[0]=a[6]=e+i,a[1]=a[3]=r+n,a[2]=a[4]=e-i,void(a[5]=a[7]=r-n);var _=0,m=4*p+(i?2:0)+2,y=m,g=f,v=e+(S=i+o),T=e-S,E=r+(A=n);if(a[_++]=v,a[_++]=E,a[--m]=E,a[--m]=T,n){var x=r-A;a[y++]=T,a[y++]=x,a[--g]=x,a[--g]=v}for(var b=1;b<p;b++){var R=Math.PI/2*(b/p);v=e+(S=i+Math.cos(R)*o),T=e-S,E=r+(A=n+Math.sin(R)*s),x=r-A;a[_++]=v,a[_++]=E,a[--m]=E,a[--m]=T,a[y++]=T,a[y++]=x,a[--g]=x,a[--g]=v}var S,A;v=e+(S=i),T=e-S,E=r+(A=n+s),x=r-A;a[_++]=v,a[_++]=E,a[--g]=x,a[--g]=v,i&&(a[_++]=T,a[_++]=E,a[--g]=x,a[--g]=T)}},triangulate:function(t,e){var r,i,n=t.points,o=e.points,s=e.indices,a=o.length/2,h=a;if(t.type!==Lt.RREC){var u=t.shape;r=u.x,i=u.y}else{var l=t.shape;r=l.x+l.width/2,i=l.y+l.height/2}var c=t.matrix;o.push(t.matrix?c.a*r+c.c*i+c.tx:r,t.matrix?c.b*r+c.d*i+c.ty:i),a++,o.push(n[0],n[1]);for(var d=2;d<n.length;d+=2)o.push(n[d],n[d+1]),s.push(a++,h,a);s.push(h+1,h,a)}};function getPt(t,e,r){return t+(e-t)*r}function quadraticBezierCurve(t,e,r,i,n,o,s){void 0===s&&(s=[]);for(var a=s,h=0,u=0,l=0,c=0,d=0,p=0,f=0,_=0;f<=20;++f)h=getPt(t,r,_=f/20),u=getPt(e,i,_),l=getPt(r,n,_),c=getPt(i,o,_),d=getPt(h,l,_),p=getPt(u,c,_),0===f&&a[a.length-2]===d&&a[a.length-1]===p||a.push(d,p);return a}var qn={build:function(t){if(co.nextRoundedRectBehavior)Kn.build(t);else{var e=t.shape,r=t.points,i=e.x,n=e.y,o=e.width,s=e.height,a=Math.max(0,Math.min(e.radius,Math.min(o,s)/2));r.length=0,a?(quadraticBezierCurve(i,n+a,i,n,i+a,n,r),quadraticBezierCurve(i+o-a,n,i+o,n,i+o,n+a,r),quadraticBezierCurve(i+o,n+s-a,i+o,n+s,i+o-a,n+s,r),quadraticBezierCurve(i+a,n+s,i,n+s,i,n+s-a,r)):r.push(i,n,i+o,n,i+o,n+s,i,n+s)}},triangulate:function(t,e){if(co.nextRoundedRectBehavior)Kn.triangulate(t,e);else{for(var r=t.points,i=e.points,n=e.indices,o=i.length/2,s=xt(r,null,2),a=0,h=s.length;a<h;a+=3)n.push(s[a]+o),n.push(s[a+1]+o),n.push(s[a+2]+o);for(a=0,h=r.length;a<h;a++)i.push(r[a],r[++a])}}};function square(t,e,r,i,n,o,s,a){var h,u;s?(h=i,u=-r):(h=-i,u=r);var l=t-r*n+h,c=e-i*n+u,d=t+r*o+h,p=e+i*o+u;return a.push(l,c),a.push(d,p),2}function round(t,e,r,i,n,o,s,a){var h=r-t,u=i-e,l=Math.atan2(h,u),c=Math.atan2(n-t,o-e);a&&l<c?l+=2*Math.PI:!a&&l>c&&(c+=2*Math.PI);var d=l,p=c-l,f=Math.abs(p),_=Math.sqrt(h*h+u*u),m=1+(15*f*Math.sqrt(_)/Math.PI|0),y=p/m;if(d+=y,a){s.push(t,e),s.push(r,i);for(var g=1,v=d;g<m;g++,v+=y)s.push(t,e),s.push(t+Math.sin(v)*_,e+Math.cos(v)*_);s.push(t,e),s.push(n,o)}else{s.push(r,i),s.push(t,e);for(g=1,v=d;g<m;g++,v+=y)s.push(t+Math.sin(v)*_,e+Math.cos(v)*_),s.push(t,e);s.push(n,o),s.push(t,e)}return 2*m}function buildLine(t,e){t.lineStyle.native?function buildNativeLine(t,e){var r=0,i=t.shape,n=t.points||i.points,o=i.type!==Lt.POLY||i.closeStroke;if(0!==n.length){var s=e.points,a=e.indices,h=n.length/2,u=s.length/2,l=u;for(s.push(n[0],n[1]),r=1;r<h;r++)s.push(n[2*r],n[2*r+1]),a.push(l,l+1),l++;o&&a.push(l,u)}}(t,e):function buildNonNativeLine(t,e){var r=t.shape,i=t.points||r.points.slice(),n=e.closePointEps;if(0!==i.length){var o=t.lineStyle,s=new Ut(i[0],i[1]),a=new Ut(i[i.length-2],i[i.length-1]),h=r.type!==Lt.POLY||r.closeStroke,u=Math.abs(s.x-a.x)<n&&Math.abs(s.y-a.y)<n;if(h){i=i.slice(),u&&(i.pop(),i.pop(),a.set(i[i.length-2],i[i.length-1]));var l=.5*(s.x+a.x),c=.5*(a.y+s.y);i.unshift(l,c),i.push(l,c)}var d=e.points,p=i.length/2,f=i.length,_=d.length/2,m=o.width/2,y=m*m,g=o.miterLimit*o.miterLimit,v=i[0],T=i[1],E=i[2],x=i[3],b=0,R=0,S=-(T-x),A=v-E,O=0,I=0,P=Math.sqrt(S*S+A*A);S/=P,A/=P,S*=m,A*=m;var M=o.alignment,D=2*(1-M),N=2*M;h||(o.cap===Hn.ROUND?f+=round(v-S*(D-N)*.5,T-A*(D-N)*.5,v-S*D,T-A*D,v+S*N,T+A*N,d,!0)+2:o.cap===Hn.SQUARE&&(f+=square(v,T,S,A,D,N,!0,d))),d.push(v-S*D,T-A*D),d.push(v+S*N,T+A*N);for(var C=1;C<p-1;++C){v=i[2*(C-1)],T=i[2*(C-1)+1],E=i[2*C],x=i[2*C+1],b=i[2*(C+1)],R=i[2*(C+1)+1],S=-(T-x),A=v-E,S/=P=Math.sqrt(S*S+A*A),A/=P,S*=m,A*=m,O=-(x-R),I=E-b,O/=P=Math.sqrt(O*O+I*I),I/=P,O*=m,I*=m;var w=E-v,L=T-x,F=E-b,B=R-x,G=L*F-B*w,U=G<0;if(Math.abs(G)<.1)d.push(E-S*D,x-A*D),d.push(E+S*N,x+A*N);else{var X=(-S+v)*(-A+x)-(-S+E)*(-A+T),k=(-O+b)*(-I+x)-(-O+E)*(-I+R),H=(w*k-F*X)/G,j=(B*X-L*k)/G,Y=(H-E)*(H-E)+(j-x)*(j-x),V=E+(H-E)*D,W=x+(j-x)*D,z=E-(H-E)*N,K=x-(j-x)*N,q=U?D:N;Y<=Math.min(w*w+L*L,F*F+B*B)+q*q*y?o.join===kn.BEVEL||Y/y>g?(U?(d.push(V,W),d.push(E+S*N,x+A*N),d.push(V,W),d.push(E+O*N,x+I*N)):(d.push(E-S*D,x-A*D),d.push(z,K),d.push(E-O*D,x-I*D),d.push(z,K)),f+=2):o.join===kn.ROUND?U?(d.push(V,W),d.push(E+S*N,x+A*N),f+=round(E,x,E+S*N,x+A*N,E+O*N,x+I*N,d,!0)+4,d.push(V,W),d.push(E+O*N,x+I*N)):(d.push(E-S*D,x-A*D),d.push(z,K),f+=round(E,x,E-S*D,x-A*D,E-O*D,x-I*D,d,!1)+4,d.push(E-O*D,x-I*D),d.push(z,K)):(d.push(V,W),d.push(z,K)):(d.push(E-S*D,x-A*D),d.push(E+S*N,x+A*N),o.join===kn.BEVEL||Y/y>g||(o.join===kn.ROUND?f+=U?round(E,x,E+S*N,x+A*N,E+O*N,x+I*N,d,!0)+2:round(E,x,E-S*D,x-A*D,E-O*D,x-I*D,d,!1)+2:(U?(d.push(z,K),d.push(z,K)):(d.push(V,W),d.push(V,W)),f+=2)),d.push(E-O*D,x-I*D),d.push(E+O*N,x+I*N),f+=2)}}v=i[2*(p-2)],T=i[2*(p-2)+1],E=i[2*(p-1)],S=-(T-(x=i[2*(p-1)+1])),A=v-E,S/=P=Math.sqrt(S*S+A*A),A/=P,S*=m,A*=m,d.push(E-S*D,x-A*D),d.push(E+S*N,x+A*N),h||(o.cap===Hn.ROUND?f+=round(E-S*(D-N)*.5,x-A*(D-N)*.5,E-S*D,x-A*D,E+S*N,x+A*N,d,!1)+2:o.cap===Hn.SQUARE&&(f+=square(E,x,S,A,D,N,!1,d)));var $=e.indices,Z=Vn.epsilon*Vn.epsilon;for(C=_;C<f+_-2;++C)v=d[2*C],T=d[2*C+1],E=d[2*(C+1)],x=d[2*(C+1)+1],b=d[2*(C+2)],R=d[2*(C+2)+1],Math.abs(v*(x-R)+E*(R-T)+b*(T-x))<Z||$.push(C,C+1,C+2)}}(t,e)}var $n,Zn=function(){function ArcUtils(){}return ArcUtils.curveTo=function(t,e,r,i,n,o){var s=o[o.length-2],a=o[o.length-1]-e,h=s-t,u=i-e,l=r-t,c=Math.abs(a*l-h*u);if(c<1e-8||0===n)return o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e),null;var d=a*a+h*h,p=u*u+l*l,f=a*u+h*l,_=n*Math.sqrt(d)/c,m=n*Math.sqrt(p)/c,y=_*f/d,g=m*f/p,v=_*l+m*h,T=_*u+m*a,E=h*(m+y),x=a*(m+y),b=l*(_+g),R=u*(_+g);return{cx:v+t,cy:T+e,radius:n,startAngle:Math.atan2(x-T,E-v),endAngle:Math.atan2(R-T,b-v),anticlockwise:h*u>l*a}},ArcUtils.arc=function(t,e,r,i,n,o,s,a,h){for(var u=s-o,l=Vn._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/Ft)),c=u/(2*l),d=2*c,p=Math.cos(c),f=Math.sin(c),_=l-1,m=_%1/_,y=0;y<=_;++y){var g=c+o+d*(y+m*y),v=Math.cos(g),T=-Math.sin(g);h.push((p*v+f*T)*n+r,(p*-T+f*v)*n+i)}},ArcUtils}(),Qn=function(){function BezierUtils(){}return BezierUtils.curveLength=function(t,e,r,i,n,o,s,a){for(var h=0,u=0,l=0,c=0,d=0,p=0,f=0,_=0,m=0,y=0,g=0,v=t,T=e,E=1;E<=10;++E)y=v-(_=(f=(p=(d=1-(u=E/10))*d)*d)*t+3*p*u*r+3*d*(l=u*u)*n+(c=l*u)*s),g=T-(m=f*e+3*p*u*i+3*d*l*o+c*a),v=_,T=m,h+=Math.sqrt(y*y+g*g);return h},BezierUtils.curveTo=function(t,e,r,i,n,o,s){var a=s[s.length-2],h=s[s.length-1];s.length-=2;var u=Vn._segmentsCount(BezierUtils.curveLength(a,h,t,e,r,i,n,o)),l=0,c=0,d=0,p=0,f=0;s.push(a,h);for(var _=1,m=0;_<=u;++_)d=(c=(l=1-(m=_/u))*l)*l,f=(p=m*m)*m,s.push(d*a+3*c*m*t+3*l*p*r+f*n,d*h+3*c*m*e+3*l*p*i+f*o)},BezierUtils}(),Jn=function(){function QuadraticUtils(){}return QuadraticUtils.curveLength=function(t,e,r,i,n,o){var s=t-2*r+n,a=e-2*i+o,h=2*r-2*t,u=2*i-2*e,l=4*(s*s+a*a),c=4*(s*h+a*u),d=h*h+u*u,p=2*Math.sqrt(l+c+d),f=Math.sqrt(l),_=2*l*f,m=2*Math.sqrt(d),y=c/f;return(_*p+f*c*(p-m)+(4*d*l-c*c)*Math.log((2*f+y+p)/(y+m)))/(4*_)},QuadraticUtils.curveTo=function(t,e,r,i,n){for(var o=n[n.length-2],s=n[n.length-1],a=Vn._segmentsCount(QuadraticUtils.curveLength(o,s,t,e,r,i)),h=0,u=0,l=1;l<=a;++l){var c=l/a;h=o+(t-o)*c,u=s+(e-s)*c,n.push(h+(t+(r-t)*c-h)*c,u+(e+(i-e)*c-u)*c)}},QuadraticUtils}(),to=function(){function BatchPart(){this.reset()}return BatchPart.prototype.begin=function(t,e,r){this.reset(),this.style=t,this.start=e,this.attribStart=r},BatchPart.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},BatchPart.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},BatchPart}(),eo=(($n={})[Lt.POLY]=zn,$n[Lt.CIRC]=Kn,$n[Lt.ELIP]=Kn,$n[Lt.RECT]={build:function(t){var e=t.shape,r=e.x,i=e.y,n=e.width,o=e.height,s=t.points;s.length=0,s.push(r,i,r+n,i,r+n,i+o,r,i+o)},triangulate:function(t,e){var r=t.points,i=e.points,n=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},$n[Lt.RREC]=qn,$n),ro=[],io=[],no=function(){function GraphicsData(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.points=[],this.holes=[],this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type}return GraphicsData.prototype.clone=function(){return new GraphicsData(this.shape,this.fillStyle,this.lineStyle,this.matrix)},GraphicsData.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},GraphicsData}(),oo=new Ut,so=new ie,ao=function(t){function GraphicsGeometry(){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 ie,e.boundsDirty=-1,e}return __extends$e(GraphicsGeometry,t),Object.defineProperty(GraphicsGeometry.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),GraphicsGeometry.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;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),io.push(this.drawCalls[t]);this.drawCalls.length=0;for(t=0;t<this.batches.length;t++){var e=this.batches[t];e.reset(),ro.push(e)}this.batches.length=0},GraphicsGeometry.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},GraphicsGeometry.prototype.drawShape=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null);var n=new no(t,e,r,i);return this.graphicsData.push(n),this.dirty++,this},GraphicsGeometry.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var r=new no(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this},GraphicsGeometry.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},GraphicsGeometry.prototype.containsPoint=function(t){for(var e=this.graphicsData,r=0;r<e.length;++r){var i=e[r];if(i.fillStyle.visible&&(i.shape&&(i.matrix?i.matrix.applyInverse(t,oo):oo.copyFrom(t),i.shape.contains(oo.x,oo.y)))){var n=!1;if(i.holes)for(var o=0;o<i.holes.length;o++){if(i.holes[o].shape.contains(oo.x,oo.y)){n=!0;break}}if(!n)return!0}}return!1},GraphicsGeometry.prototype.updateBatches=function(t){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var e=this.uvs,r=this.graphicsData,i=null,n=null;this.batches.length>0&&(n=(i=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o<r.length;o++){this.shapeIndex++;var s=r[o],a=s.fillStyle,h=s.lineStyle;eo[s.type].build(s),s.matrix&&this.transformPoints(s.points,s.matrix),(a.visible||h.visible)&&this.processHoles(s.holes);for(var u=0;u<2;u++){var l=0===u?a:h;if(l.visible){var c=l.texture.baseTexture,d=this.indices.length,p=this.points.length/2;c.wrapMode=pt.REPEAT,0===u?this.processFill(s):this.processLine(s);var f=this.points.length/2-p;0!==f&&(i&&!this._compareStyles(n,l)&&(i.end(d,p),i=null),i||((i=ro.pop()||new to).begin(l,d,p),this.batches.push(i),n=l),this.addUvs(this.points,e,l.texture,p,f,l.matrix))}}}var _=this.indices.length,m=this.points.length/2;if(i&&i.end(_,m),0!==this.batches.length){if(this.indicesUint16&&this.indices.length===this.indicesUint16.length)this.indicesUint16.set(this.indices);else{var y=m>65535&&t;this.indicesUint16=y?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},GraphicsGeometry.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))},GraphicsGeometry.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t<e;t++){var r=this.graphicsData[t],i=r.fillStyle,n=r.lineStyle;if(i&&!i.texture.baseTexture.valid)return!1;if(n&&!n.texture.baseTexture.valid)return!1}return!0},GraphicsGeometry.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,e=0,r=t.length;e<r;e++)for(var i=t[e],n=0;n<i.size;n++){var o=i.start+n;this.indicesUint16[o]=this.indicesUint16[o]-i.attribStart}},GraphicsGeometry.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<2*GraphicsGeometry.BATCHABLE_SIZE},GraphicsGeometry.prototype.buildDrawCalls=function(){for(var t=++Ye._globalBatch,e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),io.push(this.drawCalls[e]);this.drawCalls.length=0;var r=this.colors,i=this.textureIds,n=io.pop();n||((n=new Si).texArray=new Ai),n.texArray.count=0,n.start=0,n.size=0,n.type=at.TRIANGLES;var o=0,s=null,a=0,h=!1,u=at.TRIANGLES,l=0;this.drawCalls.push(n);for(e=0;e<this.batches.length;e++){var c=this.batches[e],d=c.style,p=d.texture.baseTexture;h!==!!d.native&&(u=(h=!!d.native)?at.LINES:at.TRIANGLES,s=null,o=8,t++),s!==p&&(s=p,p._batchEnabled!==t&&(8===o&&(t++,o=0,n.size>0&&((n=io.pop())||((n=new Si).texArray=new Ai),this.drawCalls.push(n)),n.start=l,n.size=0,n.texArray.count=0,n.type=u),p.touched=1,p._batchEnabled=t,p._batchLocation=o,p.wrapMode=pt.REPEAT,n.texArray.elements[n.texArray.count++]=p,o++)),n.size+=c.size,l+=c.size,a=p._batchLocation,this.addColors(r,d.color,d.alpha,c.attribSize,c.attribStart),this.addTextureIds(i,a,c.attribSize,c.attribStart)}Ye._globalBatch=t,this.packAttributes()},GraphicsGeometry.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,n=new ArrayBuffer(3*t.length*4),o=new Float32Array(n),s=new Uint32Array(n),a=0,h=0;h<t.length/2;h++)o[a++]=t[2*h],o[a++]=t[2*h+1],o[a++]=e[2*h],o[a++]=e[2*h+1],s[a++]=r[h],o[a++]=i[h];this._buffer.update(n),this._indexBuffer.update(this.indicesUint16)},GraphicsGeometry.prototype.processFill=function(t){t.holes.length?zn.triangulate(t,this):eo[t.type].triangulate(t,this)},GraphicsGeometry.prototype.processLine=function(t){buildLine(t,this);for(var e=0;e<t.holes.length;e++)buildLine(t.holes[e],this)},GraphicsGeometry.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var r=t[e];eo[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}},GraphicsGeometry.prototype.calculateBounds=function(){var t=this._bounds,e=so,r=zt.IDENTITY;this._bounds.clear(),e.clear();for(var i=0;i<this.graphicsData.length;i++){var n=this.graphicsData[i],o=n.shape,s=n.type,a=n.lineStyle,h=n.matrix||zt.IDENTITY,u=0;if(a&&a.visible&&(u=a.width,s!==Lt.POLY||n.fillStyle.visible?u*=Math.max(0,a.alignment):u*=Math.max(a.alignment,1-a.alignment)),r!==h&&(e.isEmpty()||(t.addBoundsMatrix(e,r),e.clear()),r=h),s===Lt.RECT||s===Lt.RREC){var l=o;e.addFramePad(l.x,l.y,l.x+l.width,l.y+l.height,u,u)}else if(s===Lt.CIRC){var c=o;e.addFramePad(c.x,c.y,c.x,c.y,c.radius+u,c.radius+u)}else if(s===Lt.ELIP){var d=o;e.addFramePad(d.x,d.y,d.x,d.y,d.width+u,d.height+u)}else{var p=o;t.addVerticesMatrix(r,p.points,0,p.points.length,u,u)}}e.isEmpty()||t.addBoundsMatrix(e,r),t.pad(this.boundsPadding,this.boundsPadding)},GraphicsGeometry.prototype.transformPoints=function(t,e){for(var r=0;r<t.length/2;r++){var i=t[2*r],n=t[2*r+1];t[2*r]=e.a*i+e.c*n+e.tx,t[2*r+1]=e.b*i+e.d*n+e.ty}},GraphicsGeometry.prototype.addColors=function(t,e,r,i,n){void 0===n&&(n=0);var o=premultiplyTint((e>>16)+(65280&e)+((255&e)<<16),r);t.length=Math.max(t.length,n+i);for(var s=0;s<i;s++)t[n+s]=o},GraphicsGeometry.prototype.addTextureIds=function(t,e,r,i){void 0===i&&(i=0),t.length=Math.max(t.length,i+r);for(var n=0;n<r;n++)t[i+n]=e},GraphicsGeometry.prototype.addUvs=function(t,e,r,i,n,o){void 0===o&&(o=null);for(var s=0,a=e.length,h=r.frame;s<n;){var u=t[2*(i+s)],l=t[2*(i+s)+1];if(o){var c=o.a*u+o.c*l+o.tx;l=o.b*u+o.d*l+o.ty,u=c}s++,e.push(u/h.width,l/h.height)}var d=r.baseTexture;(h.width<d.width||h.height<d.height)&&this.adjustUvs(e,r,a,n)},GraphicsGeometry.prototype.adjustUvs=function(t,e,r,i){for(var n=e.baseTexture,o=1e-6,s=r+2*i,a=e.frame,h=a.width/n.width,u=a.height/n.height,l=a.x/a.width,c=a.y/a.height,d=Math.floor(t[r]+o),p=Math.floor(t[r+1]+o),f=r+2;f<s;f+=2)d=Math.min(d,Math.floor(t[f]+o)),p=Math.min(p,Math.floor(t[f+1]+o));l-=d,c-=p;for(f=r;f<s;f+=2)t[f]=(t[f]+l)*h,t[f+1]=(t[f+1]+c)*u},GraphicsGeometry.BATCHABLE_SIZE=100,GraphicsGeometry}(Mi),ho=function(t){function LineStyle(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.alignment=.5,e.native=!1,e.cap=Hn.BUTT,e.join=kn.MITER,e.miterLimit=10,e}return __extends$e(LineStyle,t),LineStyle.prototype.clone=function(){var t=new LineStyle;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},LineStyle.prototype.reset=function(){t.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},LineStyle}(Wn),uo=new Float32Array(3),lo={},co=function(t){function Graphics(e){void 0===e&&(e=null);var r=t.call(this)||this;return r.shader=null,r.pluginName="batch",r.currentPath=null,r.batches=[],r.batchTint=-1,r.batchDirty=-1,r.vertexData=null,r._fillStyle=new Wn,r._lineStyle=new ho,r._matrix=null,r._holeMode=!1,r.state=qr.for2d(),r._geometry=e||new ao,r._geometry.refCount++,r._transformID=-1,r.tint=16777215,r.blendMode=st.NORMAL,r}return __extends$e(Graphics,t),Object.defineProperty(Graphics.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),Graphics.prototype.clone=function(){return this.finishPoly(),new Graphics(this._geometry)},Object.defineProperty(Graphics.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(Graphics.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(Graphics.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(Graphics.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),Graphics.prototype.lineStyle=function(t,e,r,i,n){return void 0===t&&(t=null),void 0===e&&(e=0),void 0===r&&(r=1),void 0===i&&(i=.5),void 0===n&&(n=!1),"number"==typeof t&&(t={width:t,color:e,alpha:r,alignment:i,native:n}),this.lineTextureStyle(t)},Graphics.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:or.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:Hn.BUTT,join:kn.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var e=t.width>0&&t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:e},t)):this._lineStyle.reset(),this},Graphics.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 Yt,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new Yt,this.currentPath.closeStroke=!1},Graphics.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},Graphics.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},Graphics.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var r=this.currentPath.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this},Graphics.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)},Graphics.prototype.quadraticCurveTo=function(t,e,r,i){this._initCurve();var n=this.currentPath.points;return 0===n.length&&this.moveTo(0,0),Jn.curveTo(t,e,r,i,n),this},Graphics.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._initCurve(),Qn.curveTo(t,e,r,i,n,o,this.currentPath.points),this},Graphics.prototype.arcTo=function(t,e,r,i,n){this._initCurve(t,e);var o=this.currentPath.points,s=Zn.curveTo(t,e,r,i,n,o);if(s){var a=s.cx,h=s.cy,u=s.radius,l=s.startAngle,c=s.endAngle,d=s.anticlockwise;this.arc(a,h,u,l,c,d)}return this},Graphics.prototype.arc=function(t,e,r,i,n,o){if(void 0===o&&(o=!1),i===n)return this;if(!o&&n<=i?n+=Ft:o&&i<=n&&(i+=Ft),0===n-i)return this;var s=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this._geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var l=Math.abs(u[u.length-2]-s),c=Math.abs(u[u.length-1]-a);l<h&&c<h||u.push(s,a)}else this.moveTo(s,a),u=this.currentPath.points;return Zn.arc(s,a,t,e,r,i,n,o,u),this},Graphics.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill({texture:or.WHITE,color:t,alpha:e})},Graphics.prototype.beginTextureFill=function(t){t=Object.assign({texture:or.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var e=t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:e},t)):this._fillStyle.reset(),this},Graphics.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},Graphics.prototype.drawRect=function(t,e,r,i){return this.drawShape(new kt(t,e,r,i))},Graphics.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new Vt(t,e,r,i,n))},Graphics.prototype.drawCircle=function(t,e,r){return this.drawShape(new Ht(t,e,r))},Graphics.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new jt(t,e,r,i))},Graphics.prototype.drawPolygon=function(){for(var t,e=arguments,r=[],i=0;i<arguments.length;i++)r[i]=e[i];var n=!0,o=r[0];o.points?(n=o.closeStroke,t=o.points):t=Array.isArray(r[0])?r[0]:r;var s=new Yt(t);return s.closeStroke=n,this.drawShape(s),this},Graphics.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},Graphics.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},Graphics.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return!(1!==t.length||t[0].shape.type!==Lt.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)},Graphics.prototype._render=function(t){this.finishPoly();var e=this._geometry,r=t.context.supports.uint32Indices;e.updateBatches(r),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},Graphics.prototype._populateBatches=function(){var t=this._geometry,e=this.blendMode,r=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=r,this.vertexData=new Float32Array(t.points);for(var i=0;i<r;i++){var n=t.batches[i],o=n.style.color,s=new Float32Array(this.vertexData.buffer,4*n.attribStart*2,2*n.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*n.attribStart*2,2*n.attribSize),h={vertexData:s,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*n.start,n.size),uvs:a,_batchRGB:hex2rgb(o),_tintRGB:o,_texture:n.style.texture,alpha:n.style.alpha,worldAlpha:1};this.batches[i]=h}},Graphics.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var e=0,r=this.batches.length;e<r;e++){var i=this.batches[e];i.worldAlpha=this.worldAlpha*i.alpha,t.plugins[this.pluginName].render(i)}}},Graphics.prototype._renderDirect=function(t){var e=this._resolveDirectShader(t),r=this._geometry,i=this.tint,n=this.worldAlpha,o=e.uniforms,s=r.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(i>>16&255)/255*n,o.tint[1]=(i>>8&255)/255*n,o.tint[2]=(255&i)/255*n,o.tint[3]=n,t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(var a=0,h=s.length;a<h;a++)this._renderDrawCallDirect(t,r.drawCalls[a])},Graphics.prototype._renderDrawCallDirect=function(t,e){for(var r=e.texArray,i=e.type,n=e.size,o=e.start,s=r.count,a=0;a<s;a++)t.texture.bind(r.elements[a],a);t.geometry.draw(i,n,o)},Graphics.prototype._resolveDirectShader=function(t){var e=this.shader,r=this.pluginName;if(!e){if(!lo[r]){for(var i=t.plugins[r].MAX_TEXTURES,n=new Int32Array(i),o=0;o<i;o++)n[o]=o;var s={tint:new Float32Array([1,1,1,1]),translationMatrix:new zt,default:vr.from({uSamplers:n},!0)},a=t.plugins[r]._shader.program;lo[r]=new Kr(a,s)}e=lo[r]}return e},Graphics.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var e=t.bounds,r=e.minX,i=e.minY,n=e.maxX,o=e.maxY;this._bounds.addFrame(this.transform,r,i,n,o)}},Graphics.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,Graphics._TEMP_POINT),this._geometry.containsPoint(Graphics._TEMP_POINT)},Graphics.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=hex2rgb(this.tint,uo),e=0;e<this.batches.length;e++){var r=this.batches[e],i=r._batchRGB,n=(t[0]*i[0]*255<<16)+(t[1]*i[1]*255<<8)+(0|t[2]*i[2]*255);r._tintRGB=(n>>16)+(65280&n)+((255&n)<<16)}}},Graphics.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,h=this._geometry.points,u=this.vertexData,l=0,c=0;c<h.length;c+=2){var d=h[c],p=h[c+1];u[l++]=r*d+n*p+s,u[l++]=o*p+i*d+a}}},Graphics.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this},Graphics.prototype.setMatrix=function(t){return this._matrix=t,this},Graphics.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},Graphics.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},Graphics.prototype.destroy=function(e){this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,t.prototype.destroy.call(this,e)},Graphics.nextRoundedRectBehavior=!1,Graphics._TEMP_POINT=new Ut,Graphics}(Se),extendStatics$d=function(t,e){return extendStatics$d=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])},extendStatics$d(t,e)};var po,fo=new Ut,_o=new Uint16Array([0,1,2,0,2,3]),mo=function(t){function Sprite(e){var r=t.call(this)||this;return r._anchor=new Wt(r._onAnchorUpdate,r,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),r._texture=null,r._width=0,r._height=0,r._tint=null,r._tintRGB=null,r.tint=16777215,r.blendMode=st.NORMAL,r._cachedTint=16777215,r.uvs=null,r.texture=e||or.EMPTY,r.vertexData=new Float32Array(8),r.vertexTrimmedData=null,r._transformID=-1,r._textureID=-1,r._transformTrimmedID=-1,r._textureTrimmedID=-1,r.indices=_o,r.pluginName="batch",r.isSprite=!0,r._roundPixels=J.ROUND_PIXELS,r}return function __extends$d(t,e){function __(){this.constructor=t}extendStatics$d(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}(Sprite,t),Sprite.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=sign(this.scale.y)*this._height/this._texture.orig.height)},Sprite.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},Sprite.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,h=this.vertexData,u=t.trim,l=t.orig,c=this._anchor,d=0,p=0,f=0,_=0;if(u?(d=(p=u.x-c._x*l.width)+u.width,f=(_=u.y-c._y*l.height)+u.height):(d=(p=-c._x*l.width)+l.width,f=(_=-c._y*l.height)+l.height),h[0]=r*p+n*_+s,h[1]=o*_+i*p+a,h[2]=r*d+n*_+s,h[3]=o*_+i*d+a,h[4]=r*d+n*f+s,h[5]=o*f+i*d+a,h[6]=r*p+n*f+s,h[7]=o*f+i*p+a,this._roundPixels)for(var m=J.RESOLUTION,y=0;y<h.length;++y)h[y]=Math.round((h[y]*m|0)/m)}},Sprite.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,r=t.orig,i=this._anchor,n=this.transform.worldTransform,o=n.a,s=n.b,a=n.c,h=n.d,u=n.tx,l=n.ty,c=-i._x*r.width,d=c+r.width,p=-i._y*r.height,f=p+r.height;e[0]=o*c+a*p+u,e[1]=h*p+s*c+l,e[2]=o*d+a*p+u,e[3]=h*p+s*d+l,e[4]=o*d+a*f+u,e[5]=h*f+s*d+l,e[6]=o*c+a*f+u,e[7]=h*f+s*c+l},Sprite.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},Sprite.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},Sprite.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._localBounds||(this._localBounds=new ie),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new kt),e=this._localBoundsRect),this._localBounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},Sprite.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,fo);var e=this._texture.orig.width,r=this._texture.orig.height,i=-e*this.anchor.x,n=0;return fo.x>=i&&fo.x<i+e&&(n=-r*this.anchor.y,fo.y>=n&&fo.y<n+r)},Sprite.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var r="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!r)}this._texture=null},Sprite.from=function(t,e){return new Sprite(t instanceof or?t:or.from(t,e))},Object.defineProperty(Sprite.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(Sprite.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var e=sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(Sprite.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var e=sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(Sprite.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(Sprite.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(Sprite.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||or.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}),Sprite}(Se),extendStatics$c=function(t,e){return extendStatics$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])},extendStatics$c(t,e)};!function(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(po||(po={}));var yo={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:po.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},go=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],vo=function(){function TextStyle(t){this.styleID=0,this.reset(),deepCopyProperties(this,t,t)}return TextStyle.prototype.clone=function(){var t={};return deepCopyProperties(t,this,yo),new TextStyle(t)},TextStyle.prototype.reset=function(){deepCopyProperties(this,yo,yo)},Object.defineProperty(TextStyle.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=getColor(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=getColor(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){(function areArraysEqual(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"padding",{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"stroke",{get:function(){return this._stroke},set:function(t){var e=getColor(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"trim",{get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(TextStyle.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},enumerable:!1,configurable:!0}),TextStyle.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var r=e.length-1;r>=0;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&go.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},TextStyle}();function getSingleColor(t){return"number"==typeof t?hex2string(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function getColor(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=getSingleColor(t[e]);return t}return getSingleColor(t)}function deepCopyProperties(t,e,r){for(var i in r)Array.isArray(e[i])?t[i]=e[i].slice():t[i]=e[i]}var To=function(){function TextMetrics(t,e,r,i,n,o,s,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h}return TextMetrics.measureText=function(t,e,r,i){void 0===i&&(i=TextMetrics._canvas),r=null==r?e.wordWrap:r;var n=e.toFontString(),o=TextMetrics.measureFont(n);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=i.getContext("2d");s.font=n;for(var a=(r?TextMetrics.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),u=0,l=0;l<a.length;l++){var c=s.measureText(a[l]).width+(a[l].length-1)*e.letterSpacing;h[l]=c,u=Math.max(u,c)}var d=u+e.strokeThickness;e.dropShadow&&(d+=e.dropShadowDistance);var p=e.lineHeight||o.fontSize+e.strokeThickness,f=Math.max(p,o.fontSize+e.strokeThickness)+(a.length-1)*(p+e.leading);return e.dropShadow&&(f+=e.dropShadowDistance),new TextMetrics(t,e,d,f,a,h,p+e.leading,u,o)},TextMetrics.wordWrap=function(t,e,r){void 0===r&&(r=TextMetrics._canvas);for(var i=r.getContext("2d"),n=0,o="",s="",a=Object.create(null),h=e.letterSpacing,u=e.whiteSpace,l=TextMetrics.collapseSpaces(u),c=TextMetrics.collapseNewlines(u),d=!l,p=e.wordWrapWidth+h,f=TextMetrics.tokenize(t),_=0;_<f.length;_++){var m=f[_];if(TextMetrics.isNewline(m)){if(!c){s+=TextMetrics.addLine(o),d=!l,o="",n=0;continue}m=" "}if(l){var y=TextMetrics.isBreakingSpace(m),g=TextMetrics.isBreakingSpace(o[o.length-1]);if(y&&g)continue}var v=TextMetrics.getFromCache(m,h,a,i);if(v>p)if(""!==o&&(s+=TextMetrics.addLine(o),o="",n=0),TextMetrics.canBreakWords(m,e.breakWords))for(var T=TextMetrics.wordWrapSplit(m),E=0;E<T.length;E++){for(var x=T[E],b=1;T[E+b];){var R=T[E+b],S=x[x.length-1];if(TextMetrics.canBreakChars(S,R,m,E,e.breakWords))break;x+=R,b++}E+=x.length-1;var A=TextMetrics.getFromCache(x,h,a,i);A+n>p&&(s+=TextMetrics.addLine(o),d=!1,o="",n=0),o+=x,n+=A}else{o.length>0&&(s+=TextMetrics.addLine(o),o="",n=0);var O=_===f.length-1;s+=TextMetrics.addLine(m,!O),d=!1,o="",n=0}else v+n>p&&(d=!1,s+=TextMetrics.addLine(o),o="",n=0),(o.length>0||!TextMetrics.isBreakingSpace(m)||d)&&(o+=m,n+=v)}return s+=TextMetrics.addLine(o,!1)},TextMetrics.addLine=function(t,e){return void 0===e&&(e=!0),t=TextMetrics.trimRight(t),t=e?t+"\n":t},TextMetrics.getFromCache=function(t,e,r,i){var n=r[t];if("number"!=typeof n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},TextMetrics.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},TextMetrics.collapseNewlines=function(t){return"normal"===t},TextMetrics.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var r=t[e];if(!TextMetrics.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},TextMetrics.isNewline=function(t){return"string"==typeof t&&TextMetrics._newlines.indexOf(t.charCodeAt(0))>=0},TextMetrics.isBreakingSpace=function(t,e){return"string"==typeof t&&TextMetrics._breakingSpaces.indexOf(t.charCodeAt(0))>=0},TextMetrics.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;i<t.length;i++){var n=t[i],o=t[i+1];TextMetrics.isBreakingSpace(n,o)||TextMetrics.isNewline(n)?(""!==r&&(e.push(r),r=""),e.push(n)):r+=n}return""!==r&&e.push(r),e},TextMetrics.canBreakWords=function(t,e){return e},TextMetrics.canBreakChars=function(t,e,r,i,n){return!0},TextMetrics.wordWrapSplit=function(t){return t.split("")},TextMetrics.measureFont=function(t){if(TextMetrics._fonts[t])return TextMetrics._fonts[t];var e={ascent:0,descent:0,fontSize:0},r=TextMetrics._canvas,i=TextMetrics._context;i.font=t;var n=TextMetrics.METRICS_STRING+TextMetrics.BASELINE_SYMBOL,o=Math.ceil(i.measureText(n).width),s=Math.ceil(i.measureText(TextMetrics.BASELINE_SYMBOL).width),a=Math.ceil(TextMetrics.HEIGHT_MULTIPLIER*s);s=s*TextMetrics.BASELINE_MULTIPLIER|0,r.width=o,r.height=a,i.fillStyle="#f00",i.fillRect(0,0,o,a),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(n,0,s);var h=i.getImageData(0,0,o,a).data,u=h.length,l=4*o,c=0,d=0,p=!1;for(c=0;c<s;++c){for(var f=0;f<l;f+=4)if(255!==h[d+f]){p=!0;break}if(p)break;d+=l}for(e.ascent=s-c,d=u-l,p=!1,c=a;c>s;--c){for(f=0;f<l;f+=4)if(255!==h[d+f]){p=!0;break}if(p)break;d-=l}return e.descent=c-s,e.fontSize=e.ascent+e.descent,TextMetrics._fonts[t]=e,e},TextMetrics.clearMetrics=function(t){void 0===t&&(t=""),t?delete TextMetrics._fonts[t]:TextMetrics._fonts={}},Object.defineProperty(TextMetrics,"_canvas",{get:function(){if(!TextMetrics.__canvas){var t=void 0;try{var e=new OffscreenCanvas(0,0),r=e.getContext("2d");if(r&&r.measureText)return TextMetrics.__canvas=e,e;t=document.createElement("canvas")}catch(e){t=document.createElement("canvas")}t.width=t.height=10,TextMetrics.__canvas=t}return TextMetrics.__canvas},enumerable:!1,configurable:!0}),Object.defineProperty(TextMetrics,"_context",{get:function(){return TextMetrics.__context||(TextMetrics.__context=TextMetrics._canvas.getContext("2d")),TextMetrics.__context},enumerable:!1,configurable:!0}),TextMetrics}();To._fonts={},To.METRICS_STRING="|ÉqÅ",To.BASELINE_SYMBOL="M",To.BASELINE_MULTIPLIER=1.4,To.HEIGHT_MULTIPLIER=2,To._newlines=[10,13],To._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var Eo={texture:!0,children:!1,baseTexture:!0},xo=function(t){function Text(e,r,i){var n=this,o=!1;i||(i=document.createElement("canvas"),o=!0),i.width=3,i.height=3;var s=or.from(i);return s.orig=new kt,s.trim=new kt,(n=t.call(this,s)||this)._ownCanvas=o,n.canvas=i,n.context=n.canvas.getContext("2d"),n._resolution=J.RESOLUTION,n._autoResolution=!0,n._text=null,n._style=null,n._styleListener=null,n._font="",n.text=e,n.style=r,n.localStyleID=-1,n}return function __extends$c(t,e){function __(){this.constructor=t}extendStatics$c(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}(Text,t),Text.prototype.updateText=function(t){var e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),this.dirty||!t){this._font=this._style.toFontString();var r,i,n=this.context,o=To.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),s=o.width,a=o.height,h=o.lines,u=o.lineHeight,l=o.lineWidths,c=o.maxLineWidth,d=o.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,s)+2*e.padding)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,a)+2*e.padding)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.lineWidth=e.strokeThickness,n.textBaseline=e.textBaseline,n.lineJoin=e.lineJoin,n.miterLimit=e.miterLimit;for(var p=e.dropShadow?2:1,f=0;f<p;++f){var _=e.dropShadow&&0===f,m=_?Math.ceil(Math.max(1,a)+2*e.padding):0,y=m*this._resolution;if(_){n.fillStyle="black",n.strokeStyle="black";var g=e.dropShadowColor,v=hex2rgb("number"==typeof g?g:string2hex(g)),T=e.dropShadowBlur*this._resolution,E=e.dropShadowDistance*this._resolution;n.shadowColor="rgba("+255*v[0]+","+255*v[1]+","+255*v[2]+","+e.dropShadowAlpha+")",n.shadowBlur=T,n.shadowOffsetX=Math.cos(e.dropShadowAngle)*E,n.shadowOffsetY=Math.sin(e.dropShadowAngle)*E+y}else n.fillStyle=this._generateFillStyle(e,h,o),n.strokeStyle=e.stroke,n.shadowColor="black",n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;var x=(u-d.fontSize)/2;(!Text.nextLineHeightBehavior||u-d.fontSize<0)&&(x=0);for(var b=0;b<h.length;b++)r=e.strokeThickness/2,i=e.strokeThickness/2+b*u+d.ascent+x,"right"===e.align?r+=c-l[b]:"center"===e.align&&(r+=(c-l[b])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(h[b],r+e.padding,i+e.padding-m,!0),e.fill&&this.drawLetterSpacing(h[b],r+e.padding,i+e.padding-m)}this.updateTexture()}},Text.prototype.drawLetterSpacing=function(t,e,r,i){void 0===i&&(i=!1);var n=this._style.letterSpacing,o=Text.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(0===n||o)return o&&(this.context.letterSpacing=n,this.context.textLetterSpacing=n),void(i?this.context.strokeText(t,e,r):this.context.fillText(t,e,r));for(var s=e,a=Array.from?Array.from(t):t.split(""),h=this.context.measureText(t).width,u=0,l=0;l<a.length;++l){var c=a[l];i?this.context.strokeText(c,s,r):this.context.fillText(c,s,r);for(var d="",p=l+1;p<a.length;++p)d+=a[p];s+=h-(u=this.context.measureText(d).width)+n,h=u}},Text.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=function trimCanvas(t){var e,r,i,n=t.width,o=t.height,s=t.getContext("2d"),a=s.getImageData(0,0,n,o).data,h=a.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e<h;e+=4)0!==a[e+3]&&(r=e/4%n,i=~~(e/4/n),null===u.top&&(u.top=i),(null===u.left||r<u.left)&&(u.left=r),(null===u.right||u.right<r)&&(u.right=r+1),(null===u.bottom||u.bottom<i)&&(u.bottom=i));return null!==u.top&&(n=u.right-u.left,o=u.bottom-u.top+1,l=s.getImageData(u.left,u.top,n,o)),{height:o,width:n,data:l}}(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var r=this._texture,i=this._style,n=i.trim?0:i.padding,o=r.baseTexture;r.trim.width=r._frame.width=t.width/this._resolution,r.trim.height=r._frame.height=t.height/this._resolution,r.trim.x=-n,r.trim.y=-n,r.orig.width=r._frame.width-2*n,r.orig.height=r._frame.height-2*n,this._onTextureUpdate(),o.setRealSize(t.width,t.height,this._resolution),r.updateUvs(),this._recursivePostUpdateTransform(),this.dirty=!1},Text.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype._render.call(this,e)},Text.prototype.getLocalBounds=function(e){return this.updateText(!0),t.prototype.getLocalBounds.call(this,e)},Text.prototype._calculateBounds=function(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)},Text.prototype._generateFillStyle=function(t,e,r){var i,n=t.fill;if(!Array.isArray(n))return n;if(1===n.length)return n[0];var o=t.dropShadow?t.dropShadowDistance:0,s=t.padding||0,a=this.canvas.width/this._resolution-o-2*s,h=this.canvas.height/this._resolution-o-2*s,u=n.slice(),l=t.fillGradientStops.slice();if(!l.length)for(var c=u.length+1,d=1;d<c;++d)l.push(d/c);if(u.unshift(n[0]),l.unshift(0),u.push(n[n.length-1]),l.push(1),t.fillGradientType===po.LINEAR_VERTICAL){i=this.context.createLinearGradient(a/2,s,a/2,h+s);var p=r.fontProperties.fontSize+t.strokeThickness;for(d=0;d<e.length;d++){var f=r.lineHeight*(d-1)+p,_=r.lineHeight*d,m=_;d>0&&f>_&&(m=(_+f)/2);var y=_+p,g=r.lineHeight*(d+1),v=y;d+1<e.length&&g<y&&(v=(y+g)/2);for(var T=(v-m)/h,E=0;E<u.length;E++){var x=0;x="number"==typeof l[E]?l[E]:E/u.length;var b=Math.min(1,Math.max(0,m/h+x*T));b=Number(b.toFixed(5)),i.addColorStop(b,u[E])}}}else{i=this.context.createLinearGradient(s,h/2,a+s,h/2);var R=u.length+1,S=1;for(d=0;d<u.length;d++){var A=void 0;A="number"==typeof l[d]?l[d]:S/R,i.addColorStop(A,u[d]),S++}}return i},Text.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},Eo,e),t.prototype.destroy.call(this,e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(Text.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var e=sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(Text.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var e=sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(Text.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},this._style=t instanceof vo?t:new vo(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(Text.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(Text.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Text.nextLineHeightBehavior=!1,Text.experimentalLetterSpacing=!1,Text}(mo);
119
+ /*!
120
+ * @pixi/prepare - v6.3.2
121
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
122
+ *
123
+ * @pixi/prepare is licensed under the MIT License.
124
+ * http://www.opensource.org/licenses/mit-license
125
+ */
126
+ J.UPLOADS_PER_FRAME=4;
127
+ /*! *****************************************************************************
128
+ Copyright (c) Microsoft Corporation. All rights reserved.
129
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
130
+ this file except in compliance with the License. You may obtain a copy of the
131
+ License at http://www.apache.org/licenses/LICENSE-2.0
132
+
133
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
134
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
135
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
136
+ MERCHANTABLITY OR NON-INFRINGEMENT.
137
+
138
+ See the Apache Version 2.0 License for specific language governing permissions
139
+ and limitations under the License.
140
+ ***************************************************************************** */
141
+ var extendStatics$b=function(t,e){return extendStatics$b=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])},extendStatics$b(t,e)};var bo=function(){function CountLimiter(t){this.maxItemsPerFrame=t,this.itemsLeft=0}return CountLimiter.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},CountLimiter.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},CountLimiter}();function findMultipleBaseTextures(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i<t._textures.length;i++)if(t._textures[i]instanceof or){var n=t._textures[i].baseTexture;-1===e.indexOf(n)&&(e.push(n),r=!0)}return r}function findBaseTexture(t,e){if(t.baseTexture instanceof Ye){var r=t.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function findTexture(t,e){if(t._texture&&t._texture instanceof or){var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function drawText(t,e){return e instanceof xo&&(e.updateText(!0),!0)}function calculateTextStyle(t,e){if(e instanceof vo){var r=e.toFontString();return To.measureFont(r),!0}return!1}function findText(t,e){if(t instanceof xo){-1===e.indexOf(t.style)&&e.push(t.style),-1===e.indexOf(t)&&e.push(t);var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function findTextStyle(t,e){return t instanceof vo&&(-1===e.indexOf(t)&&e.push(t),!0)}function uploadBaseTextures(t,e){return e instanceof Ye&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function uploadGraphics(t,e){if(!(e instanceof co))return!1;var r=e.geometry;e.finishPoly(),r.updateBatches();for(var i=r.batches,n=0;n<i.length;n++){var o=i[n].style.texture;o&&uploadBaseTextures(t,o.baseTexture)}return r.batchable||t.geometry.bind(r,e._resolveDirectShader(t)),!0}function findGraphics(t,e){return t instanceof co&&(e.push(t),!0)}var Ro=function(t){function Prepare(e){var r=t.call(this,e)||this;return r.uploadHookHelper=r.renderer,r.registerFindHook(findGraphics),r.registerUploadHook(uploadBaseTextures),r.registerUploadHook(uploadGraphics),r}return function __extends$b(t,e){function __(){this.constructor=t}extendStatics$b(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}(Prepare,t),Prepare}(function(){function BasePrepare(t){var e=this;this.limiter=new bo(J.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(findText),this.registerFindHook(findTextStyle),this.registerFindHook(findMultipleBaseTextures),this.registerFindHook(findBaseTexture),this.registerFindHook(findTexture),this.registerUploadHook(drawText),this.registerUploadHook(calculateTextStyle)}return BasePrepare.prototype.upload=function(t,e){"function"==typeof t&&(e=t,t=null),t&&this.add(t),this.queue.length?(e&&this.completes.push(e),this.ticking||(this.ticking=!0,Me.system.addOnce(this.tick,this,Ae.UTILITY))):e&&e()},BasePrepare.prototype.tick=function(){setTimeout(this.delayedTick,0)},BasePrepare.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var t=this.queue[0],e=!1;if(t&&!t._destroyed)for(var r=0,i=this.uploadHooks.length;r<i;r++)if(this.uploadHooks[r](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)Me.system.addOnce(this.tick,this,Ae.UTILITY);else{this.ticking=!1;var n=this.completes.slice(0);this.completes.length=0;for(r=0,i=n.length;r<i;r++)n[r]()}},BasePrepare.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},BasePrepare.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},BasePrepare.prototype.add=function(t){for(var e=0,r=this.addHooks.length;e<r&&!this.addHooks[e](t,this.queue);e++);if(t instanceof Se)for(e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this},BasePrepare.prototype.destroy=function(){this.ticking&&Me.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},BasePrepare}()),So=function(){function Spritesheet(t,e,r){void 0===r&&(r=null),this._texture=t instanceof or?t:null,this.baseTexture=t instanceof Ye?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;var i=this.baseTexture.resource;this.resolution=this._updateResolution(r||(i?i.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return Spritesheet.prototype._updateResolution=function(t){void 0===t&&(t=null);var e=this.data.meta.scale,r=getResolutionOfUrl(t,null);return null===r&&(r=void 0!==e?parseFloat(e):1),1!==r&&this.baseTexture.setResolution(r),r},Spritesheet.prototype.parse=function(t){this._batchIndex=0,this._callback=t,this._frameKeys.length<=Spritesheet.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},Spritesheet.prototype._processFrames=function(t){for(var e=t,r=Spritesheet.BATCH_SIZE;e-t<r&&e<this._frameKeys.length;){var i=this._frameKeys[e],n=this._frames[i],o=n.frame;if(o){var s=null,a=null,h=!1!==n.trimmed&&n.sourceSize?n.sourceSize:n.frame,u=new kt(0,0,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution);s=n.rotated?new kt(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):new kt(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),!1!==n.trimmed&&n.spriteSourceSize&&(a=new kt(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[i]=new or(this.baseTexture,s,u,a,n.rotated?2:0,n.anchor),or.addToCache(this.textures[i],i)}e++}},Spritesheet.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var r=0;r<t[e].length;r++){var i=t[e][r];this.animations[e].push(this.textures[i])}}},Spritesheet.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},Spritesheet.prototype._nextBatch=function(){var t=this;this._processFrames(this._batchIndex*Spritesheet.BATCH_SIZE),this._batchIndex++,setTimeout((function(){t._batchIndex*Spritesheet.BATCH_SIZE<t._frameKeys.length?t._nextBatch():(t._processAnimations(),t._parseComplete())}),0)},Spritesheet.prototype.destroy=function(t){var e;for(var r in void 0===t&&(t=!1),this.textures)this.textures[r].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(null===(e=this._texture)||void 0===e||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null},Spritesheet.BATCH_SIZE=1e3,Spritesheet}(),Ao=function(){function SpritesheetLoader(){}return SpritesheetLoader.use=function(t,e){var r,i,n=this,o=t.name+"_image";if(t.data&&t.type===ji.TYPE.JSON&&t.data.frames&&!n.resources[o]){var s=null===(i=null===(r=t.data)||void 0===r?void 0:r.meta)||void 0===i?void 0:i.related_multi_packs;if(Array.isArray(s))for(var _loop_1=function(e){if("string"!=typeof e)return"continue";var r=e.replace(".json",""),i=bt.resolve(t.url.replace(n.baseUrl,""),e);if(n.resources[r]||Object.values(n.resources).some((function(t){return bt.format(bt.parse(t.url))===i})))return"continue";var o={crossOrigin:t.crossOrigin,loadType:ji.LOAD_TYPE.XHR,xhrType:ji.XHR_RESPONSE_TYPE.JSON,parentResource:t,metadata:t.metadata};n.add(r,i,o)},a=0,h=s;a<h.length;a++){_loop_1(h[a])}var u={crossOrigin:t.crossOrigin,metadata:t.metadata.imageMetadata,parentResource:t},l=SpritesheetLoader.getResourcePath(t,n.baseUrl);n.add(o,l,u,(function onImageLoad(r){if(r.error)e(r.error);else{var i=new So(r.texture,t.data,t.url);i.parse((function(){t.spritesheet=i,t.textures=i.textures,e()}))}}))}else e()},SpritesheetLoader.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:bt.resolve(t.url.replace(e,""),t.data.meta.image)},SpritesheetLoader}(),extendStatics$a=function(t,e){return extendStatics$a=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])},extendStatics$a(t,e)};
142
+ /*!
143
+ * @pixi/spritesheet - v6.3.2
144
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
145
+ *
146
+ * @pixi/spritesheet is licensed under the MIT License.
147
+ * http://www.opensource.org/licenses/mit-license
148
+ */function __extends$a(t,e){function __(){this.constructor=t}extendStatics$a(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}var Oo=new Ut;!function(t){function TilingSprite(e,r,i){void 0===r&&(r=100),void 0===i&&(i=100);var n=t.call(this,e)||this;return n.tileTransform=new re,n._width=r,n._height=i,n.uvMatrix=n.texture.uvMatrix||new Qr(e),n.pluginName="tilingSprite",n.uvRespectAnchor=!1,n}__extends$a(TilingSprite,t),Object.defineProperty(TilingSprite.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(TilingSprite.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(TilingSprite.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),TilingSprite.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},TilingSprite.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},TilingSprite.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,r=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,r,i)},TilingSprite.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new kt),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},TilingSprite.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Oo);var e=this._width,r=this._height,i=-e*this.anchor._x;if(Oo.x>=i&&Oo.x<i+e){var n=-r*this.anchor._y;if(Oo.y>=n&&Oo.y<n+r)return!0}return!1},TilingSprite.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},TilingSprite.from=function(t,e){return new TilingSprite(t instanceof or?t:or.from(t,e),e.width,e.height)},Object.defineProperty(TilingSprite.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(TilingSprite.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0})}(mo);var Io="#version 100\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying 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",Po=new zt,Mo=function(t){function TilingSpriteRenderer(e){var r=t.call(this,e)||this;return e.runners.contextChange.add(r),r.quad=new yr,r.state=qr.for2d(),r}return __extends$a(TilingSpriteRenderer,t),TilingSpriteRenderer.prototype.contextChange=function(){var t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=Kr.from(Io,"#version 100\n#define SHADER_NAME Tiling-Sprite-Simple-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 texSample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = texSample * uColor;\n}\n",e),this.shader=t.context.webGLVersion>1?Kr.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",e):Kr.from(Io,"#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",e)},TilingSpriteRenderer.prototype.render=function(t){var e=this.renderer,r=this.quad,i=r.vertices;i[0]=i[6]=t._width*-t.anchor.x,i[1]=i[3]=t._height*-t.anchor.y,i[2]=i[4]=t._width*(1-t.anchor.x),i[5]=i[7]=t._height*(1-t.anchor.y);var n=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;(i=r.uvs)[0]=i[6]=-n,i[1]=i[3]=-o,i[2]=i[4]=1-n,i[5]=i[7]=1-o,r.invalidate();var s=t._texture,a=s.baseTexture,h=t.tileTransform.localTransform,u=t.uvMatrix,l=a.isPowerOfTwo&&s.frame.width===a.width&&s.frame.height===a.height;l&&(a._glTextures[e.CONTEXT_UID]?l=a.wrapMode!==pt.CLAMP:a.wrapMode===pt.CLAMP&&(a.wrapMode=pt.REPEAT));var c=l?this.simpleShader:this.shader,d=s.width,p=s.height,f=t._width,_=t._height;Po.set(h.a*d/f,h.b*d/_,h.c*p/f,h.d*p/_,h.tx/f,h.ty/_),Po.invert(),l?Po.prepend(u.mapCoord):(c.uniforms.uMapCoord=u.mapCoord.toArray(!0),c.uniforms.uClampFrame=u.uClampFrame,c.uniforms.uClampOffset=u.uClampOffset),c.uniforms.uTransform=Po.toArray(!0),c.uniforms.uColor=premultiplyTintToRgba(t.tint,t.worldAlpha,c.uniforms.uColor,a.alphaMode),c.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),c.uniforms.uSampler=s,e.shader.bind(c),e.geometry.bind(r),this.state.blendMode=correctBlendMode(t.blendMode,a.alphaMode),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},TilingSpriteRenderer}(Rr),extendStatics$9=function(t,e){return extendStatics$9=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])},extendStatics$9(t,e)};function __extends$9(t,e){function __(){this.constructor=t}extendStatics$9(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}var Do=function(){function MeshBatchUvs(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return MeshBatchUvs.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++}},MeshBatchUvs}(),No=new Ut,Co=new Yt,wo=function(t){function Mesh(e,r,i,n){void 0===n&&(n=at.TRIANGLES);var o=t.call(this)||this;return o.geometry=e,o.shader=r,o.state=i||qr.for2d(),o.drawMode=n,o.start=0,o.size=0,o.uvs=null,o.indices=null,o.vertexData=new Float32Array(1),o.vertexDirty=-1,o._transformID=-1,o._roundPixels=J.ROUND_PIXELS,o.batchUvs=null,o}return __extends$9(Mesh,t),Object.defineProperty(Mesh.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(Mesh.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(Mesh.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(Mesh.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(Mesh.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(Mesh.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(Mesh.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(Mesh.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),Mesh.prototype._render=function(t){var e=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===at.TRIANGLES&&e.length<2*Mesh.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},Mesh.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)},Mesh.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)},Mesh.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,s=i.c,a=i.d,h=i.tx,u=i.ty,l=this.vertexData,c=0;c<l.length/2;c++){var d=e[2*c],p=e[2*c+1];l[2*c]=n*d+s*p+h,l[2*c+1]=o*d+a*p+u}if(this._roundPixels){var f=J.RESOLUTION;for(c=0;c<l.length;++c)l[c]=Math.round((l[c]*f|0)/f)}this.vertexDirty=r}},Mesh.prototype.calculateUvs=function(){var t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new Do(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},Mesh.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},Mesh.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,No);for(var e=this.geometry.getBuffer("aVertexPosition").data,r=Co.points,i=this.geometry.getIndex().data,n=i.length,o=4===this.drawMode?3:1,s=0;s+2<n;s+=o){var a=2*i[s],h=2*i[s+1],u=2*i[s+2];if(r[0]=e[a],r[1]=e[a+1],r[2]=e[h],r[3]=e[h+1],r[4]=e[u],r[5]=e[u+1],Co.contains(No.x,No.y))return!0}return!1},Mesh.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},Mesh.BATCHABLE_SIZE=100,Mesh}(Se),Lo=function(t){function MeshMaterial(e,r){var i=this,n={uSampler:e,alpha:1,uTextureMatrix:zt.IDENTITY,uColor:new Float32Array([1,1,1,1])};return(r=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},r)).uniforms&&Object.assign(n,r.uniforms),(i=t.call(this,r.program||zr.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying 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 = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),n)||this)._colorDirty=!1,i.uvMatrix=new Qr(e),i.batchable=void 0===r.program,i.pluginName=r.pluginName,i.tint=r.tint,i.alpha=r.alpha,i}return __extends$9(MeshMaterial,t),Object.defineProperty(MeshMaterial.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(MeshMaterial.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(MeshMaterial.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),MeshMaterial.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;premultiplyTintToRgba(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},MeshMaterial}(Kr),Fo=function(t){function MeshGeometry(e,r,i){var n=t.call(this)||this,o=new lr(e),s=new lr(r,!0),a=new lr(i,!0,!0);return n.addAttribute("aVertexPosition",o,2,!1,lt.FLOAT).addAttribute("aTextureCoord",s,2,!1,lt.FLOAT).addIndex(a),n._updateId=-1,n}return __extends$9(MeshGeometry,t),Object.defineProperty(MeshGeometry.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),MeshGeometry}(_r),extendStatics$8=function(t,e){return extendStatics$8=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])},extendStatics$8(t,e)};var Bo=function Bo(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},Go=function(){function TextFormat(){}return TextFormat.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},TextFormat.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var i in e){var n=e[i].match(/^[a-z]+/gm)[0],o=e[i].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),s={};for(var a in o){var h=o[a].split("="),u=h[0],l=h[1].replace(/"/gm,""),c=parseFloat(l),d=isNaN(c)?l:c;s[u]=d}r[n].push(s)}var p=new Bo;return r.info.forEach((function(t){return p.info.push({face:t.face,size:parseInt(t.size,10)})})),r.common.forEach((function(t){return p.common.push({lineHeight:parseInt(t.lineHeight,10)})})),r.page.forEach((function(t){return p.page.push({id:parseInt(t.id,10),file:t.file})})),r.char.forEach((function(t){return p.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})})),r.kerning.forEach((function(t){return p.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})})),r.distanceField.forEach((function(t){return p.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType})})),p},TextFormat}(),Uo=function(){function XMLFormat(){}return XMLFormat.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},XMLFormat.parse=function(t){for(var e=new Bo,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),s=t.getElementsByTagName("kerning"),a=t.getElementsByTagName("distanceField"),h=0;h<r.length;h++)e.info.push({face:r[h].getAttribute("face"),size:parseInt(r[h].getAttribute("size"),10)});for(h=0;h<i.length;h++)e.common.push({lineHeight:parseInt(i[h].getAttribute("lineHeight"),10)});for(h=0;h<n.length;h++)e.page.push({id:parseInt(n[h].getAttribute("id"),10)||0,file:n[h].getAttribute("file")});for(h=0;h<o.length;h++){var u=o[h];e.char.push({id:parseInt(u.getAttribute("id"),10),page:parseInt(u.getAttribute("page"),10)||0,x:parseInt(u.getAttribute("x"),10),y:parseInt(u.getAttribute("y"),10),width:parseInt(u.getAttribute("width"),10),height:parseInt(u.getAttribute("height"),10),xoffset:parseInt(u.getAttribute("xoffset"),10),yoffset:parseInt(u.getAttribute("yoffset"),10),xadvance:parseInt(u.getAttribute("xadvance"),10)})}for(h=0;h<s.length;h++)e.kerning.push({first:parseInt(s[h].getAttribute("first"),10),second:parseInt(s[h].getAttribute("second"),10),amount:parseInt(s[h].getAttribute("amount"),10)});for(h=0;h<a.length;h++)e.distanceField.push({fieldType:a[h].getAttribute("fieldType"),distanceRange:parseInt(a[h].getAttribute("distanceRange"),10)});return e},XMLFormat}(),Xo=function(){function XMLStringFormat(){}return XMLStringFormat.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new globalThis.DOMParser).parseFromString(t,"text/xml");return Uo.test(e)}return!1},XMLStringFormat.parse=function(t){var e=(new globalThis.DOMParser).parseFromString(t,"text/xml");return Uo.parse(e)},XMLStringFormat}(),ko=[Go,Uo,Xo];function autoDetectFormat(t){for(var e=0;e<ko.length;e++)if(ko[e].test(t))return ko[e];return null}function drawGlyph(t,e,r,i,n,o,s){var a=r.text,h=r.fontProperties;e.translate(i,n),e.scale(o,o);var u=s.strokeThickness/2,l=-s.strokeThickness/2;if(e.font=s.toFontString(),e.lineWidth=s.strokeThickness,e.textBaseline=s.textBaseline,e.lineJoin=s.lineJoin,e.miterLimit=s.miterLimit,e.fillStyle=function generateFillStyle(t,e,r,i,n,o){var s,a=r.fill;if(!Array.isArray(a))return a;if(1===a.length)return a[0];var h=r.dropShadow?r.dropShadowDistance:0,u=r.padding||0,l=t.width/i-h-2*u,c=t.height/i-h-2*u,d=a.slice(),p=r.fillGradientStops.slice();if(!p.length)for(var f=d.length+1,_=1;_<f;++_)p.push(_/f);if(d.unshift(a[0]),p.unshift(0),d.push(a[a.length-1]),p.push(1),r.fillGradientType===po.LINEAR_VERTICAL){s=e.createLinearGradient(l/2,u,l/2,c+u);var m=0,y=(o.fontProperties.fontSize+r.strokeThickness)/c;for(_=0;_<n.length;_++)for(var g=o.lineHeight*_,v=0;v<d.length;v++){var T=g/c+("number"==typeof p[v]?p[v]:v/d.length)*y,E=Math.max(m,T);E=Math.min(E,1),s.addColorStop(E,d[v]),m=E}}else{s=e.createLinearGradient(u,c/2,l+u,c/2);var x=d.length+1,b=1;for(_=0;_<d.length;_++){var R=void 0;R="number"==typeof p[_]?p[_]:b/x,s.addColorStop(R,d[_]),b++}}return s}(t,e,s,o,[a],r),e.strokeStyle=s.stroke,s.dropShadow){var c=s.dropShadowColor,d=hex2rgb("number"==typeof c?c:string2hex(c)),p=s.dropShadowBlur*o,f=s.dropShadowDistance*o;e.shadowColor="rgba("+255*d[0]+","+255*d[1]+","+255*d[2]+","+s.dropShadowAlpha+")",e.shadowBlur=p,e.shadowOffsetX=Math.cos(s.dropShadowAngle)*f,e.shadowOffsetY=Math.sin(s.dropShadowAngle)*f}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;s.stroke&&s.strokeThickness&&e.strokeText(a,u,l+r.lineHeight-h.descent),s.fill&&e.fillText(a,u,l+r.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function splitTextToCharacters(t){return Array.from?Array.from(t):t.split("")}function extractCharCode(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}var Ho=function(){function BitmapFont(t,e,r){var i,n,o=t.info[0],s=t.common[0],a=t.page[0],h=t.distanceField[0],u=getResolutionOfUrl(a.file),l={};this._ownsTextures=r,this.font=o.face,this.size=o.size,this.lineHeight=s.lineHeight/u,this.chars={},this.pageTextures=l;for(var c=0;c<t.page.length;c++){var d=t.page[c],p=d.id,f=d.file;l[p]=e instanceof Array?e[c]:e[f],(null==h?void 0:h.fieldType)&&"none"!==h.fieldType&&(l[p].baseTexture.alphaMode=_t.NO_PREMULTIPLIED_ALPHA)}for(c=0;c<t.char.length;c++){var _=t.char[c],m=(p=_.id,_.page),y=t.char[c],g=y.x,v=y.y,T=y.width,E=y.height,x=y.xoffset,b=y.yoffset,R=y.xadvance;v/=u,T/=u,E/=u,x/=u,b/=u,R/=u;var S=new kt((g/=u)+l[m].frame.x/u,v+l[m].frame.y/u,T,E);this.chars[p]={xOffset:x,yOffset:b,xAdvance:R,kerning:{},texture:new or(l[m].baseTexture,S),page:m}}for(c=0;c<t.kerning.length;c++){var A=t.kerning[c],O=A.first,I=A.second,P=A.amount;O/=u,I/=u,P/=u,this.chars[I]&&(this.chars[I].kerning[O]=P)}this.distanceFieldRange=null==h?void 0:h.distanceRange,this.distanceFieldType=null!==(n=null===(i=null==h?void 0:h.fieldType)||void 0===i?void 0:i.toLowerCase())&&void 0!==n?n:"none"}return BitmapFont.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},BitmapFont.install=function(t,e,r){var i;if(t instanceof Bo)i=t;else{var n=autoDetectFormat(t);if(!n)throw new Error("Unrecognized data format for font.");i=n.parse(t)}e instanceof or&&(e=[e]);var o=new BitmapFont(i,e,r);return BitmapFont.available[o.font]=o,o},BitmapFont.uninstall=function(t){var e=BitmapFont.available[t];if(!e)throw new Error("No font found named '"+t+"'");e.destroy(),delete BitmapFont.available[t]},BitmapFont.from=function(t,e,r){if(!t)throw new Error("[BitmapFont] Property `name` is required.");var i=Object.assign({},BitmapFont.defaultOptions,r),n=i.chars,o=i.padding,s=i.resolution,a=i.textureWidth,h=i.textureHeight,u=function resolveCharacters(t){"string"==typeof t&&(t=[t]);for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r];if(Array.isArray(n)){if(2!==n.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var o=n[0].charCodeAt(0),s=n[1].charCodeAt(0);if(s<o)throw new Error("[BitmapFont]: Invalid character range.");for(var a=o,h=s;a<=h;a++)e.push(String.fromCharCode(a))}else e.push.apply(e,splitTextToCharacters(n))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(n),l=e instanceof vo?e:new vo(e),c=a,d=new Bo;d.info[0]={face:l.fontFamily,size:l.fontSize},d.common[0]={lineHeight:l.fontSize};for(var p,f,_,m=0,y=0,g=0,v=[],T=0;T<u.length;T++){p||((p=document.createElement("canvas")).width=a,p.height=h,f=p.getContext("2d"),_=new Ye(p,{resolution:s}),v.push(new or(_)),d.page.push({id:v.length-1,file:""}));var E=To.measureText(u[T],l,!1,p),x=E.width,b=Math.ceil(E.height),R=Math.ceil(("italic"===l.fontStyle?2:1)*x);if(y>=h-b*s){if(0===y)throw new Error("[BitmapFont] textureHeight "+h+"px is too small for "+l.fontSize+"px fonts");--T,p=null,f=null,_=null,y=0,m=0,g=0}else if(g=Math.max(b+E.fontProperties.descent,g),R*s+m>=c)--T,y+=g*s,y=Math.ceil(y),m=0,g=0;else{drawGlyph(p,f,E,m,y,s,l);var S=extractCharCode(E.text);d.char.push({id:S,page:v.length-1,x:m/s,y:y/s,width:R,height:b,xoffset:0,yoffset:0,xadvance:Math.ceil(x-(l.dropShadow?l.dropShadowDistance:0)-(l.stroke?l.strokeThickness:0))}),m+=(R+2*o)*s,m=Math.ceil(m)}}T=0;for(var A=u.length;T<A;T++)for(var O=u[T],I=0;I<A;I++){var P=u[I],M=f.measureText(O).width,D=f.measureText(P).width,N=f.measureText(O+P).width-(M+D);N&&d.kerning.push({first:extractCharCode(O),second:extractCharCode(P),amount:N})}var C=new BitmapFont(d,v,!0);return void 0!==BitmapFont.available[t]&&BitmapFont.uninstall(t),BitmapFont.available[t]=C,C},BitmapFont.ALPHA=[["a","z"],["A","Z"]," "],BitmapFont.NUMERIC=[["0","9"]],BitmapFont.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],BitmapFont.ASCII=[[" ","~"]],BitmapFont.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:BitmapFont.ALPHANUMERIC},BitmapFont.available={},BitmapFont}(),jo=[],Yo=[],Vo=[];!function(t){function BitmapText(e,r){void 0===r&&(r={});var i=t.call(this)||this;i._tint=16777215;var n=Object.assign({},BitmapText.styleDefaults,r),o=n.align,s=n.tint,a=n.maxWidth,h=n.letterSpacing,u=n.fontName,l=n.fontSize;if(!Ho.available[u])throw new Error('Missing BitmapFont "'+u+'"');return i._activePagesMeshData=[],i._textWidth=0,i._textHeight=0,i._align=o,i._tint=s,i._fontName=u,i._fontSize=l||Ho.available[u].size,i.text=e,i._maxWidth=a,i._maxLineHeight=0,i._letterSpacing=h,i._anchor=new Wt((function(){i.dirty=!0}),i,0,0),i._roundPixels=J.ROUND_PIXELS,i.dirty=!0,i._textureCache={},i}(function __extends$8(t,e){function __(){this.constructor=t}extendStatics$8(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)})(BitmapText,t),BitmapText.prototype.updateText=function(){for(var t,e=Ho.available[this._fontName],r=this._fontSize/e.size,i=new Ut,n=[],o=[],s=[],a=splitTextToCharacters(this._text.replace(/(?:\r\n|\r)/g,"\n")||" "),h=this._maxWidth*e.size/this._fontSize,u="none"===e.distanceFieldType?jo:Yo,l=null,c=0,d=0,p=0,f=-1,_=0,m=0,y=0,g=0,v=0;v<a.length;v++){var T=extractCharCode(X=a[v]);if(/(?:\s)/.test(X)&&(f=v,_=c,g++),"\r"!==X&&"\n"!==X){var E=e.chars[T];if(E){l&&E.kerning[l]&&(i.x+=E.kerning[l]);var x=Vo.pop()||{texture:or.EMPTY,line:0,charCode:0,prevSpaces:0,position:new Ut};x.texture=E.texture,x.line=p,x.charCode=T,x.position.x=i.x+E.xOffset+this._letterSpacing/2,x.position.y=i.y+E.yOffset,x.prevSpaces=g,n.push(x),c=x.position.x+Math.max(E.xAdvance,E.texture.orig.width),i.x+=E.xAdvance+this._letterSpacing,y=Math.max(y,E.yOffset+E.texture.height),l=T,-1!==f&&h>0&&i.x>h&&(removeItems(n,1+f-++m,1+v-f),v=f,f=-1,o.push(_),s.push(n.length>0?n[n.length-1].prevSpaces:0),d=Math.max(d,_),p++,i.x=0,i.y+=e.lineHeight,l=null,g=0)}}else o.push(c),s.push(-1),d=Math.max(d,c),++p,++m,i.x=0,i.y+=e.lineHeight,l=null,g=0}var b=a[a.length-1];"\r"!==b&&"\n"!==b&&(/(?:\s)/.test(b)&&(c=_),o.push(c),d=Math.max(d,c),s.push(-1));var R=[];for(v=0;v<=p;v++){var S=0;"right"===this._align?S=d-o[v]:"center"===this._align?S=(d-o[v])/2:"justify"===this._align&&(S=s[v]<0?0:(d-o[v])/s[v]),R.push(S)}var A=n.length,O={},I=[],P=this._activePagesMeshData;for(v=0;v<P.length;v++)u.push(P[v]);for(v=0;v<A;v++){var M=(H=n[v].texture).baseTexture.uid;if(!O[M]){if(!(q=u.pop())){var D=new Fo,N=void 0,C=void 0;"none"===e.distanceFieldType?(N=new Lo(or.EMPTY),C=st.NORMAL):(N=new Lo(or.EMPTY,{program:zr.from("// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n","// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n // MSDF\r\n float median = texColor.r + texColor.g + texColor.b -\r\n min(texColor.r, min(texColor.g, texColor.b)) -\r\n max(texColor.r, max(texColor.g, texColor.b));\r\n // SDF\r\n median = min(median, texColor.a);\r\n\r\n float screenPxDistance = uFWidth * (median - 0.5);\r\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n"),uniforms:{uFWidth:0}}),C=st.NORMAL_NPM);var w=new wo(D,N);w.blendMode=C,q={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:w,vertices:null,uvs:null,indices:null}}q.index=0,q.indexCount=0,q.vertexCount=0,q.uvsCount=0,q.total=0;var L=this._textureCache;L[M]=L[M]||new or(H.baseTexture),q.mesh.texture=L[M],q.mesh.tint=this._tint,I.push(q),O[M]=q}O[M].total++}for(v=0;v<P.length;v++)-1===I.indexOf(P[v])&&this.removeChild(P[v].mesh);for(v=0;v<I.length;v++)I[v].mesh.parent!==this&&this.addChild(I[v].mesh);for(var v in this._activePagesMeshData=I,O){var F=(q=O[v]).total;if(!((null===(t=q.indices)||void 0===t?void 0:t.length)>6*F)||q.vertices.length<2*wo.BATCHABLE_SIZE)q.vertices=new Float32Array(8*F),q.uvs=new Float32Array(8*F),q.indices=new Uint16Array(6*F);else for(var B=q.total,G=q.vertices,U=4*B*2;U<G.length;U++)G[U]=0;q.mesh.size=6*F}for(v=0;v<A;v++){var X,k=(X=n[v]).position.x+R[X.line]*("justify"===this._align?X.prevSpaces:1);this._roundPixels&&(k=Math.round(k));var H,j=k*r,Y=X.position.y*r,V=O[(H=X.texture).baseTexture.uid],W=H.frame,z=H._uvs,K=V.index++;V.indices[6*K+0]=0+4*K,V.indices[6*K+1]=1+4*K,V.indices[6*K+2]=2+4*K,V.indices[6*K+3]=0+4*K,V.indices[6*K+4]=2+4*K,V.indices[6*K+5]=3+4*K,V.vertices[8*K+0]=j,V.vertices[8*K+1]=Y,V.vertices[8*K+2]=j+W.width*r,V.vertices[8*K+3]=Y,V.vertices[8*K+4]=j+W.width*r,V.vertices[8*K+5]=Y+W.height*r,V.vertices[8*K+6]=j,V.vertices[8*K+7]=Y+W.height*r,V.uvs[8*K+0]=z.x0,V.uvs[8*K+1]=z.y0,V.uvs[8*K+2]=z.x1,V.uvs[8*K+3]=z.y1,V.uvs[8*K+4]=z.x2,V.uvs[8*K+5]=z.y2,V.uvs[8*K+6]=z.x3,V.uvs[8*K+7]=z.y3}for(var v in this._textWidth=d*r,this._textHeight=(i.y+e.lineHeight)*r,O){var q=O[v];if(0!==this.anchor.x||0!==this.anchor.y)for(var $=0,Z=this._textWidth*this.anchor.x,Q=this._textHeight*this.anchor.y,J=0;J<q.total;J++)q.vertices[$++]-=Z,q.vertices[$++]-=Q,q.vertices[$++]-=Z,q.vertices[$++]-=Q,q.vertices[$++]-=Z,q.vertices[$++]-=Q,q.vertices[$++]-=Z,q.vertices[$++]-=Q;this._maxLineHeight=y*r;var tt=q.mesh.geometry.getBuffer("aVertexPosition"),et=q.mesh.geometry.getBuffer("aTextureCoord"),rt=q.mesh.geometry.getIndex();tt.data=q.vertices,et.data=q.uvs,rt.data=q.indices,tt.update(),et.update(),rt.update()}for(v=0;v<n.length;v++)Vo.push(n[v])},BitmapText.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},BitmapText.prototype._render=function(e){var r=Ho.available[this._fontName],i=r.distanceFieldRange,n=r.distanceFieldType,o=r.size;if("none"!==n)for(var s=this.worldTransform,a=s.a,h=s.b,u=s.c,l=s.d,c=Math.sqrt(a*a+h*h),d=Math.sqrt(u*u+l*l),p=(Math.abs(c)+Math.abs(d))/2,f=this._fontSize/o,_=0,m=this._activePagesMeshData;_<m.length;_++){m[_].mesh.shader.uniforms.uFWidth=p*i*f*e.resolution}t.prototype._render.call(this,e)},BitmapText.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},BitmapText.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(BitmapText.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!Ho.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(BitmapText.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),BitmapText.prototype.destroy=function(e){var r=this._textureCache;for(var i in r){r[i].destroy(),delete r[i]}this._textureCache=null,t.prototype.destroy.call(this,e)},BitmapText.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0}}(Se);var Wo=function(){function BitmapFontLoader(){}return BitmapFontLoader.add=function(){ji.setExtensionXhrType("fnt",ji.XHR_RESPONSE_TYPE.TEXT)},BitmapFontLoader.use=function(t,e){var r=autoDetectFormat(t.data);if(r)for(var i=BitmapFontLoader.getBaseUrl(this,t),n=r.parse(t.data),o={},completed=function(r){o[r.metadata.pageFile]=r.texture,Object.keys(o).length===n.page.length&&(t.bitmapFont=Ho.install(n,o,!0),e())},s=0;s<n.page.length;++s){var a=n.page[s].file,h=i+a,u=!1;for(var l in this.resources){var c=this.resources[l];if(c.url===h){c.metadata.pageFile=a,c.texture?completed(c):c.onAfterMiddleware.add(completed),u=!0;break}}if(!u){var d={crossOrigin:t.crossOrigin,loadType:ji.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:a},t.metadata.imageMetadata),parentResource:t};this.add(h,d,completed)}}else e()},BitmapFontLoader.getBaseUrl=function(t,e){var r=e.isDataUrl?"":BitmapFontLoader.dirname(e.url);return e.isDataUrl&&("."===r&&(r=""),t.baseUrl&&r&&"/"===t.baseUrl.charAt(t.baseUrl.length-1)&&(r+="/")),(r=r.replace(t.baseUrl,""))&&"/"!==r.charAt(r.length-1)&&(r+="/"),r},BitmapFontLoader.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},BitmapFontLoader}(),extendStatics$7=function(t,e){return extendStatics$7=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])},extendStatics$7(t,e)};
149
+ /*!
150
+ * @pixi/filter-alpha - v6.3.2
151
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
152
+ *
153
+ * @pixi/filter-alpha is licensed under the MIT License.
154
+ * http://www.opensource.org/licenses/mit-license
155
+ */
156
+ /*! *****************************************************************************
157
+ Copyright (c) Microsoft Corporation. All rights reserved.
158
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
159
+ this file except in compliance with the License. You may obtain a copy of the
160
+ License at http://www.apache.org/licenses/LICENSE-2.0
161
+
162
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
163
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
164
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
165
+ MERCHANTABLITY OR NON-INFRINGEMENT.
166
+
167
+ See the Apache Version 2.0 License for specific language governing permissions
168
+ and limitations under the License.
169
+ ***************************************************************************** */!function(t){function AlphaFilter(e){void 0===e&&(e=1);var r=t.call(this,"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}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",{uAlpha:1})||this;return r.alpha=e,r}(function __extends$7(t,e){function __(){this.constructor=t}extendStatics$7(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)})(AlphaFilter,t),Object.defineProperty(AlphaFilter.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0})}($r);
170
+ /*!
171
+ * @pixi/filter-blur - v6.3.2
172
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
173
+ *
174
+ * @pixi/filter-blur is licensed under the MIT License.
175
+ * http://www.opensource.org/licenses/mit-license
176
+ */
177
+ /*! *****************************************************************************
178
+ Copyright (c) Microsoft Corporation. All rights reserved.
179
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
180
+ this file except in compliance with the License. You may obtain a copy of the
181
+ License at http://www.apache.org/licenses/LICENSE-2.0
182
+
183
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
184
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
185
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
186
+ MERCHANTABLITY OR NON-INFRINGEMENT.
187
+
188
+ See the Apache Version 2.0 License for specific language governing permissions
189
+ and limitations under the License.
190
+ ***************************************************************************** */
191
+ var extendStatics$6=function(t,e){return extendStatics$6=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])},extendStatics$6(t,e)};function __extends$6(t,e){function __(){this.constructor=t}extendStatics$6(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}var zo,Ko,qo,$o,Zo,Qo,Jo,ts,es,rs,is,ns,os,ss,as,hs,us,ls,cs,ds={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},ps=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join("\n");!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(zo||(zo={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(Ko||(Ko={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(qo||(qo={})),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"}($o||($o={})),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"}(Zo||(Zo={})),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"}(Qo||(Qo={})),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"}(Jo||(Jo={})),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"}(ts||(ts={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(es||(es={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(rs||(rs={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(is||(is={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(ns||(ns={})),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"}(os||(os={})),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"}(ss||(ss={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(as||(as={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(hs||(hs={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(us||(us={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(ls||(ls={})),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"}(cs||(cs={}));var fs=function(t){function BlurFilterPass(e,r,i,n,o){void 0===r&&(r=8),void 0===i&&(i=4),void 0===n&&(n=J.FILTER_RESOLUTION),void 0===o&&(o=5);var s=this,a=function generateBlurVertSource(t,e){var r,i=Math.ceil(t/2),n="\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 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\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }",o="";r=e?"vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var s=0;s<t;s++){var a=r.replace("%index%",s.toString());o+=a=a.replace("%sampleIndex%",s-(i-1)+".0"),o+="\n"}return(n=n.replace("%blur%",o)).replace("%size%",t.toString())}(o,e),h=function generateBlurFragSource(t){for(var e,r=ds[t],i=r.length,n=ps,o="",s=0;s<t;s++){var a="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",s.toString());e=s,s>=i&&(e=t-s-1),o+=a=a.replace("%value%",r[e].toString()),o+="\n"}return(n=n.replace("%blur%",o)).replace("%size%",t.toString())}
192
+ /*!
193
+ * @pixi/constants - v6.3.2
194
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
195
+ *
196
+ * @pixi/constants is licensed under the MIT License.
197
+ * http://www.opensource.org/licenses/mit-license
198
+ */(o);return(s=t.call(this,a,h)||this).horizontal=e,s.resolution=n,s._quality=0,s.quality=i,s.blur=r,s}return __extends$6(BlurFilterPass,t),BlurFilterPass.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 n=t.getFilterTexture(),o=t.renderer,s=e,a=n;this.state.blend=!1,t.applyFilter(this,s,a,ss.CLEAR);for(var h=1;h<this.passes-1;h++){t.bindAndClear(s,ss.BLIT),this.uniforms.uSampler=a;var u=a;a=s,s=u,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,a,r,i),t.returnFilterTexture(n)}},Object.defineProperty(BlurFilterPass.prototype,"blur",{get:function(){return this.strength},set:function(t){this.padding=1+2*Math.abs(t),this.strength=t},enumerable:!1,configurable:!0}),Object.defineProperty(BlurFilterPass.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t},enumerable:!1,configurable:!0}),BlurFilterPass}($r);!function(t){function BlurFilter(e,r,i,n){void 0===e&&(e=8),void 0===r&&(r=4),void 0===i&&(i=J.FILTER_RESOLUTION),void 0===n&&(n=5);var o=t.call(this)||this;return o.blurXFilter=new fs(!0,e,r,i,n),o.blurYFilter=new fs(!1,e,r,i,n),o.resolution=i,o.quality=r,o.blur=e,o.repeatEdgePixels=!1,o}__extends$6(BlurFilter,t),BlurFilter.prototype.apply=function(t,e,r,i){var n=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(n&&o){var s=t.getFilterTexture();this.blurXFilter.apply(t,e,s,ss.CLEAR),this.blurYFilter.apply(t,s,r,i),t.returnFilterTexture(s)}else o?this.blurYFilter.apply(t,e,r,i):this.blurXFilter.apply(t,e,r,i)},BlurFilter.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))},Object.defineProperty(BlurFilter.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(BlurFilter.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(BlurFilter.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(BlurFilter.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(BlurFilter.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(t){this.blurYFilter.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(BlurFilter.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(t){this._repeatEdgePixels=t,this.updatePadding()},enumerable:!1,configurable:!0})}($r);
199
+ /*!
200
+ * @pixi/filter-color-matrix - v6.3.2
201
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
202
+ *
203
+ * @pixi/filter-color-matrix is licensed under the MIT License.
204
+ * http://www.opensource.org/licenses/mit-license
205
+ */
206
+ /*! *****************************************************************************
207
+ Copyright (c) Microsoft Corporation. All rights reserved.
208
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
209
+ this file except in compliance with the License. You may obtain a copy of the
210
+ License at http://www.apache.org/licenses/LICENSE-2.0
211
+
212
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
213
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
214
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
215
+ MERCHANTABLITY OR NON-INFRINGEMENT.
216
+
217
+ See the Apache Version 2.0 License for specific language governing permissions
218
+ and limitations under the License.
219
+ ***************************************************************************** */
220
+ var extendStatics$5=function(t,e){return extendStatics$5=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])},extendStatics$5(t,e)};var _s=function(t){function ColorMatrixFilter(){var e=this,r={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return(e=t.call(this,Ri,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 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",r)||this).alpha=1,e}return function __extends$5(t,e){function __(){this.constructor=t}extendStatics$5(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}(ColorMatrixFilter,t),ColorMatrixFilter.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},ColorMatrixFilter.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},ColorMatrixFilter.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},ColorMatrixFilter.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},ColorMatrixFilter.prototype.tint=function(t,e){var r=[(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(r,e)},ColorMatrixFilter.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},ColorMatrixFilter.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)},ColorMatrixFilter.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=1/3,o=(0,Math.sqrt)(n),s=[r+(1-r)*n,n*(1-r)-o*i,n*(1-r)+o*i,0,0,n*(1-r)+o*i,r+n*(1-r),n*(1-r)-o*i,0,0,n*(1-r)-o*i,n*(1-r)+o*i,r+n*(1-r),0,0,0,0,0,1,0];this._loadMatrix(s,e)},ColorMatrixFilter.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},ColorMatrixFilter.prototype.saturate=function(t,e){void 0===t&&(t=0);var r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},ColorMatrixFilter.prototype.desaturate=function(){this.saturate(-1)},ColorMatrixFilter.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)},ColorMatrixFilter.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)},ColorMatrixFilter.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)},ColorMatrixFilter.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)},ColorMatrixFilter.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)},ColorMatrixFilter.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)},ColorMatrixFilter.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)},ColorMatrixFilter.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)},ColorMatrixFilter.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,h,u,l,e=e||.15,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},ColorMatrixFilter.prototype.night=function(t,e){var r=[-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(r,e)},ColorMatrixFilter.prototype.predator=function(t,e){var r=[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(r,e)},ColorMatrixFilter.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)},ColorMatrixFilter.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(ColorMatrixFilter.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(ColorMatrixFilter.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),ColorMatrixFilter}($r);_s.prototype.grayscale=_s.prototype.greyscale;
221
+ /*!
222
+ * @pixi/filter-displacement - v6.3.2
223
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
224
+ *
225
+ * @pixi/filter-displacement is licensed under the MIT License.
226
+ * http://www.opensource.org/licenses/mit-license
227
+ */
228
+ /*! *****************************************************************************
229
+ Copyright (c) Microsoft Corporation. All rights reserved.
230
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
231
+ this file except in compliance with the License. You may obtain a copy of the
232
+ License at http://www.apache.org/licenses/LICENSE-2.0
233
+
234
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
235
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
236
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
237
+ MERCHANTABLITY OR NON-INFRINGEMENT.
238
+
239
+ See the Apache Version 2.0 License for specific language governing permissions
240
+ and limitations under the License.
241
+ ***************************************************************************** */
242
+ var extendStatics$4=function(t,e){return extendStatics$4=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])},extendStatics$4(t,e)};!function(t){function DisplacementFilter(e,r){var i=this,n=new zt;return e.renderable=!1,(i=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:n,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,i.maskMatrix=n,null==r&&(r=20),i.scale=new Ut(r,r),i}(function __extends$4(t,e){function __(){this.constructor=t}extendStatics$4(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)})(DisplacementFilter,t),DisplacementFilter.prototype.apply=function(t,e,r,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),s=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==s&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/s,this.uniforms.rotation[3]=n.d/s),t.applyFilter(this,e,r,i)},Object.defineProperty(DisplacementFilter.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0})}($r);
243
+ /*!
244
+ * @pixi/filter-fxaa - v6.3.2
245
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
246
+ *
247
+ * @pixi/filter-fxaa is licensed under the MIT License.
248
+ * http://www.opensource.org/licenses/mit-license
249
+ */
250
+ /*! *****************************************************************************
251
+ Copyright (c) Microsoft Corporation. All rights reserved.
252
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
253
+ this file except in compliance with the License. You may obtain a copy of the
254
+ License at http://www.apache.org/licenses/LICENSE-2.0
255
+
256
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
257
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
258
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
259
+ MERCHANTABLITY OR NON-INFRINGEMENT.
260
+
261
+ See the Apache Version 2.0 License for specific language governing permissions
262
+ and limitations under the License.
263
+ ***************************************************************************** */
264
+ var extendStatics$3=function(t,e){return extendStatics$3=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])},extendStatics$3(t,e)};!function(t){function FXAAFilter(){return t.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}(function __extends$3(t,e){function __(){this.constructor=t}extendStatics$3(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)})(FXAAFilter,t)}($r);
265
+ /*!
266
+ * @pixi/filter-noise - v6.3.2
267
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
268
+ *
269
+ * @pixi/filter-noise is licensed under the MIT License.
270
+ * http://www.opensource.org/licenses/mit-license
271
+ */
272
+ /*! *****************************************************************************
273
+ Copyright (c) Microsoft Corporation. All rights reserved.
274
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
275
+ this file except in compliance with the License. You may obtain a copy of the
276
+ License at http://www.apache.org/licenses/LICENSE-2.0
277
+
278
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
279
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
280
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
281
+ MERCHANTABLITY OR NON-INFRINGEMENT.
282
+
283
+ See the Apache Version 2.0 License for specific language governing permissions
284
+ and limitations under the License.
285
+ ***************************************************************************** */
286
+ var extendStatics$2=function(t,e){return extendStatics$2=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])},extendStatics$2(t,e)};var ms,ys,gs,vs,Ts,Es,xs,bs,Rs,Ss,As,Os,Is,Ps,Ms,Ds,Ns,Cs,ws;!function(t){function NoiseFilter(e,r){void 0===e&&(e=.5),void 0===r&&(r=Math.random());var i=t.call(this,Ri,"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 i.noise=e,i.seed=r,i}(function __extends$2(t,e){function __(){this.constructor=t}extendStatics$2(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)})(NoiseFilter,t),Object.defineProperty(NoiseFilter.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(NoiseFilter.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0})}($r),function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(ms||(ms={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(ys||(ys={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(gs||(gs={})),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"}(vs||(vs={})),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"}(Ts||(Ts={})),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"}(Es||(Es={})),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"}(xs||(xs={})),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"}(bs||(bs={})),function(t){t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT"}(Rs||(Rs={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(Ss||(Ss={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(As||(As={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL"}(Os||(Os={})),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"}(Is||(Is={})),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"}(Ps||(Ps={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(Ms||(Ms={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(Ds||(Ds={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(Ns||(Ns={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(Cs||(Cs={})),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"}(ws||(ws={}));var Ls=new zt;be.prototype._cacheAsBitmap=!1,be.prototype._cacheData=null,be.prototype._cacheAsBitmapResolution=null,be.prototype._cacheAsBitmapMultisample=Cs.NONE;var Fs=function Fs(){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(be.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 e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Fs),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),be.prototype._renderCached=function _renderCached(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))},be.prototype._initCachedDisplayObject=function _initCachedDisplayObject(t){var e;if(!this._cacheData||!this._cacheData.sprite){var r=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var n=this.filters[0].padding;i.pad(n)}i.ceil(J.RESOLUTION);var o=t.renderTexture.current,s=t.renderTexture.sourceFrame.clone(),a=t.renderTexture.destinationFrame.clone(),h=t.projection.transform,u=sr.create({width:i.width,height:i.height,resolution:this.cacheAsBitmapResolution||t.resolution,multisample:null!==(e=this.cacheAsBitmapMultisample)&&void 0!==e?e:t.multisample}),l="cacheAsBitmap_"+uid();this._cacheData.textureCacheId=l,Ye.addToCache(u.baseTexture,l),or.addToCache(u,l);var c=this.transform.localTransform.copyTo(Ls).invert().translate(-i.x,-i.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:u,clear:!0,transform:c,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=h,t.renderTexture.bind(o,s,a),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var d=new mo(u);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-i.x/i.width,d.anchor.y=-i.y/i.height,d.alpha=r,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)}},be.prototype._renderCachedCanvas=function _renderCachedCanvas(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},be.prototype._initCachedDisplayObjectCanvas=function _initCachedDisplayObjectCanvas(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(null,!0),r=this.alpha;this.alpha=1;var i=t.context,n=t._projTransform;e.ceil(J.RESOLUTION);var o=sr.create({width:e.width,height:e.height}),s="cacheAsBitmap_"+uid();this._cacheData.textureCacheId=s,Ye.addToCache(o.baseTexture,s),or.addToCache(o,s);var a=Ls;this.transform.localTransform.copyTo(a),a.invert(),a.tx-=e.x,a.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:o,clear:!0,transform:a,skipUpdateTransform:!1}),t.context=i,t._projTransform=n,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;var h=new mo(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-e.x/e.width,h.anchor.y=-e.y/e.height,h.alpha=r,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},be.prototype._calculateCachedBounds=function _calculateCachedBounds(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},be.prototype._getCachedLocalBounds=function _getCachedLocalBounds(){return this._cacheData.sprite.getLocalBounds(null)},be.prototype._destroyCachedDisplayObject=function _destroyCachedDisplayObject(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,Ye.removeFromCache(this._cacheData.textureCacheId),or.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},be.prototype._cacheAsBitmapDestroy=function _cacheAsBitmapDestroy(t){this.cacheAsBitmap=!1,this.destroy(t)},
287
+ /*!
288
+ * @pixi/mixin-get-child-by-name - v6.3.2
289
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
290
+ *
291
+ * @pixi/mixin-get-child-by-name is licensed under the MIT License.
292
+ * http://www.opensource.org/licenses/mit-license
293
+ */
294
+ be.prototype.name=null,Se.prototype.getChildByName=function getChildByName(t,e){for(var r=0,i=this.children.length;r<i;r++)if(this.children[r].name===t)return this.children[r];if(e)for(r=0,i=this.children.length;r<i;r++){if(this.children[r].getChildByName){var n=this.children[r].getChildByName(t,!0);if(n)return n}}return null},
295
+ /*!
296
+ * @pixi/mixin-get-global-position - v6.3.2
297
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
298
+ *
299
+ * @pixi/mixin-get-global-position is licensed under the MIT License.
300
+ * http://www.opensource.org/licenses/mit-license
301
+ */
302
+ be.prototype.getGlobalPosition=function getGlobalPosition(t,e){return void 0===t&&(t=new Ut),void 0===e&&(e=!1),this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};
303
+ /*!
304
+ * @pixi/mesh-extras - v6.3.2
305
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
306
+ *
307
+ * @pixi/mesh-extras is licensed under the MIT License.
308
+ * http://www.opensource.org/licenses/mit-license
309
+ */
310
+ /*! *****************************************************************************
311
+ Copyright (c) Microsoft Corporation. All rights reserved.
312
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
313
+ this file except in compliance with the License. You may obtain a copy of the
314
+ License at http://www.apache.org/licenses/LICENSE-2.0
315
+
316
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
317
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
318
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
319
+ MERCHANTABLITY OR NON-INFRINGEMENT.
320
+
321
+ See the Apache Version 2.0 License for specific language governing permissions
322
+ and limitations under the License.
323
+ ***************************************************************************** */
324
+ var extendStatics$1=function(t,e){return extendStatics$1=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])},extendStatics$1(t,e)};function __extends$1(t,e){function __(){this.constructor=t}extendStatics$1(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}var Bs=function(t){function PlaneGeometry(e,r,i,n){void 0===e&&(e=100),void 0===r&&(r=100),void 0===i&&(i=10),void 0===n&&(n=10);var o=t.call(this)||this;return o.segWidth=i,o.segHeight=n,o.width=e,o.height=r,o.build(),o}return __extends$1(PlaneGeometry,t),PlaneGeometry.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],r=[],i=[],n=this.segWidth-1,o=this.segHeight-1,s=this.width/n,a=this.height/o,h=0;h<t;h++){var u=h%this.segWidth,l=h/this.segWidth|0;e.push(u*s,l*a),r.push(u/n,l/o)}var c=n*o;for(h=0;h<c;h++){var d=h%n,p=h/n|0,f=p*this.segWidth+d,_=p*this.segWidth+d+1,m=(p+1)*this.segWidth+d,y=(p+1)*this.segWidth+d+1;i.push(f,_,m,_,y,m)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(r),this.indexBuffer.data=new Uint16Array(i),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},PlaneGeometry}(Fo),Gs=function(t){function RopeGeometry(e,r,i){void 0===e&&(e=200),void 0===i&&(i=0);var n=t.call(this,new Float32Array(4*r.length),new Float32Array(4*r.length),new Uint16Array(6*(r.length-1)))||this;return n.points=r,n._width=e,n.textureScale=i,n.build(),n}return __extends$1(RopeGeometry,t),Object.defineProperty(RopeGeometry.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),RopeGeometry.prototype.build=function(){var t=this.points;if(t){var e=this.getBuffer("aVertexPosition"),r=this.getBuffer("aTextureCoord"),i=this.getIndex();if(!(t.length<1)){e.data.length/4!==t.length&&(e.data=new Float32Array(4*t.length),r.data=new Float32Array(4*t.length),i.data=new Uint16Array(6*(t.length-1)));var n=r.data,o=i.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;for(var s=0,a=t[0],h=this._width*this.textureScale,u=t.length,l=0;l<u;l++){var c=4*l;if(this.textureScale>0){var d=a.x-t[l].x,p=a.y-t[l].y,f=Math.sqrt(d*d+p*p);a=t[l],s+=f/h}else s=l/(u-1);n[c]=s,n[c+1]=0,n[c+2]=s,n[c+3]=1}var _=0;for(l=0;l<u-1;l++){c=2*l;o[_++]=c,o[_++]=c+1,o[_++]=c+2,o[_++]=c+2,o[_++]=c+1,o[_++]=c+3}r.update(),i.update(),this.updateVertices()}}},RopeGeometry.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var e,r=t[0],i=0,n=0,o=this.buffers[0].data,s=t.length,a=0;a<s;a++){var h=t[a],u=4*a;n=-((e=a<t.length-1?t[a+1]:h).x-r.x),i=e.y-r.y;var l=Math.sqrt(i*i+n*n),c=this.textureScale>0?this.textureScale*this._width/2:this._width/2;i/=l,n/=l,i*=c,n*=c,o[u]=h.x+i,o[u+1]=h.y+n,o[u+2]=h.x-i,o[u+3]=h.y-n,r=h}this.buffers[0].update()}},RopeGeometry.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},RopeGeometry}(Fo);!function(t){function SimpleRope(e,r,i){void 0===i&&(i=0);var n=this,o=new Gs(e.height,r,i),s=new Lo(e);return i>0&&(e.baseTexture.wrapMode=pt.REPEAT),(n=t.call(this,o,s)||this).autoUpdate=!0,n}__extends$1(SimpleRope,t),SimpleRope.prototype._render=function(e){var r=this.geometry;(this.autoUpdate||r._width!==this.shader.texture.height)&&(r._width=this.shader.texture.height,r.update()),t.prototype._render.call(this,e)}}(wo);var Us=function(t){function SimplePlane(e,r,i){var n=this,o=new Bs(e.width,e.height,r,i),s=new Lo(or.WHITE);return(n=t.call(this,o,s)||this).texture=e,n.autoResize=!0,n}return __extends$1(SimplePlane,t),SimplePlane.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,e=this.shader.texture,r=e.width,i=e.height;!this.autoResize||t.width===r&&t.height===i||(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(SimplePlane.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}),SimplePlane.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},SimplePlane.prototype.destroy=function(e){this.shader.texture.off("update",this.textureUpdated,this),t.prototype.destroy.call(this,e)},SimplePlane}(wo);!function(t){function SimpleMesh(e,r,i,n,o){void 0===e&&(e=or.EMPTY);var s=this,a=new Fo(r,i,n);a.getBuffer("aVertexPosition").static=!1;var h=new Lo(e);return(s=t.call(this,a,h,null,o)||this).autoUpdate=!0,s}__extends$1(SimpleMesh,t),Object.defineProperty(SimpleMesh.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),SimpleMesh.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)}}(wo);!function(t){function NineSlicePlane(e,r,i,n,o){void 0===r&&(r=10),void 0===i&&(i=10),void 0===n&&(n=10),void 0===o&&(o=10);var s=t.call(this,or.WHITE,4,4)||this;return s._origWidth=e.orig.width,s._origHeight=e.orig.height,s._width=s._origWidth,s._height=s._origHeight,s._leftWidth=r,s._rightWidth=n,s._topHeight=i,s._bottomHeight=o,s.texture=e,s}__extends$1(NineSlicePlane,t),NineSlicePlane.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(NineSlicePlane.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),NineSlicePlane.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},NineSlicePlane.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},NineSlicePlane.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,r=this._topHeight+this._bottomHeight,i=this._height>r?1:this._height/r;return Math.min(e,i)},Object.defineProperty(NineSlicePlane.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(NineSlicePlane.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(NineSlicePlane.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(NineSlicePlane.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(NineSlicePlane.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(NineSlicePlane.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),NineSlicePlane.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=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]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()}}(Us);
325
+ /*!
326
+ * @pixi/sprite-animated - v6.3.2
327
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
328
+ *
329
+ * @pixi/sprite-animated is licensed under the MIT License.
330
+ * http://www.opensource.org/licenses/mit-license
331
+ */
332
+ /*! *****************************************************************************
333
+ Copyright (c) Microsoft Corporation. All rights reserved.
334
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
335
+ this file except in compliance with the License. You may obtain a copy of the
336
+ License at http://www.apache.org/licenses/LICENSE-2.0
337
+
338
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
339
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
340
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
341
+ MERCHANTABLITY OR NON-INFRINGEMENT.
342
+
343
+ See the Apache Version 2.0 License for specific language governing permissions
344
+ and limitations under the License.
345
+ ***************************************************************************** */
346
+ var extendStatics=function(t,e){return extendStatics=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])},extendStatics(t,e)};function getAllNavigatables(t){const e=[];for(const r of t.children)r instanceof Se&&r.isNavigatable?e.push(r):e.push(...getAllNavigatables(r));return e}function getFirstNavigatable(t,e,r,{minimumDistance:i=5}={}){return getFirstNavigatableInDirection(getAllNavigatables(t),e,r,{minimumDistance:i})}function getFirstNavigatableInDirection(t,e,r,{minimumDistance:i=5}={}){var n,o,s,a,h,u,l,c,d;const p=t.filter((t=>t.isNavigatable&&t.visible&&!!t.parent)),f=p.find((t=>t===e));if(void 0===f)return p.sort(((t,e)=>t.navigationPriority-e.navigationPriority)),p[0];if(void 0===r&&f)return f;const _=null!=f?f:p[Math.floor(Math.random()*p.length)];if(void 0===f)return null!==(n=t[0])&&void 0!==n?n:_;const m=f.getBounds(),y=m.left+m.width/2,g=m.top+m.height/2,v=p.filter((t=>t!==f)).map((t=>{const e=t.getBounds(),r={x:e.left+e.width/2,y:e.top+e.height/2};return{element:t,bounds:e,center:r,xDist:Math.abs(y-r.x),yDist:Math.abs(g-r.y)}}));switch(r){case"navigateUp":return null!==(s=null===(o=v.filter((t=>t.center.y<g-i)).sort(((t,e)=>t.yDist-e.yDist))[0])||void 0===o?void 0:o.element)&&void 0!==s?s:_;case"navigateLeft":return null!==(h=null===(a=v.filter((t=>t.center.x<y-i)).sort(((t,e)=>t.xDist-e.xDist))[0])||void 0===a?void 0:a.element)&&void 0!==h?h:_;case"navigateRight":return null!==(l=null===(u=v.filter((t=>t.center.x>y+i)).sort(((t,e)=>t.xDist-e.xDist))[0])||void 0===u?void 0:u.element)&&void 0!==l?l:_;case"navigateDown":return null!==(d=null===(c=v.filter((t=>t.center.y>g+i)).sort(((t,e)=>t.yDist-e.yDist))[0])||void 0===c?void 0:c.element)&&void 0!==d?d:_;default:return f}}!function(t){function AnimatedSprite(e,r){void 0===r&&(r=!0);var i=t.call(this,e[0]instanceof or?e[0]:e[0].texture)||this;return i._textures=null,i._durations=null,i._autoUpdate=r,i._isConnectedToTicker=!1,i.animationSpeed=1,i.loop=!0,i.updateAnchor=!1,i.onComplete=null,i.onFrameChange=null,i.onLoop=null,i._currentTime=0,i._playing=!1,i._previousFrame=null,i.textures=e,i}(function __extends(t,e){function __(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)})(AnimatedSprite,t),AnimatedSprite.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Me.shared.remove(this.update,this),this._isConnectedToTicker=!1))},AnimatedSprite.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Me.shared.add(this.update,this,Ae.HIGH),this._isConnectedToTicker=!0))},AnimatedSprite.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},AnimatedSprite.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},AnimatedSprite.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 n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;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.currentFrame<r||this.animationSpeed<0&&this.currentFrame>r)&&this.onLoop(),this.updateTexture())}},AnimatedSprite.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))},AnimatedSprite.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},AnimatedSprite.fromFrames=function(t){for(var e=[],r=0;r<t.length;++r)e.push(or.from(t[r]));return new AnimatedSprite(e)},AnimatedSprite.fromImages=function(t){for(var e=[],r=0;r<t.length;++r)e.push(or.from(t[r]));return new AnimatedSprite(e)},Object.defineProperty(AnimatedSprite.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(AnimatedSprite.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof or)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(AnimatedSprite.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(AnimatedSprite.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(AnimatedSprite.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Me.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Me.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0})}(mo),
347
+ /*!
348
+ * pixi.js - v6.3.2
349
+ * Compiled Wed, 04 May 2022 17:49:13 UTC
350
+ *
351
+ * pixi.js is licensed under the MIT License.
352
+ * http://www.opensource.org/licenses/mit-license
353
+ */
354
+ bi.registerPlugin("accessibility",Ie),bi.registerPlugin("extract",Gi),bi.registerPlugin("interaction",Ge),bi.registerPlugin("particle",Yn),bi.registerPlugin("prepare",Ro),bi.registerPlugin("batch",wi),bi.registerPlugin("tilingSprite",Mo),zi.registerPlugin(Wo),zi.registerPlugin(sn),zi.registerPlugin(Rn),zi.registerPlugin(Xn),zi.registerPlugin(Ao),Li.registerPlugin(De),Li.registerPlugin($i);class Navigation{constructor(){this._responderStack=[]}get firstResponder(){return this._responderStack[0]}get responders(){return this._responderStack}emit(t,e){this._propogateIntent(t,e)}popResponder(){var t,e,r;const i=this._responderStack.shift();return null===(e=null===(t=this.firstResponder)||void 0===t?void 0:t.becameFirstResponder)||void 0===e||e.call(t),null===(r=null==i?void 0:i.resignedAsFirstResponder)||void 0===r||r.call(i),i}pushResponder(t){var e,r;if(this._responderStack.includes(t))throw new Error("Responder already in stack.");const i=this.firstResponder;this._responderStack.unshift(t),null===(e=t.becameFirstResponder)||void 0===e||e.call(t),null===(r=null==i?void 0:i.resignedAsFirstResponder)||void 0===r||r.call(i)}_propogateIntent(t,e){var r;for(const i of this._responderStack)if(null===(r=i.handledNavigationIntent)||void 0===r?void 0:r.call(i,t,e))return;void 0!==this.stageRoot&&this._handleGlobalIntent(this.stageRoot,t)}_handleGlobalIntent(t,e){var r;if(void 0===this._focused){const e=getFirstNavigatable(t);if(void 0===e)return;return _emitFocus(e),void(this._focused=e)}if("navigateBack"===e)return _emitBlur(this._focused),void(this._focused=void 0);if("trigger"===e)return void function _emitTrigger(t){const e=t.eventNames();e.includes("pointerdown")?t.emit("pointerdown"):e.includes("mousedown")&&t.emit("mousedown");t.emit("trigger")}(this._focused);const i=null!==(r=getFirstNavigatable(this.stageRoot,this._focused,e))&&void 0!==r?r:this._focused;i!==this._focused&&(_emitBlur(this._focused),_emitFocus(i),this._focused=i)}}function _emitBlur(t){const e=t.eventNames();e.includes("pointerout")?t.emit("pointerout"):e.includes("mouseout")&&t.emit("mouseout"),t.emit("blur")}function _emitFocus(t){const e=t.eventNames();e.includes("pointerover")?t.emit("pointerover"):e.includes("mouseover")&&t.emit("mouseover"),t.emit("focus")}Navigation.shared=new Navigation;let Xs=new Map;function throttle(t,e){var r;const i=Date.now();return(null!==(r=Xs.get(t))&&void 0!==r?r:0)>i||(Xs.set(t,i+e),!1)}class GamepadDevice{get leftTrigger(){return this.source.buttons[a.LeftTrigger].value}get rightTrigger(){return this.source.buttons[a.LeftTrigger].value}get leftShoulder(){return this.source.buttons[a.LeftShoulder].value}get rightShoulder(){return this.source.buttons[a.RightShoulder].value}get button(){return this.source.buttons}pressing(t){return this.source.buttons[t].pressed}pressingAll(t){for(let e=0;e<t.length;e++)if(!0!==this.source.buttons[t[e]].pressed)return!1;return!0}pressingAny(t){for(let e=0;e<t.length;e++)if(!0===this.source.buttons[t[e]].pressed)return!0;return!1}update(t,e){this.lastUpdated=e,this.updatePresses(t,!0),this.source=t}clear(){this._axisIntents=this._axisIntents.map((()=>!1)),this._btnPrevState=this._btnPrevState.map((()=>!1))}constructor(t){this.source=t,this.type="gamepad",this.lastUpdated=performance.now(),this.options={binds:GamepadDevice.defaultOptions.binds,joystickDeadzone:GamepadDevice.defaultOptions.joystickDeadzone,intent:{joystickCommitSensitivity:GamepadDevice.defaultOptions.intent.joystickCommitSensitivity,firstCooldownMs:GamepadDevice.defaultOptions.intent.firstCooldownMs,defaultCooldownMs:GamepadDevice.defaultOptions.intent.defaultCooldownMs}},this._btnPrevState=new Array(16),this._axisIntents=new Array(2),this.id="gamepad"+t.index,this.platform=function detectPlatform(t){const e=(t.id||"").toLowerCase();return/(logitech|046d)/.test(e)?"logitech":/(steam|28de)/.test(e)?"steam":/(dualshock|dualsense|sony|054c|0ce6|0810)/.test(e)?"playstation":/(nintendo|switch|joycon|057e)/.test(e)?"nintendo":/(xbox|xinput|045e|028e|0291|02a0|02a1|02ea|02ff)/.test(e)?"xbox":"other"}(t),this.leftJoystick=new GamepadJoystick(this,i,n),this.rightJoystick=new GamepadJoystick(this,o,s),this._throttleIdLeftStickX=this.id+"-lsx",this._throttleIdLeftStickY=this.id+"-lsy"}updatePresses(t,e){var r,o,s,a,h,u;const l=this._btnPrevState.length;for(let i=0;i<l;i++){if(this._btnPrevState[i]===(null===(r=t.buttons[i])||void 0===r?void 0:r.pressed))continue;const n=null!==(s=null===(o=t.buttons[i])||void 0===o?void 0:o.pressed)&&void 0!==s&&s;if(this._btnPrevState[i]=n,e&&n){const t=null!==(a=this.options.binds[i])&&void 0!==a?a:void 0;void 0!==t&&Navigation.shared.emit(t,this)}}const c=null!==(h=t.axes[i])&&void 0!==h?h:0,d=null!==(u=t.axes[n])&&void 0!==u?u:0;if(Math.abs(c)>=this.options.intent.joystickCommitSensitivity){const t=c<0?"navigateLeft":"navigateRight",r=this._axisIntents[i]?this.options.intent.defaultCooldownMs:this.options.intent.firstCooldownMs;this._axisIntents[i]=!0,e&&!throttle(this._throttleIdLeftStickX,r)&&Navigation.shared.emit(t,this)}else this._axisIntents[i]=!1;if(Math.abs(d)>=this.options.intent.joystickCommitSensitivity){const t=d<0?"navigateUp":"navigateDown",r=this._axisIntents[n]?this.options.intent.defaultCooldownMs:this.options.intent.firstCooldownMs;this._axisIntents[n]=!0,e&&!throttle(this._throttleIdLeftStickY,r)&&Navigation.shared.emit(t,this)}else this._axisIntents[n]=!1}}GamepadDevice.defaultOptions={binds:{[a.A]:"trigger",[a.B]:"navigateBack",[a.Back]:"navigateBack",[a.DPadDown]:"navigateDown",[a.DPadLeft]:"navigateLeft",[a.DPadRight]:"navigateRight",[a.DPadUp]:"navigateUp"},joystickDeadzone:.3,intent:{joystickCommitSensitivity:.5,firstCooldownMs:400,defaultCooldownMs:100}};class GamepadJoystick{constructor(t,e,r){this._owner=t,this.ix=e,this.iy=r}get x(){return this._owner.source.axes[this.ix]}get y(){return this._owner.source.axes[this.iy]}}const ks={ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",KeyA:"KeyA",KeyB:"KeyB",KeyC:"KeyC",KeyD:"KeyD",KeyE:"KeyE",KeyF:"KeyF",KeyG:"KeyG",KeyH:"KeyH",KeyI:"KeyI",KeyJ:"KeyJ",KeyK:"KeyK",KeyL:"KeyL",KeyM:"KeyM",KeyN:"KeyN",KeyO:"KeyO",KeyP:"KeyP",KeyQ:"KeyQ",KeyR:"KeyR",KeyS:"KeyS",KeyT:"KeyT",KeyU:"KeyU",KeyV:"KeyV",KeyW:"KeyW",KeyX:"KeyX",KeyY:"KeyY",KeyZ:"KeyZ",Digit0:"Digit0",Digit1:"Digit1",Digit2:"Digit2",Digit3:"Digit3",Digit4:"Digit4",Digit5:"Digit5",Digit6:"Digit6",Digit7:"Digit7",Digit8:"Digit8",Digit9:"Digit9",Backquote:"Backquote",Backslash:"Backslash",Backspace:"Backspace",BracketLeft:"BracketLeft",BracketRight:"BracketRight",Comma:"Comma",Delete:"Delete",End:"End",Enter:"Enter",Equal:"Equal",Escape:"Escape",Home:"Home",Minus:"Minus",Period:"Period",Quote:"Quote",Semicolon:"Semicolon",Slash:"Slash",Space:"Space",ShiftRight:"ShiftRight",AltRight:"AltRight",ControlRight:"ControlRight",MetaRight:"MetaRight",ShiftLeft:"ShiftLeft",AltLeft:"AltLeft",ControlLeft:"ControlLeft",MetaLeft:"MetaLeft",Numpad0:"Numpad0",Numpad1:"Numpad1",Numpad2:"Numpad2",Numpad3:"Numpad3",Numpad4:"Numpad4",Numpad5:"Numpad5",Numpad6:"Numpad6",Numpad7:"Numpad7",Numpad8:"Numpad8",Numpad9:"Numpad9"};function inferDefaultLayout(t=function getLang(){var t;const e=navigator;return null!=(null===(t=e.languages)||void 0===t?void 0:t.length)?e.languages[0]:e.userLanguage||e.language||e.browserLanguage}()){const e=(t||"").toLowerCase(),r=e.split("-")[0];return"fr"===r||e.startsWith("nl-be")?"AZERTY":"uk"===r||"ru"===r||"bg"===r?"JCUKEN":"de"===r||"cs"===r||"sk"===r||"sl"===r||"hu"===r||"hr"===r||"bs"===r||e.startsWith("sr-latn")?"QWERTZ":"QWERTY"}let Hs;class KeyboardDevice{constructor(){this.layout=inferDefaultLayout(),this.lastUpdated=performance.now(),this.options={binds:GamepadDevice.defaultOptions.binds},this.key=Object.keys(ks).reduce(((t,e)=>t[e]=!1),{})}configureEventListeners(){document.addEventListener("keydown",(t=>{this.key[t.code]=!0})),document.addEventListener("keyup",(t=>{this.key[t.code]=!1}))}pressing(t){return this.key[t]}pressingAll(t){for(let e=0;e<t.length;e++)if(!0!==this.key[t[e]])return!1;return!0}pressingAny(t){for(let e=0;e<t.length;e++)if(!0===this.key[t[e]])return!0;return!1}keyLabel(t,e=this.layout){return function getLocaleLabel(t,e){if(void 0===Hs){const t={ArrowLeft:"⬅",ArrowRight:"➡",ArrowUp:"⬆",ArrowDown:"⬇",KeyA:"A",KeyB:"B",KeyC:"C",KeyD:"D",KeyE:"E",KeyF:"F",KeyG:"G",KeyH:"H",KeyI:"I",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyQ:"Q",KeyR:"R",KeyS:"S",KeyT:"T",KeyU:"U",KeyV:"V",KeyW:"W",KeyX:"X",KeyY:"Y",KeyZ:"Z",Digit0:"0",Digit1:"1",Digit2:"2",Digit3:"3",Digit4:"4",Digit5:"5",Digit6:"6",Digit7:"7",Digit8:"8",Digit9:"9",Backquote:"`",Backslash:"\\",Backspace:"Backspace",BracketLeft:"[",BracketRight:"]",Comma:",",Delete:"Delete",End:"End",Enter:"Enter",Equal:"=",Escape:"Esc",Home:"Home",Minus:"-",Period:".",Quote:"'",Semicolon:",",Slash:"/",Space:"Space",AltLeft:"LAlt",AltRight:"RAlt",ControlLeft:"LCtrl",ControlRight:"RCtrl",MetaLeft:"L⌘",MetaRight:"R⌘",ShiftLeft:"Shift",ShiftRight:"Shift",Numpad0:"Num0",Numpad1:"Num1",Numpad2:"Num2",Numpad3:"Num3",Numpad4:"Num4",Numpad5:"Num5",Numpad6:"Num6",Numpad7:"Num7",Numpad8:"Num8",Numpad9:"Num9"},e=Object.assign(Object.assign({},t),{KeyQ:"Q",KeyW:"Z",KeyZ:"W",KeyA:"A",KeyS:"S",KeyD:"D",KeyF:"F",KeyG:"G",KeyH:"H",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyX:"X",KeyY:"Y",Digit1:"&",Digit2:"é",Digit3:'"',Digit4:"'",Digit5:"(",Digit6:"-",Digit7:"è",Digit8:"_",Digit9:"ç",Digit0:"à",Backquote:"²",Backslash:"!",BracketLeft:"(",BracketRight:")",Comma:",",Quote:"é",Semicolon:";",Slash:"/"}),r=Object.assign(Object.assign({},t),{KeyA:"Ф",KeyB:"И",KeyC:"С",KeyD:"В",KeyE:"У",KeyF:"А",KeyG:"П",KeyH:"Р",KeyI:"Ш",KeyJ:"О",KeyK:"Л",KeyL:"Д",KeyM:"Ь",KeyN:"Т",KeyO:"Щ",KeyP:"З",KeyQ:"Й",KeyR:"К",KeyS:"Ы",KeyT:"Е",KeyU:"Г",KeyV:"М",KeyW:"Ц",KeyX:"Ч",KeyY:"Н",KeyZ:"Я",Backquote:"Ё",BracketLeft:"х",BracketRight:"ъ",Comma:"Б",Period:"Ю",Quote:"Э",Semicolon:"Ж",Slash:"И"}),i=Object.assign(Object.assign({},t),{KeyZ:"Y",KeyY:"Z"});Hs={AZERTY:e,JCUKEN:r,QWERTY:t,QWERTZ:i}}return Hs[e][t]}(t,e)}clear(){for(const t of Object.keys(ks))this.key[t]=!1}}KeyboardDevice.defaultOptions={binds:{Enter:"trigger",Escape:"navigateBack",ArrowDown:"navigateDown",ArrowLeft:"navigateLeft",ArrowRight:"navigateRight",ArrowUp:"navigateUp"}};class InputDeviceManager{get gamepads(){return this._gamepadDevices}get devices(){return this._devices}constructor(){this.hasFocus=!1,this.options={clearInputInBackground:!0},this._gamepadDevices=[],this._gamepadDeviceMap=new Map,this.keyboard=new KeyboardDevice,this.keyboard.configureEventListeners(),window.addEventListener("gamepadconnected",(()=>this.pollGamepads(performance.now()))),window.addEventListener("gamepaddisconnected",(t=>this.removeGamepad(t.gamepad.index))),this._devices=[this.keyboard]}update(){if(!document.hasFocus())return this.hasFocus&&this.options.clearInputInBackground&&this.devices.forEach((t=>t.clear())),this.hasFocus=!1,this._devices;this.hasFocus=!0;const t=performance.now();return this.keyboard.lastUpdated=t,this.pollGamepads(t),this._devices}add(t){this._devices.push(t)}remove(t){const e=this._devices.indexOf(t);-1!==e&&this._devices.splice(e,1)}pollGamepads(t){if(!document.hasFocus())return this._gamepadDevices;if(!InputDeviceManager.gamepadsApiSupported)return this._gamepadDevices;for(const e of navigator.getGamepads())if(null!=e)if(this._gamepadDeviceMap.has(e.index)){this._gamepadDeviceMap.get(e.index).update(e,t)}else{const t=new GamepadDevice(e);this._gamepadDeviceMap.set(e.index,t),this._gamepadDevices.push(t),this._devices.push(t)}return this._gamepadDevices}removeGamepad(t){const e=this._gamepadDeviceMap.get(t);if(!e)return;const r=this._gamepadDevices.indexOf(e);-1!==r&&this._gamepadDevices.splice(r,1),this.remove(e),this._gamepadDeviceMap.delete(t)}}InputDeviceManager.shared=new InputDeviceManager,InputDeviceManager.gamepadsApiSupported=void 0!==navigator.getGamepads;export{a as Button,CustomDevice,GamepadDevice,InputDeviceManager,ks as KeyCode,KeyboardDevice,Navigation,getAllNavigatables,getFirstNavigatable,getFirstNavigatableInDirection};
355
+ //# sourceMappingURL=index.mjs.map