From bb80cdf5a6157ca1f3a276e12e9faae9a4739cb7 Mon Sep 17 00:00:00 2001
From: dh_ackergaul <dh_ackergaul@dh-software.de>
Date: Di, 23 Jun 2026 11:16:18 +0200
Subject: [PATCH] Update emvheya - 23.6.2026, 11:16:10 [JD]

---
 manufacturer/_furnview/_global/html/redlining/index.1785de32a61d84fd5a52.js |  189 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 189 insertions(+), 0 deletions(-)

diff --git a/manufacturer/_furnview/_global/html/redlining/index.1785de32a61d84fd5a52.js b/manufacturer/_furnview/_global/html/redlining/index.1785de32a61d84fd5a52.js
new file mode 100644
index 0000000..1de8117
--- /dev/null
+++ b/manufacturer/_furnview/_global/html/redlining/index.1785de32a61d84fd5a52.js
@@ -0,0 +1,189 @@
+/*! For license information please see index.1785de32a61d84fd5a52.js.LICENSE.txt */
+(()=>{var t={21:(t,e,r)=>{"use strict";var i=r(1031);e.ColorMatrixFilter=i.ColorMatrixFilter},37:(t,e)=>{"use strict";e.determineCrossOrigin=function(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location;const r=new URL(t,document.baseURI);return r.hostname!==e.hostname||r.port!==e.port||r.protocol!==e.protocol?"anonymous":""}},61:(t,e,r)=>{"use strict";var i=r(8894),s=r(6238),n=r(8066),o=r(5574),a=r(5577),h=r(5610);r(8116);var l=r(4611),u=r(9736),c=r(2498),d=r(4816),p=r(2152),f=r(8323);s.settings.PREFER_ENV=i.ENV.WEBGL2,s.settings.STRICT_TEXTURE_CACHE=!1,s.settings.RENDER_OPTIONS={...u.ContextSystem.defaultOptions,...c.BackgroundSystem.defaultOptions,...d.ViewSystem.defaultOptions,...p.StartupSystem.defaultOptions},Object.defineProperties(s.settings,{WRAP_MODE:{get:()=>l.BaseTexture.defaultOptions.wrapMode,set(t){n.deprecation("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),l.BaseTexture.defaultOptions.wrapMode=t}},SCALE_MODE:{get:()=>l.BaseTexture.defaultOptions.scaleMode,set(t){n.deprecation("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),l.BaseTexture.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get:()=>l.BaseTexture.defaultOptions.mipmap,set(t){n.deprecation("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),l.BaseTexture.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get:()=>l.BaseTexture.defaultOptions.anisotropicLevel,set(t){n.deprecation("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),l.BaseTexture.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get:()=>(n.deprecation("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),a.Filter.defaultResolution),set(t){a.Filter.defaultResolution=t}},FILTER_MULTISAMPLE:{get:()=>(n.deprecation("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),a.Filter.defaultMultisample),set(t){a.Filter.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get:()=>o.BatchRenderer.defaultMaxTextures,set(t){n.deprecation("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),o.BatchRenderer.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get:()=>o.BatchRenderer.defaultBatchSize,set(t){n.deprecation("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),o.BatchRenderer.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get:()=>o.BatchRenderer.canUploadSameBuffer,set(t){n.deprecation("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),o.BatchRenderer.canUploadSameBuffer=t}},GC_MODE:{get:()=>f.TextureGCSystem.defaultMode,set(t){n.deprecation("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),f.TextureGCSystem.defaultMode=t}},GC_MAX_IDLE:{get:()=>f.TextureGCSystem.defaultMaxIdle,set(t){n.deprecation("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),f.TextureGCSystem.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get:()=>f.TextureGCSystem.defaultCheckCountMax,set(t){n.deprecation("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),f.TextureGCSystem.defaultCheckCountMax=t}},PRECISION_VERTEX:{get:()=>h.Program.defaultVertexPrecision,set(t){n.deprecation("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),h.Program.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get:()=>h.Program.defaultFragmentPrecision,set(t){n.deprecation("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),h.Program.defaultFragmentPrecision=t}}})},74:(t,e,r)=>{"use strict";var i=r(6320);class s extends i.FederatedMouseEvent{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}e.FederatedPointerEvent=s},92:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},104:(t,e)=>{"use strict";e.splitTextToCharacters=function(t){return Array.from?Array.from(t):t.split("")}},110:(t,e,r)=>{"use strict";var i,s=r(5153),n=r(1488),o=r(8004),a=r(6469),h=r(2557),l=r(3429),u=r(1102),c=r(5966),d=r(7412),p=r(2418),f=r(7958),m=r(7384),g=r(250),y=r(1844),_=r(7279),v=Function,x=function(t){try{return v('"use strict"; return ('+t+").constructor;")()}catch(t){}},b=r(5667),T=r(9886),E=function(){throw new u},A=b?function(){try{return E}catch(t){try{return b(arguments,"callee").get}catch(t){return E}}}():E,S=r(1514)(),w=r(4252),P=r(3752),R=r(248),M=r(4811),C=r(6255),I={},D="undefined"!=typeof Uint8Array&&w?w(Uint8Array):i,O={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":S&&w?w([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":I,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":S&&w?w(w([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&S&&w?w((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":s,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":a,"%ReferenceError%":h,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&S&&w?w((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":S&&w?w(""[Symbol.iterator]()):i,"%Symbol%":S?Symbol:i,"%SyntaxError%":l,"%ThrowTypeError%":A,"%TypedArray%":D,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":M,"%Object.defineProperty%":T,"%Object.getPrototypeOf%":P,"%Math.abs%":d,"%Math.floor%":p,"%Math.max%":f,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":y,"%Math.sign%":_,"%Reflect.getPrototypeOf%":R};if(w)try{null.error}catch(t){var B=w(w(t));O["%Error.prototype%"]=B}var L=function t(e){var r;if("%AsyncFunction%"===e)r=x("async function () {}");else if("%GeneratorFunction%"===e)r=x("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=x("async function* () {}");else if("%AsyncGenerator%"===e){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===e){var s=t("%AsyncGenerator%");s&&w&&(r=w(s.prototype))}return O[e]=r,r},N={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=r(9524),k=r(5630),U=F.call(C,Array.prototype.concat),G=F.call(M,Array.prototype.splice),H=F.call(C,String.prototype.replace),j=F.call(C,String.prototype.slice),V=F.call(C,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,X=/\\(\\)?/g,z=function(t,e){var r,i=t;if(k(N,i)&&(i="%"+(r=N[i])[0]+"%"),k(O,i)){var s=O[i];if(s===I&&(s=L(i)),void 0===s&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:s}}throw new l("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=j(t,0,1),r=j(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var i=[];return H(t,$,(function(t,e,r,s){i[i.length]=r?H(s,X,"$1"):e||t})),i}(t),i=r.length>0?r[0]:"",s=z("%"+i+"%",e),n=s.name,o=s.value,a=!1,h=s.alias;h&&(i=h[0],G(r,U([0,1],h)));for(var c=1,d=!0;c<r.length;c+=1){var p=r[c],f=j(p,0,1),m=j(p,-1);if(('"'===f||"'"===f||"`"===f||'"'===m||"'"===m||"`"===m)&&f!==m)throw new l("property names with quotes must have matching quotes");if("constructor"!==p&&d||(a=!0),k(O,n="%"+(i+="."+p)+"%"))o=O[n];else if(null!=o){if(!(p in o)){if(!e)throw new u("base intrinsic for "+t+" exists, but the property is not available.");return}if(b&&c+1>=r.length){var g=b(o,p);o=(d=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[p]}else d=k(o,p),o=o[p];d&&!a&&(O[n]=o)}}return o}},121:(t,e,r)=>{"use strict";var i=r(1537),s=r(8036);class n{constructor(t=0,e=0,r=0){this.x=t,this.y=e,this.radius=r,this.type=i.SHAPES.CIRC}clone(){return new n(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const r=this.radius*this.radius;let i=this.x-t,s=this.y-e;return i*=i,s*=s,i+s<=r}getBounds(){return new s.Rectangle(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}}n.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`},e.Circle=n},155:(t,e,r)=>{"use strict";var i=r(238);const s=[];i.extensions.handleByList(i.ExtensionType.Renderer,s),e.autoDetectRenderer=function(t){for(const e of s)if(e.test(t))return new e(t);throw new Error("Unable to auto-detect a suitable renderer.")}},189:(t,e,r)=>{"use strict";var i=r(8894),s=r(2229),n=r(599);class o extends n.Geometry{constructor(t=!1){super(),this._buffer=new s.Buffer(null,t,!1),this._indexBuffer=new s.Buffer(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,i.TYPES.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,i.TYPES.FLOAT).addAttribute("aColor",this._buffer,4,!0,i.TYPES.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,i.TYPES.FLOAT).addIndex(this._indexBuffer)}}e.BatchGeometry=o},194:(t,e)=>{"use strict";let r;e.unsafeEvalSupported=function(){if("boolean"==typeof r)return r;try{r=!0===new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")}catch{r=!1}return r}},211:(t,e,r)=>{"use strict";var i=r(1537),s=r(8036);class n{constructor(t=0,e=0,r=0,s=0){this.x=t,this.y=e,this.width=r,this.height=s,this.type=i.SHAPES.ELIP}clone(){return new n(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,r+i<=1}getBounds(){return new s.Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)}}n.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`},e.Ellipse=n},226:(t,e,r)=>{"use strict";var i=r(9878),s=r(92),n=r(6423);class o extends i.Filter{constructor(t,e){const r=new i.Matrix;t.renderable=!1,super(n.default,s.default,{mapSampler:t._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=r,null==e&&(e=20),this.scale=new i.Point(e,e)}apply(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;const s=this.maskSprite.worldTransform,n=Math.sqrt(s.a*s.a+s.b*s.b),o=Math.sqrt(s.c*s.c+s.d*s.d);0!==n&&0!==o&&(this.uniforms.rotation[0]=s.a/n,this.uniforms.rotation[1]=s.b/n,this.uniforms.rotation[2]=s.c/o,this.uniforms.rotation[3]=s.d/o),t.applyFilter(this,e,r,i)}get map(){return this.uniforms.mapSampler}set map(t){this.uniforms.mapSampler=t}}e.DisplacementFilter=o},238:(t,e)=>{"use strict";var r=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(r||{});const i=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={..."object"!=typeof t.extension?{type:t.extension}:t.extension,ref:t}}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t={...t}).type&&(t.type=[t.type]),t},s=(t,e)=>i(t).priority??e,n={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(i).forEach((t=>{t.type.forEach((e=>this._removeHandlers[e]?.(t)))})),this},add(...t){return t.map(i).forEach((t=>{t.type.forEach((e=>{const r=this._addHandlers,i=this._queue;r[e]?r[e]?.(t):(i[e]=i[e]||[],i[e]?.push(t))}))})),this},handle(t,e,r){const i=this._addHandlers,s=this._removeHandlers;if(i[t]||s[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,s[t]=r;const n=this._queue;return n[t]&&(n[t]?.forEach((t=>e(t))),delete n[t]),this},handleByMap(t,e){return this.handle(t,(t=>{t.name&&(e[t.name]=t.ref)}),(t=>{t.name&&delete e[t.name]}))},handleByList(t,e,r=-1){return this.handle(t,(t=>{e.includes(t.ref)||(e.push(t.ref),e.sort(((t,e)=>s(e,r)-s(t,r))))}),(t=>{const r=e.indexOf(t.ref);-1!==r&&e.splice(r,1)}))}};e.ExtensionType=r,e.extensions=n},246:(t,e,r)=>{"use strict";var i=r(9878),s=r(5724),n=r(481);function o(t,e){return e instanceof i.BaseTexture&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function a(t,e){if(!(e instanceof s.Graphics))return!1;const{geometry:r}=e;e.finishPoly(),r.updateBatches();const{batches:i}=r;for(let e=0;e<i.length;e++){const{texture:r}=i[e].style;r&&o(t,r.baseTexture)}return r.batchable||t.geometry.bind(r,e._resolveDirectShader(t)),!0}function h(t,e){return t instanceof s.Graphics&&(e.push(t),!0)}class l extends n.BasePrepare{constructor(t){super(t),this.uploadHookHelper=this.renderer,this.registerFindHook(h),this.registerUploadHook(o),this.registerUploadHook(a)}}l.extension={name:"prepare",type:i.ExtensionType.RendererSystem},i.extensions.add(l),e.Prepare=l},248:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},250:t=>{"use strict";t.exports=Math.pow},270:(t,e,r)=>{"use strict";var i=r(238);class s{constructor(t){this.renderer=t}render(t,e){const r=this.renderer;let i,s,n,o;if(e&&(i=e.renderTexture,s=e.clear,n=e.transform,o=e.skipUpdateTransform),this.renderingToScreen=!i,r.runners.prerender.emit(),r.emit("prerender"),r.projection.transform=n,!r.context.isLost){if(i||(this.lastObjectRendered=t),!o){const e=t.enableTempParent();t.updateTransform(),t.disableTempParent(e)}r.renderTexture.bind(i),r.batch.currentRenderer.start(),(s??r.background.clearBeforeRender)&&r.renderTexture.clear(),t.render(r),r.batch.currentRenderer.flush(),i&&(e.blit&&r.framebuffer.blit(),i.baseTexture.update()),r.runners.postrender.emit(),r.projection.transform=null,r.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}s.extension={type:i.ExtensionType.RendererSystem,name:"objectRenderer"},i.extensions.add(s),e.ObjectRendererSystem=s},326:(t,e,r)=>{"use strict";var i=r(9878),s=r(6934);const n={extension:{type:i.ExtensionType.DetectionParser,priority:1},test:async()=>s.testImageFormat("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async t=>[...t,"avif"],remove:async t=>t.filter((t=>"avif"!==t))};i.extensions.add(n),e.detectAvif=n},339:(t,e,r)=>{"use strict";var i=r(775);e.resolveTextureUrl=i.resolveTextureUrl},377:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799);class n extends s.Container{constructor(t=1500,e,r=16384,s=!1){super(),r>16384&&(r=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=r,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=i.BLEND_MODES.NORMAL,this.autoResize=s,this.roundPixels=!0,this.baseTexture=null,this.setProperties(e),this._tintColor=new i.Color(0),this.tintRgb=new Float32Array(3),this.tint=16777215}setProperties(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])}updateTransform(){this.displayObjectUpdateTransform()}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintColor.toRgbArray(this.tintRgb)}render(t){!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",(()=>this.onChildrenChange(0)))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))}onChildrenChange(t){const e=Math.floor(t/this._batchSize);for(;this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID}dispose(){if(this._buffers){for(let t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}}destroy(t){super.destroy(t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null}}e.ParticleContainer=n},390:(t,e)=>{"use strict";e.TimeLimiter=class{constructor(t){this.maxMilliseconds=t,this.frameStart=0}beginFrame(){this.frameStart=Date.now()}allowedToUpload(){return Date.now()-this.frameStart<this.maxMilliseconds}}},394:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DhToolsSocketBase=e.ResolveType=e.Resolve=e.Service=e.Component=e.globalInjectionHandler=void 0;const i=r(9511),s=r(1653);Object.defineProperty(e,"Component",{enumerable:!0,get:function(){return s.Component}});const n=r(9645);Object.defineProperty(e,"Service",{enumerable:!0,get:function(){return n.Service}});const o=r(5638);Object.defineProperty(e,"Resolve",{enumerable:!0,get:function(){return o.Resolve}}),Object.defineProperty(e,"ResolveType",{enumerable:!0,get:function(){return o.ResolveType}});const a=r(2760);Object.defineProperty(e,"DhToolsSocketBase",{enumerable:!0,get:function(){return a.DhToolsSocketBase}}),e.globalInjectionHandler=new i.InjectionHandler},479:(t,e,r)=>{"use strict";var i=r(6238),s=r(8066),n=r(1203);const o=class t extends n.BaseImageResource{constructor(t,e){e=e||{},super(i.settings.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise((e=>{if(this._resolve=()=>{this.update(),e(this)},t.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}))),this._load}_loadSvg(){const t=new Image;n.BaseImageResource.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,r=t.height;if(!e||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let i=e*this.scale,n=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(i=this._overrideWidth||this._overrideHeight/r*e,n=this._overrideHeight||this._overrideWidth/e*r),i=Math.round(i),n=Math.round(n);const o=this.source;o.width=i,o.height=n,o._pixiId=`canvas_${s.uid()}`,o.getContext("2d").drawImage(t,0,0,e,r,0,0,i,n),this._resolve(),this._resolve=null}}static getSize(e){const r=t.SVG_SIZE.exec(e),i={};return r&&(i[r[1]]=Math.round(parseFloat(r[3])),i[r[5]]=Math.round(parseFloat(r[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,r){return"svg"===r||"string"==typeof e&&e.startsWith("data:image/svg+xml")||"string"==typeof e&&t.SVG_XML.test(e)}};o.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,o.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let a=o;e.SVGResource=a},481:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799),n=r(3293),o=r(9488);function a(t,e){let r=!1;if(t?._textures?.length)for(let s=0;s<t._textures.length;s++)if(t._textures[s]instanceof i.Texture){const i=t._textures[s].baseTexture;e.includes(i)||(e.push(i),r=!0)}return r}function h(t,e){if(t.baseTexture instanceof i.BaseTexture){const r=t.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function l(t,e){if(t._texture&&t._texture instanceof i.Texture){const r=t._texture.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function u(t,e){return e instanceof n.Text&&(e.updateText(!0),!0)}function c(t,e){if(e instanceof n.TextStyle){const t=e.toFontString();return n.TextMetrics.measureFont(t),!0}return!1}function d(t,e){if(t instanceof n.Text){e.includes(t.style)||e.push(t.style),e.includes(t)||e.push(t);const r=t._texture.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function p(t,e){return t instanceof n.TextStyle&&(e.includes(t)||e.push(t),!0)}const f=class t{constructor(e){this.limiter=new o.CountLimiter(t.uploadsPerFrame),this.renderer=e,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{this.queue&&this.prepareItems()},this.registerFindHook(d),this.registerFindHook(p),this.registerFindHook(a),this.registerFindHook(h),this.registerFindHook(l),this.registerUploadHook(u),this.registerUploadHook(c)}upload(t){return new Promise((e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,i.Ticker.system.addOnce(this.tick,this,i.UPDATE_PRIORITY.UTILITY))):e()}))}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const t=this.queue[0];let e=!1;if(t&&!t._destroyed)for(let 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)i.Ticker.system.addOnce(this.tick,this,i.UPDATE_PRIORITY.UTILITY);else{this.ticking=!1;const t=this.completes.slice(0);this.completes.length=0;for(let e=0,r=t.length;e<r;e++)t[e]()}}registerFindHook(t){return t&&this.addHooks.push(t),this}registerUploadHook(t){return t&&this.uploadHooks.push(t),this}add(t){for(let e=0,r=this.addHooks.length;e<r&&!this.addHooks[e](t,this.queue);e++);if(t instanceof s.Container)for(let e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&i.Ticker.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}};f.uploadsPerFrame=4;let m=f;e.BasePrepare=m},508:(t,e,r)=>{"use strict";r(1153);var i=r(6238);let s;e.isWebGLSupported=function(){return typeof s>"u"&&(s=function(){const t={stencil:!0,failIfMajorPerformanceCaveat:i.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!i.settings.ADAPTER.getWebGLRenderingContext())return!1;const e=i.settings.ADAPTER.createCanvas();let r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);const s=!!r?.getContextAttributes()?.stencil;if(r){const t=r.getExtension("WEBGL_lose_context");t&&t.loseContext()}return r=null,s}catch{return!1}}()),s}},510:(t,e,r)=>{"use strict";var i=r(3273),s=r(6247);const n=class{constructor(){this.worldTransform=new i.Matrix,this.localTransform=new i.Matrix,this.position=new s.ObservablePoint(this.onChange,this,0,0),this.scale=new s.ObservablePoint(this.onChange,this,1,1),this.pivot=new s.ObservablePoint(this.onChange,this,0,0),this.skew=new s.ObservablePoint(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}onChange(){this._localID++}updateSkew(){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++}updateLocalTransform(){const 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)}updateTransform(t){const 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){const 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++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};n.IDENTITY=new n;let o=n;o.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}) ]`},e.Transform=o},521:(t,e)=>{"use strict";var r=(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",t))(r||{});e.UPDATE_PRIORITY=r},522:t=>{t.exports=function(t,e){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var s in r)i[r[s]]=s;var n={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,o,a=i[this.toHex()];if(a)return a;if(null==e?void 0:e.closest){var h=this.toRgb(),l=1/0,u="black";if(!n.length)for(var c in r)n[c]=new t(r[c]).toRgb();for(var d in r){var p=(s=h,o=n[d],Math.pow(s.r-o.r,2)+Math.pow(s.g-o.g,2)+Math.pow(s.b-o.b,2));p<l&&(l=p,u=d)}return u}},e.string.push([function(e){var i=e.toLowerCase(),s="transparent"===i?"#0000":r[i];return s?new t(s).toRgb():null},"name"])}},565:(t,e,r)=>{"use strict";var i=r(9878),s=r(7728),n=r(1907);class o extends i.Filter{constructor(t,e=8,r=4,o=i.Filter.defaultResolution,a=5){super(n.generateBlurVertSource(a,t),s.generateBlurFragSource(a)),this.horizontal=t,this.resolution=o,this._quality=0,this.quality=r,this.blur=e}apply(t,e,r,s){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,s);else{const n=t.getFilterTexture(),o=t.renderer;let a=e,h=n;this.state.blend=!1,t.applyFilter(this,a,h,i.CLEAR_MODES.CLEAR);for(let e=1;e<this.passes-1;e++){t.bindAndClear(a,i.CLEAR_MODES.BLIT),this.uniforms.uSampler=h;const e=h;h=a,a=e,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,h,r,s),t.returnFilterTexture(n)}}get blur(){return this.strength}set blur(t){this.padding=1+2*Math.abs(t),this.strength=t}get quality(){return this._quality}set quality(t){this._quality=t,this.passes=t}}e.BlurFilterPass=o},580:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="#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"},596:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,":host{width:2px;height:90%;transform:translateY(5%);border-left:solid #000 2px;border-right:solid #000 2px}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},599:(t,e,r)=>{"use strict";var i=r(8894),s=r(3386),n=r(8066),o=r(7255),a=r(2229),h=r(3044);const l={5126:4,5123:2,5121:1};let u=0;const c={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class d{constructor(t=[],e={}){this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=u++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new s.Runner("disposeGeometry"),this.refCount=0}addAttribute(t,e,r=0,i=!1,s,n,h,l=!1){if(!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof a.Buffer||(e instanceof Array&&(e=new Float32Array(e)),e=new a.Buffer(e));const u=t.split("|");if(u.length>1){for(let t=0;t<u.length;t++)this.addAttribute(u[t],e,r,i,s);return this}let c=this.buffers.indexOf(e);return-1===c&&(this.buffers.push(e),c=this.buffers.length-1),this.attributes[t]=new o.Attribute(c,r,i,s,n,h,l),this.instanced=this.instanced||l,this}getAttribute(t){return this.attributes[t]}getBuffer(t){return this.buffers[this.getAttribute(t).buffer]}addIndex(t){return t instanceof a.Buffer||(t instanceof Array&&(t=new Uint16Array(t)),t=new a.Buffer(t)),t.type=i.BUFFER_TYPE.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.includes(t)||this.buffers.push(t),this}getIndex(){return this.indexBuffer}interleave(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;const t=[],e=[],r=new a.Buffer;let i;for(i in this.attributes){const r=this.attributes[i],s=this.buffers[r.buffer];t.push(s.data),e.push(r.size*l[r.type]/4),r.buffer=0}for(r.data=h.interleaveTypedArrays(t,e),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[r],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const t in this.attributes){const e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const t=new d;for(let e=0;e<this.buffers.length;e++)t.buffers[e]=new a.Buffer(this.buffers[e].data.slice(0));for(const e in this.attributes){const r=this.attributes[e];t.attributes[e]=new o.Attribute(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=i.BUFFER_TYPE.ELEMENT_ARRAY_BUFFER),t}static merge(t){const e=new d,r=[],s=[],o=[];let h;for(let e=0;e<t.length;e++){h=t[e];for(let t=0;t<h.buffers.length;t++)s[t]=s[t]||0,s[t]+=h.buffers[t].data.length,o[t]=0}for(let t=0;t<h.buffers.length;t++)r[t]=new(c[n.getBufferType(h.buffers[t].data)])(s[t]),e.buffers[t]=new a.Buffer(r[t]);for(let e=0;e<t.length;e++){h=t[e];for(let t=0;t<h.buffers.length;t++)r[t].set(h.buffers[t].data,o[t]),o[t]+=h.buffers[t].data.length}if(e.attributes=h.attributes,h.indexBuffer){e.indexBuffer=e.buffers[h.buffers.indexOf(h.indexBuffer)],e.indexBuffer.type=i.BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;let r=0,s=0,n=0,o=0;for(let t=0;t<h.buffers.length;t++)if(h.buffers[t]!==h.indexBuffer){o=t;break}for(const t in h.attributes){const e=h.attributes[t];(0|e.buffer)===o&&(s+=e.size*l[e.type]/4)}for(let i=0;i<t.length;i++){const a=t[i].indexBuffer.data;for(let t=0;t<a.length;t++)e.indexBuffer.data[t+n]+=r;r+=t[i].buffers[o].data.length/s,n+=a.length}}return e}}e.Geometry=d},606:(t,e,r)=>{"use strict";var i=r(7495),s=r(706);e.getAttributeData=function(t,e){const r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let o=0;o<n;o++){const n=e.getActiveAttrib(t,o);if(n.name.startsWith("gl_"))continue;const a=s.mapType(e,n.type),h={type:a,name:n.name,size:i.mapSize(a),location:e.getAttribLocation(t,n.name)};r[n.name]=h}return r}},616:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},620:(t,e,r)=>{"use strict";r(6545),r(7069),r(6853);var i=r(9567),s=r(993),n=r(6892),o=r(2629),a=r(902),h=r(9878),l=r(1799),u=r(8817),c=r(2035),d=r(3457),p=r(4175),f=r(21),m=r(2471),g=r(7135),y=r(8229),_=r(5724),v=r(8071),x=r(5941),b=r(2396),T=r(7125),E=r(1520),A=r(6861),S=r(8626),w=r(9455),P=r(3293),R=r(1612),M=r(5655);e.filters=i.filters,Object.keys(s).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}})})),Object.keys(n).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})),Object.keys(o).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})})),Object.keys(a).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return a[t]}})})),Object.keys(h).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return h[t]}})})),Object.keys(l).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return l[t]}})})),Object.keys(u).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return u[t]}})})),Object.keys(c).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return c[t]}})})),Object.keys(d).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return d[t]}})})),Object.keys(p).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return p[t]}})})),Object.keys(f).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return f[t]}})})),Object.keys(m).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return m[t]}})})),Object.keys(g).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return g[t]}})})),Object.keys(y).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return y[t]}})})),Object.keys(_).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return _[t]}})})),Object.keys(v).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return v[t]}})})),Object.keys(x).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return x[t]}})})),Object.keys(b).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return b[t]}})})),Object.keys(T).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return T[t]}})})),Object.keys(E).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return E[t]}})})),Object.keys(A).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return A[t]}})})),Object.keys(S).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return S[t]}})})),Object.keys(w).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return w[t]}})})),Object.keys(P).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return P[t]}})})),Object.keys(R).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return R[t]}})})),Object.keys(M).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return M[t]}})}))},622:(t,e,r)=>{"use strict";var i=r(8465);e.Color=i.Color},629:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},669:(t,e,r)=>{"use strict";var i=r(3293);e.generateFillStyle=function(t,e,r,s,n,o){const a=r.fill;if(!Array.isArray(a))return a;if(1===a.length)return a[0];let h;const l=r.dropShadow?r.dropShadowDistance:0,u=r.padding||0,c=t.width/s-l-2*u,d=t.height/s-l-2*u,p=a.slice(),f=r.fillGradientStops.slice();if(!f.length){const t=p.length+1;for(let e=1;e<t;++e)f.push(e/t)}if(p.unshift(a[0]),f.unshift(0),p.push(a[a.length-1]),f.push(1),r.fillGradientType===i.TEXT_GRADIENT.LINEAR_VERTICAL){h=e.createLinearGradient(c/2,u,c/2,d+u);let t=0;const i=(o.fontProperties.fontSize+r.strokeThickness)/d;for(let e=0;e<n.length;e++){const r=o.lineHeight*e;for(let e=0;e<p.length;e++){let s=0;s="number"==typeof f[e]?f[e]:e/p.length;const n=r/d+s*i;let o=Math.max(t,n);o=Math.min(o,1),h.addColorStop(o,p[e]),t=o}}}else{h=e.createLinearGradient(u,d/2,c+u,d/2);const t=p.length+1;let r=1;for(let e=0;e<p.length;e++){let i;i="number"==typeof f[e]?f[e]:r/t,h.addColorStop(i,p[e]),r++}}return h}},706:(t,e)=>{"use strict";let r=null;const i={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"};e.mapType=function(t,e){if(!r){const e=Object.keys(i);r={};for(let s=0;s<e.length;++s){const n=e[s];r[t[n]]=i[n]}}return r[e]}},723:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},775:(t,e,r)=>{"use strict";var i=r(9878);r(9265);var s=r(8795);const n={extension:i.ExtensionType.ResolveParser,test:s.loadTextures.test,parse:t=>({resolution:parseFloat(i.settings.RETINA_PREFIX.exec(t)?.[1]??"1"),format:i.utils.path.extname(t).slice(1),src:t})};i.extensions.add(n),e.resolveTextureUrl=n},782:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseSocketService=e.SocketConnectionState=e.SocketBaseError=void 0;const i=r(3943);class s extends Error{code;data;constructor(t,e){let r=`request response with status: ${t}`;e?.message&&(r+=`\n\tmessage: '${e.message}'`),super(r),this.code=t,this.data=e}}var n;e.SocketBaseError=s,function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(n=e.SocketConnectionState||(e.SocketConnectionState={})),e.BaseSocketService=class{reconnectTimeout=-1;host="127.0.0.1";port=0;route="";socket;commandRegistry;openRequests=new Map;connectionState=new i.BehaviorSubject(n.CLOSED);messageHandler=[];constructor(){this.commandRegistry=new Map}setHost(t){if(!/^((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9])$/.test(t)&&!/^(localhost)|(((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+[A-Za-z]{2,6})$/.test(t))throw new SyntaxError("host needs to be an ipv4 address or a domain name");this.getReadyState()!=n.CLOSED&&console.warn("Host changed while socket is connected or connecting!"),this.host=t}setPort(t){if(!Number.isInteger(t)||t<0)throw TypeError("port needs to be an positive integer");if(0!=t&&(t<1024||t>49151))throw RangeError("port needs to be an registered port. Registered ports are between 1024-49151. For more information see https://en.wikipedia.org/wiki/Registered_port");this.getReadyState()!=n.CLOSED&&console.warn("Port changed while socket is connected or connecting!"),this.port=t}setRoute(t){if(!t.startsWith("/"))throw new SyntaxError(`"${t}" is not a valid route! Routes needs to start with a slash '/'!`);this.route=t}getUrl(){return this.host+(this.port?":"+this.port:"")+this.route}connectPromise;async connect(){const t=this.getUrl();if(!t)throw new SyntaxError(`host name is required for a websocket connection! Please specify 'hostAndPath' in your ${this.constructor.name} Implementation`);this.connectPromise||(this.connectPromise=new Promise(((e,r)=>{let i;this.connectionState.next(n.CONNECTING),this.socket=new WebSocket(`ws://${t}`),this.socket.onmessage=t=>{this.processMessage(JSON.parse(t.data))},this.socket.onopen=()=>{i=setInterval((()=>{this.socket.send("ping")}),1e4),this.processMessage({command:"open"}),this.connectionState.next(n.OPEN),e(!0)},this.socket.onclose=()=>{clearInterval(i),this.processMessage({command:"close",data:!0}),this.connectionState.next(n.CLOSED),r(),this.connectPromise=null,this.reconnectTimeout>0&&setTimeout((()=>this.connect()),5e3)}}))),await this.connectPromise}onConnectionStateChange(){return this.connectionState.asObservable()}getReadyState(){return this.socket?this.socket.readyState:WebSocket.CLOSED}processMessage(t){if(t?.id){const e=this.openRequests.get(t.id);e&&e(t)}if(t?.command&&t.data){let e=this.commandRegistry.get(t.command);e&&e.subscriptions.forEach((e=>{e.next(t.data)})),!t?.id&&this.messageHandler&&this.messageHandler.forEach((e=>e(t.command,t.data)))}}addMessageHandler(t){this.messageHandler.push(t)}removeMessageHandler(t){const e=this.messageHandler.indexOf(t);-1!==e&&this.messageHandler.splice(e,1)}internalSend(t){this.connect().then((()=>{this.socket.send(JSON.stringify(t))}))}on(t){let e=this.commandRegistry.get(t);return e||(e={subscriptions:[],observer:new i.Observable((r=>{0===e.subscriptions.length&&(console.log("now listening for event ",t),this.internalSend({activateListener:t})),e.subscriptions.push(r),r.add((()=>{e.subscriptions.splice(e.subscriptions.indexOf(r),1),0==e.subscriptions.length&&(console.log("stop listening for event ",t),this.internalSend({deactivateListener:t}))}))}))},this.commandRegistry.set(t,e)),e.observer}uniqueIdCounter=0;getUniqueId(){return(++this.uniqueIdCounter).toString()}async send(t,e){return await this.connect(),new Promise(((r,i)=>{const n=this.getUniqueId();this.openRequests.set(n,(t=>{this.openRequests.delete(n),!t?.status||t.status>=400?i(new s(t.status,t?.data)):r(t.data)})),this.internalSend({id:n,command:t,data:e})}))}}},836:(t,e,r)=>{"use strict";var i=r(4198),s=r(3952),n=r(8085),o=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},h=Array.isArray,l=Array.prototype.push,u=function(t,e){l.apply(t,h(e)?e:[e])},c=Date.prototype.toISOString,d=n.default,p={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:s.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:n.formatters[d],indices:!1,serializeDate:function(t){return c.call(t)},skipNulls:!1,strictNullHandling:!1},f={},m=function t(e,r,n,o,a,l,c,d,m,g,y,_,v,x,b,T,E,A){for(var S,w=e,P=A,R=0,M=!1;void 0!==(P=P.get(f))&&!M;){var C=P.get(e);if(R+=1,void 0!==C){if(C===R)throw new RangeError("Cyclic object value");M=!0}void 0===P.get(f)&&(R=0)}if("function"==typeof g?w=g(r,w):w instanceof Date?w=v(w):"comma"===n&&h(w)&&(w=s.maybeMap(w,(function(t){return t instanceof Date?v(t):t}))),null===w){if(l)return m&&!T?m(r,p.encoder,E,"key",x):r;w=""}if("string"==typeof(S=w)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||s.isBuffer(w))return m?[b(T?r:m(r,p.encoder,E,"key",x))+"="+b(m(w,p.encoder,E,"value",x))]:[b(r)+"="+b(String(w))];var I,D=[];if(void 0===w)return D;if("comma"===n&&h(w))T&&m&&(w=s.maybeMap(w,m)),I=[{value:w.length>0?w.join(",")||null:void 0}];else if(h(g))I=g;else{var O=Object.keys(w);I=y?O.sort(y):O}var B=d?String(r).replace(/\./g,"%2E"):String(r),L=o&&h(w)&&1===w.length?B+"[]":B;if(a&&h(w)&&0===w.length)return L+"[]";for(var N=0;N<I.length;++N){var F=I[N],k="object"==typeof F&&F&&void 0!==F.value?F.value:w[F];if(!c||null!==k){var U=_&&d?String(F).replace(/\./g,"%2E"):String(F),G=h(w)?"function"==typeof n?n(L,U):L:L+(_?"."+U:"["+U+"]");A.set(e,R);var H=i();H.set(f,A),u(D,t(k,G,n,o,a,l,c,d,"comma"===n&&T&&h(w)?null:m,g,y,_,v,x,b,T,E,H))}}return D};t.exports=function(t,e){var r,s=t,l=function(t){if(!t)return p;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.encodeDotInKeys&&"boolean"!=typeof t.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||p.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=n.default;if(void 0!==t.format){if(!o.call(n.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var i,s=n.formatters[r],l=p.filter;if(("function"==typeof t.filter||h(t.filter))&&(l=t.filter),i=t.arrayFormat in a?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":p.arrayFormat,"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===t.allowDots?!0===t.encodeDotInKeys||p.allowDots:!!t.allowDots;return{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:p.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:p.allowEmptyArrays,arrayFormat:i,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:p.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:void 0===t.delimiter?p.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:p.encode,encodeDotInKeys:"boolean"==typeof t.encodeDotInKeys?t.encodeDotInKeys:p.encodeDotInKeys,encoder:"function"==typeof t.encoder?t.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:p.encodeValuesOnly,filter:l,format:r,formatter:s,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:p.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:p.strictNullHandling}}(e);"function"==typeof l.filter?s=(0,l.filter)("",s):h(l.filter)&&(r=l.filter);var c=[];if("object"!=typeof s||null===s)return"";var d=a[l.arrayFormat],f="comma"===d&&l.commaRoundTrip;r||(r=Object.keys(s)),l.sort&&r.sort(l.sort);for(var g=i(),y=0;y<r.length;++y){var _=r[y],v=s[_];l.skipNulls&&null===v||u(c,m(v,_,d,f,l.allowEmptyArrays,l.strictNullHandling,l.skipNulls,l.encodeDotInKeys,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,g))}var x=c.join(l.delimiter),b=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),x.length>0?b+x:""}},842:()=>{},856:(t,e)=>{"use strict";function r(t,e,i,s,n){const o=e[i];for(let a=0;a<o.length;a++){const h=o[a];i<e.length-1?r(t.replace(s[i],h),e,i+1,s,n):n.push(t.replace(s[i],h))}}e.createStringVariations=function(t){const e=t.match(/\{(.*?)\}/g),i=[];if(e){const s=[];e.forEach((t=>{const e=t.substring(1,t.length-1).split(",");s.push(e)})),r(t,s,0,e,i)}else i.push(t);return i}},862:(t,e,r)=>{"use strict";var i=r(9878),s=r(669);e.drawGlyph=function(t,e,r,n,o,a,h){const l=r.text,u=r.fontProperties;e.translate(n,o),e.scale(a,a);const c=h.strokeThickness/2,d=-h.strokeThickness/2;if(e.font=h.toFontString(),e.lineWidth=h.strokeThickness,e.textBaseline=h.textBaseline,e.lineJoin=h.lineJoin,e.miterLimit=h.miterLimit,e.fillStyle=s.generateFillStyle(t,e,h,a,[l],r),e.strokeStyle=h.stroke,h.dropShadow){const t=h.dropShadowColor,r=h.dropShadowBlur*a,s=h.dropShadowDistance*a;e.shadowColor=i.Color.shared.setValue(t).setAlpha(h.dropShadowAlpha).toRgbaString(),e.shadowBlur=r,e.shadowOffsetX=Math.cos(h.dropShadowAngle)*s,e.shadowOffsetY=Math.sin(h.dropShadowAngle)*s}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;h.stroke&&h.strokeThickness&&e.strokeText(l,c,d+r.lineHeight-u.descent),h.fill&&e.fillText(l,c,d+r.lineHeight-u.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}},865:(t,e,r)=>{"use strict";var i=r(9878);class s{constructor(){this.color=16777215,this.alpha=1,this.texture=i.Texture.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new s;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t}reset(){this.color=16777215,this.alpha=1,this.texture=i.Texture.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}e.FillStyle=s},866:(t,e)=>{"use strict";e.BackgroundLoader=class{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach((t=>{this._assetList.push(t)})),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let r=0;r<e;r++)t.push(this._assetList.pop());await this._loader.load(t),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}},892:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n    gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"},902:(t,e,r)=>{"use strict";var i=r(7773);r(1413),r(7601),r(8840);var s=r(2255),n=r(6276),o=r(5288),a=r(1236),h=r(5885),l=r(8049),u=r(3869),c=r(2768);e.INTERNAL_FORMATS=i.INTERNAL_FORMATS,e.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL=i.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL,e.detectCompressedTextures=s.detectCompressedTextures,e.loadDDS=n.loadDDS,e.loadKTX=o.loadKTX,e.resolveCompressedTextureUrl=a.resolveCompressedTextureUrl,e.parseDDS=h.parseDDS,e.FORMATS_TO_COMPONENTS=l.FORMATS_TO_COMPONENTS,e.TYPES_TO_BYTES_PER_COMPONENT=l.TYPES_TO_BYTES_PER_COMPONENT,e.TYPES_TO_BYTES_PER_PIXEL=l.TYPES_TO_BYTES_PER_PIXEL,e.parseKTX=l.parseKTX,e.BlobResource=u.BlobResource,e.CompressedTextureResource=c.CompressedTextureResource},928:(t,e,r)=>{"use strict";var i=r(7146),s=r(6238),n=r(8066),o=r(4611),a=r(6484),h=r(6318);const l=new h.TextureUvs;function u(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class c extends n.EventEmitter{constructor(t,e,r,s,n,o,a){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new i.Rectangle(0,0,1,1)),t instanceof c&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=s,this.valid=!1,this.destroyed=!1,this._uvs=l,this.uvMatrix=null,this.orig=r||e,this._rotate=Number(n||0),!0===n)this._rotate=2;else if(this._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new i.Point(o.x,o.y):new i.Point(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(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)}destroy(t){if(this.baseTexture){if(t){const{resource:t}=this.baseTexture;t?.url&&n.TextureCache[t.url]&&c.removeFromCache(t.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,c.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){const t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),r=new c(this.baseTexture,!this.noFrame&&t,e,this.trim?.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(r._frame=t),r}updateUvs(){this._uvs===l&&(this._uvs=new h.TextureUvs),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},r=s.settings.STRICT_TEXTURE_CACHE){const i="string"==typeof t;let a=null;if(i)a=t;else if(t instanceof o.BaseTexture){if(!t.cacheId){const r=e?.pixiIdPrefix||"pixiid";t.cacheId=`${r}-${n.uid()}`,o.BaseTexture.addToCache(t,t.cacheId)}a=t.cacheId}else{if(!t._pixiId){const r=e?.pixiIdPrefix||"pixiid";t._pixiId=`${r}_${n.uid()}`}a=t._pixiId}let h=n.TextureCache[a];if(i&&r&&!h)throw new Error(`The cacheId "${a}" does not exist in TextureCache.`);return h||t instanceof o.BaseTexture?!h&&t instanceof o.BaseTexture&&(h=new c(t),c.addToCache(h,a)):(e.resolution||(e.resolution=n.getResolutionOfUrl(t)),h=new c(new o.BaseTexture(t,e)),h.baseTexture.cacheId=a,o.BaseTexture.addToCache(h.baseTexture,a),c.addToCache(h,a)),h}static fromURL(t,e){const r=Object.assign({autoLoad:!1},e?.resourceOptions),i=c.from(t,Object.assign({resourceOptions:r},e),!1),s=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):s.load().then((()=>Promise.resolve(i)))}static fromBuffer(t,e,r,i){return new c(o.BaseTexture.fromBuffer(t,e,r,i))}static fromLoader(t,e,r,i){const s=new o.BaseTexture(t,Object.assign({scaleMode:o.BaseTexture.defaultOptions.scaleMode,resolution:n.getResolutionOfUrl(e)},i)),{resource:h}=s;h instanceof a.ImageResource&&(h.url=e);const l=new c(s);return r||(r=e),o.BaseTexture.addToCache(l.baseTexture,r),c.addToCache(l,r),r!==e&&(o.BaseTexture.addToCache(l.baseTexture,e),c.addToCache(l,e)),l.baseTexture.valid?Promise.resolve(l):new Promise((t=>{l.baseTexture.once("loaded",(()=>t(l)))}))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),n.TextureCache[e]&&n.TextureCache[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),n.TextureCache[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=n.TextureCache[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete n.TextureCache[t],e}}else if(t?.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)n.TextureCache[t.textureCacheIds[e]]===t&&delete n.TextureCache[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(t){this._frame=t,this.noFrame=!1;const{x:e,y:r,width:i,height:s}=t,n=e+i>this.baseTexture.width,o=r+s>this.baseTexture.height;if(n||o){const t=n&&o?"and":"or",a=`X: ${e} + ${i} = ${e+i} > ${this.baseTexture.width}`,h=`Y: ${r} + ${s} = ${r+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${a} ${t} ${h}`)}this.valid=i&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return c._EMPTY||(c._EMPTY=new c(new o.BaseTexture),u(c._EMPTY),u(c._EMPTY.baseTexture)),c._EMPTY}static get WHITE(){if(!c._WHITE){const t=s.settings.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),c._WHITE=new c(o.BaseTexture.from(t)),u(c._WHITE),u(c._WHITE.baseTexture)}return c._WHITE}}e.Texture=c},949:(t,e,r)=>{"use strict";var i=r(9156);e.trimCanvas=function(t){const e=i.getCanvasBoundingBox(t),{width:r,height:s}=e;let n=null;if(!e.isEmpty()){const i=t.getContext("2d");if(null===i)throw new TypeError("Failed to get canvas 2D context");n=i.getImageData(e.left,e.top,r,s)}return{width:r,height:s,data:n}}},993:(t,e,r)=>{"use strict";var i=r(6738),s=r(3046);e.AccessibilityManager=i.AccessibilityManager,e.accessibleTarget=s.accessibleTarget},1005:(t,e,r)=>{"use strict";var i=r(9878),s=r(1520);class n extends s.Sprite{constructor(t,e=!0){super(t[0]instanceof i.Texture?t[0]:t[0].texture),this._textures=null,this._durations=null,this._autoUpdate=e,this._isConnectedToTicker=!1,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=t}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(i.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(i.Ticker.shared.add(this.update,this,i.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(t){this.stop(),this.currentFrame=t}gotoAndPlay(t){this.currentFrame=t,this.play()}update(t){if(!this._playing)return;const e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){let r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];const i=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=r/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())}updateTexture(){const 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))}destroy(t){this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){const e=[];for(let r=0;r<t.length;++r)e.push(i.Texture.from(t[r]));return new n(e)}static fromImages(t){const e=[];for(let r=0;r<t.length;++r)e.push(i.Texture.from(t[r]));return new n(e)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(t){if(t[0]instanceof i.Texture)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(let 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()}get currentFrame(){let t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}set currentFrame(t){if(t<0||t>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(i.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(i.Ticker.shared.add(this.update,this),this._isConnectedToTicker=!0))}}e.AnimatedSprite=n},1031:(t,e,r)=>{"use strict";var i=r(9878),s=r(723);class n extends i.Filter{constructor(){const t={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};super(i.defaultFilterVertex,s.default,t),this.alpha=1}_loadMatrix(t,e=!1){let r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r}_multiply(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}_colorMatrix(t){const e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e}brightness(t,e){const 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)}tint(t,e){const[r,s,n]=i.Color.shared.setValue(t).toArray(),o=[r,0,0,0,0,0,s,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(o,e)}greyscale(t,e){const 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)}blackAndWhite(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)}hue(t,e){t=(t||0)/180*Math.PI;const r=Math.cos(t),i=Math.sin(t),s=1/3,n=(0,Math.sqrt)(s),o=[r+(1-r)*s,s*(1-r)-n*i,s*(1-r)+n*i,0,0,s*(1-r)+n*i,r+s*(1-r),s*(1-r)-n*i,0,0,s*(1-r)-n*i,s*(1-r)+n*i,r+s*(1-r),0,0,0,0,0,1,0];this._loadMatrix(o,e)}contrast(t,e){const r=(t||0)+1,i=-.5*(r-1),s=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(s,e)}saturate(t=0,e){const r=2*t/3+1,i=-.5*(r-1),s=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(s,e)}desaturate(){this.saturate(-1)}negative(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)}sepia(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)}technicolor(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)}polaroid(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)}toBGR(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)}kodachrome(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)}browni(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)}vintage(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)}colorTone(t,e,r,s,n){t=t||.2,e=e||.15,r=r||16770432,s=s||3375104;const o=i.Color.shared,[a,h,l]=o.setValue(r).toArray(),[u,c,d]=o.setValue(s).toArray(),p=[.3,.59,.11,0,0,a,h,l,t,0,u,c,d,e,0,a-u,h-c,l-d,0,0];this._loadMatrix(p,n)}night(t,e){const 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)}predator(t,e){const 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)}lsd(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)}reset(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)}get matrix(){return this.uniforms.m}set matrix(t){this.uniforms.m=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}n.prototype.grayscale=n.prototype.greyscale,e.ColorMatrixFilter=n},1098:(t,e,r)=>{"use strict";r(1797)},1102:t=>{"use strict";t.exports=TypeError},1133:(t,e,r)=>{"use strict";var i=r(9878),s=r(3557),n=r(9510);class o extends i.Filter{constructor(){super(n.default,s.default)}}e.FXAAFilter=o},1153:(t,e,r)=>{"use strict";var i=r(6238);i.settings.RETINA_PREFIX=/@([0-9\.]+)x/,i.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1,Object.defineProperty(e,"settings",{enumerable:!0,get:function(){return i.settings}})},1159:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},1188:()=>{},1196:(t,e,r)=>{"use strict";var i=r(4692),s=r(6010);const n=i.default,o=s.default;e.defaultFilterVertex=o,e.defaultVertex=n},1203:(t,e,r)=>{"use strict";var i=r(8894),s=r(8066),n=r(3801);class o extends n.Resource{constructor(t){const e=t;super(e.naturalWidth||e.videoWidth||e.displayWidth||e.width,e.naturalHeight||e.videoHeight||e.displayHeight||e.height),this.source=t,this.noSubImage=!1}static crossOrigin(t,e,r){void 0!==r||e.startsWith("data:")?!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous"):t.crossOrigin=s.determineCrossOrigin(e)}upload(t,e,r,s){const n=t.gl,o=e.realWidth,a=e.realHeight;if(s=s||this.source,typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement){if(!s.complete||0===s.naturalWidth)return!1}else if(typeof HTMLVideoElement<"u"&&s instanceof HTMLVideoElement&&s.readyState<=1)return!1;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===i.ALPHA_MODES.UNPACK),this.noSubImage||e.target!==n.TEXTURE_2D||r.width!==o||r.height!==a?(r.width=o,r.height=a,n.texImage2D(e.target,0,r.internalFormat,e.format,r.type,s)):n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,r.type,s),!0}update(){if(this.destroyed)return;const t=this.source,e=t.naturalWidth||t.videoWidth||t.width,r=t.naturalHeight||t.videoHeight||t.height;this.resize(e,r),super.update()}dispose(){this.source=null}}e.BaseImageResource=o},1236:(t,e,r)=>{"use strict";var i=r(9878);const s=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],n={extension:i.ExtensionType.ResolveParser,test:t=>{const e=i.utils.path.extname(t).slice(1);return["basis","ktx","dds"].includes(e)},parse:t=>{const e=t.split("."),r=e.pop();if(["ktx","dds"].includes(r)){const r=e.pop();if(s.includes(r))return{resolution:parseFloat(i.settings.RETINA_PREFIX.exec(t)?.[1]??"1"),format:r,src:t}}return{resolution:parseFloat(i.settings.RETINA_PREFIX.exec(t)?.[1]??"1"),format:r,src:t}}};i.extensions.add(n),e.resolveCompressedTextureUrl=n},1239:function(t,e,r){var i;t=r.nmd(t),function(){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof r.g&&r.g;s.global!==s&&s.window!==s&&s.self;var n,o=2147483647,a=36,h=/^xn--/,l=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function f(t){throw new RangeError(c[t])}function m(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function g(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+m((t=t.replace(u,".")).split("."),e).join(".")}function y(t){for(var e,r,i=[],s=0,n=t.length;s<n;)(e=t.charCodeAt(s++))>=55296&&e<=56319&&s<n?56320==(64512&(r=t.charCodeAt(s++)))?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),s--):i.push(e);return i}function _(t){return m(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)})).join("")}function v(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,r){var i=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;i+=a)t=d(t/35);return d(i+36*t/(t+38))}function b(t){var e,r,i,s,n,h,l,u,c,p,m,g=[],y=t.length,v=0,b=128,T=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i<r;++i)t.charCodeAt(i)>=128&&f("not-basic"),g.push(t.charCodeAt(i));for(s=r>0?r+1:0;s<y;){for(n=v,h=1,l=a;s>=y&&f("invalid-input"),((u=(m=t.charCodeAt(s++))-48<10?m-22:m-65<26?m-65:m-97<26?m-97:a)>=a||u>d((o-v)/h))&&f("overflow"),v+=u*h,!(u<(c=l<=T?1:l>=T+26?26:l-T));l+=a)h>d(o/(p=a-c))&&f("overflow"),h*=p;T=x(v-n,e=g.length+1,0==n),d(v/e)>o-b&&f("overflow"),b+=d(v/e),v%=e,g.splice(v++,0,b)}return _(g)}function T(t){var e,r,i,s,n,h,l,u,c,m,g,_,b,T,E,A=[];for(_=(t=y(t)).length,e=128,r=0,n=72,h=0;h<_;++h)(g=t[h])<128&&A.push(p(g));for(i=s=A.length,s&&A.push("-");i<_;){for(l=o,h=0;h<_;++h)(g=t[h])>=e&&g<l&&(l=g);for(l-e>d((o-r)/(b=i+1))&&f("overflow"),r+=(l-e)*b,e=l,h=0;h<_;++h)if((g=t[h])<e&&++r>o&&f("overflow"),g==e){for(u=r,c=a;!(u<(m=c<=n?1:c>=n+26?26:c-n));c+=a)E=u-m,T=a-m,A.push(p(v(m+E%T,0))),u=d(E/T);A.push(p(v(u,0))),n=x(r,b,i==s),r=0,++i}++r,++e}return A.join("")}n={version:"1.4.1",ucs2:{decode:y,encode:_},decode:b,encode:T,toASCII:function(t){return g(t,(function(t){return l.test(t)?"xn--"+T(t):t}))},toUnicode:function(t){return g(t,(function(t){return h.test(t)?b(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return n}.call(e,r,e,t))||(t.exports=i)}()},1278:(t,e,r)=>{"use strict";var i=r(9878);class s extends i.Geometry{constructor(t,e,r){super();const s=new i.Buffer(t),n=new i.Buffer(e,!0),o=new i.Buffer(r,!0,!0);this.addAttribute("aVertexPosition",s,2,!1,i.TYPES.FLOAT).addAttribute("aTextureCoord",n,2,!1,i.TYPES.FLOAT).addIndex(o),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}e.MeshGeometry=s},1298:(t,e,r)=>{"use strict";var i=r(238),s=r(6238),n=r(6624);class o extends n.AbstractMaskSystem{constructor(t){super(t),this.glConst=s.settings.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:r}=this.renderer,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++;const s=t._colorMask;0!==s&&(t._colorMask=0,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,0!==s&&(t._colorMask=s,r.colorMask(!!(1&s),!!(2&s),!!(4&s),!!(8&s))),this._useCurrent()}pop(t){const e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{const r=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,i=r?r._colorMask:15;0!==i&&(r._colorMask=0,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,0!==i&&(r._colorMask=i,e.colorMask(!!(1&i),!!(2&i),!!(4&i),!!(8&i))),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}o.extension={type:i.ExtensionType.RendererSystem,name:"stencil"},i.extensions.add(o),e.StencilSystem=o},1300:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});let r=null;class i{constructor(){r||(r=URL.createObjectURL(new Blob(['(function() {\n  "use strict";\n  const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";\n  async function checkImageBitmap() {\n    try {\n      if (typeof createImageBitmap != "function")\n        return !1;\n      const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob);\n      return imageBitmap.width === 1 && imageBitmap.height === 1;\n    } catch {\n      return !1;\n    }\n  }\n  checkImageBitmap().then((result) => {\n    self.postMessage(result);\n  });\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(r)}}i.revokeObjectURL=function(){r&&(URL.revokeObjectURL(r),r=null)},e.default=i},1304:(t,e,r)=>{"use strict";var i=r(6320);class s extends i.FederatedMouseEvent{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}s.DOM_DELTA_PIXEL=0,s.DOM_DELTA_LINE=1,s.DOM_DELTA_PAGE=2,e.FederatedWheelEvent=s},1306:(t,e,r)=>{"use strict";var i=r(8894),s=r(9525);let n;e.getMaxFragmentPrecision=function(){if(!n){n=i.PRECISION.MEDIUM;const t=s.getTestContext();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);e&&(n=e.precision?i.PRECISION.HIGH:i.PRECISION.MEDIUM)}}return n}},1333:t=>{"use strict";t.exports=Object.getOwnPropertyDescriptor},1413:(t,e,r)=>{"use strict";r(5235);var i=r(2255),s=r(6276),n=r(5288),o=r(1236);e.detectCompressedTextures=i.detectCompressedTextures,e.loadDDS=s.loadDDS,e.loadKTX=n.loadKTX,e.resolveCompressedTextureUrl=o.resolveCompressedTextureUrl},1481:(t,e,r)=>{"use strict";var i=r(1239);function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var n=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,h=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(h),u=["%","/","?",";","#"].concat(l),c=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(3365);function _(t,e,r){if(t&&"object"==typeof t&&t instanceof s)return t;var i=new s;return i.parse(t,e,r),i}s.prototype.parse=function(t,e,r){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var s=t.indexOf("?"),o=-1!==s&&s<t.indexOf("#")?"?":"#",h=t.split(o);h[0]=h[0].replace(/\\/g,"/");var _=t=h.join(o);if(_=_.trim(),!r&&1===t.split("#").length){var v=a.exec(_);if(v)return this.path=_,this.href=_,this.pathname=v[1],v[2]?(this.search=v[2],this.query=e?y.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var x=n.exec(_);if(x){var b=(x=x[0]).toLowerCase();this.protocol=b,_=_.substr(x.length)}if(r||x||_.match(/^\/\/[^@/]+@[^@/]+/)){var T="//"===_.substr(0,2);!T||x&&m[x]||(_=_.substr(2),this.slashes=!0)}if(!m[x]&&(T||x&&!g[x])){for(var E,A,S=-1,w=0;w<c.length;w++)-1!==(P=_.indexOf(c[w]))&&(-1===S||P<S)&&(S=P);for(-1!==(A=-1===S?_.lastIndexOf("@"):_.lastIndexOf("@",S))&&(E=_.slice(0,A),_=_.slice(A+1),this.auth=decodeURIComponent(E)),S=-1,w=0;w<u.length;w++){var P;-1!==(P=_.indexOf(u[w]))&&(-1===S||P<S)&&(S=P)}-1===S&&(S=_.length),this.host=_.slice(0,S),_=_.slice(S),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var M=this.hostname.split(/\./),C=(w=0,M.length);w<C;w++){var I=M[w];if(I&&!I.match(d)){for(var D="",O=0,B=I.length;O<B;O++)I.charCodeAt(O)>127?D+="x":D+=I[O];if(!D.match(d)){var L=M.slice(0,w),N=M.slice(w+1),F=I.match(p);F&&(L.push(F[1]),N.unshift(F[2])),N.length&&(_="/"+N.join(".")+_),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=i.toASCII(this.hostname));var k=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+k,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!f[b])for(w=0,C=l.length;w<C;w++){var G=l[w];if(-1!==_.indexOf(G)){var H=encodeURIComponent(G);H===G&&(H=escape(G)),_=_.split(G).join(H)}}var j=_.indexOf("#");-1!==j&&(this.hash=_.substr(j),_=_.slice(0,j));var V=_.indexOf("?");if(-1!==V?(this.search=_.substr(V),this.query=_.substr(V+1),e&&(this.query=y.parse(this.query)),_=_.slice(0,V)):e&&(this.search="",this.query={}),_&&(this.pathname=_),g[b]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){k=this.pathname||"";var $=this.search||"";this.path=k+$}return this.href=this.format(),this},s.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",s=!1,n="";this.host?s=t+this.host:this.hostname&&(s=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(n=y.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var o=this.search||n&&"?"+n||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==s?(s="//"+(s||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):s||(s=""),i&&"#"!==i.charAt(0)&&(i="#"+i),o&&"?"!==o.charAt(0)&&(o="?"+o),e+s+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(o=o.replace("#","%23"))+i},s.prototype.resolve=function(t){return this.resolveObject(_(t,!1,!0)).format()},s.prototype.resolveObject=function(t){if("string"==typeof t){var e=new s;e.parse(t,!1,!0),t=e}for(var r=new s,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),h=0;h<a.length;h++){var l=a[h];"protocol"!==l&&(r[l]=t[l])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!g[t.protocol]){for(var u=Object.keys(t),c=0;c<u.length;c++){var d=u[c];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||m[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var f=r.pathname||"",y=r.search||"";r.path=f+y}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var _=r.pathname&&"/"===r.pathname.charAt(0),v=t.host||t.pathname&&"/"===t.pathname.charAt(0),x=v||_||r.host&&t.pathname,b=x,T=r.pathname&&r.pathname.split("/")||[],E=(p=t.pathname&&t.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===T[0]?T[0]=r.host:T.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),x=x&&(""===p[0]||""===T[0])),v)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,T=p;else if(p.length)T||(T=[]),T.pop(),T=T.concat(p),r.search=t.search,r.query=t.query;else if(null!=t.search)return E&&(r.host=T.shift(),r.hostname=r.host,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)),r.search=t.search,r.query=t.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=T.slice(-1)[0],S=(r.host||t.host||T.length>1)&&("."===A||".."===A)||""===A,w=0,P=T.length;P>=0;P--)"."===(A=T[P])?T.splice(P,1):".."===A?(T.splice(P,1),w++):w&&(T.splice(P,1),w--);if(!x&&!b)for(;w--;w)T.unshift("..");!x||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),S&&"/"!==T.join("/").substr(-1)&&T.push("");var R,M=""===T[0]||T[0]&&"/"===T[0].charAt(0);return E&&(r.hostname=M?"":T.length?T.shift():"",r.host=r.hostname,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)),(x=x||r.host&&T.length)&&!M&&T.unshift(""),T.length>0?r.pathname=T.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},s.prototype.parseHost=function(){var t=this.host,e=o.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},e.parse=_,e.resolve=function(t,e){return _(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?_(t,!1,!0).resolveObject(e):e},e.format=function(t){return"string"==typeof t&&(t=_(t)),t instanceof s?t.format():s.prototype.format.call(t)},e.Url=s},1488:t=>{"use strict";t.exports=Error},1514:(t,e,r)=>{"use strict";var i="undefined"!=typeof Symbol&&Symbol,s=r(9712);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"==typeof i("foo")&&"symbol"==typeof Symbol("bar")&&s()}},1515:(t,e,r)=>{"use strict";var i=r(8894),s=r(3801);class n extends s.Resource{constructor(t,e){const{width:r,height:i}=e||{};if(!r||!i)throw new Error("BufferResource width or height invalid");super(r,i),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,r){const s=t.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,this.unpackAlignment),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===i.ALPHA_MODES.UNPACK);const n=e.realWidth,o=e.realHeight;return r.width===n&&r.height===o?s.texSubImage2D(e.target,0,0,0,n,o,e.format,r.type,this.data):(r.width=n,r.height=o,s.texImage2D(e.target,0,r.internalFormat,n,o,0,e.format,r.type,this.data)),!0}dispose(){this.data=null}static test(t){return null===t||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}e.BufferResource=n},1517:(t,e,r)=>{"use strict";var i=r(9878),s=r(629);class n extends i.Filter{constructor(t=.5,e=Math.random()){super(i.defaultFilterVertex,s.default,{uNoise:0,uSeed:0}),this.noise=t,this.seed=e}get noise(){return this.uniforms.uNoise}set noise(t){this.uniforms.uNoise=t}get seed(){return this.uniforms.uSeed}set seed(t){this.uniforms.uSeed=t}}e.NoiseFilter=n},1520:(t,e,r)=>{"use strict";var i=r(6803);e.Sprite=i.Sprite},1537:(t,e)=>{"use strict";const r=2*Math.PI,i=180/Math.PI,s=Math.PI/180;var n=(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",t))(n||{});e.DEG_TO_RAD=s,e.PI_2=r,e.RAD_TO_DEG=i,e.SHAPES=n},1573:(t,e,r)=>{"use strict";var i=r(9878),s=r(5815),n=r(9116),o=r(8488),a=r(3595),h=r(580);const l=new i.Matrix;class u extends i.ObjectRenderer{constructor(t){super(t),t.runners.contextChange.add(this),this.quad=new i.QuadUv,this.state=i.State.for2d()}contextChange(){const t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=i.Shader.from(a.default,h.default,e),this.shader=t.context.webGLVersion>1?i.Shader.from(n.default,s.default,e):i.Shader.from(a.default,o.default,e)}render(t){const e=this.renderer,r=this.quad;let s=r.vertices;s[0]=s[6]=t._width*-t.anchor.x,s[1]=s[3]=t._height*-t.anchor.y,s[2]=s[4]=t._width*(1-t.anchor.x),s[5]=s[7]=t._height*(1-t.anchor.y);const n=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;s=r.uvs,s[0]=s[6]=-n,s[1]=s[3]=-o,s[2]=s[4]=1-n,s[5]=s[7]=1-o,r.invalidate();const a=t._texture,h=a.baseTexture,u=h.alphaMode>0,c=t.tileTransform.localTransform,d=t.uvMatrix;let p=h.isPowerOfTwo&&a.frame.width===h.width&&a.frame.height===h.height;p&&(h._glTextures[e.CONTEXT_UID]?p=h.wrapMode!==i.WRAP_MODES.CLAMP:h.wrapMode===i.WRAP_MODES.CLAMP&&(h.wrapMode=i.WRAP_MODES.REPEAT));const f=p?this.simpleShader:this.shader,m=a.width,g=a.height,y=t._width,_=t._height;l.set(c.a*m/y,c.b*m/_,c.c*g/y,c.d*g/_,c.tx/y,c.ty/_),l.invert(),p?l.prepend(d.mapCoord):(f.uniforms.uMapCoord=d.mapCoord.toArray(!0),f.uniforms.uClampFrame=d.uClampFrame,f.uniforms.uClampOffset=d.uClampOffset),f.uniforms.uTransform=l.toArray(!0),f.uniforms.uColor=i.Color.shared.setValue(t.tint).premultiply(t.worldAlpha,u).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,e.shader.bind(f),e.geometry.bind(r),this.state.blendMode=i.utils.correctBlendMode(t.blendMode,u),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}u.extension={name:"tilingSprite",type:i.ExtensionType.RendererPlugin},i.extensions.add(u),e.TilingSpriteRenderer=u},1610:(t,e,r)=>{"use strict";var i=r(8894);e.mapTypeAndFormatToInternalFormat=function(t){let e;return e="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?{[i.TYPES.UNSIGNED_BYTE]:{[i.FORMATS.RGBA]:t.RGBA8,[i.FORMATS.RGB]:t.RGB8,[i.FORMATS.RG]:t.RG8,[i.FORMATS.RED]:t.R8,[i.FORMATS.RGBA_INTEGER]:t.RGBA8UI,[i.FORMATS.RGB_INTEGER]:t.RGB8UI,[i.FORMATS.RG_INTEGER]:t.RG8UI,[i.FORMATS.RED_INTEGER]:t.R8UI,[i.FORMATS.ALPHA]:t.ALPHA,[i.FORMATS.LUMINANCE]:t.LUMINANCE,[i.FORMATS.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[i.TYPES.BYTE]:{[i.FORMATS.RGBA]:t.RGBA8_SNORM,[i.FORMATS.RGB]:t.RGB8_SNORM,[i.FORMATS.RG]:t.RG8_SNORM,[i.FORMATS.RED]:t.R8_SNORM,[i.FORMATS.RGBA_INTEGER]:t.RGBA8I,[i.FORMATS.RGB_INTEGER]:t.RGB8I,[i.FORMATS.RG_INTEGER]:t.RG8I,[i.FORMATS.RED_INTEGER]:t.R8I},[i.TYPES.UNSIGNED_SHORT]:{[i.FORMATS.RGBA_INTEGER]:t.RGBA16UI,[i.FORMATS.RGB_INTEGER]:t.RGB16UI,[i.FORMATS.RG_INTEGER]:t.RG16UI,[i.FORMATS.RED_INTEGER]:t.R16UI,[i.FORMATS.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[i.TYPES.SHORT]:{[i.FORMATS.RGBA_INTEGER]:t.RGBA16I,[i.FORMATS.RGB_INTEGER]:t.RGB16I,[i.FORMATS.RG_INTEGER]:t.RG16I,[i.FORMATS.RED_INTEGER]:t.R16I},[i.TYPES.UNSIGNED_INT]:{[i.FORMATS.RGBA_INTEGER]:t.RGBA32UI,[i.FORMATS.RGB_INTEGER]:t.RGB32UI,[i.FORMATS.RG_INTEGER]:t.RG32UI,[i.FORMATS.RED_INTEGER]:t.R32UI,[i.FORMATS.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[i.TYPES.INT]:{[i.FORMATS.RGBA_INTEGER]:t.RGBA32I,[i.FORMATS.RGB_INTEGER]:t.RGB32I,[i.FORMATS.RG_INTEGER]:t.RG32I,[i.FORMATS.RED_INTEGER]:t.R32I},[i.TYPES.FLOAT]:{[i.FORMATS.RGBA]:t.RGBA32F,[i.FORMATS.RGB]:t.RGB32F,[i.FORMATS.RG]:t.RG32F,[i.FORMATS.RED]:t.R32F,[i.FORMATS.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[i.TYPES.HALF_FLOAT]:{[i.FORMATS.RGBA]:t.RGBA16F,[i.FORMATS.RGB]:t.RGB16F,[i.FORMATS.RG]:t.RG16F,[i.FORMATS.RED]:t.R16F},[i.TYPES.UNSIGNED_SHORT_5_6_5]:{[i.FORMATS.RGB]:t.RGB565},[i.TYPES.UNSIGNED_SHORT_4_4_4_4]:{[i.FORMATS.RGBA]:t.RGBA4},[i.TYPES.UNSIGNED_SHORT_5_5_5_1]:{[i.FORMATS.RGBA]:t.RGB5_A1},[i.TYPES.UNSIGNED_INT_2_10_10_10_REV]:{[i.FORMATS.RGBA]:t.RGB10_A2,[i.FORMATS.RGBA_INTEGER]:t.RGB10_A2UI},[i.TYPES.UNSIGNED_INT_10F_11F_11F_REV]:{[i.FORMATS.RGB]:t.R11F_G11F_B10F},[i.TYPES.UNSIGNED_INT_5_9_9_9_REV]:{[i.FORMATS.RGB]:t.RGB9_E5},[i.TYPES.UNSIGNED_INT_24_8]:{[i.FORMATS.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[i.TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[i.FORMATS.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:{[i.TYPES.UNSIGNED_BYTE]:{[i.FORMATS.RGBA]:t.RGBA,[i.FORMATS.RGB]:t.RGB,[i.FORMATS.ALPHA]:t.ALPHA,[i.FORMATS.LUMINANCE]:t.LUMINANCE,[i.FORMATS.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[i.TYPES.UNSIGNED_SHORT_5_6_5]:{[i.FORMATS.RGB]:t.RGB},[i.TYPES.UNSIGNED_SHORT_4_4_4_4]:{[i.FORMATS.RGBA]:t.RGBA},[i.TYPES.UNSIGNED_SHORT_5_5_5_1]:{[i.FORMATS.RGBA]:t.RGBA}},e}},1612:(t,e,r)=>{"use strict";var i=r(5648),s=r(8456),n=r(7813);r(5053);var o=r(7259),a=r(8588),h=r(9263),l=r(7425),u=r(9948);e.BitmapFont=i.BitmapFont,e.BitmapFontData=s.BitmapFontData,e.BitmapText=n.BitmapText,e.autoDetectFormat=o.autoDetectFormat,e.loadBitmapFont=a.loadBitmapFont,e.TextFormat=h.TextFormat,e.XMLFormat=l.XMLFormat,e.XMLStringFormat=u.XMLStringFormat},1613:(t,e,r)=>{"use strict";var i=r(8792),s=r(9441),n=r(1515),o=r(6021),a=r(4476),h=r(8507),l=r(6484),u=r(479),c=r(2385),d=r(9662),p=r(1203),f=r(3801),m=r(7450);s.INSTALLED.push(h.ImageBitmapResource,l.ImageResource,o.CanvasResource,d.VideoResource,c.VideoFrameResource,u.SVGResource,n.BufferResource,a.CubeResource,i.ArrayResource),e.ArrayResource=i.ArrayResource,e.INSTALLED=s.INSTALLED,e.autoDetectResource=s.autoDetectResource,e.BufferResource=n.BufferResource,e.CanvasResource=o.CanvasResource,e.CubeResource=a.CubeResource,e.ImageBitmapResource=h.ImageBitmapResource,e.ImageResource=l.ImageResource,e.SVGResource=u.SVGResource,e.VideoResource=d.VideoResource,e.BaseImageResource=p.BaseImageResource,e.Resource=f.Resource,e.AbstractMultiResource=m.AbstractMultiResource},1653:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Component=void 0;const i=r(394),s=r(7480),n=new class{templateMap;constructor(){this.templateMap=new Map}getTemplate(t){return this.templateMap.get(t.selector)||this.buildTemplate(t)}buildTemplate(t){let e=null;return t.style&&(t.template=`<style>${t.style}</style>${t.template}`),t.template&&(e=document.createElement("template"),e.innerHTML=t.template),this.templateMap.set(t.selector,e),e}};e.Component=t=>e=>{if("boolean"!=typeof t.useShadow&&(t.useShadow=!1),"string"!=typeof t.selector||0===t.selector.length)throw new TypeError(`Couldn't create component ${e.name} without selector!`);const r=t.selector.replace(/[^a-z0-9]/g,"_"),o=`__dhcom_host_${r}`,a=`__dhcom_content_${r}`;let h=null;if(t.style&&!t.useShadow){const e=function(t,e,r){const i=/((?<=})[^}]+|^[^}]+){/gm;let s,n="",o=0;for(;s=i.exec(t);){const i=t.substring(o,s.index);o=s.index+s[0].length,n+=i,n+=s[0].split(/:host/g).map((t=>t.split(/\s*,\s*/g).map((t=>t.split(/\s+/).map((t=>t.replace(/\b((\.|#|(?<![:\-("@]))(?!(even|odd|\d))(\w+(-\w+)*|\*)(?![\-(=)"]))\b/g,`$1[${r}]`))).join(" "))).join(", "))).join(`[${e}]`).replace(new RegExp(`(\\[${e}]\\.\\w+)\\[${r}]`,"g"),"$1")}return n+=t.substring(o),n}(t.style,o,a);h=()=>{h=null;const t=document.createElement("style");t.innerHTML=e,document.head.appendChild(t)},t.style=void 0}t.template&&(t.template=t.template.replace(/(<[\w-]+\b)/g,`$1 ${a}`));const l={[e.name]:class extends e{alreadyConnected;templateTree;_updateViewIntervalId;constructor(){super(...i.globalInjectionHandler.resolveInjections(e)),this.initResolvent()}initResolvent(){this.__resolve&&this.__resolve.initProperties(this)}addContent(e){const r=this;if(r.setAttribute(o,""),e&&r.shadowRoot)for(;r.shadowRoot.firstChild;)r.shadowRoot.removeChild(r.shadowRoot.lastChild);const i=n.getTemplate(t);i&&(t.useShadow?(r.shadowRoot||r.attachShadow({mode:"open"}),this.templateTree=s.TemplateFactory.build(i.content,r.shadowRoot,r)):this.templateTree=s.TemplateFactory.build(i.content,r,r))}connectedCallback(){if(this.alreadyConnected||(this.addContent(!1),h&&h()),super.connectedCallback&&super.connectedCallback(),this.templateTree&&(this.templateTree.updateView(!0),!1!==t.autoTemplateUpdate)){const t=()=>{this.templateTree.updateView(!0),this._updateViewIntervalId=requestAnimationFrame(t)};this._updateViewIntervalId=requestAnimationFrame(t)}this.alreadyConnected=!0}disconnectedCallback(){this._updateViewIntervalId&&cancelAnimationFrame(this._updateViewIntervalId)}}}[e.name];l.selector=t.selector,window.customElements.define(t.selector,l)}},1723:(t,e,r)=>{"use strict";var i=r(9878),s=r(3959);class n extends i.Filter{constructor(t=1){super(i.defaultVertex,s.default,{uAlpha:1}),this.alpha=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}e.AlphaFilter=n},1770:(t,e,r)=>{"use strict";var i=r(8894);e.mapInternalFormatToSamplerType=function(t){let e;return e="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?{[t.RGB]:i.SAMPLER_TYPES.FLOAT,[t.RGBA]:i.SAMPLER_TYPES.FLOAT,[t.ALPHA]:i.SAMPLER_TYPES.FLOAT,[t.LUMINANCE]:i.SAMPLER_TYPES.FLOAT,[t.LUMINANCE_ALPHA]:i.SAMPLER_TYPES.FLOAT,[t.R8]:i.SAMPLER_TYPES.FLOAT,[t.R8_SNORM]:i.SAMPLER_TYPES.FLOAT,[t.RG8]:i.SAMPLER_TYPES.FLOAT,[t.RG8_SNORM]:i.SAMPLER_TYPES.FLOAT,[t.RGB8]:i.SAMPLER_TYPES.FLOAT,[t.RGB8_SNORM]:i.SAMPLER_TYPES.FLOAT,[t.RGB565]:i.SAMPLER_TYPES.FLOAT,[t.RGBA4]:i.SAMPLER_TYPES.FLOAT,[t.RGB5_A1]:i.SAMPLER_TYPES.FLOAT,[t.RGBA8]:i.SAMPLER_TYPES.FLOAT,[t.RGBA8_SNORM]:i.SAMPLER_TYPES.FLOAT,[t.RGB10_A2]:i.SAMPLER_TYPES.FLOAT,[t.RGB10_A2UI]:i.SAMPLER_TYPES.FLOAT,[t.SRGB8]:i.SAMPLER_TYPES.FLOAT,[t.SRGB8_ALPHA8]:i.SAMPLER_TYPES.FLOAT,[t.R16F]:i.SAMPLER_TYPES.FLOAT,[t.RG16F]:i.SAMPLER_TYPES.FLOAT,[t.RGB16F]:i.SAMPLER_TYPES.FLOAT,[t.RGBA16F]:i.SAMPLER_TYPES.FLOAT,[t.R32F]:i.SAMPLER_TYPES.FLOAT,[t.RG32F]:i.SAMPLER_TYPES.FLOAT,[t.RGB32F]:i.SAMPLER_TYPES.FLOAT,[t.RGBA32F]:i.SAMPLER_TYPES.FLOAT,[t.R11F_G11F_B10F]:i.SAMPLER_TYPES.FLOAT,[t.RGB9_E5]:i.SAMPLER_TYPES.FLOAT,[t.R8I]:i.SAMPLER_TYPES.INT,[t.R8UI]:i.SAMPLER_TYPES.UINT,[t.R16I]:i.SAMPLER_TYPES.INT,[t.R16UI]:i.SAMPLER_TYPES.UINT,[t.R32I]:i.SAMPLER_TYPES.INT,[t.R32UI]:i.SAMPLER_TYPES.UINT,[t.RG8I]:i.SAMPLER_TYPES.INT,[t.RG8UI]:i.SAMPLER_TYPES.UINT,[t.RG16I]:i.SAMPLER_TYPES.INT,[t.RG16UI]:i.SAMPLER_TYPES.UINT,[t.RG32I]:i.SAMPLER_TYPES.INT,[t.RG32UI]:i.SAMPLER_TYPES.UINT,[t.RGB8I]:i.SAMPLER_TYPES.INT,[t.RGB8UI]:i.SAMPLER_TYPES.UINT,[t.RGB16I]:i.SAMPLER_TYPES.INT,[t.RGB16UI]:i.SAMPLER_TYPES.UINT,[t.RGB32I]:i.SAMPLER_TYPES.INT,[t.RGB32UI]:i.SAMPLER_TYPES.UINT,[t.RGBA8I]:i.SAMPLER_TYPES.INT,[t.RGBA8UI]:i.SAMPLER_TYPES.UINT,[t.RGBA16I]:i.SAMPLER_TYPES.INT,[t.RGBA16UI]:i.SAMPLER_TYPES.UINT,[t.RGBA32I]:i.SAMPLER_TYPES.INT,[t.RGBA32UI]:i.SAMPLER_TYPES.UINT,[t.DEPTH_COMPONENT16]:i.SAMPLER_TYPES.FLOAT,[t.DEPTH_COMPONENT24]:i.SAMPLER_TYPES.FLOAT,[t.DEPTH_COMPONENT32F]:i.SAMPLER_TYPES.FLOAT,[t.DEPTH_STENCIL]:i.SAMPLER_TYPES.FLOAT,[t.DEPTH24_STENCIL8]:i.SAMPLER_TYPES.FLOAT,[t.DEPTH32F_STENCIL8]:i.SAMPLER_TYPES.FLOAT}:{[t.RGB]:i.SAMPLER_TYPES.FLOAT,[t.RGBA]:i.SAMPLER_TYPES.FLOAT,[t.ALPHA]:i.SAMPLER_TYPES.FLOAT,[t.LUMINANCE]:i.SAMPLER_TYPES.FLOAT,[t.LUMINANCE_ALPHA]:i.SAMPLER_TYPES.FLOAT,[t.DEPTH_STENCIL]:i.SAMPLER_TYPES.FLOAT},e}},1797:(t,e,r)=>{"use strict";var i=r(326),s=r(2428),n=r(2952),o=r(7647),a=r(2063),h=r(8616);e.detectAvif=i.detectAvif,e.detectWebp=s.detectWebp,e.detectDefaults=n.detectDefaults,e.detectWebm=o.detectWebm,e.detectMp4=a.detectMp4,e.detectOgv=h.detectOgv},1799:(t,e,r)=>{"use strict";r(9954);var i=r(6513),s=r(9064),n=r(9346);e.Bounds=i.Bounds,e.Container=s.Container,e.DisplayObject=n.DisplayObject,e.TemporaryDisplayObject=n.TemporaryDisplayObject},1816:(t,e,r)=>{"use strict";var i=r(238),s=r(4978);class n{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glBuffers[r]||this.createGLBuffer(t);e.bindBuffer(t.type,i.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:r,CONTEXT_UID:i}=this;if(this.boundBufferBases[e]!==t){const s=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,s.buffer)}}bindBufferRange(t,e,r){const{gl:i,CONTEXT_UID:s}=this;r=r||0;const n=t._glBuffers[s]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,e||0,n.buffer,256*r,256)}update(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glBuffers[r]||this.createGLBuffer(t);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{const r=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,r)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const 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])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let r=0;r<e.length;r++)this.dispose(this.managedBuffers[e[r]],t)}createGLBuffer(t){const{CONTEXT_UID:e,gl:r}=this;return t._glBuffers[e]=new s.GLBuffer(r.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]}}n.extension={type:i.ExtensionType.RendererSystem,name:"buffer"},i.extensions.add(n),e.BufferSystem=n},1831:(t,e,r)=>{"use strict";r.d(e,{A:()=>v});var i=/iPhone/i,s=/iPod/i,n=/iPad/i,o=/\biOS-universal(?:.+)Mac\b/i,a=/\bAndroid(?:.+)Mobile\b/i,h=/Android/i,l=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,u=/Silk/i,c=/Windows Phone/i,d=/\bWindows(?:.+)ARM\b/i,p=/BlackBerry/i,f=/BB10/i,m=/Opera Mini/i,g=/\b(CriOS|Chrome)(?:.+)Mobile/i,y=/Mobile(?:.+)Firefox\b/i,_=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};function v(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,v=r.split("[FBAN");void 0!==v[1]&&(r=v[0]),void 0!==(v=r.split("Twitter"))[1]&&(r=v[0]);var x=function(t){return function(e){return e.test(t)}}(r),b={apple:{phone:x(i)&&!x(c),ipod:x(s),tablet:!x(i)&&(x(n)||_(e))&&!x(c),universal:x(o),device:(x(i)||x(s)||x(n)||x(o)||_(e))&&!x(c)},amazon:{phone:x(l),tablet:!x(l)&&x(u),device:x(l)||x(u)},android:{phone:!x(c)&&x(l)||!x(c)&&x(a),tablet:!x(c)&&!x(l)&&!x(a)&&(x(u)||x(h)),device:!x(c)&&(x(l)||x(u)||x(a)||x(h))||x(/\bokhttp\b/i)},windows:{phone:x(c),tablet:x(d),device:x(c)||x(d)},other:{blackberry:x(p),blackberry10:x(f),opera:x(m),firefox:x(y),chrome:x(g),device:x(p)||x(f)||x(m)||x(y)||x(g)},any:!1,phone:!1,tablet:!1};return b.any=b.apple.device||b.android.device||b.windows.device||b.other.device,b.phone=b.apple.phone||b.android.phone||b.windows.phone,b.tablet=b.apple.tablet||b.android.tablet||b.windows.tablet,b}},1844:t=>{"use strict";t.exports=Math.round},1904:(t,e,r)=>{"use strict";var i=r(9878);const s={loader:i.ExtensionType.LoadParser,resolver:i.ExtensionType.ResolveParser,cache:i.ExtensionType.CacheParser,detection:i.ExtensionType.DetectionParser};i.extensions.handle(i.ExtensionType.Asset,(t=>{const e=t.ref;Object.entries(s).filter((([t])=>!!e[t])).forEach((([t,r])=>i.extensions.add(Object.assign(e[t],{extension:e[t].extension??r}))))}),(t=>{const e=t.ref;Object.keys(s).filter((t=>!!e[t])).forEach((t=>i.extensions.remove(e[t])))}))},1907:(t,e)=>{"use strict";e.generateBlurVertSource=function(t,e){const r=Math.ceil(t/2);let i,s="\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    }",n="";i=e?"vBlurTexCoords[%index%] =  textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] =  textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let e=0;e<t;e++){let t=i.replace("%index%",e.toString());t=t.replace("%sampleIndex%",e-(r-1)+".0"),n+=t,n+="\n"}return s=s.replace("%blur%",n),s=s.replace("%size%",t.toString()),s}},1914:(t,e)=>{"use strict";e.MeshBatchUvs=class{constructor(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(t){if(!t&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const 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++}}},1916:(t,e)=>{"use strict";function r(t,e){const r=t.getShaderSource(e).split("\n").map(((t,e)=>`${e}: ${t}`)),i=t.getShaderInfoLog(e),s=i.split("\n"),n={},o=s.map((t=>parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1")))).filter((t=>!(!t||n[t]||(n[t]=!0,0)))),a=[""];o.forEach((t=>{r[t-1]=`%c${r[t-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));const h=r.join("\n");a[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}e.logProgramError=function(t,e,i,s){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(i,t.COMPILE_STATUS)||r(t,i),t.getShaderParameter(s,t.COMPILE_STATUS)||r(t,s),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}},1966:(t,e,r)=>{"use strict";var i=r(9878),s=r(1520),n=r(3937),o=r(6217),a=r(7737);const h={texture:!0,children:!1,baseTexture:!0},l=class t extends s.Sprite{constructor(e,r,s){let n=!1;s||(s=i.settings.ADAPTER.createCanvas(),n=!0),s.width=3,s.height=3;const o=i.Texture.from(s);o.orig=new i.Rectangle,o.trim=new i.Rectangle,super(o),this._ownCanvas=n,this.canvas=s,this.context=s.getContext("2d",{willReadFrequently:!0}),this._resolution=t.defaultResolution??i.settings.RESOLUTION,this._autoResolution=t.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=r,this.localStyleID=-1}static get experimentalLetterSpacing(){return o.TextMetrics.experimentalLetterSpacing}static set experimentalLetterSpacing(t){i.utils.deprecation("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),o.TextMetrics.experimentalLetterSpacing=t}updateText(t){const e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;this._font=this._style.toFontString();const r=this.context,s=o.TextMetrics.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),n=s.width,a=s.height,h=s.lines,l=s.lineHeight,u=s.lineWidths,c=s.maxLineWidth,d=s.fontProperties;let p,f;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,n)+2*e.padding)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,a)+2*e.padding)*this._resolution),r.scale(this._resolution,this._resolution),r.clearRect(0,0,this.canvas.width,this.canvas.height),r.font=this._font,r.lineWidth=e.strokeThickness,r.textBaseline=e.textBaseline,r.lineJoin=e.lineJoin,r.miterLimit=e.miterLimit;const m=e.dropShadow?2:1;for(let t=0;t<m;++t){const n=e.dropShadow&&0===t,o=n?Math.ceil(Math.max(1,a)+2*e.padding):0,m=o*this._resolution;if(n){r.fillStyle="black",r.strokeStyle="black";const t=e.dropShadowColor,s=e.dropShadowBlur*this._resolution,n=e.dropShadowDistance*this._resolution;r.shadowColor=i.Color.shared.setValue(t).setAlpha(e.dropShadowAlpha).toRgbaString(),r.shadowBlur=s,r.shadowOffsetX=Math.cos(e.dropShadowAngle)*n,r.shadowOffsetY=Math.sin(e.dropShadowAngle)*n+m}else r.fillStyle=this._generateFillStyle(e,h,s),r.strokeStyle=e.stroke,r.shadowColor="black",r.shadowBlur=0,r.shadowOffsetX=0,r.shadowOffsetY=0;let g=(l-d.fontSize)/2;l-d.fontSize<0&&(g=0);for(let t=0;t<h.length;t++)p=e.strokeThickness/2,f=e.strokeThickness/2+t*l+d.ascent+g,"right"===e.align?p+=c-u[t]:"center"===e.align&&(p+=(c-u[t])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(h[t],p+e.padding,f+e.padding-o,!0),e.fill&&this.drawLetterSpacing(h[t],p+e.padding,f+e.padding-o)}this.updateTexture()}drawLetterSpacing(t,e,r,i=!1){const s=this._style.letterSpacing;let n=!1;if(o.TextMetrics.experimentalLetterSpacingSupported&&(o.TextMetrics.experimentalLetterSpacing?(this.context.letterSpacing=`${s}px`,this.context.textLetterSpacing=`${s}px`,n=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),0===s||n)return void(i?this.context.strokeText(t,e,r):this.context.fillText(t,e,r));let a=e;const h=o.TextMetrics.graphemeSegmenter(t);let l=this.context.measureText(t).width,u=0;for(let t=0;t<h.length;++t){const e=h[t];i?this.context.strokeText(e,a,r):this.context.fillText(e,a,r);let n="";for(let e=t+1;e<h.length;++e)n+=h[e];u=this.context.measureText(n).width,a+=l-u+s,l=u}}updateTexture(){const t=this.canvas;if(this._style.trim){const e=i.utils.trimCanvas(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}const e=this._texture,r=this._style,s=r.trim?0:r.padding,n=e.baseTexture;e.trim.width=e._frame.width=t.width/this._resolution,e.trim.height=e._frame.height=t.height/this._resolution,e.trim.x=-s,e.trim.y=-s,e.orig.width=e._frame.width-2*s,e.orig.height=e._frame.height-2*s,this._onTextureUpdate(),n.setRealSize(t.width,t.height,this._resolution),e.updateUvs(),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(t,e){return this.updateText(!0),-1===this._textureID&&(t=!1),super.getBounds(t,e)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds.call(this,t)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(t,e,r){const i=t.fill;if(!Array.isArray(i))return i;if(1===i.length)return i[0];let s;const o=t.dropShadow?t.dropShadowDistance:0,a=t.padding||0,h=this.canvas.width/this._resolution-o-2*a,l=this.canvas.height/this._resolution-o-2*a,u=i.slice(),c=t.fillGradientStops.slice();if(!c.length){const t=u.length+1;for(let e=1;e<t;++e)c.push(e/t)}if(u.unshift(i[0]),c.unshift(0),u.push(i[i.length-1]),c.push(1),t.fillGradientType===n.TEXT_GRADIENT.LINEAR_VERTICAL){s=this.context.createLinearGradient(h/2,a,h/2,l+a);const i=r.fontProperties.fontSize+t.strokeThickness;for(let t=0;t<e.length;t++){const n=r.lineHeight*(t-1)+i,o=r.lineHeight*t;let a=o;t>0&&n>o&&(a=(o+n)/2);const h=o+i,d=r.lineHeight*(t+1);let p=h;t+1<e.length&&d<h&&(p=(h+d)/2);const f=(p-a)/l;for(let t=0;t<u.length;t++){let e=0;e="number"==typeof c[t]?c[t]:t/u.length;let r=Math.min(1,Math.max(0,a/l+e*f));r=Number(r.toFixed(5)),s.addColorStop(r,u[t])}}}else{s=this.context.createLinearGradient(a,l/2,h+a,l/2);const t=u.length+1;let e=1;for(let r=0;r<u.length;r++){let i;i="number"==typeof c[r]?c[r]:e/t,s.addColorStop(i,u[r]),e++}}return s}destroy(t){"boolean"==typeof t&&(t={children:t}),t=Object.assign({},h,t),super.destroy(t),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this.updateText(!0);const e=i.utils.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this.updateText(!0);const e=i.utils.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get style(){return this._style}set style(t){(t=t||{})instanceof a.TextStyle?this._style=t:this._style=new a.TextStyle(t),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}};l.defaultAutoResolution=!0;let u=l;e.Text=u},1991:(t,e,r)=>{"use strict";var i=r(622),s=r(8894),n=r(4778);const o=function(){const t=[],e=[];for(let r=0;r<32;r++)t[r]=r,e[r]=r;t[s.BLEND_MODES.NORMAL_NPM]=s.BLEND_MODES.NORMAL,t[s.BLEND_MODES.ADD_NPM]=s.BLEND_MODES.ADD,t[s.BLEND_MODES.SCREEN_NPM]=s.BLEND_MODES.SCREEN,e[s.BLEND_MODES.NORMAL]=s.BLEND_MODES.NORMAL_NPM,e[s.BLEND_MODES.ADD]=s.BLEND_MODES.ADD_NPM,e[s.BLEND_MODES.SCREEN]=s.BLEND_MODES.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}();e.correctBlendMode=function(t,e){return o[e?1:0][t]},e.premultiplyBlendMode=o,e.premultiplyRgba=function(t,e,r,s=!0){return n.deprecation("7.2.0","utils.premultiplyRgba has moved to Color.premultiply"),i.Color.shared.setValue(t).premultiply(e,s).toArray(r??new Float32Array(4))},e.premultiplyTint=function(t,e){return n.deprecation("7.2.0","utils.premultiplyTint has moved to Color.toPremultiplied"),i.Color.shared.setValue(t).toPremultiplied(e)},e.premultiplyTintToRgba=function(t,e,r,s=!0){return n.deprecation("7.2.0","utils.premultiplyTintToRgba has moved to Color.premultiply"),i.Color.shared.setValue(t).premultiply(e,s).toArray(r??new Float32Array(4))}},2014:(t,e,r)=>{"use strict";var i=r(9878),s=r(3306),n=r(3308),o=r(6182),a=r(9976),h=r(4093),l=r(6055),u=r(4426),c=r(5796),d=r(7287);const p={[i.SHAPES.POLY]:n.buildPoly,[i.SHAPES.CIRC]:s.buildCircle,[i.SHAPES.ELIP]:s.buildCircle,[i.SHAPES.RECT]:o.buildRectangle,[i.SHAPES.RREC]:a.buildRoundedRectangle};e.buildCircle=s.buildCircle,e.buildPoly=n.buildPoly,e.buildRectangle=o.buildRectangle,e.buildRoundedRectangle=a.buildRoundedRectangle,e.ArcUtils=h.ArcUtils,e.BatchPart=l.BatchPart,e.BezierUtils=u.BezierUtils,e.buildLine=c.buildLine,e.QuadraticUtils=d.QuadraticUtils,e.BATCH_POOL=[],e.DRAW_CALL_POOL=[],e.FILL_COMMANDS=p},2035:(t,e,r)=>{"use strict";var i=r(4842);e.Extract=i.Extract},2044:(t,e)=>{"use strict";function r(t){const e=new Array(t);for(let t=0;t<e.length;t++)e[t]=!1;return e}e.defaultValue=function(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 r(2*e);case"bvec3":return r(3*e);case"bvec4":return r(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}},2063:(t,e,r)=>{"use strict";var i=r(9878),s=r(6048);const n={extension:{type:i.ExtensionType.DetectionParser,priority:0},test:async()=>s.testVideoFormat("video/mp4"),add:async t=>[...t,"mp4","m4v"],remove:async t=>t.filter((t=>"mp4"!==t&&"m4v"!==t))};i.extensions.add(n),e.detectMp4=n},2074:(t,e,r)=>{"use strict";var i=r(8894),s=r(238),n=r(6238);const o={5126:4,5123:2,5121:1};class a{constructor(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){let e=this.renderer.context.extensions.vertexArrayObject;n.settings.PREFER_ENV===i.ENV.WEBGL_LEGACY&&(e=null),e?(t.createVertexArray=()=>e.createVertexArrayOES(),t.bindVertexArray=t=>e.bindVertexArrayOES(t),t.deleteVertexArray=t=>e.deleteVertexArrayOES(t)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(2!==e.webGLVersion){const e=t.getExtension("ANGLE_instanced_arrays");e?(t.vertexAttribDivisor=(t,r)=>e.vertexAttribDivisorANGLE(t,r),t.drawElementsInstanced=(t,r,i,s,n)=>e.drawElementsInstancedANGLE(t,r,i,s,n),t.drawArraysInstanced=(t,r,i,s)=>e.drawArraysInstancedANGLE(t,r,i,s)):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:r}=this;let i=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},s=!0);const n=i[e.program.id]||this.initGeometryVao(t,e,s);this._activeGeometry=t,this._activeVao!==n&&(this._activeVao=n,this.hasVao?r.bindVertexArray(n):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let r=0;r<t.buffers.length;r++){const i=t.buffers[r];e.update(i)}}checkCompatibility(t,e){const r=t.attributes,i=e.attributeData;for(const t in i)if(!r[t])throw new Error(`shader and geometry incompatible, geometry missing the "${t}" attribute`)}getSignature(t,e){const r=t.attributes,i=e.attributeData,s=["g",t.id];for(const t in r)i[t]&&s.push(t,i[t].location);return s.join("-")}initGeometryVao(t,e,r=!0){const s=this.gl,n=this.CONTEXT_UID,a=this.renderer.buffer,h=e.program;h.glPrograms[n]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,h);const l=this.getSignature(t,h),u=t.glVertexArrayObjects[this.CONTEXT_UID];let c=u[l];if(c)return u[h.id]=c,c;const d=t.buffers,p=t.attributes,f={},m={};for(const t in d)f[t]=0,m[t]=0;for(const t in p)!p[t].size&&h.attributeData[t]?p[t].size=h.attributeData[t].size:p[t].size||console.warn(`PIXI Geometry attribute '${t}' size cannot be determined (likely the bound shader does not have the attribute)`),f[p[t].buffer]+=p[t].size*o[p[t].type];for(const t in p){const e=p[t],r=e.size;void 0===e.stride&&(f[e.buffer]===r*o[e.type]?e.stride=0:e.stride=f[e.buffer]),void 0===e.start&&(e.start=m[e.buffer],m[e.buffer]+=r*o[e.type])}c=s.createVertexArray(),s.bindVertexArray(c);for(let t=0;t<d.length;t++){const e=d[t];a.bind(e),r&&e._glBuffers[n].refCount++}return this.activateVao(t,h),u[h.id]=c,u[l]=c,s.bindVertexArray(null),a.unbind(i.BUFFER_TYPE.ARRAY_BUFFER),c}disposeGeometry(t,e){if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const r=t.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,s=t.buffers,n=this.renderer?.buffer;if(t.disposeRunner.remove(this),r){if(n)for(let t=0;t<s.length;t++){const r=s[t]._glBuffers[this.CONTEXT_UID];r&&(r.refCount--,0===r.refCount&&!e&&n.dispose(s[t],e))}if(!e)for(const t in r)if("g"===t[0]){const e=r[t];this._activeVao===e&&this.unbind(),i.deleteVertexArray(e)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(t){const e=Object.keys(this.managedGeometries);for(let r=0;r<e.length;r++)this.disposeGeometry(this.managedGeometries[e[r]],t)}activateVao(t,e){const r=this.gl,i=this.CONTEXT_UID,s=this.renderer.buffer,n=t.buffers,o=t.attributes;t.indexBuffer&&s.bind(t.indexBuffer);let a=null;for(const t in o){const h=o[t],l=n[h.buffer],u=l._glBuffers[i];if(e.attributeData[t]){a!==u&&(s.bind(l),a=u);const i=e.attributeData[t].location;if(r.enableVertexAttribArray(i),r.vertexAttribPointer(i,h.size,h.type||r.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");r.vertexAttribDivisor(i,h.divisor)}}}}draw(t,e,r,i){const{gl:s}=this,n=this._activeGeometry;if(n.indexBuffer){const o=n.indexBuffer.data.BYTES_PER_ELEMENT,a=2===o?s.UNSIGNED_SHORT:s.UNSIGNED_INT;2===o||4===o&&this.canUseUInt32ElementIndex?n.instanced?s.drawElementsInstanced(t,e||n.indexBuffer.data.length,a,(r||0)*o,i||1):s.drawElements(t,e||n.indexBuffer.data.length,a,(r||0)*o):console.warn("unsupported index buffer type: uint32")}else n.instanced?s.drawArraysInstanced(t,r,e||n.getSize(),i||1):s.drawArrays(t,r,e||n.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}a.extension={type:s.ExtensionType.RendererSystem,name:"geometry"},s.extensions.add(a),e.GeometrySystem=a},2095:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,":host{overflow:hidden;display:block;z-index:1000}#canvas:hover{cursor:none !important}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},2115:(t,e,r)=>{"use strict";var i=r(1481),s=r(4778);const n={get parse(){return s.deprecation("7.3.0","utils.url.parse is deprecated, use native URL API instead."),i.parse},get format(){return s.deprecation("7.3.0","utils.url.format is deprecated, use native URL API instead."),i.format},get resolve(){return s.deprecation("7.3.0","utils.url.resolve is deprecated, use native URL API instead."),i.resolve}};e.url=n},2118:(t,e,r)=>{"use strict";var i=r(104);e.resolveCharacters=function(t){"string"==typeof t&&(t=[t]);const e=[];for(let r=0,s=t.length;r<s;r++){const s=t[r];if(Array.isArray(s)){if(2!==s.length)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${s.length}.`);const t=s[0].charCodeAt(0),r=s[1].charCodeAt(0);if(r<t)throw new Error("[BitmapFont]: Invalid character range.");for(let i=t,s=r;i<=s;i++)e.push(String.fromCharCode(i))}else e.push(...i.splitTextToCharacters(s))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}},2133:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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}"},2147:t=>{"use strict";t.exports=function(t){return t[1]}},2152:(t,e,r)=>{"use strict";var i=r(238);class s{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.4.3 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}s.defaultOptions={hello:!1},s.extension={type:[i.ExtensionType.RendererSystem,i.ExtensionType.CanvasRendererSystem],name:"startup"},i.extensions.add(s),e.StartupSystem=s},2229:(t,e,r)=>{"use strict";var i=r(8894),s=r(3386);let n=0;class o{constructor(t,e=!0,r=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=n++,this.disposeRunner=new s.Runner("disposeBuffer")}update(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(t){this.type=t?i.BUFFER_TYPE.ELEMENT_ARRAY_BUFFER:i.BUFFER_TYPE.ARRAY_BUFFER}get index(){return this.type===i.BUFFER_TYPE.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new o(t)}}e.Buffer=o},2242:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,":host{width:fit-content;padding:8px}.spacer{display:inline-block;width:25px}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},2255:(t,e,r)=>{"use strict";var i=r(9878);let s,n;function o(){n={bptc:s.getExtension("EXT_texture_compression_bptc"),astc:s.getExtension("WEBGL_compressed_texture_astc"),etc:s.getExtension("WEBGL_compressed_texture_etc"),s3tc:s.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:s.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:s.getExtension("WEBGL_compressed_texture_pvrtc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:s.getExtension("WEBGL_compressed_texture_etc1"),atc:s.getExtension("WEBGL_compressed_texture_atc")}}const a={extension:{type:i.ExtensionType.DetectionParser,priority:2},test:async()=>{const t=i.settings.ADAPTER.createCanvas().getContext("webgl");return t?(s=t,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async t=>{n||o();const e=[];for(const t in n)n[t]&&e.push(t);return[...e,...t]},remove:async t=>(n||o(),t.filter((t=>!(t in n))))};i.extensions.add(a),e.detectCompressedTextures=a},2307:(t,e,r)=>{"use strict";var i=r(8894);e.mapWebGLBlendModesToPixi=function(t,e=[]){return e[i.BLEND_MODES.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.ADD]=[t.ONE,t.ONE],e[i.BLEND_MODES.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.NONE]=[0,0],e[i.BLEND_MODES.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[i.BLEND_MODES.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[i.BLEND_MODES.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[i.BLEND_MODES.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[i.BLEND_MODES.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[i.BLEND_MODES.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[i.BLEND_MODES.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}},2322:(t,e,r)=>{"use strict";var i=r(622),s=r(8894),n=r(7605),o=r(4611);class a extends o.BaseTexture{constructor(t={}){"number"==typeof t&&(t={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),t.width=t.width??100,t.height=t.height??100,t.multisample??(t.multisample=s.MSAA_QUALITY.NONE),super(null,t),this.mipmap=s.MIPMAP_MODES.OFF,this.valid=!0,this._clear=new i.Color([0,0,0,0]),this.framebuffer=new n.Framebuffer(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=t.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(t){this._clear.setValue(t)}get clearColor(){return this._clear.value}get clear(){return this._clear}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}e.BaseRenderTexture=a},2366:(t,e)=>{"use strict";e.checkDataUrl=function(t,e){if(Array.isArray(e)){for(const r of e)if(t.startsWith(`data:${r}`))return!0;return!1}return t.startsWith(`data:${e}`)}},2385:(t,e,r)=>{"use strict";var i=r(1203);class s extends i.BaseImageResource{constructor(t){super(t)}static test(t){return!!globalThis.VideoFrame&&t instanceof globalThis.VideoFrame}}e.VideoFrameResource=s},2396:(t,e,r)=>{"use strict";var i=r(377),s=r(6059);e.ParticleContainer=i.ParticleContainer,e.ParticleRenderer=s.ParticleRenderer},2416:(t,e,r)=>{"use strict";var i=r(9878),s=r(866),n=r(4450),o=r(5758);r(4350);var a=r(7476),h=r(2501),l=r(7092),u=r(8795);class c{constructor(){this._detections=[],this._initialized=!1,this.resolver=new a.Resolver,this.loader=new o.Loader,this.cache=n.Cache,this._backgroundLoader=new s.BackgroundLoader(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized)return void console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let e=t.manifest;"string"==typeof e&&(e=await this.load(e)),this.resolver.addManifest(e)}const e=t.texturePreference?.resolution??1,r="number"==typeof e?[e]:e,i=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:i,resolution:r}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,r,i,s){this.resolver.add(t,e,r,i,s)}async load(t,e){this._initialized||await this.init();const r=l.isSingleItem(t),i=h.convertToList(t).map((t=>{if("string"!=typeof t){const e=this.resolver.getAlias(t);return e.some((t=>!this.resolver.hasKey(t)))&&this.add(t),Array.isArray(e)?e[0]:e}return this.resolver.hasKey(t)||this.add({alias:t,src:t}),t})),s=this.resolver.resolve(i),n=await this._mapLoadToResolve(s,e);return r?n[i[0]]:n}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let r=!1;"string"==typeof t&&(r=!0,t=[t]);const i=this.resolver.resolveBundle(t),s={},n=Object.keys(i);let o=0,a=0;const h=()=>{e?.(++o/a)},l=n.map((t=>{const e=i[t];return a+=Object.keys(e).length,this._mapLoadToResolve(e,h).then((e=>{s[t]=e}))}));return await Promise.all(l),r?s[t[0]]:s}async backgroundLoad(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach((t=>{this._backgroundLoader.add(Object.values(t))}))}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if("string"==typeof t)return n.Cache.get(t);const e={};for(let r=0;r<t.length;r++)e[r]=n.Cache.get(t[r]);return e}async _mapLoadToResolve(t,e){const r=Object.values(t),i=Object.keys(t);this._backgroundLoader.active=!1;const s=await this.loader.load(r,e);this._backgroundLoader.active=!0;const o={};return r.forEach(((t,e)=>{const r=s[t.src],a=[t.src];t.alias&&a.push(...t.alias),o[i[e]]=r,n.Cache.set(a,r)})),o}async unload(t){this._initialized||await this.init();const e=h.convertToList(t).map((t=>"string"!=typeof t?t.src:t)),r=this.resolver.resolve(e);await this._unloadFromResolved(r)}async unloadBundle(t){this._initialized||await this.init(),t=h.convertToList(t);const e=this.resolver.resolveBundle(t),r=Object.keys(e).map((t=>this._unloadFromResolved(e[t])));await Promise.all(r)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach((t=>{n.Cache.remove(t.src)})),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const r of t.detections)t.skipDetections||await r.test()?e=await r.add(e):t.skipDetections||(e=await r.remove(e));return e=e.filter(((t,r)=>e.indexOf(t)===r)),e}get detections(){return this._detections}get preferWorkers(){return u.loadTextures.config.preferWorkers}set preferWorkers(t){i.utils.deprecation("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach((e=>{e.config&&Object.keys(e.config).filter((e=>e in t)).forEach((r=>{e.config[r]=t[r]}))}))}}const d=new c;i.extensions.handleByList(i.ExtensionType.LoadParser,d.loader.parsers).handleByList(i.ExtensionType.ResolveParser,d.resolver.parsers).handleByList(i.ExtensionType.CacheParser,d.cache.parsers).handleByList(i.ExtensionType.DetectionParser,d.detections),e.Assets=d,e.AssetsClass=c},2418:t=>{"use strict";t.exports=Math.floor},2427:(t,e,r)=>{"use strict";var i=r(9524),s=r(1102),n=r(6255),o=r(7785);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new s("a function is required");return o(i,n,t)}},2428:(t,e,r)=>{"use strict";var i=r(9878),s=r(6934);const n={extension:{type:i.ExtensionType.DetectionParser,priority:0},test:async()=>s.testImageFormat("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async t=>[...t,"webp"],remove:async t=>t.filter((t=>"webp"!==t))};i.extensions.add(n),e.detectWebp=n},2446:(t,e)=>{"use strict";e.sign=function(t){return 0===t?0:t<0?-1:1}},2471:(t,e,r)=>{"use strict";var i=r(226);e.DisplacementFilter=i.DisplacementFilter},2498:(t,e,r)=>{"use strict";var i=r(622),s=r(238);class n{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new i.Color(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:e,background:r,backgroundAlpha:i}=t,s=r??e;void 0!==s&&(this.color=s),this.alpha=i}get color(){return this._backgroundColor.value}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get backgroundColor(){return this._backgroundColor}destroy(){}}n.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},n.extension={type:[s.ExtensionType.RendererSystem,s.ExtensionType.CanvasRendererSystem],name:"background"},s.extensions.add(n),e.BackgroundSystem=n},2501:(t,e)=>{"use strict";e.convertToList=(t,e,r=!1)=>(Array.isArray(t)||(t=[t]),e?t.map((t=>"string"==typeof t||r?e(t):t)):t)},2557:t=>{"use strict";t.exports=ReferenceError},2573:(t,e,r)=>{"use strict";var i=r(9878);e.checkExtension=function(t,e){const r=t.split("?")[0],s=i.utils.path.extname(r).toLowerCase();return Array.isArray(e)?e.includes(s):s===e}},2579:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function i(){}function s(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(t,e,i,n,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new s(i,n||t,o),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,s=[];if(0===this._eventsCount)return s;for(i in t=this._events)e.call(t,i)&&s.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var s=0,n=i.length,o=new Array(n);s<n;s++)o[s]=i[s].fn;return o},a.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,s,n,o){var a=r?r+t:t;if(!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,s),!0;case 5:return u.fn.call(u.context,e,i,s,n),!0;case 6:return u.fn.call(u.context,e,i,s,n,o),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var d,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,i);break;case 4:u[l].fn.call(u[l].context,e,i,s);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];u[l].fn.apply(u[l].context,h)}}return!0},a.prototype.on=function(t,e,r){return n(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return n(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,i,s){var n=r?r+t:t;if(!this._events[n])return this;if(!e)return o(this,n),this;var a=this._events[n];if(a.fn)a.fn!==e||s&&!a.once||i&&a.context!==i||o(this,n);else{for(var h=0,l=[],u=a.length;h<u;h++)(a[h].fn!==e||s&&!a[h].once||i&&a[h].context!==i)&&l.push(a[h]);l.length?this._events[n]=1===l.length?l[0]:l:o(this,n)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&o(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},2602:function(t,e,r){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var s in e=arguments[r])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},i.apply(this,arguments)};e.__esModule=!0,e.DashLine=void 0;var s=r(620),n={dash:[10,5],width:1,color:16777215,alpha:1,scale:1,useTexture:!1,alignment:.5},o=function(){function t(t,e){void 0===e&&(e={}),this.cursor=new s.Point,this.scale=1,this.graphics=t,e=i(i({},n),e),this.dash=e.dash,this.dashSize=this.dash.reduce((function(t,e){return t+e})),this.useTexture=e.useTexture,this.options=e,this.setLineStyle()}return t.prototype.setLineStyle=function(){var e=this.options;if(this.useTexture){var r=t.getTexture(e,this.dashSize);this.graphics.lineTextureStyle({width:e.width*e.scale,color:e.color,alpha:e.alpha,texture:r,alignment:e.alignment}),this.activeTexture=r}else this.graphics.lineStyle({width:e.width*e.scale,color:e.color,alpha:e.alpha,cap:e.cap,join:e.join,alignment:e.alignment});this.scale=e.scale},t.distance=function(t,e,r,i){return Math.sqrt(Math.pow(r-t,2)+Math.pow(i-e,2))},t.prototype.moveTo=function(t,e){return this.lineLength=0,this.cursor.set(t,e),this.start=new s.Point(t,e),this.graphics.moveTo(this.cursor.x,this.cursor.y),this},t.prototype.lineTo=function(e,r,i){void 0===typeof this.lineLength&&this.moveTo(0,0);var s=t.distance(this.cursor.x,this.cursor.y,e,r),n=Math.atan2(r-this.cursor.y,e-this.cursor.x),o=i&&e===this.start.x&&r===this.start.y;if(this.useTexture)if(this.graphics.moveTo(this.cursor.x,this.cursor.y),this.adjustLineStyle(n),o&&this.dash.length%2==0){var a=Math.min(this.dash[this.dash.length-1],s);this.graphics.lineTo(e-Math.cos(n)*a,r-Math.sin(n)*a),this.graphics.closePath()}else this.graphics.lineTo(e,r);else{for(var h=Math.cos(n),l=Math.sin(n),u=this.cursor.x,c=this.cursor.y,d=this.lineLength%(this.dashSize*this.scale),p=0,f=0,m=0,g=0;g<this.dash.length;g++){if(d<m+(_=this.dash[g]*this.scale)){p=g,f=d-m;break}m+=_}for(var y=s;y>0;){var _,v=y>(_=this.dash[p]*this.scale-f)?_:y;if(o&&t.distance(u+h*v,c+l*v,this.start.x,this.start.y)<=v){if(p%2==0){var x=t.distance(u,c,this.start.x,this.start.y)-this.dash[this.dash.length-1]*this.scale;u+=h*x,c+=l*x,this.graphics.lineTo(u,c)}break}u+=h*v,c+=l*v,p%2?this.graphics.moveTo(u,c):this.graphics.lineTo(u,c),y-=v,p=++p===this.dash.length?0:p,f=0}}return this.lineLength+=s,this.cursor.set(e,r),this},t.prototype.closePath=function(){this.lineTo(this.start.x,this.start.y,!0)},t.prototype.drawCircle=function(t,e,r,i,n){void 0===i&&(i=80);var o,a=2*Math.PI/i,h=0;n?(o=new s.Point(t+Math.cos(h)*r,e+Math.sin(h)*r),n.apply(o,o),this.moveTo(o[0],o[1])):(o=new s.Point(t+Math.cos(h)*r,e+Math.sin(h)*r),this.moveTo(o.x,o.y)),h+=a;for(var l=1;l<i+1;l++){var u=l===i?o:[t+Math.cos(h)*r,e+Math.sin(h)*r];this.lineTo(u[0],u[1]),h+=a}return this},t.prototype.drawEllipse=function(t,e,r,i,n,o){void 0===n&&(n=80);for(var a,h=2*Math.PI/n,l=new s.Point,u=0;u<2*Math.PI;u+=h){var c=t-r*Math.sin(u),d=e-i*Math.cos(u);o&&(l.set(c,d),o.apply(l,l),c=l.x,d=l.y),0===u?(this.moveTo(c,d),a={x:c,y:d}):this.lineTo(c,d)}return this.lineTo(a.x,a.y,!0),this},t.prototype.drawPolygon=function(t,e){var r=new s.Point;if("number"==typeof t[0])if(e){r.set(t[0],t[1]),e.apply(r,r),this.moveTo(r.x,r.y);for(var i=2;i<t.length;i+=2)r.set(t[i],t[i+1]),e.apply(r,r),this.lineTo(r.x,r.y,i===t.length-2)}else for(this.moveTo(t[0],t[1]),i=2;i<t.length;i+=2)this.lineTo(t[i],t[i+1],i===t.length-2);else if(e){var n=t[0];for(r.copyFrom(n),e.apply(r,r),this.moveTo(r.x,r.y),i=1;i<t.length;i++){var o=t[i];r.copyFrom(o),e.apply(r,r),this.lineTo(r.x,r.y,i===t.length-1)}}else for(n=t[0],this.moveTo(n.x,n.y),i=1;i<t.length;i++){var a=t[i];this.lineTo(a.x,a.y,i===t.length-1)}return this},t.prototype.drawRect=function(t,e,r,i,n){if(n){var o=new s.Point;o.set(t,e),n.apply(o,o),this.moveTo(o.x,o.y),o.set(t+r,e),n.apply(o,o),this.lineTo(o.x,o.y),o.set(t+r,e+i),n.apply(o,o),this.lineTo(o.x,o.y),o.set(t,e+i),n.apply(o,o),this.lineTo(o.x,o.y),o.set(t,e),n.apply(o,o),this.lineTo(o.x,o.y,!0)}else this.moveTo(t,e).lineTo(t+r,e).lineTo(t+r,e+i).lineTo(t,e+i).lineTo(t,e,!0);return this},t.prototype.adjustLineStyle=function(t){var e=this.graphics.line;e.matrix=new s.Matrix,t&&e.matrix.rotate(t),1!==this.scale&&e.matrix.scale(this.scale,this.scale);var r=-this.lineLength;e.matrix.translate(this.cursor.x+r*Math.cos(t),this.cursor.y+r*Math.sin(t)),this.graphics.lineStyle(e)},t.getTexture=function(e,r){var i=e.dash.toString();if(t.dashTextureCache[i])return t.dashTextureCache[i];var n=document.createElement("canvas");n.width=r,n.height=Math.ceil(e.width);var o=n.getContext("2d");if(o){o.strokeStyle="white",o.globalAlpha=e.alpha,o.lineWidth=e.width;var a=0,h=e.width/2;o.moveTo(a,h);for(var l=0;l<e.dash.length;l+=2)a+=e.dash[l],o.lineTo(a,h),e.dash.length!==l+1&&(a+=e.dash[l+1],o.moveTo(a,h));o.stroke();var u=t.dashTextureCache[i]=s.Texture.from(n);return u.baseTexture.scaleMode=s.SCALE_MODES.NEAREST,u}console.warn("Did not get context from canvas")},t.dashTextureCache={},t}();e.DashLine=o},2629:(t,e,r)=>{"use strict";r(1904);var i=r(2416);r(5084),r(1098),r(9265),r(8988),r(5788),r(4791);var s=r(4450),n=r(7505),o=r(326),a=r(2428),h=r(2952),l=r(7647),u=r(2063),c=r(8616),d=r(9139),p=r(3622),f=r(8225),m=r(5873),g=r(9277),y=r(8795),_=r(2844),v=r(2774),x=r(775),b=r(2366),T=r(2573),E=r(2501),A=r(3496),S=r(856),w=r(7092);e.Assets=i.Assets,e.AssetsClass=i.AssetsClass,e.Cache=s.Cache,e.cacheTextureArray=n.cacheTextureArray,e.detectAvif=o.detectAvif,e.detectWebp=a.detectWebp,e.detectDefaults=h.detectDefaults,e.detectWebm=l.detectWebm,e.detectMp4=u.detectMp4,e.detectOgv=c.detectOgv,e.LoaderParserPriority=d.LoaderParserPriority,e.loadJson=p.loadJson,e.loadTxt=f.loadTxt,e.getFontFamilyName=m.getFontFamilyName,e.loadWebFont=m.loadWebFont,e.loadSVG=g.loadSVG,e.loadImageBitmap=y.loadImageBitmap,e.loadTextures=y.loadTextures,e.loadVideo=_.loadVideo,e.createTexture=v.createTexture,e.resolveTextureUrl=x.resolveTextureUrl,e.checkDataUrl=b.checkDataUrl,e.checkExtension=T.checkExtension,e.convertToList=E.convertToList,e.copySearchParams=A.copySearchParams,e.createStringVariations=S.createStringVariations,e.isSingleItem=w.isSingleItem},2648:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,":host{width:fit-content;display:flex;flex-wrap:nowrap;flex-direction:row}#navigation{margin:12px;border:solid #000 1px;width:fit-content;height:120px;max-height:120px;display:flex;flex-wrap:nowrap;flex-direction:row}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},2728:t=>{"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},2760:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DhToolsSocketBase=void 0;const i=r(782);class s extends i.BaseSocketService{constructor(){super();const t=new URL(document.location.toString()).searchParams;t.has("p")&&this.setPort(parseInt(t.get("p")))}}e.DhToolsSocketBase=s},2768:(t,e,r)=>{"use strict";var i=r(7773),s=r(3869);class n extends s.BlobResource{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=n._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||n._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,r){const 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;i.pixelStorei(i.UNPACK_ALIGNMENT,4);for(let t=0,e=this.levels;t<e;t++){const{levelID:e,levelWidth:r,levelHeight:s,levelBuffer:n}=this._levelBuffers[t];i.compressedTexImage2D(i.TEXTURE_2D,e,this.format,r,s,0,n)}return!0}onBlobLoaded(){this._levelBuffers=n._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=35916&&t<=35919)return"s3tc_sRGB";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(36196===t)return"etc1";if(35986===t||35987===t||34798===t)return"atc";if(t>=36492&&t<=36495)return"bptc";if(37808===t)return"astc";throw new Error(`Invalid (compressed) texture format given: ${t}`)}static _createLevelBuffers(t,e,r,s,n,o,a){const h=new Array(r);let l=t.byteOffset,u=o,c=a,d=u+s-1&~(s-1),p=c+n-1&~(n-1),f=d*p*i.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[e];for(let o=0;o<r;o++)h[o]={levelID:o,levelWidth:r>1?u:d,levelHeight:r>1?c:p,levelBuffer:new Uint8Array(t.buffer,l,f)},l+=f,u=u>>1||1,c=c>>1||1,d=u+s-1&~(s-1),p=c+n-1&~(n-1),f=d*p*i.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[e];return h}}e.CompressedTextureResource=n},2774:(t,e,r)=>{"use strict";var i=r(9878),s=r(4450);e.createTexture=function(t,e,r){t.resource.internal=!0;const n=new i.Texture(t),o=()=>{delete e.promiseCache[r],s.Cache.has(r)&&s.Cache.remove(r)};return n.baseTexture.once("destroyed",(()=>{r in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),o())})),n.once("destroyed",(()=>{t.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),o())})),n}},2802:(t,e,r)=>{"use strict";r(8017);var i=r(521),s=r(7902),n=r(9045);e.UPDATE_PRIORITY=i.UPDATE_PRIORITY,e.Ticker=s.Ticker,e.TickerPlugin=n.TickerPlugin},2828:(t,e,r)=>{"use strict";var i=r(9878),s=r(3293);const n=class t extends s.TextStyle{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new t(Object.keys(t.defaultOptions).reduce(((t,r)=>({...t,[r]:e[r]})),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach((e=>{URL.revokeObjectURL(e.src),e.refs--,0===e.refs&&(e.fontFace&&document.fonts.delete(e.fontFace),delete t.availableFonts[e.originalUrl])})),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,r={}){const{availableFonts:s}=t;if(s[e]){const t=s[e];return this._fonts.push(t),t.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return i.settings.ADAPTER.fetch(e).then((t=>t.blob())).then((async t=>new Promise(((e,r)=>{const i=URL.createObjectURL(t),s=new FileReader;s.onload=()=>e([i,s.result]),s.onerror=r,s.readAsDataURL(t)})))).then((async([t,n])=>{const o=Object.assign({family:i.utils.path.basename(e,i.utils.path.extname(e)),weight:"normal",style:"normal",display:"auto",src:t,dataSrc:n,refs:1,originalUrl:e,fontFace:null},r);s[e]=o,this._fonts.push(o),this.styleID++;const a=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0}))}addOverride(...t){const e=t.filter((t=>!this._overrides.includes(t)));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter((t=>this._overrides.includes(t)));e.length>0&&(this._overrides=this._overrides.filter((t=>!e.includes(t))),this.styleID++)}toCSS(t){return[`transform: scale(${t})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?["word-wrap: "+(this.breakWords?"break-all":"break-word"),`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce(((t,e)=>`${t}\n            @font-face {\n                font-family: "${e.family}";\n                src: url('${e.dataSrc}');\n                font-weight: ${e.weight};\n                font-style: ${e.style};\n                font-display: ${e.display};\n            }`),this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=i.utils.rgb2hex(t)),"number"==typeof t?i.utils.hex2string(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,r=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),i=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(255*e|0).toString(16).padStart(2,"0"));const s=`${r}px ${i}px`;return this.dropShadowBlur>0?`text-shadow: ${s} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${s} ${t}`}reset(){Object.assign(this,t.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise((t=>setTimeout(t,100))):Promise.resolve()}get isSafari(){const{userAgent:t}=i.settings.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};n.availableFonts={},n.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let o=n;e.HTMLTextStyle=o},2844:(t,e,r)=>{"use strict";var i=r(9878),s=r(2366),n=r(2573),o=r(9139),a=r(2774);const h=[".mp4",".m4v",".webm",".ogv"],l=["video/mp4","video/webm","video/ogg"],u={name:"loadVideo",extension:{type:i.ExtensionType.LoadParser,priority:o.LoaderParserPriority.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test:t=>s.checkDataUrl(t,l)||n.checkExtension(t,h),async load(t,e,r){let s;const n=await(await i.settings.ADAPTER.fetch(t)).blob(),o=URL.createObjectURL(n);try{const n={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...e?.data?.resourceOptions,autoLoad:!0},h=new i.VideoResource(o,n);await h.load();const l=new i.BaseTexture(h,{alphaMode:await i.utils.detectVideoAlphaMode(),resolution:i.utils.getResolutionOfUrl(t),...e?.data});l.resource.src=t,s=a.createTexture(l,r,t),s.baseTexture.once("destroyed",(()=>{URL.revokeObjectURL(o)}))}catch(t){throw URL.revokeObjectURL(o),t}return s},unload(t){t.destroy(!0)}};i.extensions.add(u),e.loadVideo=u},2935:(t,e)=>{"use strict";var r=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(r||{}),i=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(i||{});const s={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}},n=s;e.GRAPHICS_CURVES=n,e.LINE_CAP=i,e.LINE_JOIN=r,e.curves=s},2952:(t,e,r)=>{"use strict";var i=r(9878);const s=["png","jpg","jpeg"],n={extension:{type:i.ExtensionType.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async t=>[...t,...s],remove:async t=>t.filter((t=>!s.includes(t)))};i.extensions.add(n),e.detectDefaults=n},3e3:(t,e,r)=>{"use strict";var i=r(238);class s{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glTransformFeedbacks[r]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:r,renderer:i}=this;e&&i.shader.bind(e),r.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:r,CONTEXT_UID:i}=this,s=e.createTransformFeedback();t._glTransformFeedbacks[i]=s,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,s);for(let s=0;s<t.buffers.length;s++){const n=t.buffers[s];n&&(r.buffer.update(n),n._glBuffers[i].refCount++,e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER,s,n._glBuffers[i].buffer||null))}return e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null),t.disposeRunner.add(this),s}disposeTransformFeedback(t,e){const r=t._glTransformFeedbacks[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let r=0;r<t.buffers.length;r++){const i=t.buffers[r];if(!i)continue;const n=i._glBuffers[this.CONTEXT_UID];n&&(n.refCount--,0===n.refCount&&!e&&s.dispose(i,e))}r&&(e||i.deleteTransformFeedback(r),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}s.extension={type:i.ExtensionType.RendererSystem,name:"transformFeedback"},i.extensions.add(s),e.TransformFeedbackSystem=s},3042:(t,e,r)=>{"use strict";var i=r(6441);e.decomposeDataUri=function(t){const e=i.DATA_URI.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}}},3044:(t,e,r)=>{"use strict";var i=r(8066);const s={Float32Array,Uint32Array,Int32Array,Uint8Array};e.interleaveTypedArrays=function(t,e){let r=0,n=0;const o={};for(let i=0;i<t.length;i++)n+=e[i],r+=t[i].length;const a=new ArrayBuffer(4*r);let h=null,l=0;for(let r=0;r<t.length;r++){const u=e[r],c=t[r],d=i.getBufferType(c);o[d]||(o[d]=new s[d](a)),h=o[d];for(let t=0;t<c.length;t++)h[(t/u|0)*n+l+t%u]=c[t];l+=u}return new Float32Array(a)}},3046:(t,e)=>{"use strict";e.accessibleTarget={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1}},3064:(t,e,r)=>{"use strict";var i=r(8894);let s;e.detectVideoAlphaMode=async function(){return s??(s=(async()=>{const t=document.createElement("canvas").getContext("webgl");if(!t)return i.ALPHA_MODES.UNPACK;const e=await new Promise((t=>{const e=document.createElement("video");e.onloadeddata=()=>t(e),e.onerror=()=>t(null),e.autoplay=!1,e.crossOrigin="anonymous",e.preload="auto",e.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",e.load()}));if(!e)return i.ALPHA_MODES.UNPACK;const r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);const s=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(s),t.deleteTexture(r),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?i.ALPHA_MODES.PMA:i.ALPHA_MODES.UNPACK})()),s}},3086:(t,e,r)=>{"use strict";var i=r(8894);e.setPrecision=function(t,e,r){if("precision"!==t.substring(0,9)){let s=e;return e===i.PRECISION.HIGH&&r!==i.PRECISION.HIGH&&(s=i.PRECISION.MEDIUM),`precision ${s} float;\n${t}`}return r!==i.PRECISION.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}},3126:(t,e,r)=>{"use strict";var i=r(2229),s=r(599);class n extends s.Geometry{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new i.Buffer(this.vertices),this.uvBuffer=new i.Buffer(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,e){let 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}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}e.QuadUv=n},3148:(t,e,r)=>{"use strict";var i=r(9878),s=r(565);class n extends i.Filter{constructor(t=8,e=4,r=i.Filter.defaultResolution,n=5){super(),this._repeatEdgePixels=!1,this.blurXFilter=new s.BlurFilterPass(!0,t,e,r,n),this.blurYFilter=new s.BlurFilterPass(!1,t,e,r,n),this.resolution=r,this.quality=e,this.blur=t,this.repeatEdgePixels=!1}apply(t,e,r,s){const n=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(n&&o){const n=t.getFilterTexture();this.blurXFilter.apply(t,e,n,i.CLEAR_MODES.CLEAR),this.blurYFilter.apply(t,n,r,s),t.returnFilterTexture(n)}else o?this.blurYFilter.apply(t,e,r,s):this.blurXFilter.apply(t,e,r,s)}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))}get blur(){return this.blurXFilter.blur}set blur(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(t){this.blurXFilter.quality=this.blurYFilter.quality=t}get blurX(){return this.blurXFilter.blur}set blurX(t){this.blurXFilter.blur=t,this.updatePadding()}get blurY(){return this.blurYFilter.blur}set blurY(t){this.blurYFilter.blur=t,this.updatePadding()}get blendMode(){return this.blurYFilter.blendMode}set blendMode(t){this.blurYFilter.blendMode=t}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(t){this._repeatEdgePixels=t,this.updatePadding()}}e.BlurFilter=n},3210:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,'@keyframes spinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes hide{0%{opacity:1}100%{opacity:0;z-index:0;display:none}}:host{position:absolute;left:0;top:0;width:100vw;height:100vh;z-index:1337;pointer-events:none}.wrapper{pointer-events:initial;width:100%;height:100%;background-color:rgba(0,0,0,.8)}.hide{pointer-events:none;animation:hide .5s linear;opacity:0;z-index:0}.loader{width:6vh;height:6vh;border:4px solid #fb0;border-radius:50%;-webkit-animation:rotation .75s infinite cubic-bezier(0.65, 0, 0.35, 1);animation:spinner .75s infinite linear;border-top:0;border-right:0}.loader::before,.loader::after{left:-2px;top:-2px;display:none;position:absolute;content:""}.centered{pointer-events:none;position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%)}',""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},3219:(t,e,r)=>{"use strict";r(1153);var i=r(6238);e.getResolutionOfUrl=function(t,e=1){const r=i.settings.RETINA_PREFIX?.exec(t);return r?parseFloat(r[1]):e}},3240:(t,e,r)=>{"use strict";var i=r(9878),s=r(481);Object.defineProperties(i.settings,{UPLOADS_PER_FRAME:{get:()=>s.BasePrepare.uploadsPerFrame,set(t){i.utils.deprecation("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),s.BasePrepare.uploadsPerFrame=t}}}),Object.defineProperty(e,"settings",{enumerable:!0,get:function(){return i.settings}})},3273:(t,e,r)=>{"use strict";var i=r(1537),s=r(4008);class n{constructor(t=1,e=0,r=0,i=1,s=0,n=0){this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=s,this.ty=n}fromArray(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]}set(t,e,r,i,s,n){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=s,this.ty=n,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const 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}apply(t,e){e=e||new s.Point;const 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}applyInverse(t,e){e=e||new s.Point;const 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}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),r=Math.sin(t),i=this.a,s=this.c,n=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=s*e-this.d*r,this.d=s*r+this.d*e,this.tx=n*e-this.ty*r,this.ty=n*r+this.ty*e,this}append(t){const e=this.a,r=this.b,i=this.c,s=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*s,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*s,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*s+this.ty,this}setTransform(t,e,r,i,s,n,o,a,h){return this.a=Math.cos(o+h)*s,this.b=Math.sin(o+h)*s,this.c=-Math.sin(o-a)*n,this.d=Math.cos(o-a)*n,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,r=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*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}decompose(t){const e=this.a,r=this.b,s=this.c,n=this.d,o=t.pivot,a=-Math.atan2(-s,n),h=Math.atan2(r,e),l=Math.abs(a+h);return l<1e-5||Math.abs(i.PI_2-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(s*s+n*n),t.position.x=this.tx+(o.x*e+o.y*s),t.position.y=this.ty+(o.x*r+o.y*n),t}invert(){const t=this.a,e=this.b,r=this.c,i=this.d,s=this.tx,n=t*i-e*r;return this.a=i/n,this.b=-e/n,this.c=-r/n,this.d=t/n,this.tx=(r*this.ty-i*s)/n,this.ty=-(t*this.ty-e*s)/n,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new n;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}copyTo(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}copyFrom(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}static get IDENTITY(){return new n}static get TEMP_MATRIX(){return new n}}n.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}]`},e.Matrix=n},3276:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="// 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  if (median < 0.01) {\r\n    alpha = 0.0;\r\n  } else if (median > 0.99) {\r\n    alpha = 1.0;\r\n  }\r\n\r\n  // Gamma correction for coverage-like alpha\r\n  float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r\n  float gamma = mix(1.0, 1.0 / 2.2, luma);\r\n  float coverage = pow(uColor.a * alpha, gamma);  \r\n\r\n  // NPM Textures, NPM outputs\r\n  gl_FragColor = vec4(uColor.rgb, coverage);\r\n}\r\n"},3279:(t,e)=>{"use strict";e.isPow2=function(t){return!(t&t-1||!t)},e.log2=function(t){let e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,r=((t>>>=r)>15?1:0)<<2,e|=r,r=((t>>>=r)>3?1:0)<<1,e|=r,e|(t>>>=r)>>1},e.nextPow2=function(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)}},3293:(t,e,r)=>{"use strict";var i=r(3937),s=r(1966),n=r(6217),o=r(7737);e.TEXT_GRADIENT=i.TEXT_GRADIENT,e.Text=s.Text,e.TextMetrics=n.TextMetrics,e.TextStyle=o.TextStyle},3298:(t,e,r)=>{"use strict";var i=r(9878),s=r(1520);const n=new i.Point;class o extends s.Sprite{constructor(t,e=100,r=100){super(t),this.tileTransform=new i.Transform,this._width=e,this._height=r,this.uvMatrix=this.texture.uvMatrix||new i.TextureMatrix(t),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}get clampMargin(){return this.uvMatrix.clampMargin}set clampMargin(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)}get tileScale(){return this.tileTransform.scale}set tileScale(t){this.tileTransform.scale.copyFrom(t)}get tilePosition(){return this.tileTransform.position}set tilePosition(t){this.tileTransform.position.copyFrom(t)}_onTextureUpdate(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215}_render(t){const 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))}_calculateBounds(){const 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)}getLocalBounds(t){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),t||(this._localBoundsRect||(this._localBoundsRect=new i.Rectangle),t=this._localBoundsRect),this._bounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,n);const e=this._width,r=this._height,i=-e*this.anchor._x;if(n.x>=i&&n.x<i+e){const t=-r*this.anchor._y;if(n.y>=t&&n.y<t+r)return!0}return!1}destroy(t){super.destroy(t),this.tileTransform=null,this.uvMatrix=null}static from(t,e){const r=t instanceof i.Texture?t:i.Texture.from(t,e);return new o(r,e.width,e.height)}get width(){return this._width}set width(t){this._width=t}get height(){return this._height}set height(t){this._height=t}}e.TilingSprite=o},3306:(t,e,r)=>{"use strict";var i=r(9878);const s={build(t){const e=t.points;let r,s,n,o,a,h;if(t.type===i.SHAPES.CIRC){const e=t.shape;r=e.x,s=e.y,a=h=e.radius,n=o=0}else if(t.type===i.SHAPES.ELIP){const e=t.shape;r=e.x,s=e.y,a=e.width,h=e.height,n=o=0}else{const e=t.shape,i=e.width/2,l=e.height/2;r=e.x+i,s=e.y+l,a=h=Math.max(0,Math.min(e.radius,Math.min(i,l))),n=i-a,o=l-h}if(!(a>=0&&h>=0&&n>=0&&o>=0))return void(e.length=0);const l=Math.ceil(2.3*Math.sqrt(a+h)),u=8*l+(n?4:0)+(o?4:0);if(e.length=u,0===u)return;if(0===l)return e.length=8,e[0]=e[6]=r+n,e[1]=e[3]=s+o,e[2]=e[4]=r-n,void(e[5]=e[7]=s-o);let c=0,d=4*l+(n?2:0)+2,p=d,f=u;{const t=n+a,i=o,h=r+t,l=r-t,u=s+i;if(e[c++]=h,e[c++]=u,e[--d]=u,e[--d]=l,o){const t=s-i;e[p++]=l,e[p++]=t,e[--f]=t,e[--f]=h}}for(let t=1;t<l;t++){const i=Math.PI/2*(t/l),u=n+Math.cos(i)*a,m=o+Math.sin(i)*h,g=r+u,y=r-u,_=s+m,v=s-m;e[c++]=g,e[c++]=_,e[--d]=_,e[--d]=y,e[p++]=y,e[p++]=v,e[--f]=v,e[--f]=g}{const t=o+h,i=r+n,a=r-n,l=s+t,u=s-t;e[c++]=i,e[c++]=l,e[--f]=u,e[--f]=i,n&&(e[c++]=a,e[c++]=l,e[--f]=u,e[--f]=a)}},triangulate(t,e){const r=t.points,s=e.points,n=e.indices;if(0===r.length)return;let o=s.length/2;const a=o;let h,l;if(t.type!==i.SHAPES.RREC){const e=t.shape;h=e.x,l=e.y}else{const e=t.shape;h=e.x+e.width/2,l=e.y+e.height/2}const u=t.matrix;s.push(t.matrix?u.a*h+u.c*l+u.tx:h,t.matrix?u.b*h+u.d*l+u.ty:l),o++,s.push(r[0],r[1]);for(let t=2;t<r.length;t+=2)s.push(r[t],r[t+1]),n.push(o++,a,o);n.push(a+1,a,o)}};e.buildCircle=s},3308:(t,e,r)=>{"use strict";var i=r(9878);function s(t,e=!1){const r=t.length;if(r<6)return;let i=0;for(let e=0,s=t[r-2],n=t[r-1];e<r;e+=2){const r=t[e],o=t[e+1];i+=(r-s)*(o+n),s=r,n=o}if(!e&&i>0||e&&i<=0){const e=r/2;for(let i=e+e%2;i<r;i+=2){const e=r-i-2,s=r-i-1,n=i,o=i+1;[t[e],t[n]]=[t[n],t[e]],[t[s],t[o]]=[t[o],t[s]]}}}const n={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let r=t.points;const n=t.holes,o=e.points,a=e.indices;if(r.length>=6){s(r,!1);const t=[];for(let e=0;e<n.length;e++){const i=n[e];s(i.points,!0),t.push(r.length/2),r=r.concat(i.points)}const e=i.utils.earcut(r,t,2);if(!e)return;const h=o.length/2;for(let t=0;t<e.length;t+=3)a.push(e[t]+h),a.push(e[t+1]+h),a.push(e[t+2]+h);for(let t=0;t<r.length;t++)o.push(r[t])}}};e.buildPoly=n},3314:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,":host{display:flex;flex-flow:column;height:100%;background-color:silver}#dpi{height:1in;width:1in;left:-100%;top:-100%;position:absolute}navigation-wrapper{width:100%;flex:1}canvas-wrapper{flex:auto}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},3365:(t,e,r)=>{"use strict";var i=r(836),s=r(4250),n=r(8085);t.exports={formats:n,parse:s,stringify:i}},3386:(t,e,r)=>{"use strict";var i=r(9882);e.Runner=i.Runner},3393:(t,e,r)=>{"use strict";var i=r(8894),s=r(7146);e.FilterState=class{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=i.MSAA_QUALITY.NONE,this.sourceFrame=new s.Rectangle,this.destinationFrame=new s.Rectangle,this.bindingSourceFrame=new s.Rectangle,this.bindingDestinationFrame=new s.Rectangle,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}},3429:t=>{"use strict";t.exports=SyntaxError},3445:(t,e,r)=>{"use strict";var i=r(6119),s=r(7100),n=r(2044),o=r(606),a=r(8925),h=r(1916);e.generateProgram=function(t,e){const r=s.compileShader(t,t.VERTEX_SHADER,e.vertexSrc),l=s.compileShader(t,t.FRAGMENT_SHADER,e.fragmentSrc),u=t.createProgram();t.attachShader(u,r),t.attachShader(u,l);const c=e.extra?.transformFeedbackVaryings;if(c&&("function"!=typeof t.transformFeedbackVaryings?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(u,c.names,"separate"===c.bufferMode?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(u),t.getProgramParameter(u,t.LINK_STATUS)||h.logProgramError(t,u,r,l),e.attributeData=o.getAttributeData(u,t),e.uniformData=a.getUniformData(u,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const r=Object.keys(e.attributeData);r.sort(((t,e)=>t>e?1:-1));for(let i=0;i<r.length;i++)e.attributeData[r[i]].location=i,t.bindAttribLocation(u,i,r[i]);t.linkProgram(u)}t.deleteShader(r),t.deleteShader(l);const d={};for(const r in e.uniformData){const i=e.uniformData[r];d[r]={location:t.getUniformLocation(u,r),value:n.defaultValue(i.type,i.size)}}return new i.GLProgram(u,d)}},3457:(t,e,r)=>{"use strict";var i=r(1723);e.AlphaFilter=i.AlphaFilter},3487:()=>{},3496:(t,e)=>{"use strict";e.copySearchParams=(t,e)=>{const r=e.split("?")[1];return r&&(t+=`?${r}`),t}},3557:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default='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'},3595:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="#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"},3604:(t,e,r)=>{"use strict";var i=r(8071);class s extends i.MeshGeometry{constructor(t=200,e,r=0){super(new Float32Array(4*e.length),new Float32Array(4*e.length),new Uint16Array(6*(e.length-1))),this.points=e,this._width=t,this.textureScale=r,this.build()}get width(){return this._width}build(){const t=this.points;if(!t)return;const e=this.getBuffer("aVertexPosition"),r=this.getBuffer("aTextureCoord"),i=this.getIndex();if(t.length<1)return;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)));const s=r.data,n=i.data;s[0]=0,s[1]=0,s[2]=0,s[3]=1;let o=0,a=t[0];const h=this._width*this.textureScale,l=t.length;for(let e=0;e<l;e++){const r=4*e;if(this.textureScale>0){const r=a.x-t[e].x,i=a.y-t[e].y,s=Math.sqrt(r*r+i*i);a=t[e],o+=s/h}else o=e/(l-1);s[r]=o,s[r+1]=0,s[r+2]=o,s[r+3]=1}let u=0;for(let t=0;t<l-1;t++){const e=2*t;n[u++]=e,n[u++]=e+1,n[u++]=e+2,n[u++]=e+2,n[u++]=e+1,n[u++]=e+3}r.update(),i.update(),this.updateVertices()}updateVertices(){const t=this.points;if(t.length<1)return;let e,r=t[0],i=0,s=0;const n=this.buffers[0].data,o=t.length,a=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let h=0;h<o;h++){const l=t[h],u=4*h;e=h<t.length-1?t[h+1]:l,s=-(e.x-r.x),i=e.y-r.y;let c=10*(1-h/(o-1));c>1&&(c=1);const d=Math.sqrt(i*i+s*s);d<1e-6?(i=0,s=0):(i/=d,s/=d,i*=a,s*=a),n[u]=l.x+i,n[u+1]=l.y+s,n[u+2]=l.x-i,n[u+3]=l.y-s,r=l}this.buffers[0].update()}update(){this.textureScale>0?this.build():this.updateVertices()}}e.RopeGeometry=s},3622:(t,e,r)=>{"use strict";var i=r(9878),s=r(2366),n=r(2573),o=r(9139);const a={extension:{type:i.ExtensionType.LoadParser,priority:o.LoaderParserPriority.Low},name:"loadJson",test:t=>s.checkDataUrl(t,"application/json")||n.checkExtension(t,".json"),load:async t=>await(await i.settings.ADAPTER.fetch(t)).json()};i.extensions.add(a),e.loadJson=a},3635:(t,e,r)=>{"use strict";var i=r(110),s=r(5031),n=r(8311),o=r(4566),a=r(1102),h=i("%WeakMap%",!0),l=s("WeakMap.prototype.get",!0),u=s("WeakMap.prototype.set",!0),c=s("WeakMap.prototype.has",!0),d=s("WeakMap.prototype.delete",!0);t.exports=h?function(){var t,e,r={assert:function(t){if(!r.has(t))throw new a("Side channel does not contain "+n(t))},delete:function(r){if(h&&r&&("object"==typeof r||"function"==typeof r)){if(t)return d(t,r)}else if(o&&e)return e.delete(r);return!1},get:function(r){return h&&r&&("object"==typeof r||"function"==typeof r)&&t?l(t,r):e&&e.get(r)},has:function(r){return h&&r&&("object"==typeof r||"function"==typeof r)&&t?c(t,r):!!e&&e.has(r)},set:function(r,i){h&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new h),u(t,r,i)):o&&(e||(e=o()),e.set(r,i))}};return r}:o},3643:(t,e,r)=>{"use strict";var i=r(9878),s=r(8599),n=r(6320),o=r(74),a=r(1304);const h=new i.Point,l=new i.Point;e.EventBoundary=class{constructor(t){this.dispatch=new i.utils.EventEmitter,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let r=0,i=e.length;r<i;r++)e[r].fn(t);else console.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){s.EventsTicker.pauseUpdate=!0;const r=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,h.set(t,e),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(t,e){if(!t.target)return;const r=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,s=r.length-1;i<s;i++)if(t.currentTarget=r[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let i=r.length-2;i>=0;i--)if(t.currentTarget=r[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,r=this._allInteractiveElements){if(0===r.length)return;t.eventPhase=t.BUBBLING_PHASE;const i=Array.isArray(e)?e:[e];for(let e=r.length-1;e>=0;e--)i.forEach((i=>{t.currentTarget=r[e],this.notifyTarget(t,i)}))}propagationPath(t){const e=[t];for(let r=0;r<2048&&t!==this.rootTarget;r++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,r,i,n,o=!1){let a=!1;if(this._interactivePrune(t))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(s.EventsTicker.pauseUpdate=!1),t.interactiveChildren&&t.children){const s=t.children;for(let h=s.length-1;h>=0;h--){const l=s[h],u=this.hitTestMoveRecursive(l,this._isInteractive(e)?e:l.eventMode,r,i,n,o||n(t,r));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const e=t.isInteractive();(u.length>0||e)&&(e&&this._allInteractiveElements.push(t),u.push(t)),0===this._hitElements.length&&(this._hitElements=u),a=!0}}}const h=this._isInteractive(e),l=t.isInteractive();return h&&l&&this._allInteractiveElements.push(t),o||this._hitElements.length>0?null:a?this._hitElements:h&&!n(t,r)&&i(t,r)?l?[t]:[]:null}hitTestRecursive(t,e,r,i,n){if(this._interactivePrune(t)||n(t,r))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(s.EventsTicker.pauseUpdate=!1),t.interactiveChildren&&t.children){const s=t.children;for(let o=s.length-1;o>=0;o--){const a=s[o],h=this.hitTestRecursive(a,this._isInteractive(e)?e:a.eventMode,r,i,n);if(h){if(h.length>0&&!h[h.length-1].parent)continue;const e=t.isInteractive();return(h.length>0||e)&&h.push(t),h}}}const o=this._isInteractive(e),a=t.isInteractive();return o&&i(t,r)?a?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&!t.isMask&&t.visible&&t.renderable&&"none"!==t.eventMode&&("passive"!==t.eventMode||t.interactiveChildren)&&!t.isMask)}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,l),!t.hitArea.contains(l.x,l.y)))return!0;if(t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;if(r&&!r.containsPoint?.(e))return!0}return!1}hitTestFn(t,e){return"passive"!==t.eventMode&&(!!t.hitArea||!!t.containsPoint&&t.containsPoint(e))}notifyTarget(t,e){const r=`on${e=e??t.type}`;t.currentTarget[r]?.(t);const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof o.FederatedPointerEvent))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)this.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){const t=2===e.button;this.dispatchEvent(e,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){if(!(t instanceof o.FederatedPointerEvent))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const r="mouse"===e.pointerType||"pen"===e.pointerType,i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.overTargets);if(i.overTargets?.length>0&&s!==e.target){const i="mousemove"===t.type?"mouseout":"pointerout",n=this.createPointerEvent(t,i,s);if(this.dispatchEvent(n,"pointerout"),r&&this.dispatchEvent(n,"mouseout"),!e.composedPath().includes(s)){const i=this.createPointerEvent(t,"pointerleave",s);for(i.eventPhase=i.AT_TARGET;i.target&&!e.composedPath().includes(i.target);)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,"mouseleave"),i.target=i.target.parent;this.freeEvent(i)}this.freeEvent(n)}if(s!==e.target){const i="mousemove"===t.type?"mouseover":"pointerover",n=this.clonePointerEvent(e,i);this.dispatchEvent(n,"pointerover"),r&&this.dispatchEvent(n,"mouseover");let o=s?.parent;for(;o&&o!==this.rootTarget.parent&&o!==e.target;)o=o.parent;if(!o||o===this.rootTarget.parent){const t=this.clonePointerEvent(e,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==s&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}const n=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?n.push("pointermove"):this.dispatchEvent(e,"pointermove"),a&&n.push("globalpointermove"),"touch"===e.pointerType&&(this.moveOnAll?n.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),a&&n.push("globaltouchmove")),r&&(this.moveOnAll?n.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),a&&n.push("globalmousemove"),this.cursor=e.target?.cursor),n.length>0&&this.all(e,n),this._allInteractiveElements.length=0,this._hitElements.length=0,i.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){if(!(t instanceof o.FederatedPointerEvent))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),r=this.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;this.dispatchEvent(r,"pointerover"),i&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursor=r.target?.cursor);const s=this.clonePointerEvent(r,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),i&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;e.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(s)}mapPointerOut(t){if(!(t instanceof o.FederatedPointerEvent))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId);if(e.overTargets){const r="mouse"===t.pointerType||"pen"===t.pointerType,i=this.findMountedTarget(e.overTargets),s=this.createPointerEvent(t,"pointerout",i);this.dispatchEvent(s),r&&this.dispatchEvent(s,"mouseout");const n=this.createPointerEvent(t,"pointerleave",i);for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),r&&this.notifyTarget(n,"mouseleave"),n.target=n.target.parent;e.overTargets=null,this.freeEvent(s),this.freeEvent(n)}this.cursor=null}mapPointerUp(t){if(!(t instanceof o.FederatedPointerEvent))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=performance.now(),r=this.createPointerEvent(t);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){const t=2===r.button;this.dispatchEvent(r,t?"rightup":"mouseup")}const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]);let n=s;if(s&&!r.composedPath().includes(s)){let e=s;for(;e&&!r.composedPath().includes(e);){if(r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){const t=2===r.button;this.notifyTarget(r,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete i.pressTargetsByButton[t.button],n=e}if(n){const s=this.clonePointerEvent(r,"click");s.target=n,s.path=null,i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:s.target,timeStamp:e});const o=i.clicksByButton[t.button];if(o.target===s.target&&e-o.timeStamp<200?++o.clickCount:o.clickCount=1,o.target=s.target,o.timeStamp=e,s.detail=o.clickCount,"mouse"===s.pointerType){const t=2===s.button;this.dispatchEvent(s,t?"rightclick":"click")}else"touch"===s.pointerType&&this.dispatchEvent(s,"tap");this.dispatchEvent(s,"pointertap"),this.freeEvent(s)}this.freeEvent(r)}mapPointerUpOutside(t){if(!(t instanceof o.FederatedPointerEvent))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),r=this.findMountedTarget(e.pressTargetsByButton[t.button]),i=this.createPointerEvent(t);if(r){let s=r;for(;s;)i.currentTarget=s,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?this.notifyTarget(i,"touchendoutside"):("mouse"===i.pointerType||"pen"===i.pointerType)&&this.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),s=s.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(i)}mapWheel(t){if(!(t instanceof a.FederatedWheelEvent))return void console.warn("EventBoundary cannot map a non-wheel event as a wheel event");const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let r=1;r<t.length&&t[r].parent===e;r++)e=t[r];return e}createPointerEvent(t,e,r){const i=this.allocateEvent(o.FederatedPointerEvent);return this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=r??this.hitTest(i.global.x,i.global.y)??this._hitElements[0],"string"==typeof e&&(i.type=e),i}createWheelEvent(t){const e=this.allocateEvent(a.FederatedWheelEvent);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const r=this.allocateEvent(o.FederatedPointerEvent);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=e??r.type,r}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof o.FederatedPointerEvent&&e instanceof o.FederatedPointerEvent&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof n.FederatedMouseEvent&&e instanceof n.FederatedMouseEvent&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}notifyListeners(t,e){const r=t.currentTarget._events[e];if(r&&t.currentTarget.isInteractive())if("fn"in r)r.once&&t.currentTarget.removeListener(e,r.fn,void 0,!0),r.fn.call(r.context,t);else for(let i=0,s=r.length;i<s&&!t.propagationImmediatelyStopped;i++)r[i].once&&t.currentTarget.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(r[i].context,t)}}},3647:(t,e,r)=>{"use strict";var i=r(6782);const s={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:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",samplerCube:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",sampler2DArray:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }"},n={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)"};e.generateUniformsSync=function(t,e){const r=["\n        var v = null;\n        var cv = null;\n        var cu = null;\n        var t = 0;\n        var gl = renderer.gl;\n    "];for(const o in t.uniforms){const a=e[o];if(!a){!0===t.uniforms[o]?.group&&(t.uniforms[o].ubo?r.push(`\n                        renderer.shader.syncUniformBufferGroup(uv.${o}, '${o}');\n                    `):r.push(`\n                        renderer.shader.syncUniformGroup(uv.${o}, syncData);\n                    `));continue}const h=t.uniforms[o];let l=!1;for(let t=0;t<i.uniformParsers.length;t++)if(i.uniformParsers[t].test(a,h)){r.push(i.uniformParsers[t].code(o,h)),l=!0;break}if(!l){const t=(1!==a.size||a.isArray?n:s)[a.type].replace("location",`ud["${o}"].location`);r.push(`\n            cu = ud["${o}"];\n            cv = cu.value;\n            v = uv["${o}"];\n            ${t};`)}}return new Function("ud","uv","renderer","syncData",r.join("\n"))}},3701:(t,e)=>{"use strict";e.getBufferType=function(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}},3752:(t,e,r)=>{"use strict";var i=r(5153);t.exports=i.getPrototypeOf||null},3801:(t,e,r)=>{"use strict";var i=r(3386);e.Resource=class{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new i.Runner("setRealSize"),this.onUpdate=new i.Runner("update"),this.onError=new i.Runner("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,r){return!1}dispose(){}destroy(){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)}static test(t,e){return!1}}},3816:(t,e,r)=>{"use strict";var i=r(2935),s=r(865);class n extends s.FillStyle{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=i.LINE_CAP.BUTT,this.join=i.LINE_JOIN.MITER,this.miterLimit=10}clone(){const t=new n;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}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1,this.cap=i.LINE_CAP.BUTT,this.join=i.LINE_JOIN.MITER,this.miterLimit=10}}e.LineStyle=n},3859:(t,e,r)=>{"use strict";var i=r(1300),s=r(5254);let n,o=0;const a=new class{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return void 0!==this._isImageBitmapSupported||(this._isImageBitmapSupported=new Promise((t=>{const{worker:e}=new i.default;e.addEventListener("message",(r=>{e.terminate(),i.default.revokeObjectURL(),t(r.data)}))}))),this._isImageBitmapSupported}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){void 0===n&&(n=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers<n&&(this._createdWorkers++,t=(new s.default).worker,t.addEventListener("message",(t=>{this.complete(t.data),this.returnWorker(t.target),this.next()}))),t}returnWorker(t){this.workerPool.push(t)}complete(t){void 0!==t.error?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const r=new Promise(((r,i)=>{this.queue.push({id:t,arguments:e,resolve:r,reject:i})}));return this.next(),r}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),r=e.id;this.resolveHash[o]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:o++,id:r})}};e.WorkerManager=a},3869:(t,e,r)=>{"use strict";var i=r(9878);class s extends i.BufferResource{constructor(t,e={width:1,height:1,autoLoad:!0}){let r,s;"string"==typeof t?(r=t,s=new Uint8Array):(r=null,s=t),super(s,e),this.origin=r,this.buffer=s?new i.ViewableBuffer(s):null,this._load=null,this.loaded=!1,null!==this.origin&&!1!==e.autoLoad&&this.load(),null===this.origin&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load||(this._load=fetch(this.origin).then((t=>t.blob())).then((t=>t.arrayBuffer())).then((t=>(this.data=new Uint32Array(t),this.buffer=new i.ViewableBuffer(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)))),this._load}}e.BlobResource=s},3882:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,"img{user-select:none;width:32px;height:32px}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},3937:(t,e)=>{"use strict";var r=(t=>(t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",t))(r||{});e.TEXT_GRADIENT=r},3943:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ArgumentOutOfRangeError:()=>xt,AsyncSubject:()=>it,BehaviorSubject:()=>L,ConnectableObservable:()=>I,EMPTY:()=>j,EmptyError:()=>bt,GroupedObservable:()=>O,NEVER:()=>fe,Notification:()=>Q,NotificationKind:()=>X,ObjectUnsubscribedError:()=>A,Observable:()=>T,ReplaySubject:()=>et,Scheduler:()=>k,Subject:()=>P,Subscriber:()=>m,Subscription:()=>d,TimeoutError:()=>Tt,UnsubscriptionError:()=>c,VirtualAction:()=>yt,VirtualTimeScheduler:()=>gt,animationFrame:()=>mt,animationFrameScheduler:()=>ft,asap:()=>ut,asapScheduler:()=>lt,async:()=>dt,asyncScheduler:()=>ct,bindCallback:()=>wt,bindNodeCallback:()=>Mt,combineLatest:()=>jt,concat:()=>te,config:()=>o,defer:()=>ee,empty:()=>V,forkJoin:()=>re,from:()=>zt,fromEvent:()=>se,fromEventPattern:()=>oe,generate:()=>ae,identity:()=>v,iif:()=>le,interval:()=>ce,isObservable:()=>vt,merge:()=>pe,never:()=>me,noop:()=>_t,observable:()=>_,of:()=>q,onErrorResumeNext:()=>ge,pairs:()=>ye,partition:()=>Ee,pipe:()=>x,queue:()=>H,queueScheduler:()=>G,race:()=>Ae,range:()=>Pe,scheduled:()=>Xt,throwError:()=>K,timer:()=>Me,using:()=>Ie,zip:()=>De});var i=r(5927);function s(t){return"function"==typeof t}var n=!1,o={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack,n=t},get useDeprecatedSynchronousErrorHandling(){return n}};function a(t){setTimeout((function(){throw t}),0)}var h={closed:!0,next:function(t){},error:function(t){if(o.useDeprecatedSynchronousErrorHandling)throw t;a(t)},complete:function(){}},l=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function u(t){return null!==t&&"object"==typeof t}var c=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),d=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,i=r._parentOrParents,n=r._ctorUnsubscribe,o=r._unsubscribe,a=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof t)i.remove(this);else if(null!==i)for(var h=0;h<i.length;++h)i[h].remove(this);if(s(o)){n&&(this._unsubscribe=void 0);try{o.call(this)}catch(t){e=t instanceof c?p(t.errors):[t]}}if(l(a)){h=-1;for(var d=a.length;++h<d;){var f=a[h];if(u(f))try{f.unsubscribe()}catch(t){e=e||[],t instanceof c?e=e.concat(p(t.errors)):e.push(t)}}}if(e)throw new c(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var i=r;(r=new t)._subscriptions=[i]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var s=r._parentOrParents;if(null===s)r._parentOrParents=this;else if(s instanceof t){if(s===this)return r;r._parentOrParents=[s,this]}else{if(-1!==s.indexOf(this))return r;s.push(this)}var n=this._subscriptions;return null===n?this._subscriptions=[r]:n.push(r),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function p(t){return t.reduce((function(t,e){return t.concat(e instanceof c?e.errors:e)}),[])}var f=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),m=function(t){function e(r,i,s){var n=t.call(this)||this;switch(n.syncErrorValue=null,n.syncErrorThrown=!1,n.syncErrorThrowable=!1,n.isStopped=!1,arguments.length){case 0:n.destination=h;break;case 1:if(!r){n.destination=h;break}if("object"==typeof r){r instanceof e?(n.syncErrorThrowable=r.syncErrorThrowable,n.destination=r,r.add(n)):(n.syncErrorThrowable=!0,n.destination=new g(n,r));break}default:n.syncErrorThrowable=!0,n.destination=new g(n,r,i,s)}return n}return i.C6(e,t),e.prototype[f]=function(){return this},e.create=function(t,r,i){var s=new e(t,r,i);return s.syncErrorThrowable=!1,s},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(d),g=function(t){function e(e,r,i,n){var o,a=t.call(this)||this;a._parentSubscriber=e;var l=a;return s(r)?o=r:r&&(o=r.next,i=r.error,n=r.complete,r!==h&&(s((l=Object.create(r)).unsubscribe)&&a.add(l.unsubscribe.bind(l)),l.unsubscribe=a.unsubscribe.bind(a))),a._context=l,a._next=o,a._error=i,a._complete=n,a}return i.C6(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;o.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,r=o.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):a(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;a(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};o.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),o.useDeprecatedSynchronousErrorHandling)throw t;a(t)}},e.prototype.__tryOrSetError=function(t,e,r){if(!o.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return o.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(a(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(m);function y(t){for(;t;){var e=t,r=e.closed,i=e.destination,s=e.isStopped;if(r||s)return!1;t=i&&i instanceof m?i:null}return!0}var _=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function v(t){return t}function x(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return b(t)}function b(t){return 0===t.length?v:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var T=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var i=this.operator,s=function(t,e,r){if(t){if(t instanceof m)return t;if(t[f])return t[f]()}return t||e||r?new m(t,e,r):new m(h)}(t,e,r);if(i?s.add(i.call(s,this.source)):s.add(this.source||o.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),o.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){o.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),y(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=E(e))((function(e,i){var s;s=r.subscribe((function(e){try{t(e)}catch(t){i(t),s&&s.unsubscribe()}}),i,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[_]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:b(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=E(t))((function(t,r){var i;e.subscribe((function(t){return i=t}),(function(t){return r(t)}),(function(){return t(i)}))}))},t.create=function(e){return new t(e)},t}();function E(t){if(t||(t=o.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var A=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),S=function(t){function e(e,r){var i=t.call(this)||this;return i.subject=e,i.subscriber=r,i.closed=!1,i}return i.C6(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(d),w=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return i.C6(e,t),e}(m),P=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return i.C6(e,t),e.prototype[f]=function(){return new w(this)},e.prototype.lift=function(t){var e=new R(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new A;if(!this.isStopped)for(var e=this.observers,r=e.length,i=e.slice(),s=0;s<r;s++)i[s].next(t)},e.prototype.error=function(t){if(this.closed)throw new A;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,i=e.slice(),s=0;s<r;s++)i[s].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new A;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),i=0;i<e;i++)r[i].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new A;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new A;return this.hasError?(t.error(this.thrownError),d.EMPTY):this.isStopped?(t.complete(),d.EMPTY):(this.observers.push(t),new S(this,t))},e.prototype.asObservable=function(){var t=new T;return t.source=this,t},e.create=function(t,e){return new R(t,e)},e}(T),R=function(t){function e(e,r){var i=t.call(this)||this;return i.destination=e,i.source=r,i}return i.C6(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):d.EMPTY},e}(P),M=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var i=new C(t,r),s=e.subscribe(i);return i.closed||(i.connection=r.connect()),s},t}(),C=function(t){function e(e,r){var i=t.call(this,e)||this;return i.connectable=r,i}return i.C6(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,i=t._connection;this.connection=null,!i||r&&i!==r||i.unsubscribe()}}else this.connection=null},e}(m),I=function(t){function e(e,r){var i=t.call(this)||this;return i.source=e,i.subjectFactory=r,i._refCount=0,i._isComplete=!1,i}return i.C6(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new d).add(this.source.subscribe(new D(this.getSubject(),this))),t.closed&&(this._connection=null,t=d.EMPTY)),t},e.prototype.refCount=function(){return(t=this).lift(new M(t));var t},e}(T),D=function(t){function e(e,r){var i=t.call(this,e)||this;return i.connectable=r,i}return i.C6(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(w),O=function(t){function e(e,r,i){var s=t.call(this)||this;return s.key=e,s.groupSubject=r,s.refCountSubscription=i,s}return i.C6(e,t),e.prototype._subscribe=function(t){var e=new d,r=this.refCountSubscription,i=this.groupSubject;return r&&!r.closed&&e.add(new B(r)),e.add(i.subscribe(t)),e},e}(T),B=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,e.count++,r}return i.C6(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(d),L=function(t){function e(e){var r=t.call(this)||this;return r._value=e,r}return i.C6(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);return r&&!r.closed&&e.next(this._value),r},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new A;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(P),N=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i.pending=!1,i}return i.C6(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,i=void 0;try{this.work(t)}catch(t){r=!0,i=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),i},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,i=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&r.splice(i,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,r){return t.call(this)||this}return i.C6(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(d)),F=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return i.C6(e,t),e.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,i):e.flush(this)},e}(N),k=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}(),U=function(t){function e(r,i){void 0===i&&(i=k.now);var s=t.call(this,r,(function(){return e.delegate&&e.delegate!==s?e.delegate.now():i()}))||this;return s.actions=[],s.active=!1,s.scheduled=void 0,s}return i.C6(e,t),e.prototype.schedule=function(r,i,s){return void 0===i&&(i=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,i,s):t.prototype.schedule.call(this,r,i,s)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(k),G=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.C6(e,t),e}(U))(F),H=G,j=new T((function(t){return t.complete()}));function V(t){return t?function(t){return new T((function(e){return t.schedule((function(){return e.complete()}))}))}(t):j}function $(t){return t&&"function"==typeof t.schedule}var X,z=function(t){return function(e){for(var r=0,i=t.length;r<i&&!e.closed;r++)e.next(t[r]);e.complete()}};function W(t,e){return new T((function(r){var i=new d,s=0;return i.add(e.schedule((function(){s!==t.length?(r.next(t[s++]),r.closed||i.add(this.schedule())):r.complete()}))),i}))}function Y(t,e){return e?W(t,e):new T(z(t))}function q(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return $(r)?(t.pop(),W(t,r)):Y(t)}function K(t,e){return new T(e?function(r){return e.schedule(Z,0,{error:t,subscriber:r})}:function(e){return e.error(t)})}function Z(t){var e=t.error;t.subscriber.error(e)}X||(X={});var Q=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){switch(this.kind){case"N":return q(this.value);case"E":return K(this.error);case"C":return V()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}(),J=function(t){function e(e,r,i){void 0===i&&(i=0);var s=t.call(this,e)||this;return s.scheduler=r,s.delay=i,s}return i.C6(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new tt(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(Q.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(Q.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(Q.createComplete()),this.unsubscribe()},e}(m),tt=function(){return function(t,e){this.notification=t,this.destination=e}}(),et=function(t){function e(e,r,i){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var s=t.call(this)||this;return s.scheduler=i,s._events=[],s._infiniteTimeWindow=!1,s._bufferSize=e<1?1:e,s._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(s._infiniteTimeWindow=!0,s.next=s.nextInfiniteTimeWindow):s.next=s.nextTimeWindow,s}return i.C6(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new rt(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,i=r?this._events:this._trimBufferThenGetEvents(),s=this.scheduler,n=i.length;if(this.closed)throw new A;if(this.isStopped||this.hasError?e=d.EMPTY:(this.observers.push(t),e=new S(this,t)),s&&t.add(t=new J(t,s)),r)for(var o=0;o<n&&!t.closed;o++)t.next(i[o]);else for(o=0;o<n&&!t.closed;o++)t.next(i[o].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||H).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,r=this._windowTime,i=this._events,s=i.length,n=0;n<s&&!(t-i[n].time<r);)n++;return s>e&&(n=Math.max(n,s-e)),n>0&&i.splice(0,n),i},e}(P),rt=function(){return function(t,e){this.time=t,this.value=e}}(),it=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return i.C6(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),d.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),d.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(P),st=1,nt=function(){return Promise.resolve()}(),ot={};function at(t){return t in ot&&(delete ot[t],!0)}var ht=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return i.C6(e,t),e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,r,i):(e.actions.push(this),e.scheduled||(e.scheduled=(s=e.flush.bind(e,null),n=st++,ot[n]=!0,nt.then((function(){return at(n)&&s()})),n)));var s,n},e.prototype.recycleAsyncId=function(e,r,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,i);0===e.actions.length&&(at(r),e.scheduled=void 0)},e}(N),lt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.C6(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,i=-1,s=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i<s&&(t=r.shift()));if(this.active=!1,e){for(;++i<s&&(t=r.shift());)t.unsubscribe();throw e}},e}(U))(ht),ut=lt,ct=new U(N),dt=ct,pt=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.scheduler=e,i.work=r,i}return i.C6(e,t),e.prototype.requestAsyncId=function(e,r,i){return void 0===i&&(i=0),null!==i&&i>0?t.prototype.requestAsyncId.call(this,e,r,i):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,r,i){if(void 0===i&&(i=0),null!==i&&i>0||null===i&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,i);0===e.actions.length&&(cancelAnimationFrame(r),e.scheduled=void 0)},e}(N),ft=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.C6(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,r=this.actions,i=-1,s=r.length;t=t||r.shift();do{if(e=t.execute(t.state,t.delay))break}while(++i<s&&(t=r.shift()));if(this.active=!1,e){for(;++i<s&&(t=r.shift());)t.unsubscribe();throw e}},e}(U))(pt),mt=ft,gt=function(t){function e(e,r){void 0===e&&(e=yt),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e,(function(){return i.frame}))||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return i.C6(e,t),e.prototype.flush=function(){for(var t,e,r=this.actions,i=this.maxFrames;(e=r[0])&&e.delay<=i&&(r.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=r.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10,e}(U),yt=function(t){function e(e,r,i){void 0===i&&(i=e.index+=1);var s=t.call(this,e,r)||this;return s.scheduler=e,s.work=r,s.index=i,s.active=!0,s.index=e.index=i,s}return i.C6(e,t),e.prototype.schedule=function(r,i){if(void 0===i&&(i=0),!this.id)return t.prototype.schedule.call(this,r,i);this.active=!1;var s=new e(this.scheduler,this.work);return this.add(s),s.schedule(r,i)},e.prototype.requestAsyncId=function(t,r,i){void 0===i&&(i=0),this.delay=t.frame+i;var s=t.actions;return s.push(this),s.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,r){void 0===r&&(r=0)},e.prototype._execute=function(e,r){if(!0===this.active)return t.prototype._execute.call(this,e,r)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(N);function _t(){}function vt(t){return!!t&&(t instanceof T||"function"==typeof t.lift&&"function"==typeof t.subscribe)}var xt=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),bt=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),Tt=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}();function Et(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new At(t,e))}}var At=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new St(t,this.project,this.thisArg))},t}(),St=function(t){function e(e,r,i){var s=t.call(this,e)||this;return s.project=r,s.count=0,s.thisArg=i||s,s}return i.C6(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(m);function wt(t,e,r){if(e){if(!$(e))return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return wt(t,r).apply(void 0,i).pipe(Et((function(t){return l(t)?e.apply(void 0,t):e(t)})))};r=e}return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var s,n=this,o={context:n,subject:s,callbackFunc:t,scheduler:r};return new T((function(i){if(r){var a={args:e,subscriber:i,params:o};return r.schedule(Pt,0,a)}if(!s){s=new it;try{t.apply(n,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];s.next(t.length<=1?t[0]:t),s.complete()}]))}catch(t){y(s)?s.error(t):console.warn(t)}}return s.subscribe(i)}))}}function Pt(t){var e=this,r=t.args,i=t.subscriber,s=t.params,n=s.callbackFunc,o=s.context,a=s.scheduler,h=s.subject;if(!h){h=s.subject=new it;try{n.apply(o,r.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t.length<=1?t[0]:t;e.add(a.schedule(Rt,0,{value:i,subject:h}))}]))}catch(t){h.error(t)}}this.add(h.subscribe(i))}function Rt(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function Mt(t,e,r){if(e){if(!$(e))return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return Mt(t,r).apply(void 0,i).pipe(Et((function(t){return l(t)?e.apply(void 0,t):e(t)})))};r=e}return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var s={subject:void 0,args:e,callbackFunc:t,scheduler:r,context:this};return new T((function(i){var n=s.context,o=s.subject;if(r)return r.schedule(Ct,0,{params:s,subscriber:i,context:n});if(!o){o=s.subject=new it;try{t.apply(n,e.concat([function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.shift();r?o.error(r):(o.next(t.length<=1?t[0]:t),o.complete())}]))}catch(t){y(o)?o.error(t):console.warn(t)}}return o.subscribe(i)}))}}function Ct(t){var e=this,r=t.params,i=t.subscriber,s=t.context,n=r.callbackFunc,o=r.args,a=r.scheduler,h=r.subject;if(!h){h=r.subject=new it;try{n.apply(s,o.concat([function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=t.shift();if(i)e.add(a.schedule(Dt,0,{err:i,subject:h}));else{var s=t.length<=1?t[0]:t;e.add(a.schedule(It,0,{value:s,subject:h}))}}]))}catch(t){this.add(a.schedule(Dt,0,{err:t,subject:h}))}}this.add(h.subscribe(i))}function It(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function Dt(t){var e=t.err;t.subject.error(e)}var Ot=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.C6(e,t),e.prototype.notifyNext=function(t,e,r,i,s){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(m),Bt=function(t){function e(e,r,i){var s=t.call(this)||this;return s.parent=e,s.outerValue=r,s.outerIndex=i,s.index=0,s}return i.C6(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(m);function Lt(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Nt=Lt(),Ft=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function kt(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var Ut=function(t){if(t&&"function"==typeof t[_])return i=t,function(t){var e=i[_]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Ft(t))return z(t);if(kt(t))return r=t,function(t){return r.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,a),t};if(t&&"function"==typeof t[Nt])return e=t,function(t){for(var r=e[Nt]();;){var i=void 0;try{i=r.next()}catch(e){return t.error(e),t}if(i.done){t.complete();break}if(t.next(i.value),t.closed)break}return"function"==typeof r.return&&t.add((function(){r.return&&r.return()})),t};var e,r,i,s=u(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+s+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function Gt(t,e,r,i,s){if(void 0===s&&(s=new Bt(t,r,i)),!s.closed)return e instanceof T?e.subscribe(s):Ut(e)(s)}var Ht={};function jt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,i=void 0;return $(t[t.length-1])&&(i=t.pop()),"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&l(t[0])&&(t=t[0]),Y(t,i).lift(new Vt(r))}var Vt=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new $t(t,this.resultSelector))},t}(),$t=function(t){function e(e,r){var i=t.call(this,e)||this;return i.resultSelector=r,i.active=0,i.values=[],i.observables=[],i}return i.C6(e,t),e.prototype._next=function(t){this.values.push(Ht),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var r=0;r<e;r++){var i=t[r];this.add(Gt(this,i,void 0,r))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,r){var i=this.values,s=i[r],n=this.toRespond?s===Ht?--this.toRespond:this.toRespond:0;i[r]=e,0===n&&(this.resultSelector?this._tryResultSelector(i):this.destination.next(i.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Ot);function Xt(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[_]}(t))return function(t,e){return new T((function(r){var i=new d;return i.add(e.schedule((function(){var s=t[_]();i.add(s.subscribe({next:function(t){i.add(e.schedule((function(){return r.next(t)})))},error:function(t){i.add(e.schedule((function(){return r.error(t)})))},complete:function(){i.add(e.schedule((function(){return r.complete()})))}}))}))),i}))}(t,e);if(kt(t))return function(t,e){return new T((function(r){var i=new d;return i.add(e.schedule((function(){return t.then((function(t){i.add(e.schedule((function(){r.next(t),i.add(e.schedule((function(){return r.complete()})))})))}),(function(t){i.add(e.schedule((function(){return r.error(t)})))}))}))),i}))}(t,e);if(Ft(t))return W(t,e);if(function(t){return t&&"function"==typeof t[Nt]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new T((function(r){var i,s=new d;return s.add((function(){i&&"function"==typeof i.return&&i.return()})),s.add(e.schedule((function(){i=t[Nt](),s.add(e.schedule((function(){if(!r.closed){var t,e;try{var s=i.next();t=s.value,e=s.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}})))}))),s}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function zt(t,e){return e?Xt(t,e):t instanceof T?t:new T(Ut(t))}var Wt=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,r}return i.C6(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(m),Yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.C6(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(m);function qt(t,e){if(!e.closed){if(t instanceof T)return t.subscribe(e);var r;try{r=Ut(t)(e)}catch(t){e.error(t)}return r}}function Kt(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?function(i){return i.pipe(Kt((function(r,i){return zt(t(r,i)).pipe(Et((function(t,s){return e(r,t,i,s)})))}),r))}:("number"==typeof e&&(r=e),function(e){return e.lift(new Zt(t,r))})}var Zt=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new Qt(t,this.project,this.concurrent))},t}(),Qt=function(t){function e(e,r,i){void 0===i&&(i=Number.POSITIVE_INFINITY);var s=t.call(this,e)||this;return s.project=r,s.concurrent=i,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return i.C6(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new Wt(this),r=this.destination;r.add(e);var i=qt(t,e);i!==e&&r.add(i)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(Yt);function Jt(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Kt(v,t)}function te(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Jt(1)(q.apply(void 0,t))}function ee(t){return new T((function(e){var r;try{r=t()}catch(t){return void e.error(t)}return(r?zt(r):V()).subscribe(e)}))}function re(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){var r=t[0];if(l(r))return ie(r,null);if(u(r)&&Object.getPrototypeOf(r)===Object.prototype){var i=Object.keys(r);return ie(i.map((function(t){return r[t]})),i)}}if("function"==typeof t[t.length-1]){var s=t.pop();return ie(t=1===t.length&&l(t[0])?t[0]:t,null).pipe(Et((function(t){return s.apply(void 0,t)})))}return ie(t,null)}function ie(t,e){return new T((function(r){var i=t.length;if(0!==i)for(var s=new Array(i),n=0,o=0,a=function(a){var h=zt(t[a]),l=!1;r.add(h.subscribe({next:function(t){l||(l=!0,o++),s[a]=t},error:function(t){return r.error(t)},complete:function(){++n!==i&&l||(o===i&&r.next(e?e.reduce((function(t,e,r){return t[e]=s[r],t}),{}):s),r.complete())}}))},h=0;h<i;h++)a(h);else r.complete()}))}function se(t,e,r,i){return s(r)&&(i=r,r=void 0),i?se(t,e,r).pipe(Et((function(t){return l(t)?i.apply(void 0,t):i(t)}))):new T((function(i){ne(t,e,(function(t){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(t)}),i,r)}))}function ne(t,e,r,i,s){var n;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(t)){var o=t;t.addEventListener(e,r,s),n=function(){return o.removeEventListener(e,r,s)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(t)){var a=t;t.on(e,r),n=function(){return a.off(e,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(t)){var h=t;t.addListener(e,r),n=function(){return h.removeListener(e,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var l=0,u=t.length;l<u;l++)ne(t[l],e,r,i,s)}i.add(n)}function oe(t,e,r){return r?oe(t,e).pipe(Et((function(t){return l(t)?r.apply(void 0,t):r(t)}))):new T((function(r){var i,n=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.next(1===t.length?t[0]:t)};try{i=t(n)}catch(t){return void r.error(t)}if(s(e))return function(){return e(n,i)}}))}function ae(t,e,r,i,s){var n,o;if(1==arguments.length){var a=t;o=a.initialState,e=a.condition,r=a.iterate,n=a.resultSelector||v,s=a.scheduler}else void 0===i||$(i)?(o=t,n=v,s=i):(o=t,n=i);return new T((function(t){var i=o;if(s)return s.schedule(he,0,{subscriber:t,iterate:r,condition:e,resultSelector:n,state:i});for(;;){if(e){var a=void 0;try{a=e(i)}catch(e){return void t.error(e)}if(!a){t.complete();break}}var h=void 0;try{h=n(i)}catch(e){return void t.error(e)}if(t.next(h),t.closed)break;try{i=r(i)}catch(e){return void t.error(e)}}}))}function he(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(r){var i=void 0;try{i=r(t.state)}catch(t){return void e.error(t)}if(!i)return void e.complete();if(e.closed)return}var s;try{s=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(s),!e.closed))return this.schedule(t)}}function le(t,e,r){return void 0===e&&(e=j),void 0===r&&(r=j),ee((function(){return t()?e:r}))}function ue(t){return!l(t)&&t-parseFloat(t)+1>=0}function ce(t,e){return void 0===t&&(t=0),void 0===e&&(e=dt),(!ue(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=dt),new T((function(r){return r.add(e.schedule(de,t,{subscriber:r,counter:0,period:t})),r}))}function de(t){var e=t.subscriber,r=t.counter,i=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:i},i)}function pe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,i=null,s=t[t.length-1];return $(s)?(i=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof s&&(r=t.pop()),null===i&&1===t.length&&t[0]instanceof T?t[0]:Jt(r)(Y(t,i))}var fe=new T(_t);function me(){return fe}function ge(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return j;var r=t[0],i=t.slice(1);return 1===t.length&&l(r)?ge.apply(void 0,r):new T((function(t){var e=function(){return t.add(ge.apply(void 0,i).subscribe(t))};return zt(r).subscribe({next:function(e){t.next(e)},error:e,complete:e})}))}function ye(t,e){return new T(e?function(r){var i=Object.keys(t),s=new d;return s.add(e.schedule(_e,0,{keys:i,index:0,subscriber:r,subscription:s,obj:t})),s}:function(e){for(var r=Object.keys(t),i=0;i<r.length&&!e.closed;i++){var s=r[i];t.hasOwnProperty(s)&&e.next([s,t[s]])}e.complete()})}function _e(t){var e=t.keys,r=t.index,i=t.subscriber,s=t.subscription,n=t.obj;if(!i.closed)if(r<e.length){var o=e[r];i.next([o,n[o]]),s.add(this.schedule({keys:e,index:r+1,subscriber:i,subscription:s,obj:n}))}else i.complete()}function ve(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}function xe(t,e){return function(r){return r.lift(new be(t,e))}}var be=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new Te(t,this.predicate,this.thisArg))},t}(),Te=function(t){function e(e,r,i){var s=t.call(this,e)||this;return s.predicate=r,s.thisArg=i,s.count=0,s}return i.C6(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(m);function Ee(t,e,r){return[xe(e,r)(new T(Ut(t))),xe(ve(e,r))(new T(Ut(t)))]}function Ae(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!l(t[0]))return t[0];t=t[0]}return Y(t,void 0).lift(new Se)}var Se=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new we(t))},t}(),we=function(t){function e(e){var r=t.call(this,e)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return i.C6(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var r=0;r<e&&!this.hasFirst;r++){var i=Gt(this,t[r],void 0,r);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},e.prototype.notifyNext=function(t,e,r){if(!this.hasFirst){this.hasFirst=!0;for(var i=0;i<this.subscriptions.length;i++)if(i!==r){var s=this.subscriptions[i];s.unsubscribe(),this.remove(s)}this.subscriptions=null}this.destination.next(e)},e}(Ot);function Pe(t,e,r){return void 0===t&&(t=0),new T((function(i){void 0===e&&(e=t,t=0);var s=0,n=t;if(r)return r.schedule(Re,0,{index:s,count:e,start:t,subscriber:i});for(;;){if(s++>=e){i.complete();break}if(i.next(n++),i.closed)break}}))}function Re(t){var e=t.start,r=t.index,i=t.count,s=t.subscriber;r>=i?s.complete():(s.next(e),s.closed||(t.index=r+1,t.start=e+1,this.schedule(t)))}function Me(t,e,r){void 0===t&&(t=0);var i=-1;return ue(e)?i=Number(e)<1?1:Number(e):$(e)&&(r=e),$(r)||(r=dt),new T((function(e){var s=ue(t)?t:+t-r.now();return r.schedule(Ce,s,{index:0,period:i,subscriber:e})}))}function Ce(t){var e=t.index,r=t.period,i=t.subscriber;if(i.next(e),!i.closed){if(-1===r)return i.complete();t.index=e+1,this.schedule(t,r)}}function Ie(t,e){return new T((function(r){var i,s;try{i=t()}catch(t){return void r.error(t)}try{s=e(i)}catch(t){return void r.error(t)}var n=(s?zt(s):j).subscribe(r);return function(){n.unsubscribe(),i&&i.unsubscribe()}}))}function De(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return"function"==typeof r&&t.pop(),Y(t,void 0).lift(new Oe(r))}var Oe=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new Be(t,this.resultSelector))},t}(),Be=function(t){function e(e,r,i){void 0===i&&(i=Object.create(null));var s=t.call(this,e)||this;return s.resultSelector=r,s.iterators=[],s.active=0,s.resultSelector="function"==typeof r?r:void 0,s}return i.C6(e,t),e.prototype._next=function(t){var e=this.iterators;l(t)?e.push(new Ne(t)):"function"==typeof t[Nt]?e.push(new Le(t[Nt]())):e.push(new Fe(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var r=0;r<e;r++){var i=t[r];i.stillUnsubscribed?this.destination.add(i.subscribe()):this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,r=this.destination,i=0;i<e;i++)if("function"==typeof(o=t[i]).hasValue&&!o.hasValue())return;var s=!1,n=[];for(i=0;i<e;i++){var o,a=(o=t[i]).next();if(o.hasCompleted()&&(s=!0),a.done)return void r.complete();n.push(a.value)}this.resultSelector?this._tryresultSelector(n):r.next(n),s&&r.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(m),Le=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),Ne=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[Nt]=function(){return this},t.prototype.next=function(t){var e=this.index++,r=this.array;return e<this.length?{value:r[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),Fe=function(t){function e(e,r,i){var s=t.call(this,e)||this;return s.parent=r,s.observable=i,s.stillUnsubscribed=!0,s.buffer=[],s.isComplete=!1,s}return i.C6(e,t),e.prototype[Nt]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},e.prototype.subscribe=function(){return qt(this.observable,new Wt(this))},e}(Yt)},3952:(t,e,r)=>{"use strict";var i=r(8085),s=Object.prototype.hasOwnProperty,n=Array.isArray,o=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),a=function(t,e){for(var r=e&&e.plainObjects?{__proto__:null}:{},i=0;i<t.length;++i)void 0!==t[i]&&(r[i]=t[i]);return r},h=1024;t.exports={arrayToObject:a,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],i=0;i<e.length;++i)for(var s=e[i],o=s.obj[s.prop],a=Object.keys(o),h=0;h<a.length;++h){var l=a[h],u=o[l];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(e.push({obj:o,prop:l}),r.push(u))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(n(r)){for(var i=[],s=0;s<r.length;++s)void 0!==r[s]&&i.push(r[s]);e.obj[e.prop]=i}}}(e),t},decode:function(t,e,r){var i=t.replace(/\+/g," ");if("iso-8859-1"===r)return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch(t){return i}},encode:function(t,e,r,s,n){if(0===t.length)return t;var a=t;if("symbol"==typeof t?a=Symbol.prototype.toString.call(t):"string"!=typeof t&&(a=String(t)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var l="",u=0;u<a.length;u+=h){for(var c=a.length>=h?a.slice(u,u+h):a,d=[],p=0;p<c.length;++p){var f=c.charCodeAt(p);45===f||46===f||95===f||126===f||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||n===i.RFC1738&&(40===f||41===f)?d[d.length]=c.charAt(p):f<128?d[d.length]=o[f]:f<2048?d[d.length]=o[192|f>>6]+o[128|63&f]:f<55296||f>=57344?d[d.length]=o[224|f>>12]+o[128|f>>6&63]+o[128|63&f]:(p+=1,f=65536+((1023&f)<<10|1023&c.charCodeAt(p)),d[d.length]=o[240|f>>18]+o[128|f>>12&63]+o[128|f>>6&63]+o[128|63&f])}l+=d.join("")}return l},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(n(t)){for(var r=[],i=0;i<t.length;i+=1)r.push(e(t[i]));return r}return e(t)},merge:function t(e,r,i){if(!r)return e;if("object"!=typeof r&&"function"!=typeof r){if(n(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(i&&(i.plainObjects||i.allowPrototypes)||!s.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var o=e;return n(e)&&!n(r)&&(o=a(e,i)),n(e)&&n(r)?(r.forEach((function(r,n){if(s.call(e,n)){var o=e[n];o&&"object"==typeof o&&r&&"object"==typeof r?e[n]=t(o,r,i):e.push(r)}else e[n]=r})),e):Object.keys(r).reduce((function(e,n){var o=r[n];return s.call(e,n)?e[n]=t(e[n],o,i):e[n]=o,e}),o)}}},3959:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n   gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n"},4008:(t,e)=>{"use strict";class r{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new r(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}}r.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`},e.Point=r},4029:(t,e,r)=>{"use strict";var i=r(9878),s=r(1520),n=r(3293),o=r(2828);const a=class t extends s.Sprite{constructor(e="",r={}){super(i.Texture.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const s=new Image,n=i.Texture.from(s,{scaleMode:i.settings.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new i.Rectangle,n.trim=new i.Rectangle,this.texture=n;const o="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",h=document.createElementNS(o,"svg"),l=document.createElementNS(o,"foreignObject"),u=document.createElementNS(a,"div"),c=document.createElementNS(a,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",h.appendChild(l),this.maxWidth=t.defaultMaxWidth,this.maxHeight=t.defaultMaxHeight,this._domElement=u,this._styleElement=c,this._svgRoot=h,this._foreignObject=l,this._foreignObject.appendChild(c),this._foreignObject.appendChild(u),this._image=s,this._loadImage=new Image,this._autoResolution=t.defaultAutoResolution,this._resolution=t.defaultResolution??i.settings.RESOLUTION,this.text=e,this.style=r}measureText(t){const{text:e,style:r,resolution:i}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:r.toCSS(i)}),this._styleElement.textContent=r.toGlobalCSS(),document.body.appendChild(this._svgRoot);const s=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:n,height:o}=s;(n>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const a=Math.min(this.maxWidth,Math.ceil(n)),h=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",a.toString()),this._svgRoot.setAttribute("height",h.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),r!==this._style&&(Object.assign(this._domElement,{style:this._style?.toCSS(i)}),this._styleElement.textContent=this._style?.toGlobalCSS()),{width:a+2*r.padding,height:h+2*r.padding}}async updateText(t=!0){const{style:e,_image:r,_loadImage:i}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:s,height:n}=this.measureText();r.width=i.width=Math.ceil(Math.max(1,s)),r.height=i.height=Math.ceil(Math.max(1,n)),this._updateID++;const o=this._updateID;await new Promise((t=>{i.onload=async()=>{o<this._updateID||(await e.onBeforeDraw(),r.src=i.src,i.onload=null,i.src="",this.updateTexture()),t()};const s=(new XMLSerializer).serializeToString(this._svgRoot);i.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(s)}`}))}get source(){return this._image}updateTexture(){const{style:t,texture:e,_image:r,resolution:i}=this,{padding:s}=t,{baseTexture:n}=e;e.trim.width=e._frame.width=r.width/i,e.trim.height=e._frame.height=r.height/i,e.trim.x=-s,e.trim.y=-s,e.orig.width=e._frame.width-2*s,e.orig.height=e._frame.height-2*s,this._onTextureUpdate(),n.setRealSize(r.width,r.height,i),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}_renderCanvas(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(t)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds(t)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},t.defaultDestroyOptions,e),super.destroy(e);const r=null;this.ownsStyle&&this._style?.cleanFonts(),this._style=r,this._svgRoot?.remove(),this._svgRoot=r,this._domElement?.remove(),this._domElement=r,this._foreignObject?.remove(),this._foreignObject=r,this._styleElement?.remove(),this._styleElement=r,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=r,this._image.src="",this._image=r}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(t){this.updateText(!0);const e=i.utils.sign(this.scale.x)||1;this.scale.x=e*t/this._image.width/this.resolution,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(t){this.updateText(!0);const e=i.utils.sign(this.scale.y)||1;this.scale.y=e*t/this._image.height/this.resolution,this._height=t}get style(){return this._style}set style(t){this._style!==t&&((t=t||{})instanceof o.HTMLTextStyle?(this.ownsStyle=!1,this._style=t):t instanceof n.TextStyle?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=o.HTMLTextStyle.from(t)):(this.ownsStyle=!0,this._style=new o.HTMLTextStyle(t)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(t){t=String(""===t||null==t?" ":t),t=this.sanitiseText(t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}sanitiseText(t){return t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};a.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},a.defaultMaxWidth=2024,a.defaultMaxHeight=2024,a.defaultAutoResolution=!0;let h=a;e.HTMLText=h},4058:()=>{},4093:(t,e,r)=>{"use strict";var i=r(9878),s=r(2935);e.ArcUtils=class{static curveTo(t,e,r,i,s,n){const o=n[n.length-2],a=n[n.length-1]-e,h=o-t,l=i-e,u=r-t,c=Math.abs(a*u-h*l);if(c<1e-8||0===s)return(n[n.length-2]!==t||n[n.length-1]!==e)&&n.push(t,e),null;const d=a*a+h*h,p=l*l+u*u,f=a*l+h*u,m=s*Math.sqrt(d)/c,g=s*Math.sqrt(p)/c,y=m*f/d,_=g*f/p,v=m*u+g*h,x=m*l+g*a,b=h*(g+y),T=a*(g+y),E=u*(m+_),A=l*(m+_);return{cx:v+t,cy:x+e,radius:s,startAngle:Math.atan2(T-x,b-v),endAngle:Math.atan2(A-x,E-v),anticlockwise:h*l>u*a}}static arc(t,e,r,n,o,a,h,l,u){const c=h-a,d=s.curves._segmentsCount(Math.abs(c)*o,40*Math.ceil(Math.abs(c)/i.PI_2)),p=c/(2*d),f=2*p,m=Math.cos(p),g=Math.sin(p),y=d-1,_=y%1/y;for(let t=0;t<=y;++t){const e=p+a+f*(t+_*t),i=Math.cos(e),s=-Math.sin(e);u.push((m*i+g*s)*o+r,(m*-s+g*i)*o+n)}}}},4110:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},4123:(t,e)=>{"use strict";class r{constructor(t,e=null,r=null,i=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type}clone(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}e.GraphicsData=r},4175:(t,e,r)=>{"use strict";var i=r(3148),s=r(565);e.BlurFilter=i.BlurFilter,e.BlurFilterPass=s.BlurFilterPass},4198:(t,e,r)=>{"use strict";var i=r(1102),s=r(8311),n=r(5755),o=r(4566),a=r(3635)||o||n;t.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new i("Side channel does not contain "+s(t))},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,r){t||(t=a()),t.set(e,r)}};return e}},4213:(t,e,r)=>{"use strict";const i={ADAPTER:r(6921).BrowserAdapter,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};e.settings=i},4224:(t,e,r)=>{"use strict";var i=r(238);r(9440);var s=r(3445),n=r(7664),o=r(194),a=r(3647);let h=0;const l={textureCount:0,uboCount:0};class u{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=h++}systemCheck(){if(!o.unsafeEvalSupported())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const 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||(l.textureCount=0,l.uboCount=0,this.syncUniformGroup(t.uniformGroup,l)),i}setUniforms(t){const e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)}syncUniformGroup(t,e){const r=this.getGlProgram();(!t.static||t.dirtyId!==r.uniformDirtyGroups[t.id])&&(r.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,r,e))}syncUniforms(t,e,r){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,r)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=a.generateUniformsSync(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const r=this.getGlProgram();if(!t.static||0!==t.dirtyId||!r.uniformGroups[t.id]){t.dirtyId=0;const i=r.uniformGroups[t.id]||this.createSyncBufferGroup(t,r,e);t.buffer.update(),i(r.uniformData,t.uniforms,this.renderer,l,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,r.uniformBufferBindings[e])}createSyncBufferGroup(t,e,r){const{gl:i}=this.renderer;this.renderer.buffer.bind(t.buffer);const s=this.gl.getUniformBlockIndex(e.program,r);e.uniformBufferBindings[r]=this.shader.uniformBindCount,i.uniformBlockBinding(e.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(t,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=n.generateUniformBufferSync(t,this.shader.program.uniformData)),t.autoManage){const e=new Float32Array(a.size/4);t.buffer.update(e)}return e.uniformGroups[t.id]=a.syncFunc,e.uniformGroups[t.id]}getSignature(t,e,r){const i=t.uniforms,s=[`${r}-`];for(const t in i)s.push(t),e[t]&&s.push(e[t].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const e=this.gl,r=t.program,i=s.generateProgram(e,r);return r.glPrograms[this.renderer.CONTEXT_UID]=i,i}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}u.extension={type:i.ExtensionType.RendererSystem,name:"shader"},i.extensions.add(u),e.ShaderSystem=u},4250:(t,e,r)=>{"use strict";var i=r(3952),s=Object.prototype.hasOwnProperty,n=Array.isArray,o={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:i.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},h=function(t,e,r){if(t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");return t},l=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/g,l=r.depth>0&&/(\[[^[\]]*])/.exec(o),u=l?o.slice(0,l.index):o,c=[];if(u){if(!r.plainObjects&&s.call(Object.prototype,u)&&!r.allowPrototypes)return;c.push(u)}for(var d=0;r.depth>0&&null!==(l=a.exec(o))&&d<r.depth;){if(d+=1,!r.plainObjects&&s.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(l[1])}if(l){if(!0===r.strictDepth)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");c.push("["+o.slice(l.index)+"]")}return function(t,e,r,s){var n=0;if(t.length>0&&"[]"===t[t.length-1]){var o=t.slice(0,-1).join("");n=Array.isArray(e)&&e[o]?e[o].length:0}for(var a=s?e:h(e,r,n),l=t.length-1;l>=0;--l){var u,c=t[l];if("[]"===c&&r.parseArrays)u=r.allowEmptyArrays&&(""===a||r.strictNullHandling&&null===a)?[]:i.combine([],a);else{u=r.plainObjects?{__proto__:null}:{};var d="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,p=r.decodeDotInKeys?d.replace(/%2E/g,"."):d,f=parseInt(p,10);r.parseArrays||""!==p?!isNaN(f)&&c!==p&&String(f)===p&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(u=[])[f]=a:"__proto__"!==p&&(u[p]=a):u={0:a}}a=u}return a}(c,e,r,n)}};t.exports=function(t,e){var r=function(t){if(!t)return o;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.decodeDotInKeys&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==t.throwOnLimitExceeded&&"boolean"!=typeof t.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=void 0===t.charset?o.charset:t.charset,r=void 0===t.duplicates?o.duplicates:t.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===t.allowDots?!0===t.decodeDotInKeys||o.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:o.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:o.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:o.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:o.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:o.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:o.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:o.decoder,delimiter:"string"==typeof t.delimiter||i.isRegExp(t.delimiter)?t.delimiter:o.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:o.depth,duplicates:r,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:o.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:o.strictDepth,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof t.throwOnLimitExceeded&&t.throwOnLimitExceeded}}(e);if(""===t||null==t)return r.plainObjects?{__proto__:null}:{};for(var u="string"==typeof t?function(t,e){var r={__proto__:null},l=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;l=l.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=e.parameterLimit===1/0?void 0:e.parameterLimit,c=l.split(e.delimiter,e.throwOnLimitExceeded?u+1:u);if(e.throwOnLimitExceeded&&c.length>u)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var d,p=-1,f=e.charset;if(e.charsetSentinel)for(d=0;d<c.length;++d)0===c[d].indexOf("utf8=")&&("utf8=%E2%9C%93"===c[d]?f="utf-8":"utf8=%26%2310003%3B"===c[d]&&(f="iso-8859-1"),p=d,d=c.length);for(d=0;d<c.length;++d)if(d!==p){var m,g,y=c[d],_=y.indexOf("]="),v=-1===_?y.indexOf("="):_+1;-1===v?(m=e.decoder(y,o.decoder,f,"key"),g=e.strictNullHandling?null:""):(m=e.decoder(y.slice(0,v),o.decoder,f,"key"),g=i.maybeMap(h(y.slice(v+1),e,n(r[m])?r[m].length:0),(function(t){return e.decoder(t,o.decoder,f,"value")}))),g&&e.interpretNumericEntities&&"iso-8859-1"===f&&(g=a(String(g))),y.indexOf("[]=")>-1&&(g=n(g)?[g]:g);var x=s.call(r,m);x&&"combine"===e.duplicates?r[m]=i.combine(r[m],g):x&&"last"!==e.duplicates||(r[m]=g)}return r}(t,r):t,c=r.plainObjects?{__proto__:null}:{},d=Object.keys(u),p=0;p<d.length;++p){var f=d[p],m=l(f,u[f],r,"string"==typeof t);c=i.merge(c,m,r)}return!0===r.allowSparse?c:i.compact(c)}},4252:(t,e,r)=>{"use strict";var i=r(248),s=r(3752),n=r(7678);t.exports=i?function(t){return i(t)}:s?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return s(t)}:n?function(t){return n(t)}:null},4333:(t,e,r)=>{"use strict";var i=r(8894);e.GLTexture=class{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=i.TYPES.UNSIGNED_BYTE,this.internalFormat=i.FORMATS.RGBA,this.samplerType=0}}},4350:(t,e,r)=>{"use strict";var i=r(9139),s=r(3622),n=r(8225),o=r(5873);r(4971),e.LoaderParserPriority=i.LoaderParserPriority,e.loadJson=s.loadJson,e.loadTxt=n.loadTxt,e.getFontFamilyName=o.getFontFamilyName,e.loadWebFont=o.loadWebFont},4405:(t,e)=>{"use strict";e.ObjectRenderer=class{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}},4426:(t,e,r)=>{"use strict";var i=r(2935);class s{static curveLength(t,e,r,i,s,n,o,a){let h=0,l=0,u=0,c=0,d=0,p=0,f=0,m=0,g=0,y=0,_=0,v=t,x=e;for(let b=1;b<=10;++b)l=b/10,u=l*l,c=u*l,d=1-l,p=d*d,f=p*d,m=f*t+3*p*l*r+3*d*u*s+c*o,g=f*e+3*p*l*i+3*d*u*n+c*a,y=v-m,_=x-g,v=m,x=g,h+=Math.sqrt(y*y+_*_);return h}static curveTo(t,e,r,n,o,a,h){const l=h[h.length-2],u=h[h.length-1];h.length-=2;const c=i.curves._segmentsCount(s.curveLength(l,u,t,e,r,n,o,a));let d=0,p=0,f=0,m=0,g=0;h.push(l,u);for(let i=1,s=0;i<=c;++i)s=i/c,d=1-s,p=d*d,f=p*d,m=s*s,g=m*s,h.push(f*l+3*p*s*t+3*d*m*r+g*o,f*u+3*p*s*e+3*d*m*n+g*a)}}e.BezierUtils=s},4450:(t,e,r)=>{"use strict";var i=r(9878);r(4791);var s=r(2501);const n=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const r=s.convertToList(t);let n;for(let t=0;t<this.parsers.length;t++){const i=this.parsers[t];if(i.test(e)){n=i.getCacheableAssets(r,e);break}}n||(n={},r.forEach((t=>{n[t]=e})));const o=Object.keys(n),a={cacheKeys:o,keys:r};if(r.forEach((t=>{this._cacheMap.set(t,a)})),o.forEach((t=>{const r=n?n[t]:e;this._cache.has(t)&&this._cache.get(t)!==r&&console.warn("[Cache] already has key:",t),this._cache.set(t,n[t])})),e instanceof i.Texture){const t=e;r.forEach((e=>{t.baseTexture!==i.Texture.EMPTY.baseTexture&&i.BaseTexture.addToCache(t.baseTexture,e),i.Texture.addToCache(t,e)}))}}remove(t){if(!this._cacheMap.has(t))return void console.warn(`[Assets] Asset id ${t} was not found in the Cache`);const e=this._cacheMap.get(t);e.cacheKeys.forEach((t=>{this._cache.delete(t)})),e.keys.forEach((t=>{this._cacheMap.delete(t)}))}get parsers(){return this._parsers}};e.Cache=n},4476:(t,e,r)=>{"use strict";var i=r(8894),s=r(7450);const n=class t extends s.AbstractMultiResource{constructor(e,r){const{width:s,height:n,autoLoad:o,linkBaseTexture:a}=r||{};if(e&&e.length!==t.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:s,height:n});for(let e=0;e<t.SIDES;e++)this.items[e].target=i.TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+e;this.linkBaseTexture=!1!==a,e&&this.initFromArray(e,r),!1!==o&&this.load()}bind(t){super.bind(t),t.target=i.TARGETS.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,r){if(void 0===r&&(r=this.linkBaseTexture),!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=i.TARGETS.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}upload(e,r,i){const s=this.itemDirtyIds;for(let n=0;n<t.SIDES;n++){const t=this.items[n];(s[n]<t.dirtyId||i.dirtyId<r.dirtyId)&&(t.valid&&t.resource?(t.resource.upload(e,t,i),s[n]=t.dirtyId):s[n]<-1&&(e.gl.texImage2D(t.target,0,i.internalFormat,r.realWidth,r.realHeight,0,r.format,i.type,null),s[n]=-1))}return!0}static test(e){return Array.isArray(e)&&e.length===t.SIDES}};n.SIDES=6;let o=n;e.CubeResource=o},4496:(t,e,r)=>{"use strict";var i=r(622),s=r(238),n=r(7146);const o=new n.Rectangle,a=new n.Rectangle;class h{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new n.Rectangle,this.destinationFrame=new n.Rectangle,this.viewportFrame=new n.Rectangle}contextChange(){const t=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,e,r){const i=this.renderer;let s,n,h;this.current=t,t?(s=t.baseTexture,h=s.resolution,e||(o.width=t.frame.width,o.height=t.frame.height,e=o),r||(a.x=t.frame.x,a.y=t.frame.y,a.width=e.width,a.height=e.height,r=a),n=s.framebuffer):(h=i.resolution,e||(o.width=i._view.screen.width,o.height=i._view.screen.height,e=o),r||((r=o).width=e.width,r.height=e.height));const l=this.viewportFrame;l.x=r.x*h,l.y=r.y*h,l.width=r.width*h,l.height=r.height*h,t||(l.y=i.view.height-(l.y+l.height)),l.ceil(),this.renderer.framebuffer.bind(n,l),this.renderer.projection.update(r,e,h,!n),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(r)}clear(t,e){const r=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,s=i.Color.shared.setValue(t||r);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&s.premultiply(s.alpha);const n=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=n.width!==o.width||n.height!==o.height;if(a){let{x:t,y:e,width:r,height:i}=this.viewportFrame;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(t,e,r,i)}this.renderer.framebuffer.clear(s.red,s.green,s.blue,s.alpha,e),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}h.extension={type:s.ExtensionType.RendererSystem,name:"renderTexture"},s.extensions.add(h),e.RenderTextureSystem=h},4542:(t,e,r)=>{"use strict";var i=r(6238);e.canUploadSameBuffer=function(){return!i.isMobile.apple.device}},4566:(t,e,r)=>{"use strict";var i=r(110),s=r(5031),n=r(8311),o=r(1102),a=i("%Map%",!0),h=s("Map.prototype.get",!0),l=s("Map.prototype.set",!0),u=s("Map.prototype.has",!0),c=s("Map.prototype.delete",!0),d=s("Map.prototype.size",!0);t.exports=!!a&&function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){if(t){var r=c(t,e);return 0===d(t)&&(t=void 0),r}return!1},get:function(e){if(t)return h(t,e)},has:function(e){return!!t&&u(t,e)},set:function(e,r){t||(t=new a),l(t,e,r)}};return e}},4611:(t,e,r)=>{"use strict";var i=r(8894),s=r(6238),n=r(8066),o=r(9441),a=r(1515),h=r(3801);const l={scaleMode:i.SCALE_MODES.NEAREST,alphaMode:i.ALPHA_MODES.NPM},u=class t extends n.EventEmitter{constructor(e=null,r=null){super(),r=Object.assign({},t.defaultOptions,r);const{alphaMode:i,mipmap:a,anisotropicLevel:l,scaleMode:u,width:c,height:d,wrapMode:p,format:f,type:m,target:g,resolution:y,resourceOptions:_}=r;e&&!(e instanceof h.Resource)&&((e=o.autoDetectResource(e,_)).internal=!0),this.resolution=y||s.settings.RESOLUTION,this.width=Math.round((c||0)*this.resolution)/this.resolution,this.height=Math.round((d||0)*this.resolution)/this.resolution,this._mipmap=a,this.anisotropicLevel=l,this._wrapMode=p,this._scaleMode=u,this.format=f,this.type=m,this.target=g,this.alphaMode=i,this.uid=n.uid(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=c>0&&d>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let 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}setSize(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)}setRealSize(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}_refreshPOT(){this.isPowerOfTwo=n.isPow2(this.realWidth)&&n.isPow2(this.realHeight)}setResolution(t){const 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}setResource(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}update(){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))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete n.BaseTextureCache[this.cacheId],delete n.TextureCache[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,r,i=s.settings.STRICT_TEXTURE_CACHE){const o="string"==typeof e;let a=null;if(o)a=e;else{if(!e._pixiId){const t=r?.pixiIdPrefix||"pixiid";e._pixiId=`${t}_${n.uid()}`}a=e._pixiId}let h=n.BaseTextureCache[a];if(o&&i&&!h)throw new Error(`The cacheId "${a}" does not exist in BaseTextureCache.`);return h||(h=new t(e,r),h.cacheId=a,t.addToCache(h,a)),h}static fromBuffer(e,r,s,n){e=e||new Float32Array(r*s*4);const o=new a.BufferResource(e,{width:r,height:s,...n?.resourceOptions});let h,u;return e instanceof Float32Array?(h=i.FORMATS.RGBA,u=i.TYPES.FLOAT):e instanceof Int32Array?(h=i.FORMATS.RGBA_INTEGER,u=i.TYPES.INT):e instanceof Uint32Array?(h=i.FORMATS.RGBA_INTEGER,u=i.TYPES.UNSIGNED_INT):e instanceof Int16Array?(h=i.FORMATS.RGBA_INTEGER,u=i.TYPES.SHORT):e instanceof Uint16Array?(h=i.FORMATS.RGBA_INTEGER,u=i.TYPES.UNSIGNED_SHORT):e instanceof Int8Array?(h=i.FORMATS.RGBA,u=i.TYPES.BYTE):(h=i.FORMATS.RGBA,u=i.TYPES.UNSIGNED_BYTE),o.internal=!0,new t(o,Object.assign({},l,{type:u,format:h},n))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),n.BaseTextureCache[e]&&n.BaseTextureCache[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),n.BaseTextureCache[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=n.BaseTextureCache[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete n.BaseTextureCache[t],e}}else if(t?.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete n.BaseTextureCache[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};u.defaultOptions={mipmap:i.MIPMAP_MODES.POW2,anisotropicLevel:0,scaleMode:i.SCALE_MODES.LINEAR,wrapMode:i.WRAP_MODES.CLAMP,alphaMode:i.ALPHA_MODES.UNPACK,target:i.TARGETS.TEXTURE_2D,format:i.FORMATS.RGBA,type:i.TYPES.UNSIGNED_BYTE},u._globalBatch=0;let c=u;e.BaseTexture=c},4676:(t,e,r)=>{"use strict";var i=r(8071);class s extends i.MeshGeometry{constructor(t=100,e=100,r=10,i=10){super(),this.segWidth=r,this.segHeight=i,this.width=t,this.height=e,this.build()}build(){const t=this.segWidth*this.segHeight,e=[],r=[],i=[],s=this.segWidth-1,n=this.segHeight-1,o=this.width/s,a=this.height/n;for(let i=0;i<t;i++){const t=i%this.segWidth,h=i/this.segWidth|0;e.push(t*o,h*a),r.push(t/s,h/n)}const h=s*n;for(let t=0;t<h;t++){const e=t%s,r=t/s|0,n=r*this.segWidth+e,o=r*this.segWidth+e+1,a=(r+1)*this.segWidth+e,h=(r+1)*this.segWidth+e+1;i.push(n,o,a,o,h,a)}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()}}e.PlaneGeometry=s},4682:(t,e,r)=>{"use strict";var i=r(9878),s=r(8071);class n extends s.Mesh{constructor(t=i.Texture.EMPTY,e,r,n,o){const a=new s.MeshGeometry(e,r,n);a.getBuffer("aVertexPosition").static=!1,super(a,new s.MeshMaterial(t),null,o),this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}_render(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(t)}}e.SimpleMesh=n},4691:(t,e,r)=>{"use strict";var i=r(6238);function s(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function n(t){return t.split("?")[0].split("#")[0]}const o={toPosix:t=>t.replace(new RegExp("\\".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"/"),isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),isBlobUrl:t=>t.startsWith("blob:"),hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){s(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const r=/^[^/:]+:\/{0,2}/.exec(t);return r?r[0]:""},toAbsolute(t,e,r){if(s(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const a=n(this.toPosix(e??i.settings.ADAPTER.getBaseUrl())),h=n(this.toPosix(r??this.rootname(a)));return(t=this.toPosix(t)).startsWith("/")?o.join(h,t.slice(1)):this.isAbsolute(t)?t:this.join(a,t)},normalize(t){if(s(t),0===t.length)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;let e="";const r=(t=this.toPosix(t)).startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return(t=function(t){let e="",r=0,i=-1,s=0,n=-1;for(let o=0;o<=t.length;++o){if(o<t.length)n=t.charCodeAt(o);else{if(47===n)break;n=47}if(47===n){if(i!==o-1&&1!==s)if(i!==o-1&&2===s){if(e.length<2||2!==r||46!==e.charCodeAt(e.length-1)||46!==e.charCodeAt(e.length-2))if(e.length>2){const t=e.lastIndexOf("/");if(t!==e.length-1){-1===t?(e="",r=0):(e=e.slice(0,t),r=e.length-1-e.lastIndexOf("/")),i=o,s=0;continue}}else if(2===e.length||1===e.length){e="",r=0,i=o,s=0;continue}}else e.length>0?e+=`/${t.slice(i+1,o)}`:e=t.slice(i+1,o),r=o-i-1;i=o,s=0}else 46===n&&-1!==s?++s:s=-1}return e}(t)).length>0&&i&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return s(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){if(0===t.length)return".";let e;for(let r=0;r<t.length;++r){const i=t[r];if(s(i),i.length>0)if(void 0===e)e=i;else{const s=t[r-1]??"";this.joinExtensions.includes(this.extname(s).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return void 0===e?".":this.normalize(e)},dirname(t){if(s(t),0===t.length)return".";let e=(t=this.toPosix(t)).charCodeAt(0);const r=47===e;let i=-1,n=!0;const o=this.getProtocol(t),a=t;for(let r=(t=t.slice(o.length)).length-1;r>=1;--r)if(e=t.charCodeAt(r),47===e){if(!n){i=r;break}}else n=!1;return-1===i?r?"/":this.isUrl(a)?o+t:o:r&&1===i?"//":o+t.slice(0,i)},rootname(t){s(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);e=-1!==r?t.slice(0,r):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){s(t),e&&s(e),t=n(this.toPosix(t));let r,i=0,o=-1,a=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let s=e.length-1,n=-1;for(r=t.length-1;r>=0;--r){const h=t.charCodeAt(r);if(47===h){if(!a){i=r+1;break}}else-1===n&&(a=!1,n=r+1),s>=0&&(h===e.charCodeAt(s)?-1==--s&&(o=r):(s=-1,o=n))}return i===o?o=n:-1===o&&(o=t.length),t.slice(i,o)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!a){i=r+1;break}}else-1===o&&(a=!1,o=r+1);return-1===o?"":t.slice(i,o)},extname(t){s(t);let e=-1,r=0,i=-1,o=!0,a=0;for(let s=(t=n(this.toPosix(t))).length-1;s>=0;--s){const n=t.charCodeAt(s);if(47!==n)-1===i&&(o=!1,i=s+1),46===n?-1===e?e=s:1!==a&&(a=1):-1!==e&&(a=-1);else if(!o){r=s+1;break}}return-1===e||-1===i||0===a||1===a&&e===i-1&&e===r+1?"":t.slice(e,i)},parse(t){s(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let r=(t=n(this.toPosix(t))).charCodeAt(0);const i=this.isAbsolute(t);let o;e.root=this.rootname(t),o=i||this.hasProtocol(t)?1:0;let a=-1,h=0,l=-1,u=!0,c=t.length-1,d=0;for(;c>=o;--c)if(r=t.charCodeAt(c),47!==r)-1===l&&(u=!1,l=c+1),46===r?-1===a?a=c:1!==d&&(d=1):-1!==a&&(d=-1);else if(!u){h=c+1;break}return-1===a||-1===l||0===d||1===d&&a===l-1&&a===h+1?-1!==l&&(e.base=e.name=0===h&&i?t.slice(1,l):t.slice(h,l)):(0===h&&i?(e.name=t.slice(1,a),e.base=t.slice(1,l)):(e.name=t.slice(h,a),e.base=t.slice(h,l)),e.ext=t.slice(a,l)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};e.path=o},4692:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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}"},4694:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},4751:(t,e,r)=>{"use strict";var i=r(7146),s=r(5881),n=r(5577),o=r(5309),a=r(4110);class h extends n.Filter{constructor(t,e,r){let s=null;"string"!=typeof t&&void 0===e&&void 0===r&&(s=t,t=void 0,e=void 0,r=void 0),super(t||a.default,e||o.default,r),this.maskSprite=s,this.maskMatrix=new i.Matrix}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,e,r,i){const n=this._maskSprite,o=n._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new s.TextureMatrix(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))}}e.SpriteMaskFilter=h},4778:(t,e)=>{"use strict";const r={};e.deprecation=function(t,e,i=3){if(r[e])return;let s=(new Error).stack;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}\nDeprecated since v${t}`):(s=s.split("\n").splice(i).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(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}\nDeprecated since v${t}`),console.warn(s))),r[e]=!0}},4783:(t,e,r)=>{"use strict";var i=r(238),s=r(4405);class n{constructor(t){this.renderer=t,this.emptyRenderer=new s.ObjectRenderer(t),this.currentRenderer=this.emptyRenderer}setObjectRenderer(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(t,e){const{boundTextures:r}=this.renderer.texture;for(let i=e-1;i>=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)}boundArray(t,e,r,i){const{elements:s,ids:n,count:o}=t;let a=0;for(let t=0;t<o;t++){const o=s[t],h=o._batchLocation;if(h>=0&&h<i&&e[h]===o)n[t]=h;else for(;a<i;){const i=e[a];if(!i||i._batchEnabled!==r||i._batchLocation!==a){n[t]=a,o._batchLocation=a,e[a]=o;break}a++}}}destroy(){this.renderer=null}}n.extension={type:i.ExtensionType.RendererSystem,name:"batch"},i.extensions.add(n),e.BatchSystem=n},4787:(t,e,r)=>{"use strict";var i=r(7505);e.cacheTextureArray=i.cacheTextureArray},4791:(t,e,r)=>{"use strict";var i=r(2366),s=r(2573),n=r(2501),o=r(3496),a=r(856),h=r(7092);e.checkDataUrl=i.checkDataUrl,e.checkExtension=s.checkExtension,e.convertToList=n.convertToList,e.copySearchParams=o.copySearchParams,e.createStringVariations=a.createStringVariations,e.isSingleItem=h.isSingleItem},4811:t=>{"use strict";t.exports=Function.prototype.apply},4816:(t,e,r)=>{"use strict";var i=r(238),s=r(7146),n=r(6238);class o{constructor(t){this.renderer=t}init(t){this.screen=new s.Rectangle(0,0,t.width,t.height),this.element=t.view||n.settings.ADAPTER.createCanvas(),this.resolution=t.resolution||n.settings.RESOLUTION,this.autoDensity=!!t.autoDensity}resizeView(t,e){this.element.width=Math.round(t*this.resolution),this.element.height=Math.round(e*this.resolution);const r=this.element.width/this.resolution,i=this.element.height/this.resolution;this.screen.width=r,this.screen.height=i,this.autoDensity&&(this.element.style.width=`${r}px`,this.element.style.height=`${i}px`),this.renderer.emit("resize",r,i),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(t){t&&this.element.parentNode?.removeChild(this.element),this.renderer=null,this.element=null,this.screen=null}}o.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},o.extension={type:[i.ExtensionType.RendererSystem,i.ExtensionType.CanvasRendererSystem],name:"_view"},i.extensions.add(o),e.ViewSystem=o},4842:(t,e,r)=>{"use strict";var i=r(9878);const s=new i.Rectangle,n=class t{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){const t=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}async image(t,e,r,i){const s=new Image;return s.src=await this.base64(t,e,r,i),s}async base64(t,e,r,i){const s=this.canvas(t,i);if(void 0!==s.toBlob)return new Promise(((t,i)=>{s.toBlob((e=>{if(!e)return void i(new Error("ICanvas.toBlob failed!"));const r=new FileReader;r.onload=()=>t(r.result),r.onerror=i,r.readAsDataURL(e)}),e,r)}));if(void 0!==s.toDataURL)return s.toDataURL(e,r);if(void 0!==s.convertToBlob){const t=await s.convertToBlob({type:e,quality:r});return new Promise(((e,r)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=r,i.readAsDataURL(t)}))}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,r){const{pixels:s,width:n,height:o,flipY:a,premultipliedAlpha:h}=this._rawPixels(e,r);a&&t._flipY(s,n,o),h&&t._unpremultiplyAlpha(s);const l=new i.utils.CanvasRenderTarget(n,o,1),u=new ImageData(new Uint8ClampedArray(s.buffer),n,o);return l.context.putImageData(u,0,0),l.canvas}pixels(e,r){const{pixels:i,width:s,height:n,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,r);return o&&t._flipY(i,s,n),a&&t._unpremultiplyAlpha(i),i}_rawPixels(t,e){const r=this.renderer;if(!r)throw new Error("The Extract has already been destroyed");let n,o,a=!1,h=!1,l=!1;t&&(t instanceof i.RenderTexture?o=t:(o=r.generateTexture(t,{region:e,resolution:r.resolution,multisample:r.multisample}),l=!0,e&&(s.width=e.width,s.height=e.height,e=s)));const u=r.gl;if(o){if(n=o.baseTexture.resolution,e=e??o.frame,a=!1,h=o.baseTexture.alphaMode>0&&o.baseTexture.format===i.FORMATS.RGBA,!l){r.renderTexture.bind(o);const t=o.framebuffer.glFramebuffers[r.CONTEXT_UID];t.blitFramebuffer&&r.framebuffer.bind(t.blitFramebuffer)}}else n=r.resolution,e||((e=s).width=r.width/n,e.height=r.height/n),a=!0,h=this._rendererPremultipliedAlpha,r.renderTexture.bind();const c=Math.max(Math.round(e.width*n),1),d=Math.max(Math.round(e.height*n),1),p=new Uint8Array(4*c*d);return u.readPixels(Math.round(e.x*n),Math.round(e.y*n),c,d,u.RGBA,u.UNSIGNED_BYTE,p),l&&o?.destroy(!0),{pixels:p,width:c,height:d,flipY:a,premultipliedAlpha:h}}destroy(){this.renderer=null}static _flipY(t,e,r){const i=e<<2,s=r>>1,n=new Uint8Array(i);for(let e=0;e<s;e++){const s=e*i,o=(r-e-1)*i;n.set(t.subarray(s,s+i)),t.copyWithin(s,o,o+i),t.set(n,o)}}static _unpremultiplyAlpha(t){t instanceof Uint8ClampedArray&&(t=new Uint8Array(t.buffer));const e=t.length;for(let r=0;r<e;r+=4){const e=t[r+3];if(0!==e){const i=255.001/e;t[r]=t[r]*i+.5,t[r+1]=t[r+1]*i+.5,t[r+2]=t[r+2]*i+.5}}}};n.extension={name:"extract",type:i.ExtensionType.RendererSystem};let o=n;i.extensions.add(o),e.Extract=o},4923:(t,e,r)=>{"use strict";var i=r(7146),s=r(5610),n=r(9693),o=r(8991);e.BatchShaderGenerator=class{constructor(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},!e.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!e.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(t){if(!this.programCache[t]){const e=new Int32Array(t);for(let r=0;r<t;r++)e[r]=r;this.defaultGroupCache[t]=o.UniformGroup.from({uSamplers:e},!0);let r=this.fragTemplate;r=r.replace(/%count%/gi,`${t}`),r=r.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new s.Program(this.vertexSrc,r)}const e={tint:new Float32Array([1,1,1,1]),translationMatrix:new i.Matrix,default:this.defaultGroupCache[t]};return new n.Shader(this.programCache[t],e)}generateSampleSrc(t){let e="";e+="\n",e+="\n";for(let 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",e}}},4971:(t,e,r)=>{"use strict";var i=r(9277),s=r(8795),n=r(2844);r(8837),e.loadSVG=i.loadSVG,e.loadImageBitmap=s.loadImageBitmap,e.loadTextures=s.loadTextures,e.loadVideo=n.loadVideo},4978:(t,e)=>{"use strict";e.GLBuffer=class{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}},4993:(t,e,r)=>{"use strict";var i=r(9878);class s{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=s.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new i.Point,this.page=new i.Point,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,r){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,r,i,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}e.FederatedEvent=s},5023:(t,e,r)=>{"use strict";var i=r(8894);e.BatchDrawCall=class{constructor(){this.texArray=null,this.blend=0,this.type=i.DRAW_MODES.TRIANGLES,this.start=0,this.size=0,this.data=null}}},5031:(t,e,r)=>{"use strict";var i=r(110),s=r(2427),n=s([i("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=i(t,!!e);return"function"==typeof r&&n(t,".prototype.")>-1?s([r]):r}},5034:(t,e,r)=>{"use strict";var i=r(3701);const s={Float32Array,Uint32Array,Int32Array,Uint8Array};e.interleaveTypedArrays=function(t,e){let r=0,n=0;const o={};for(let i=0;i<t.length;i++)n+=e[i],r+=t[i].length;const a=new ArrayBuffer(4*r);let h=null,l=0;for(let r=0;r<t.length;r++){const u=e[r],c=t[r],d=i.getBufferType(c);o[d]||(o[d]=new s[d](a)),h=o[d];for(let t=0;t<c.length;t++)h[(t/u|0)*n+l+t%u]=c[t];l+=u}return new Float32Array(a)}},5053:()=>{},5081:(t,e,r)=>{"use strict";var i=r(8894);class s{constructor(){this.data=0,this.blendMode=i.BLEND_MODES.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(t){!!(1&this.data)!==t&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(t){!!(2&this.data)!==t&&(this.data^=2)}get culling(){return!!(4&this.data)}set culling(t){!!(4&this.data)!==t&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(t){!!(8&this.data)!==t&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(t){!!(32&this.data)!==t&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(t){!!(16&this.data)!==t&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==i.BLEND_MODES.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}static for2d(){const t=new s;return t.depthTest=!1,t.blend=!0,t}}s.prototype.toString=function(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`},e.State=s},5084:(t,e,r)=>{"use strict";var i=r(4450);r(6041),r(4787),e.Cache=i.Cache},5153:t=>{"use strict";t.exports=Object},5219:(t,e,r)=>{"use strict";var i=r(9878),s=r(892),n=r(7239);class o extends i.Shader{constructor(t,e){const r={uSampler:t,alpha:1,uTextureMatrix:i.Matrix.IDENTITY,uColor:new Float32Array([1,1,1,1])};(e=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},e)).uniforms&&Object.assign(r,e.uniforms),super(e.program||i.Program.from(n.default,s.default),r),this._colorDirty=!1,this.uvMatrix=new i.TextureMatrix(t),this.batchable=void 0===e.program,this.pluginName=e.pluginName,this._tintColor=new i.Color(e.tint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0,this.alpha=e.alpha}get texture(){return this.uniforms.uSampler}set texture(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)}set alpha(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(t){t!==this.tint&&(this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}get tintValue(){return this._tintColor.toNumber()}update(){if(this._colorDirty){this._colorDirty=!1;const t=this.texture.baseTexture.alphaMode;i.Color.shared.setValue(this._tintColor).premultiply(this._alpha,t).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}e.MeshMaterial=o},5231:(t,e,r)=>{"use strict";var i=r(622),s=r(4778);e.hex2rgb=function(t,e=[]){return s.deprecation("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),i.Color.shared.setValue(t).toRgbArray(e)},e.hex2string=function(t){return s.deprecation("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),i.Color.shared.setValue(t).toHex()},e.rgb2hex=function(t){return s.deprecation("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),i.Color.shared.setValue(t).toNumber()},e.string2hex=function(t){return s.deprecation("7.2.0","utils.string2hex is deprecated, use Color#toNumber instead"),i.Color.shared.setValue(t).toNumber()}},5235:()=>{},5254:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});let r=null;class i{constructor(){r||(r=URL.createObjectURL(new Blob(['(function() {\n  "use strict";\n  async function loadImageBitmap(url) {\n    const response = await fetch(url);\n    if (!response.ok)\n      throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);\n    const imageBlob = await response.blob();\n    return await createImageBitmap(imageBlob);\n  }\n  self.onmessage = async (event) => {\n    try {\n      const imageBitmap = await loadImageBitmap(event.data.data[0]);\n      self.postMessage({\n        data: imageBitmap,\n        uuid: event.data.uuid,\n        id: event.data.id\n      }, [imageBitmap]);\n    } catch (e) {\n      self.postMessage({\n        error: e,\n        uuid: event.data.uuid,\n        id: event.data.id\n      });\n    }\n  };\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(r)}}i.revokeObjectURL=function(){r&&(URL.revokeObjectURL(r),r=null)},e.default=i},5288:(t,e,r)=>{"use strict";var i=r(2629),s=r(9878);r(7601);var n=r(8049);const o={extension:{type:s.ExtensionType.LoadParser,priority:i.LoaderParserPriority.High},name:"loadKTX",test:t=>i.checkExtension(t,".ktx"),async load(t,e,r){const o=await(await s.settings.ADAPTER.fetch(t)).arrayBuffer(),{compressed:a,uncompressed:h,kvData:l}=n.parseKTX(t,o),u=a??h,c={mipmap:s.MIPMAP_MODES.OFF,alphaMode:s.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:s.utils.getResolutionOfUrl(t),...e.data},d=u.map((e=>{u===h&&Object.assign(c,{type:e.type,format:e.format});const n=e.resource??e,o=new s.BaseTexture(n,c);return o.ktxKeyValueData=l,i.createTexture(o,r,t)}));return 1===d.length?d[0]:d},unload(t){Array.isArray(t)?t.forEach((t=>t.destroy(!0))):t.destroy(!0)}};s.extensions.add(o),e.loadKTX=o},5309:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},5415:(t,e,r)=>{"use strict";var i=r(8894),s=r(238),n=r(7146),o=r(6238),a=r(8066),h=r(8991),l=r(7826);const u=class t extends l.SystemManager{constructor(e){super(),this.type=i.RENDERER_TYPE.WEBGL,e=Object.assign({},o.settings.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new h.UniformGroup({projectionMatrix:new n.Matrix},!0);const r={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:t.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(r),"useContextAlpha"in e&&(a.deprecation("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&"notMultiplied"!==e.useContextAlpha,e.backgroundAlpha=!1===e.useContextAlpha?1:e.backgroundAlpha),this._plugin.rendererPlugins=t.__plugins,this.options=e,this.startup.run(this.options)}static test(t){return!t?.forceCanvas&&a.isWebGLSupported()}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return a.deprecation("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return a.deprecation("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return a.deprecation("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return a.deprecation("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){a.deprecation("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return a.deprecation("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){a.deprecation("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return a.deprecation("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};u.extension={type:s.ExtensionType.Renderer,priority:1},u.__plugins={},u.__systems={};let c=u;s.extensions.handleByMap(s.ExtensionType.RendererPlugin,c.__plugins),s.extensions.handleByMap(s.ExtensionType.RendererSystem,c.__systems),s.extensions.add(c),e.Renderer=c},5574:(t,e,r)=>{"use strict";var i=r(622),s=r(8894),n=r(238),o=r(6238),a=r(8066),h=r(8788),l=r(8099),u=r(5081),c=r(4611),d=r(5023),p=r(189),f=r(4923),m=r(8602),g=r(4542),y=r(6372),_=r(4405),v=r(7970),x=r(6945);const b=class t extends _.ObjectRenderer{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=p.BatchGeometry,this.vertexSize=6,this.state=u.State.for2d(),this.size=4*t.defaultBatchSize,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??y.maxRecommendedTextures(32),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??g.canUploadSameBuffer(),this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return a.deprecation("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return x.default}static get defaultFragmentTemplate(){return v.default}setShaderGenerator({vertex:e=t.defaultVertexSrc,fragment:r=t.defaultFragmentTemplate}={}){this.shaderGenerator=new f.BatchShaderGenerator(e,r)}contextChange(){const e=this.renderer.gl;o.settings.PREFER_ENV===s.ENV.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),t.defaultMaxTextures),this.maxTextures=l.checkMaxIfStatementsInShader(this.maxTextures,e)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:e,_textureArrayPool:r}=t,i=this.size/4,s=Math.floor(i/this.maxTextures)+1;for(;e.length<i;)e.push(new d.BatchDrawCall);for(;r.length<s;)r.push(new m.BatchTextureArray);for(let t=0;t<this.maxTextures;t++)this._tempBoundTextures[t]=null}onPrerender(){this._flushId=0}render(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)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:r}=this,i=t._textureArrayPool,s=this.renderer.batch,n=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++c.BaseTexture._globalBatch,h=0,l=i[0],u=0;s.copyBoundTextures(n,r);for(let t=0;t<this._bufferSize;++t){const c=e[t];e[t]=null,c._batchEnabled!==a&&(l.count>=r&&(s.boundArray(l,n,a,r),this.buildDrawCalls(l,u,t),u=t,l=i[++h],++a),c._batchEnabled=a,c.touched=o,l.elements[l.count++]=c)}l.count>0&&(s.boundArray(l,n,a,r),this.buildDrawCalls(l,u,this._bufferSize),++h,++a);for(let t=0;t<n.length;t++)n[t]=null;c.BaseTexture._globalBatch=a}buildDrawCalls(e,r,i){const{_bufferedElements:s,_attributeBuffer:n,_indexBuffer:o,vertexSize:h}=this,l=t._drawCallPool;let u=this._dcIndex,c=this._aIndex,d=this._iIndex,p=l[u];p.start=this._iIndex,p.texArray=e;for(let t=r;t<i;++t){const i=s[t],f=i._texture.baseTexture,m=a.premultiplyBlendMode[f.alphaMode?1:0][i.blendMode];s[t]=null,r<t&&p.blend!==m&&(p.size=d-p.start,r=t,p=l[++u],p.texArray=e,p.start=d),this.packInterleavedGeometry(i,n,o,c,d),c+=i.vertexData.length/2*h,d+=i.indices.length,p.blend=m}r<i&&(p.size=d-p.start,++u),this._dcIndex=u,this._aIndex=c,this._iIndex=d}bindAndClearTexArray(t){const e=this.renderer.texture;for(let r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0}updateGeometry(){const{_packedGeometries:e,_attributeBuffer:r,_indexBuffer:i}=this;t.canUploadSameBuffer?(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++)}drawBatches(){const e=this._dcIndex,{gl:r,state:i}=this.renderer,s=t._drawCallPool;let n=null;for(let t=0;t<e;t++){const{texArray:e,type:o,size:a,start:h,blend:l}=s[t];n!==e&&(n=e,this.bindAndClearTexArray(e)),this.state.blendMode=l,i.set(this.state),r.drawElements(o,a,r.UNSIGNED_SHORT,2*h)}}flush(){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)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),t.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].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),super.destroy()}getAttributeBuffer(t){const e=a.nextPow2(Math.ceil(t/8)),r=a.log2(e),i=8*e;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);let s=this._aBuffers[i];return s||(this._aBuffers[i]=s=new h.ViewableBuffer(i*this.vertexSize*4)),s}getIndexBuffer(t){const e=a.nextPow2(Math.ceil(t/12)),r=a.log2(e),i=12*e;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);let s=this._iBuffers[r];return s||(this._iBuffers[r]=s=new Uint16Array(i)),s}packInterleavedGeometry(t,e,r,s,n){const{uint32View:o,float32View:a}=e,h=s/this.vertexSize,l=t.uvs,u=t.indices,c=t.vertexData,d=t._texture.baseTexture._batchLocation,p=Math.min(t.worldAlpha,1),f=i.Color.shared.setValue(t._tintRGB).toPremultiplied(p,t._texture.baseTexture.alphaMode>0);for(let t=0;t<c.length;t+=2)a[s++]=c[t],a[s++]=c[t+1],a[s++]=l[t],a[s++]=l[t+1],o[s++]=f,a[s++]=d;for(let t=0;t<u.length;t++)r[n++]=h+u[t]}};b.defaultBatchSize=4096,b.extension={name:"batch",type:n.ExtensionType.RendererPlugin},b._drawCallPool=[],b._textureArrayPool=[];let T=b;n.extensions.add(T),e.BatchRenderer=T},5575:(t,e,r)=>{"use strict";var i=r(2629),s=r(9878),n=r(7391);const o=["jpg","png","jpeg","avif","webp","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"];function a(t,e,r){const i={};if(t.forEach((t=>{i[t]=e})),Object.keys(e.textures).forEach((t=>{i[`${e.cachePrefix}${t}`]=e.textures[t]})),!r){const r=s.utils.path.dirname(t[0]);e.linkedSheets.forEach(((t,s)=>{Object.assign(i,a([`${r}/${e.data.meta.related_multi_packs[s]}`],t,!0))}))}return i}const h={extension:s.ExtensionType.Asset,cache:{test:t=>t instanceof n.Spritesheet,getCacheableAssets:(t,e)=>a(t,e,!1)},resolver:{test:t=>{const e=t.split("?")[0].split("."),r=e.pop(),i=e.pop();return"json"===r&&o.includes(i)},parse:t=>{const e=t.split(".");return{resolution:parseFloat(s.settings.RETINA_PREFIX.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",extension:{type:s.ExtensionType.LoadParser,priority:i.LoaderParserPriority.Normal},testParse:async(t,e)=>".json"===s.utils.path.extname(e.src).toLowerCase()&&!!t.frames,async parse(t,e,r){const{texture:o,imageFilename:a,cachePrefix:h}=e?.data??{};let l,u=s.utils.path.dirname(e.src);if(u&&u.lastIndexOf("/")!==u.length-1&&(u+="/"),o&&o.baseTexture)l=o;else{const s=i.copySearchParams(u+(a??t.meta.image),e.src);l=(await r.load([s]))[s]}const c=new n.Spritesheet({texture:l.baseTexture,data:t,resolutionFilename:e.src,cachePrefix:h});await c.parse();const d=t?.meta?.related_multi_packs;if(Array.isArray(d)){const t=[];for(const s of d){if("string"!=typeof s)continue;let n=u+s;e.data?.ignoreMultiPack||(n=i.copySearchParams(n,e.src),t.push(r.load({src:n,data:{ignoreMultiPack:!0}})))}const s=await Promise.all(t);c.linkedSheets=s,s.forEach((t=>{t.linkedSheets=[c].concat(c.linkedSheets.filter((e=>e!==t)))}))}return c},unload(t){t.destroy(!0)}}};s.extensions.add(h),e.spritesheetAsset=h},5577:(t,e,r)=>{"use strict";var i=r(8894),s=r(5610),n=r(9693),o=r(5081),a=r(8379),h=r(616);const l=class t extends n.Shader{constructor(e,r,i){super(s.Program.from(e||t.defaultVertexSrc,r||t.defaultFragmentSrc),i),this.padding=0,this.resolution=t.defaultResolution,this.multisample=t.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new o.State}apply(t,e,r,i,s){t.applyFilter(this,e,r,i)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){return h.default}static get defaultFragmentSrc(){return a.default}};l.defaultResolution=1,l.defaultMultisample=i.MSAA_QUALITY.NONE;let u=l;e.Filter=u},5610:(t,e,r)=>{"use strict";var i=r(8894),s=r(8066),n=r(8913),o=r(5770);r(9440);var a=r(3086),h=r(1306);let l=0;const u={},c=class t{constructor(e,r,s="pixi-shader",n={}){this.extra={},this.id=l++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=r||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=n,"#version"!==this.vertexSrc.substring(0,8)&&(s=s.replace(/\s+/g,"-"),u[s]?(u[s]++,s+=`-${u[s]}`):u[s]=1,this.vertexSrc=`#define SHADER_NAME ${s}\n${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${s}\n${this.fragmentSrc}`,this.vertexSrc=a.setPrecision(this.vertexSrc,t.defaultVertexPrecision,i.PRECISION.HIGH),this.fragmentSrc=a.setPrecision(this.fragmentSrc,t.defaultFragmentPrecision,h.getMaxFragmentPrecision())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return o.default}static get defaultFragmentSrc(){return n.default}static from(e,r,i){const n=e+r;let o=s.ProgramCache[n];return o||(s.ProgramCache[n]=o=new t(e,r,i)),o}};c.defaultVertexPrecision=i.PRECISION.HIGH,c.defaultFragmentPrecision=s.isMobile.apple.device?i.PRECISION.HIGH:i.PRECISION.MEDIUM;let d=c;e.Program=d},5630:(t,e,r)=>{"use strict";var i=Function.prototype.call,s=Object.prototype.hasOwnProperty,n=r(9524);t.exports=n.call(i,s)},5638:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Resolve=e.ResolveType=void 0;const i=r(3943);var s;!function(t){t[t.BEHAVIOUR_SUBJECT=0]="BEHAVIOUR_SUBJECT",t[t.VARIABLE=1]="VARIABLE"}(s=e.ResolveType||(e.ResolveType={}));class n extends Map{constructor(){super()}initProperties(t){this.forEach((e=>{switch(e.type){case s.VARIABLE:t[e.propertyKey]=t[e.propertyKey];break;case s.BEHAVIOUR_SUBJECT:default:t[e.propertyKey]&&t[e.propertyKey]?.constructor?.name===i.BehaviorSubject.name||(t[e.propertyKey]=new i.BehaviorSubject(t[e.propertyKey]))}}))}setProperty(t,e,r){if(!this.has(e))return!1;const i=this.get(e);switch(i.type){case s.VARIABLE:t[i.propertyKey]=r;break;case s.BEHAVIOUR_SUBJECT:default:t[i.propertyKey].next(r)}return!0}}e.Resolve=(t,e=s.BEHAVIOUR_SUBJECT)=>(r,i)=>{r.__resolve=r.__resolve||new n,r.__resolve.set(t,{selector:t,propertyKey:i,type:e})}},5648:(t,e,r)=>{"use strict";var i=r(9878),s=r(3293),n=r(8456),o=r(7259);r(8270);var a=r(2118),h=r(862),l=r(6526);const u=class t{constructor(t,e,r){const[s]=t.info,[n]=t.common,[o]=t.page,[a]=t.distanceField,h=i.utils.getResolutionOfUrl(o.file),l={};this._ownsTextures=r,this.font=s.face,this.size=s.size,this.lineHeight=n.lineHeight/h,this.chars={},this.pageTextures=l;for(let r=0;r<t.page.length;r++){const{id:s,file:n}=t.page[r];l[s]=e instanceof Array?e[r]:e[n],a?.fieldType&&"none"!==a.fieldType&&(l[s].baseTexture.alphaMode=i.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,l[s].baseTexture.mipmap=i.MIPMAP_MODES.OFF)}for(let e=0;e<t.char.length;e++){const{id:r,page:s}=t.char[e];let{x:n,y:o,width:a,height:u,xoffset:c,yoffset:d,xadvance:p}=t.char[e];n/=h,o/=h,a/=h,u/=h,c/=h,d/=h,p/=h;const f=new i.Rectangle(n+l[s].frame.x/h,o+l[s].frame.y/h,a,u);this.chars[r]={xOffset:c,yOffset:d,xAdvance:p,kerning:{},texture:new i.Texture(l[s].baseTexture,f),page:s}}for(let e=0;e<t.kerning.length;e++){let{first:r,second:i,amount:s}=t.kerning[e];r/=h,i/=h,s/=h,this.chars[i]&&(this.chars[i].kerning[r]=s)}this.distanceFieldRange=a?.distanceRange,this.distanceFieldType=a?.fieldType?.toLowerCase()??"none"}destroy(){for(const t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(const t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null}static install(e,r,s){let a;if(e instanceof n.BitmapFontData)a=e;else{const t=o.autoDetectFormat(e);if(!t)throw new Error("Unrecognized data format for font.");a=t.parse(e)}r instanceof i.Texture&&(r=[r]);const h=new t(a,r,s);return t.available[h.font]=h,h}static uninstall(e){const r=t.available[e];if(!r)throw new Error(`No font found named '${e}'`);r.destroy(),delete t.available[e]}static from(e,r,o){if(!e)throw new Error("[BitmapFont] Property `name` is required.");const{chars:u,padding:c,resolution:d,textureWidth:p,textureHeight:f,...m}=Object.assign({},t.defaultOptions,o),g=a.resolveCharacters(u),y=r instanceof s.TextStyle?r:new s.TextStyle(r),_=p,v=new n.BitmapFontData;v.info[0]={face:y.fontFamily,size:y.fontSize},v.common[0]={lineHeight:y.fontSize};let x,b,T,E=0,A=0,S=0;const w=[],P=[];for(let t=0;t<g.length;t++){x||(x=i.settings.ADAPTER.createCanvas(),x.width=p,x.height=f,b=x.getContext("2d"),T=new i.BaseTexture(x,{resolution:d,...m}),w.push(T),P.push(new i.Texture(T)),v.page.push({id:P.length-1,file:""}));const e=g[t],r=s.TextMetrics.measureText(e,y,!1,x),n=r.width,o=Math.ceil(r.height),a=Math.ceil(("italic"===y.fontStyle?2:1)*n);if(A>=f-o*d){if(0===A)throw new Error(`[BitmapFont] textureHeight ${f}px is too small (fontFamily: '${y.fontFamily}', fontSize: ${y.fontSize}px, char: '${e}')`);--t,x=null,b=null,T=null,A=0,E=0,S=0;continue}if(S=Math.max(o+r.fontProperties.descent,S),a*d+E>=_){if(0===E)throw new Error(`[BitmapFont] textureWidth ${p}px is too small (fontFamily: '${y.fontFamily}', fontSize: ${y.fontSize}px, char: '${e}')`);--t,A+=S*d,A=Math.ceil(A),E=0,S=0;continue}h.drawGlyph(x,b,r,E,A,d,y);const u=l.extractCharCode(r.text);v.char.push({id:u,page:P.length-1,x:E/d,y:A/d,width:a,height:o,xoffset:0,yoffset:0,xadvance:n-(y.dropShadow?y.dropShadowDistance:0)-(y.stroke?y.strokeThickness:0)}),E+=(a+2*c)*d,E=Math.ceil(E)}if(!o?.skipKerning)for(let t=0,e=g.length;t<e;t++){const r=g[t];for(let t=0;t<e;t++){const e=g[t],i=b.measureText(r).width,s=b.measureText(e).width,n=b.measureText(r+e).width-(i+s);n&&v.kerning.push({first:l.extractCharCode(r),second:l.extractCharCode(e),amount:n})}}const R=new t(v,P,!0);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=R,R}};u.ALPHA=[["a","z"],["A","Z"]," "],u.NUMERIC=[["0","9"]],u.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],u.ASCII=[[" ","~"]],u.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:u.ALPHANUMERIC},u.available={};let c=u;e.BitmapFont=c},5655:(t,e,r)=>{"use strict";var i=r(4029),s=r(2828);e.HTMLText=i.HTMLText,e.HTMLTextStyle=s.HTMLTextStyle},5667:(t,e,r)=>{"use strict";var i=r(1333);if(i)try{i([],"length")}catch(t){i=null}t.exports=i},5724:(t,e,r)=>{"use strict";var i=r(2014),s=r(2935),n=r(7491),o=r(4123),a=r(7395),h=r(865),l=r(3816),u=r(3308),c=r(3306),d=r(6182),p=r(9976),f=r(5796),m=r(4093),g=r(4426),y=r(7287),_=r(6055);const v={buildPoly:u.buildPoly,buildCircle:c.buildCircle,buildRectangle:d.buildRectangle,buildRoundedRectangle:p.buildRoundedRectangle,buildLine:f.buildLine,ArcUtils:m.ArcUtils,BezierUtils:g.BezierUtils,QuadraticUtils:y.QuadraticUtils,BatchPart:_.BatchPart,FILL_COMMANDS:i.FILL_COMMANDS,BATCH_POOL:i.BATCH_POOL,DRAW_CALL_POOL:i.DRAW_CALL_POOL};e.GRAPHICS_CURVES=s.GRAPHICS_CURVES,e.LINE_CAP=s.LINE_CAP,e.LINE_JOIN=s.LINE_JOIN,e.curves=s.curves,e.Graphics=n.Graphics,e.GraphicsData=o.GraphicsData,e.GraphicsGeometry=a.GraphicsGeometry,e.FillStyle=h.FillStyle,e.LineStyle=l.LineStyle,e.graphicsUtils=v},5755:(t,e,r)=>{"use strict";var i=r(8311),s=r(1102),n=function(t,e,r){for(var i,s=t;null!=(i=s.next);s=i)if(i.key===e)return s.next=i.next,r||(i.next=t.next,t.next=i),i};t.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new s("Side channel does not contain "+i(t))},delete:function(e){var r=t&&t.next,i=function(t,e){if(t)return n(t,e,!0)}(t,e);return i&&r&&r===i&&(t=void 0),!!i},get:function(e){return function(t,e){if(t){var r=n(t,e);return r&&r.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!n(t,e)}(t,e)},set:function(e,r){t||(t={next:void 0}),function(t,e,r){var i=n(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}}(t,e,r)}};return e}},5758:(t,e,r)=>{"use strict";var i=r(9878);r(4791);var s=r(7092),n=r(2501);e.Loader=class{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,r)=>(this._parsersValidated=!1,t[e]=r,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const r={promise:null,parser:null};return r.promise=(async()=>{let i=null,s=null;if(e.loadParser&&(s=this._parserHash[e.loadParser],s||console.warn(`[Assets] specified load parser "${e.loadParser}" not found while loading ${t}`)),!s){for(let r=0;r<this.parsers.length;r++){const i=this.parsers[r];if(i.load&&i.test?.(t,e,this)){s=i;break}}if(!s)return console.warn(`[Assets] ${t} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}i=await s.load(t,e,this),r.parser=s;for(let t=0;t<this.parsers.length;t++){const s=this.parsers[t];s.parse&&s.parse&&await(s.testParse?.(i,e,this))&&(i=await s.parse(i,e,this)||i,r.parser=s)}return i})(),r}async load(t,e){this._parsersValidated||this._validateParsers();let r=0;const o={},a=s.isSingleItem(t),h=n.convertToList(t,(t=>({alias:[t],src:t}))),l=h.length,u=h.map((async t=>{const s=i.utils.path.toAbsolute(t.src);if(!o[t.src])try{this.promiseCache[s]||(this.promiseCache[s]=this._getLoadPromiseAndParser(s,t)),o[t.src]=await this.promiseCache[s].promise,e&&e(++r/l)}catch(e){throw delete this.promiseCache[s],delete o[t.src],new Error(`[Loader.load] Failed to load ${s}.\n${e}`)}}));return await Promise.all(u),a?o[h[0].src]:o}async unload(t){const e=n.convertToList(t,(t=>({alias:[t],src:t}))).map((async t=>{const e=i.utils.path.toAbsolute(t.src),r=this.promiseCache[e];if(r){const i=await r.promise;delete this.promiseCache[e],r.parser?.unload?.(i,t,this)}}));await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter((t=>t.name)).reduce(((t,e)=>(t[e.name]&&console.warn(`[Assets] loadParser name conflict "${e.name}"`),{...t,[e.name]:e})),{})}}},5770:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},5788:()=>{},5796:(t,e,r)=>{"use strict";var i=r(9878),s=r(2935);function n(t,e,r,i,s,n,o,a){let h,l;o?(h=i,l=-r):(h=-i,l=r);const u=t-r*s+h,c=e-i*s+l,d=t+r*n+h,p=e+i*n+l;return a.push(u,c,d,p),2}function o(t,e,r,i,s,n,o,a){const h=r-t,l=i-e;let u=Math.atan2(h,l),c=Math.atan2(s-t,n-e);a&&u<c?u+=2*Math.PI:!a&&u>c&&(c+=2*Math.PI);let d=u;const p=c-u,f=Math.abs(p),m=Math.sqrt(h*h+l*l),g=1+(15*f*Math.sqrt(m)/Math.PI|0),y=p/g;if(d+=y,a){o.push(t,e,r,i);for(let r=1,i=d;r<g;r++,i+=y)o.push(t,e,t+Math.sin(i)*m,e+Math.cos(i)*m);o.push(t,e,s,n)}else{o.push(r,i,t,e);for(let r=1,i=d;r<g;r++,i+=y)o.push(t+Math.sin(i)*m,e+Math.cos(i)*m,t,e);o.push(s,n,t,e)}return 2*g}e.buildLine=function(t,e){t.lineStyle.native?function(t,e){let r=0;const s=t.shape,n=t.points||s.points,o=s.type!==i.SHAPES.POLY||s.closeStroke;if(0===n.length)return;const a=e.points,h=e.indices,l=n.length/2,u=a.length/2;let c=u;for(a.push(n[0],n[1]),r=1;r<l;r++)a.push(n[2*r],n[2*r+1]),h.push(c,c+1),c++;o&&h.push(c,u)}(t,e):function(t,e){const r=t.shape;let a=t.points||r.points.slice();const h=e.closePointEps;if(0===a.length)return;const l=t.lineStyle,u=new i.Point(a[0],a[1]),c=new i.Point(a[a.length-2],a[a.length-1]),d=r.type!==i.SHAPES.POLY||r.closeStroke,p=Math.abs(u.x-c.x)<h&&Math.abs(u.y-c.y)<h;if(d){a=a.slice(),p&&(a.pop(),a.pop(),c.set(a[a.length-2],a[a.length-1]));const t=.5*(u.x+c.x),e=.5*(c.y+u.y);a.unshift(t,e),a.push(t,e)}const f=e.points,m=a.length/2;let g=a.length;const y=f.length/2,_=l.width/2,v=_*_,x=l.miterLimit*l.miterLimit;let b=a[0],T=a[1],E=a[2],A=a[3],S=0,w=0,P=-(T-A),R=b-E,M=0,C=0,I=Math.sqrt(P*P+R*R);P/=I,R/=I,P*=_,R*=_;const D=l.alignment,O=2*(1-D),B=2*D;d||(l.cap===s.LINE_CAP.ROUND?g+=o(b-P*(O-B)*.5,T-R*(O-B)*.5,b-P*O,T-R*O,b+P*B,T+R*B,f,!0)+2:l.cap===s.LINE_CAP.SQUARE&&(g+=n(b,T,P,R,O,B,!0,f))),f.push(b-P*O,T-R*O,b+P*B,T+R*B);for(let t=1;t<m-1;++t){b=a[2*(t-1)],T=a[2*(t-1)+1],E=a[2*t],A=a[2*t+1],S=a[2*(t+1)],w=a[2*(t+1)+1],P=-(T-A),R=b-E,I=Math.sqrt(P*P+R*R),P/=I,R/=I,P*=_,R*=_,M=-(A-w),C=E-S,I=Math.sqrt(M*M+C*C),M/=I,C/=I,M*=_,C*=_;const e=E-b,r=T-A,i=E-S,n=w-A,h=e*i+r*n,u=r*i-n*e,c=u<0;if(Math.abs(u)<.001*Math.abs(h)){f.push(E-P*O,A-R*O,E+P*B,A+R*B),h>=0&&(l.join===s.LINE_JOIN.ROUND?g+=o(E,A,E-P*O,A-R*O,E-M*O,A-C*O,f,!1)+4:g+=2,f.push(E-M*B,A-C*B,E+M*O,A+C*O));continue}const d=(-P+b)*(-R+A)-(-P+E)*(-R+T),p=(-M+S)*(-C+A)-(-M+E)*(-C+w),m=(e*p-i*d)/u,y=(n*d-r*p)/u,D=(m-E)*(m-E)+(y-A)*(y-A),L=E+(m-E)*O,N=A+(y-A)*O,F=E-(m-E)*B,k=A-(y-A)*B,U=c?O:B,G=D<=Math.min(e*e+r*r,i*i+n*n)+U*U*v;let H=l.join;if(H===s.LINE_JOIN.MITER&&D/v>x&&(H=s.LINE_JOIN.BEVEL),G)switch(H){case s.LINE_JOIN.MITER:f.push(L,N,F,k);break;case s.LINE_JOIN.BEVEL:c?f.push(L,N,E+P*B,A+R*B,L,N,E+M*B,A+C*B):f.push(E-P*O,A-R*O,F,k,E-M*O,A-C*O,F,k),g+=2;break;case s.LINE_JOIN.ROUND:c?(f.push(L,N,E+P*B,A+R*B),g+=o(E,A,E+P*B,A+R*B,E+M*B,A+C*B,f,!0)+4,f.push(L,N,E+M*B,A+C*B)):(f.push(E-P*O,A-R*O,F,k),g+=o(E,A,E-P*O,A-R*O,E-M*O,A-C*O,f,!1)+4,f.push(E-M*O,A-C*O,F,k))}else{switch(f.push(E-P*O,A-R*O,E+P*B,A+R*B),H){case s.LINE_JOIN.MITER:c?f.push(F,k,F,k):f.push(L,N,L,N),g+=2;break;case s.LINE_JOIN.ROUND:g+=c?o(E,A,E+P*B,A+R*B,E+M*B,A+C*B,f,!0)+2:o(E,A,E-P*O,A-R*O,E-M*O,A-C*O,f,!1)+2}f.push(E-M*O,A-C*O,E+M*B,A+C*B),g+=2}}b=a[2*(m-2)],T=a[2*(m-2)+1],E=a[2*(m-1)],A=a[2*(m-1)+1],P=-(T-A),R=b-E,I=Math.sqrt(P*P+R*R),P/=I,R/=I,P*=_,R*=_,f.push(E-P*O,A-R*O,E+P*B,A+R*B),d||(l.cap===s.LINE_CAP.ROUND?g+=o(E-P*(O-B)*.5,A-R*(O-B)*.5,E-P*O,A-R*O,E+P*B,A+R*B,f,!1)+2:l.cap===s.LINE_CAP.SQUARE&&(g+=n(E,A,P,R,O,B,!1,f)));const L=e.indices,N=s.curves.epsilon*s.curves.epsilon;for(let t=y;t<g+y-2;++t)b=f[2*t],T=f[2*t+1],E=f[2*(t+1)],A=f[2*(t+1)+1],S=f[2*(t+2)],w=f[2*(t+2)+1],!(Math.abs(b*(A-w)+E*(w-T)+S*(T-A))<N)&&L.push(t,t+1,t+2)}(t,e)}},5815:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="#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"},5873:(t,e,r)=>{"use strict";var i=r(9878),s=r(2366),n=r(2573),o=r(9139);const a=["normal","bold","100","200","300","400","500","600","700","800","900"],h=[".ttf",".otf",".woff",".woff2"],l=["font/ttf","font/otf","font/woff","font/woff2"],u=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function c(t){const e=i.utils.path.extname(t),r=i.utils.path.basename(t,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map((t=>t.charAt(0).toUpperCase()+t.slice(1)));let s=r.length>0;for(const t of r)if(!t.match(u)){s=!1;break}let n=r.join(" ");return s||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const d=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/,p={extension:{type:i.ExtensionType.LoadParser,priority:o.LoaderParserPriority.Low},name:"loadWebFont",test:t=>s.checkDataUrl(t,l)||n.checkExtension(t,h),async load(t,e){const r=i.settings.ADAPTER.getFontFaceSet();if(r){const i=[],n=e.data?.family??c(t),o=e.data?.weights?.filter((t=>a.includes(t)))??["normal"],h=e.data??{};for(let e=0;e<o.length;e++){const a=o[e],l=new FontFace(n,`url(${s=t,d.test(s)?s:encodeURI(s)})`,{...h,weight:a});await l.load(),r.add(l),i.push(l)}return 1===i.length?i[0]:i}var s;return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(t){(Array.isArray(t)?t:[t]).forEach((t=>i.settings.ADAPTER.getFontFaceSet().delete(t)))}};i.extensions.add(p),e.getFontFamilyName=c,e.loadWebFont=p},5881:(t,e,r)=>{"use strict";var i=r(7146);const s=new i.Matrix;e.TextureMatrix=class{constructor(t,e){this._texture=t,this.mapCoord=new i.Matrix,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof e>"u"?.5:e,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,e){void 0===e&&(e=t);const r=this.mapCoord;for(let i=0;i<t.length;i+=2){const s=t[i],n=t[i+1];e[i]=s*r.a+n*r.c+r.tx,e[i+1]=s*r.b+n*r.d+r.ty}return e}update(t){const e=this._texture;if(!e||!e.valid||!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;const 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);const i=e.orig,n=e.trim;n&&(s.set(i.width/n.width,0,0,i.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(s));const o=e.baseTexture,a=this.uClampFrame,h=this.clampMargin/o.resolution,l=this.clampOffset;return a[0]=(e._frame.x+h+l)/o.width,a[1]=(e._frame.y+h+l)/o.height,a[2]=(e._frame.x+e._frame.width-h+l)/o.width,a[3]=(e._frame.y+e._frame.height-h+l)/o.height,this.uClampOffset[0]=l/o.realWidth,this.uClampOffset[1]=l/o.realHeight,this.isSimple=e._frame.width===o.width&&e._frame.height===o.height&&0===e.rotate,!0}}},5885:(t,e,r)=>{"use strict";var i=r(7773);r(8840);var s=r(2768);const n=827611204,o=861165636,a=894720068,h={[n]:i.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,[o]:i.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,[a]:i.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT},l={70:i.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:i.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:i.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:i.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:i.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:i.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:i.INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:i.INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:i.INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:i.INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:i.INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:i.INTERNAL_FORMATS.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:i.INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};e.parseDDS=function(t){const e=new Uint32Array(t);if(542327876!==e[0])throw new Error("Invalid DDS file magic word");const r=new Uint32Array(t,0,124/Uint32Array.BYTES_PER_ELEMENT),n=r[3],o=r[4],a=r[7],u=new Uint32Array(t,19*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),c=u[1];if(4&c){const r=u[2];if(808540228!==r){const e=h[r],i=new Uint8Array(t,128);return[new s.CompressedTextureResource(i,{format:e,width:o,height:n,levels:a})]}const c=128,d=new Uint32Array(e.buffer,c,20/Uint32Array.BYTES_PER_ELEMENT),p=d[0],f=d[1],m=d[2],g=d[3],y=l[p];if(void 0===y)throw new Error(`DDSParser cannot parse texture data with DXGI format ${p}`);if(4===m)throw new Error("DDSParser does not support cubemap textures");if(6===f)throw new Error("DDSParser does not supported 3D texture data");const _=new Array,v=148;if(1===g)_.push(new Uint8Array(t,v));else{const e=i.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[y];let r=0,s=o,h=n;for(let t=0;t<a;t++)r+=Math.max(1,s+3&-4)*Math.max(1,h+3&-4)*e,s>>>=1,h>>>=1;let l=v;for(let e=0;e<g;e++)_.push(new Uint8Array(t,l,r)),l+=r}return _.map((t=>new s.CompressedTextureResource(t,{format:y,width:o,height:n,levels:a})))}throw 64&c?new Error("DDSParser does not support uncompressed texture data."):512&c?new Error("DDSParser does not supported YUV uncompressed texture data."):131072&c?new Error("DDSParser does not support single-channel (lumninance) texture data!"):2&c?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}},5927:(t,e,r)=>{"use strict";r.d(e,{C6:()=>s,sH:()=>n});var i=function(t,e){return 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])},i(t,e)};function s(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function n(t,e,r,i){return new(r||(r=Promise))((function(s,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(o,a)}h((i=i.apply(t,e||[])).next())}))}},5929:(t,e,r)=>{var i;!function(t){!function(){var e="object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=s(t);function s(t,e){return function(r,i){"function"!=typeof t[r]&&Object.defineProperty(t,r,{configurable:!0,writable:!0,value:i}),e&&e(r,i)}}void 0===e.Reflect?e.Reflect=t:i=s(e.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,i=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",s=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",n="function"==typeof Object.create,o={__proto__:[]}instanceof Array,a=!n&&!o,h={create:n?function(){return L(Object.create(null))}:o?function(){return L({__proto__:null})}:function(){return L({})},has:a?function(t,r){return e.call(t,r)}:function(t,e){return e in t},get:a?function(t,r){return e.call(t,r)?t[r]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),u="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,c=u||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[s]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var r=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var i=this._keys.length,s=r+1;s<i;s++)this._keys[s-1]=this._keys[s],this._values[s-1]=this._values[s];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new r(this._keys,this._values,i)},e.prototype.values=function(){return new r(this._keys,this._values,n)},e.prototype.entries=function(){return new r(this._keys,this._values,o)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[s]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function i(t,e){return t}function n(t,e){return e}function o(t,e){return[t,e]}}():Map,d=u||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new c}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[s]=function(){return this.keys()},t}():Set,p=new(u||"function"!=typeof WeakMap?function(){var t=h.create(),r=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=s(t,!1);return void 0!==e&&h.has(e,this._key)},t.prototype.get=function(t){var e=s(t,!1);return void 0!==e?h.get(e,this._key):void 0},t.prototype.set=function(t,e){return s(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=s(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var e;do{e="@@WeakMap@@"+o()}while(h.has(t,e));return t[e]=!0,e}function s(t,i){if(!e.call(t,r)){if(!i)return;Object.defineProperty(t,r,{value:h.create()})}return t[r]}function n(t,e){for(var r=0;r<e;++r)t[r]=255*Math.random()|0;return t}function o(){var t,e=(t=16,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):n(new Uint8Array(t),t):n(new Array(t),t));e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var r="",i=0;i<16;++i){var s=e[i];4!==i&&6!==i&&8!==i||(r+="-"),s<16&&(r+="0"),r+=s.toString(16).toLowerCase()}return r}}():WeakMap);function f(t,e,r){var i=p.get(t);if(E(i)){if(!r)return;i=new c,p.set(t,i)}var s=i.get(e);if(E(s)){if(!r)return;s=new c,i.set(e,s)}return s}function m(t,e,r){if(g(t,e,r))return!0;var i=B(e);return!A(i)&&m(t,i,r)}function g(t,e,r){var i=f(e,r,!1);return!E(i)&&!!i.has(t)}function y(t,e,r){if(g(t,e,r))return _(t,e,r);var i=B(e);return A(i)?void 0:y(t,i,r)}function _(t,e,r){var i=f(e,r,!1);if(!E(i))return i.get(t)}function v(t,e,r,i){f(r,i,!0).set(t,e)}function x(t,e){var r=b(t,e),i=B(t);if(null===i)return r;var s=x(i,e);if(s.length<=0)return r;if(r.length<=0)return s;for(var n=new d,o=[],a=0,h=r;a<h.length;a++){var l=h[a];n.has(l)||(n.add(l),o.push(l))}for(var u=0,c=s;u<c.length;u++)l=c[u],n.has(l)||(n.add(l),o.push(l));return o}function b(t,e){var r=[],i=f(t,e,!1);if(E(i))return r;for(var n=function(t){var e=I(t,s);if(!M(e))throw new TypeError;var r=e.call(t);if(!S(r))throw new TypeError;return r}(i.keys()),o=0;;){var a=D(n);if(!a)return r.length=o,r;var h=a.value;try{r[o]=h}catch(t){try{O(n)}finally{throw t}}o++}}function T(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function E(t){return void 0===t}function A(t){return null===t}function S(t){return"object"==typeof t?null!==t:"function"==typeof t}function w(t,e){switch(T(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var r=3===e?"string":5===e?"number":"default",s=I(t,i);if(void 0!==s){var n=s.call(t,r);if(S(n))throw new TypeError;return n}return function(t,e){if("string"===e){var r=t.toString;if(M(r)&&!S(s=r.call(t)))return s;if(M(i=t.valueOf)&&!S(s=i.call(t)))return s}else{var i;if(M(i=t.valueOf)&&!S(s=i.call(t)))return s;var s,n=t.toString;if(M(n)&&!S(s=n.call(t)))return s}throw new TypeError}(t,"default"===r?"number":r)}function P(t){var e=w(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function R(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function M(t){return"function"==typeof t}function C(t){return"function"==typeof t}function I(t,e){var r=t[e];if(null!=r){if(!M(r))throw new TypeError;return r}}function D(t){var e=t.next();return!e.done&&e}function O(t){var e=t.return;e&&e.call(t)}function B(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)return e;var r=t.prototype,i=r&&Object.getPrototypeOf(r);if(null==i||i===Object.prototype)return e;var s=i.constructor;return"function"!=typeof s||s===t?e:s}function L(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,r,i){if(E(r)){if(!R(t))throw new TypeError;if(!C(e))throw new TypeError;return function(t,e){for(var r=t.length-1;r>=0;--r){var i=(0,t[r])(e);if(!E(i)&&!A(i)){if(!C(i))throw new TypeError;e=i}}return e}(t,e)}if(!R(t))throw new TypeError;if(!S(e))throw new TypeError;if(!S(i)&&!E(i)&&!A(i))throw new TypeError;return A(i)&&(i=void 0),function(t,e,r,i){for(var s=t.length-1;s>=0;--s){var n=(0,t[s])(e,r,i);if(!E(n)&&!A(n)){if(!S(n))throw new TypeError;i=n}}return i}(t,e,r=P(r),i)})),t("metadata",(function(t,e){return function(r,i){if(!S(r))throw new TypeError;if(!E(i)&&!function(t){switch(T(t)){case 3:case 4:return!0;default:return!1}}(i))throw new TypeError;v(t,e,r,i)}})),t("defineMetadata",(function(t,e,r,i){if(!S(r))throw new TypeError;return E(i)||(i=P(i)),v(t,e,r,i)})),t("hasMetadata",(function(t,e,r){if(!S(e))throw new TypeError;return E(r)||(r=P(r)),m(t,e,r)})),t("hasOwnMetadata",(function(t,e,r){if(!S(e))throw new TypeError;return E(r)||(r=P(r)),g(t,e,r)})),t("getMetadata",(function(t,e,r){if(!S(e))throw new TypeError;return E(r)||(r=P(r)),y(t,e,r)})),t("getOwnMetadata",(function(t,e,r){if(!S(e))throw new TypeError;return E(r)||(r=P(r)),_(t,e,r)})),t("getMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return E(e)||(e=P(e)),x(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return E(e)||(e=P(e)),b(t,e)})),t("deleteMetadata",(function(t,e,r){if(!S(e))throw new TypeError;E(r)||(r=P(r));var i=f(e,r,!1);if(E(i))return!1;if(!i.delete(t))return!1;if(i.size>0)return!0;var s=p.get(e);return s.delete(r),s.size>0||p.delete(e),!0}))}(i)}()}(i||(i={}))},5936:(t,e,r)=>{"use strict";var i=r(238),s=r(7146);class n{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new s.Matrix,this.transform=null}update(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);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(t,e,r,i){const s=this.projectionMatrix,n=i?-1:1;s.identity(),s.a=1/e.width*2,s.d=n*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-n-e.y*s.d}setTransform(t){}destroy(){this.renderer=null}}n.extension={type:i.ExtensionType.RendererSystem,name:"projection"},i.extensions.add(n),e.ProjectionSystem=n},5941:(t,e,r)=>{"use strict";var i=r(4676),s=r(3604),n=r(6489),o=r(4682),a=r(8681),h=r(7927);e.PlaneGeometry=i.PlaneGeometry,e.RopeGeometry=s.RopeGeometry,e.NineSlicePlane=n.NineSlicePlane,e.SimpleMesh=o.SimpleMesh,e.SimplePlane=a.SimplePlane,e.SimpleRope=h.SimpleRope},5966:t=>{"use strict";t.exports=URIError},6010:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},6017:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i.A});var i=r(1831)},6021:(t,e,r)=>{"use strict";var i=r(1203);class s extends i.BaseImageResource{constructor(t){super(t)}static test(t){const{OffscreenCanvas:e}=globalThis;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}}e.CanvasResource=s},6041:()=>{},6048:(t,e)=>{"use strict";const r="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;e.testVideoFormat=function(t){return!r&&""!==document.createElement("video").canPlayType(t)}},6055:(t,e)=>{"use strict";e.BatchPart=class{constructor(){this.reset()}begin(t,e,r){this.reset(),this.style=t,this.start=e,this.attribStart=r}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}},6059:(t,e,r)=>{"use strict";var i=r(9878),s=r(7378),n=r(2133),o=r(4694);class a extends i.ObjectRenderer{constructor(t){super(t),this.shader=null,this.properties=null,this.tempMatrix=new i.Matrix,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:i.TYPES.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=i.Shader.from(o.default,n.default,{}),this.state=i.State.for2d()}render(t){const e=t.children,r=t._maxSize,s=t._batchSize,n=this.renderer;let o=e.length;if(0===o)return;o>r&&!t.autoResize&&(o=r);let a=t._buffers;a||(a=t._buffers=this.generateBuffers(t));const h=e[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=i.utils.correctBlendMode(t.blendMode,l),n.state.set(this.state);const u=n.gl,c=t.worldTransform.copyTo(this.tempMatrix);c.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=i.Color.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let r=0,i=0;r<o;r+=s,i+=1){let h=o-r;h>s&&(h=s),i>=a.length&&a.push(this._generateOneMoreBuffer(t));const l=a[i];l.uploadDynamic(e,r,h);const c=t._bufferUpdateIDs[i]||0;d=d||l._updateID<c,d&&(l._updateID=t._updateID,l.uploadStatic(e,r,h)),n.geometry.bind(l.geometry),u.drawElements(u.TRIANGLES,6*h,u.UNSIGNED_SHORT,0)}}generateBuffers(t){const e=[],r=t._maxSize,i=t._batchSize,n=t._properties;for(let t=0;t<r;t+=i)e.push(new s.ParticleBuffer(this.properties,n,i));return e}_generateOneMoreBuffer(t){const e=t._batchSize,r=t._properties;return new s.ParticleBuffer(this.properties,r,e)}uploadVertices(t,e,r,i,s,n){let o=0,a=0,h=0,l=0;for(let u=0;u<r;++u){const r=t[e+u],c=r._texture,d=r.scale.x,p=r.scale.y,f=c.trim,m=c.orig;f?(a=f.x-r.anchor.x*m.width,o=a+f.width,l=f.y-r.anchor.y*m.height,h=l+f.height):(o=m.width*(1-r.anchor.x),a=m.width*-r.anchor.x,h=m.height*(1-r.anchor.y),l=m.height*-r.anchor.y),i[n]=a*d,i[n+1]=l*p,i[n+s]=o*d,i[n+s+1]=l*p,i[n+2*s]=o*d,i[n+2*s+1]=h*p,i[n+3*s]=a*d,i[n+3*s+1]=h*p,n+=4*s}}uploadPosition(t,e,r,i,s,n){for(let o=0;o<r;o++){const r=t[e+o].position;i[n]=r.x,i[n+1]=r.y,i[n+s]=r.x,i[n+s+1]=r.y,i[n+2*s]=r.x,i[n+2*s+1]=r.y,i[n+3*s]=r.x,i[n+3*s+1]=r.y,n+=4*s}}uploadRotation(t,e,r,i,s,n){for(let o=0;o<r;o++){const r=t[e+o].rotation;i[n]=r,i[n+s]=r,i[n+2*s]=r,i[n+3*s]=r,n+=4*s}}uploadUvs(t,e,r,i,s,n){for(let o=0;o<r;++o){const r=t[e+o]._texture._uvs;r?(i[n]=r.x0,i[n+1]=r.y0,i[n+s]=r.x1,i[n+s+1]=r.y1,i[n+2*s]=r.x2,i[n+2*s+1]=r.y2,i[n+3*s]=r.x3,i[n+3*s+1]=r.y3,n+=4*s):(i[n]=0,i[n+1]=0,i[n+s]=0,i[n+s+1]=0,i[n+2*s]=0,i[n+2*s+1]=0,i[n+3*s]=0,i[n+3*s+1]=0,n+=4*s)}}uploadTint(t,e,r,s,n,o){for(let a=0;a<r;++a){const r=t[e+a],h=i.Color.shared.setValue(r._tintRGB).toPremultiplied(r.alpha,r.texture.baseTexture.alphaMode>0);s[o]=h,s[o+n]=h,s[o+2*n]=h,s[o+3*n]=h,o+=4*n}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}a.extension={name:"particle",type:i.ExtensionType.RendererPlugin},i.extensions.add(a),e.ParticleRenderer=a},6071:(t,e,r)=>{"use strict";var i=r(1537);class s{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let r=0,i=e.length;r<i;r++)t.push(e[r].x,e[r].y);e=t}this.points=e,this.type=i.SHAPES.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),e=new s(t);return e.closeStroke=this.closeStroke,e}contains(t,e){let r=!1;const i=this.points.length/2;for(let s=0,n=i-1;s<i;n=s++){const i=this.points[2*s],o=this.points[2*s+1],a=this.points[2*n],h=this.points[2*n+1];o>e!=h>e&&t<(e-o)/(h-o)*(a-i)+i&&(r=!r)}return r}}s.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce(((t,e)=>`${t}, ${e}`),"")}]`},e.Polygon=s},6119:(t,e)=>{"use strict";e.GLProgram=class{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}},e.IGLUniformData=class{}},6145:()=>{},6152:()=>{},6182:(t,e)=>{"use strict";const r={build(t){const e=t.shape,r=e.x,i=e.y,s=e.width,n=e.height,o=t.points;o.length=0,s>=0&&n>=0&&o.push(r,i,r+s,i,r+s,i+n,r,i+n)},triangulate(t,e){const r=t.points,i=e.points;if(0===r.length)return;const s=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(s,s+1,s+2,s+1,s+2,s+3)}};e.buildRectangle=r},6217:(t,e,r)=>{"use strict";var i=r(9878);const s={willReadFrequently:!0},n=class t{static get experimentalLetterSpacingSupported(){let e=t._experimentalLetterSpacingSupported;if(void 0!==e){const r=i.settings.ADAPTER.getCanvasRenderingContext2D().prototype;e=t._experimentalLetterSpacingSupported="letterSpacing"in r||"textLetterSpacing"in r}return e}constructor(t,e,r,i,s,n,o,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=s,this.lineWidths=n,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=h}static measureText(e,r,i,n=t._canvas){i=i??r.wordWrap;const o=r.toFontString(),a=t.measureFont(o);0===a.fontSize&&(a.fontSize=r.fontSize,a.ascent=r.fontSize);const h=n.getContext("2d",s);h.font=o;const l=(i?t.wordWrap(e,r,n):e).split(/(?:\r\n|\r|\n)/),u=new Array(l.length);let c=0;for(let e=0;e<l.length;e++){const i=t._measureText(l[e],r.letterSpacing,h);u[e]=i,c=Math.max(c,i)}let d=c+r.strokeThickness;r.dropShadow&&(d+=r.dropShadowDistance);const p=r.lineHeight||a.fontSize+r.strokeThickness;let f=Math.max(p,a.fontSize+2*r.strokeThickness)+r.leading+(l.length-1)*(p+r.leading);return r.dropShadow&&(f+=r.dropShadowDistance),new t(e,r,d,f,l,u,p+r.leading,c,a)}static _measureText(e,r,i){let s=!1;t.experimentalLetterSpacingSupported&&(t.experimentalLetterSpacing?(i.letterSpacing=`${r}px`,i.textLetterSpacing=`${r}px`,s=!0):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(e).width;return n>0&&(s?n-=r:n+=(t.graphemeSegmenter(e).length-1)*r),n}static wordWrap(e,r,i=t._canvas){const n=i.getContext("2d",s);let o=0,a="",h="";const l=Object.create(null),{letterSpacing:u,whiteSpace:c}=r,d=t.collapseSpaces(c),p=t.collapseNewlines(c);let f=!d;const m=r.wordWrapWidth+u,g=t.tokenize(e);for(let e=0;e<g.length;e++){let i=g[e];if(t.isNewline(i)){if(!p){h+=t.addLine(a),f=!d,a="",o=0;continue}i=" "}if(d){const e=t.isBreakingSpace(i),r=t.isBreakingSpace(a[a.length-1]);if(e&&r)continue}const s=t.getFromCache(i,u,l,n);if(s>m)if(""!==a&&(h+=t.addLine(a),a="",o=0),t.canBreakWords(i,r.breakWords)){const e=t.wordWrapSplit(i);for(let s=0;s<e.length;s++){let c=e[s],d=c,p=1;for(;e[s+p];){const n=e[s+p];if(t.canBreakChars(d,n,i,s,r.breakWords))break;c+=n,d=n,p++}s+=p-1;const g=t.getFromCache(c,u,l,n);g+o>m&&(h+=t.addLine(a),f=!1,a="",o=0),a+=c,o+=g}}else{a.length>0&&(h+=t.addLine(a),a="",o=0);const r=e===g.length-1;h+=t.addLine(i,!r),f=!1,a="",o=0}else s+o>m&&(f=!1,h+=t.addLine(a),a="",o=0),(a.length>0||!t.isBreakingSpace(i)||f)&&(a+=i,o+=s)}return h+=t.addLine(a,!1),h}static addLine(e,r=!0){return e=t.trimRight(e),r?`${e}\n`:e}static getFromCache(e,r,i,s){let n=i[e];return"number"!=typeof n&&(n=t._measureText(e,r,s)+r,i[e]=n),n}static collapseSpaces(t){return"normal"===t||"pre-line"===t}static collapseNewlines(t){return"normal"===t}static trimRight(e){if("string"!=typeof e)return"";for(let r=e.length-1;r>=0;r--){const i=e[r];if(!t.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return"string"==typeof e&&t._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,r){return"string"==typeof e&&t._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const r=[];let i="";if("string"!=typeof e)return r;for(let s=0;s<e.length;s++){const n=e[s],o=e[s+1];t.isBreakingSpace(n,o)||t.isNewline(n)?(""!==i&&(r.push(i),i=""),r.push(n)):i+=n}return""!==i&&r.push(i),r}static canBreakWords(t,e){return e}static canBreakChars(t,e,r,i,s){return!0}static wordWrapSplit(e){return t.graphemeSegmenter(e)}static measureFont(e){if(t._fonts[e])return t._fonts[e];const r={ascent:0,descent:0,fontSize:0},i=t._canvas,s=t._context;s.font=e;const n=t.METRICS_STRING+t.BASELINE_SYMBOL,o=Math.ceil(s.measureText(n).width);let a=Math.ceil(s.measureText(t.BASELINE_SYMBOL).width);const h=Math.ceil(t.HEIGHT_MULTIPLIER*a);if(a=a*t.BASELINE_MULTIPLIER|0,0===o||0===h)return t._fonts[e]=r,r;i.width=o,i.height=h,s.fillStyle="#f00",s.fillRect(0,0,o,h),s.font=e,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(n,0,a);const l=s.getImageData(0,0,o,h).data,u=l.length,c=4*o;let d=0,p=0,f=!1;for(d=0;d<a;++d){for(let t=0;t<c;t+=4)if(255!==l[p+t]){f=!0;break}if(f)break;p+=c}for(r.ascent=a-d,p=u-c,f=!1,d=h;d>a;--d){for(let t=0;t<c;t+=4)if(255!==l[p+t]){f=!0;break}if(f)break;p-=c}return r.descent=d-a,r.fontSize=r.ascent+r.descent,t._fonts[e]=r,r}static clearMetrics(e=""){e?delete t._fonts[e]:t._fonts={}}static get _canvas(){if(!t.__canvas){let e;try{const r=new OffscreenCanvas(0,0);if(r.getContext("2d",s)?.measureText)return t.__canvas=r,r;e=i.settings.ADAPTER.createCanvas()}catch{e=i.settings.ADAPTER.createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas}static get _context(){return t.__context||(t.__context=t._canvas.getContext("2d",s)),t.__context}};n.METRICS_STRING="|ÉqÅ",n.BASELINE_SYMBOL="M",n.BASELINE_MULTIPLIER=1.4,n.HEIGHT_MULTIPLIER=2,n.graphemeSegmenter=(()=>{if("function"==typeof Intl?.Segmenter){const t=new Intl.Segmenter;return e=>[...t.segment(e)].map((t=>t.segment))}return t=>[...t]})(),n.experimentalLetterSpacing=!1,n._fonts={},n._newlines=[10,13],n._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let o=n;e.TextMetrics=o},6221:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});var r={grad:.9,turn:360,rad:360/(2*Math.PI)},i=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},s=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},n=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),t>r?r:t>e?t:e},o=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},a=function(t){return{r:n(t.r,0,255),g:n(t.g,0,255),b:n(t.b,0,255),a:n(t.a)}},h=function(t){return{r:s(t.r),g:s(t.g),b:s(t.b),a:s(t.a,3)}},l=/^#([0-9a-f]{3,8})$/i,u=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},c=function(t){var e=t.r,r=t.g,i=t.b,s=t.a,n=Math.max(e,r,i),o=n-Math.min(e,r,i),a=o?n===e?(r-i)/o:n===r?2+(i-e)/o:4+(e-r)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:s}},d=function(t){var e=t.h,r=t.s,i=t.v,s=t.a;e=e/360*6,r/=100,i/=100;var n=Math.floor(e),o=i*(1-r),a=i*(1-(e-n)*r),h=i*(1-(1-e+n)*r),l=n%6;return{r:255*[i,a,o,o,h,i][l],g:255*[h,i,i,a,o,o][l],b:255*[o,o,h,i,i,a][l],a:s}},p=function(t){return{h:o(t.h),s:n(t.s,0,100),l:n(t.l,0,100),a:n(t.a)}},f=function(t){return{h:s(t.h),s:s(t.s),l:s(t.l),a:s(t.a,3)}},m=function(t){return d((r=(e=t).s,{h:e.h,s:(r*=((i=e.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:e.a}));var e,r,i},g=function(t){return{h:(e=c(t)).h,s:(s=(200-(r=e.s))*(i=e.v)/100)>0&&s<200?r*i/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,r,i,s},y=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,x=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b={string:[[function(t){var e=l.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?s(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?s(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=v.exec(t)||x.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:a({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=y.exec(t)||_.exec(t);if(!e)return null;var i,s,n=p({h:(i=e[1],s=e[2],void 0===s&&(s="deg"),Number(i)*(r[s]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return m(n)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,s=t.b,n=t.a,o=void 0===n?1:n;return i(e)&&i(r)&&i(s)?a({r:Number(e),g:Number(r),b:Number(s),a:Number(o)}):null},"rgb"],[function(t){var e=t.h,r=t.s,s=t.l,n=t.a,o=void 0===n?1:n;if(!i(e)||!i(r)||!i(s))return null;var a=p({h:Number(e),s:Number(r),l:Number(s),a:Number(o)});return m(a)},"hsl"],[function(t){var e=t.h,r=t.s,s=t.v,a=t.a,h=void 0===a?1:a;if(!i(e)||!i(r)||!i(s))return null;var l=function(t){return{h:o(t.h),s:n(t.s,0,100),v:n(t.v,0,100),a:n(t.a)}}({h:Number(e),s:Number(r),v:Number(s),a:Number(h)});return d(l)},"hsv"]]},T=function(t,e){for(var r=0;r<e.length;r++){var i=e[r][0](t);if(i)return[i,e[r][1]]}return[null,void 0]},E=function(t){return"string"==typeof t?T(t.trim(),b.string):"object"==typeof t&&null!==t?T(t,b.object):[null,void 0]},A=function(t,e){var r=g(t);return{h:r.h,s:n(r.s+100*e,0,100),l:r.l,a:r.a}},S=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},w=function(t,e){var r=g(t);return{h:r.h,s:r.s,l:n(r.l+100*e,0,100),a:r.a}},P=function(){function t(t){this.parsed=E(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return null!==this.parsed},t.prototype.brightness=function(){return s(S(this.rgba),2)},t.prototype.isDark=function(){return S(this.rgba)<.5},t.prototype.isLight=function(){return S(this.rgba)>=.5},t.prototype.toHex=function(){return e=(t=h(this.rgba)).r,r=t.g,i=t.b,o=(n=t.a)<1?u(s(255*n)):"","#"+u(e)+u(r)+u(i)+o;var t,e,r,i,n,o},t.prototype.toRgb=function(){return h(this.rgba)},t.prototype.toRgbString=function(){return e=(t=h(this.rgba)).r,r=t.g,i=t.b,(s=t.a)<1?"rgba("+e+", "+r+", "+i+", "+s+")":"rgb("+e+", "+r+", "+i+")";var t,e,r,i,s},t.prototype.toHsl=function(){return f(g(this.rgba))},t.prototype.toHslString=function(){return e=(t=f(g(this.rgba))).h,r=t.s,i=t.l,(s=t.a)<1?"hsla("+e+", "+r+"%, "+i+"%, "+s+")":"hsl("+e+", "+r+"%, "+i+"%)";var t,e,r,i,s},t.prototype.toHsv=function(){return t=c(this.rgba),{h:s(t.h),s:s(t.s),v:s(t.v),a:s(t.a,3)};var t},t.prototype.invert=function(){return R({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),R(A(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),R(A(this.rgba,-t))},t.prototype.grayscale=function(){return R(A(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),R(w(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),R(w(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?R({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):s(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=g(this.rgba);return"number"==typeof t?R({h:t,s:e.s,l:e.l,a:e.a}):s(e.h)},t.prototype.isEqual=function(t){return this.toHex()===R(t).toHex()},t}(),R=function(t){return t instanceof P?t:new P(t)},M=[];e.Colord=P,e.colord=R,e.extend=function(t){t.forEach((function(t){M.indexOf(t)<0&&(t(P,b),M.push(t))}))},e.getFormat=function(t){return E(t)[1]},e.random=function(){return new P({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}},6230:t=>{"use strict";var e=[];function r(t){for(var r=-1,i=0;i<e.length;i++)if(e[i].identifier===t){r=i;break}return r}function i(t,i){for(var n={},o=[],a=0;a<t.length;a++){var h=t[a],l=i.base?h[0]+i.base:h[0],u=n[l]||0,c="".concat(l," ").concat(u);n[l]=u+1;var d=r(c),p={css:h[1],media:h[2],sourceMap:h[3],supports:h[4],layer:h[5]};if(-1!==d)e[d].references++,e[d].updater(p);else{var f=s(p,i);i.byIndex=a,e.splice(a,0,{identifier:c,updater:f,references:1})}o.push(c)}return o}function s(t,e){var r=e.domAPI(e);return r.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;r.update(t=e)}else r.remove()}}t.exports=function(t,s){var n=i(t=t||[],s=s||{});return function(t){t=t||[];for(var o=0;o<n.length;o++){var a=r(n[o]);e[a].references--}for(var h=i(t,s),l=0;l<n.length;l++){var u=r(n[l]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}n=h}}},6238:(t,e,r)=>{"use strict";var i=r(6921);r(6145),r(8452);var s=r(4213),n=r(6716);e.BrowserAdapter=i.BrowserAdapter,e.settings=s.settings,e.isMobile=n.isMobile},6247:(t,e)=>{"use strict";class r{constructor(t,e,r=0,i=0){this._x=r,this._y=i,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new r(t,e,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}r.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`},e.ObservablePoint=r},6255:t=>{"use strict";t.exports=Function.prototype.call},6267:(t,e)=>{"use strict";e.createIndicesForQuads=function(t,e=null){const 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(let t=0,i=0;t<r;t+=6,i+=4)e[t+0]=i+0,e[t+1]=i+1,e[t+2]=i+2,e[t+3]=i+0,e[t+4]=i+2,e[t+5]=i+3;return e}},6276:(t,e,r)=>{"use strict";var i=r(2629),s=r(9878);r(7601);var n=r(5885);const o={extension:{type:s.ExtensionType.LoadParser,priority:i.LoaderParserPriority.High},name:"loadDDS",test:t=>i.checkExtension(t,".dds"),async load(t,e,r){const o=await(await s.settings.ADAPTER.fetch(t)).arrayBuffer(),a=n.parseDDS(o).map((n=>{const o=new s.BaseTexture(n,{mipmap:s.MIPMAP_MODES.OFF,alphaMode:s.ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:s.utils.getResolutionOfUrl(t),...e.data});return i.createTexture(o,r,t)}));return 1===a.length?a[0]:a},unload(t){Array.isArray(t)?t.forEach((t=>t.destroy(!0))):t.destroy(!0)}};s.extensions.add(o),e.loadDDS=o},6311:()=>{},6318:(t,e,r)=>{"use strict";var i=r(7146);class s{constructor(){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)}set(t,e,r){const s=e.width,n=e.height;if(r){const e=t.width/2/s,o=t.height/2/n,a=t.x/s+e,h=t.y/n+o;r=i.groupD8.add(r,i.groupD8.NW),this.x0=a+e*i.groupD8.uX(r),this.y0=h+o*i.groupD8.uY(r),r=i.groupD8.add(r,2),this.x1=a+e*i.groupD8.uX(r),this.y1=h+o*i.groupD8.uY(r),r=i.groupD8.add(r,2),this.x2=a+e*i.groupD8.uX(r),this.y2=h+o*i.groupD8.uY(r),r=i.groupD8.add(r,2),this.x3=a+e*i.groupD8.uX(r),this.y3=h+o*i.groupD8.uY(r)}else this.x0=t.x/s,this.y0=t.y/n,this.x1=(t.x+t.width)/s,this.y1=t.y/n,this.x2=(t.x+t.width)/s,this.y2=(t.y+t.height)/n,this.x3=t.x/s,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}}s.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}]`},e.TextureUvs=s},6320:(t,e,r)=>{"use strict";var i=r(9878),s=r(4993);class n extends s.FederatedEvent{constructor(){super(...arguments),this.client=new i.Point,this.movement=new i.Point,this.offset=new i.Point,this.global=new i.Point,this.screen=new i.Point}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,r,i,s,n,o,a,h,l,u,c,d,p,f){throw new Error("Method not implemented.")}}e.FederatedMouseEvent=n},6362:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,":host{width:fit-content;margin:20px;padding:0px}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},6372:(t,e,r)=>{"use strict";var i=r(6238);e.maxRecommendedTextures=function(t){let e=!0;const r=i.settings.ADAPTER.getNavigator();if(i.isMobile.tablet||i.isMobile.phone){if(i.isMobile.apple.device){const t=r.userAgent.match(/OS (\d+)_(\d+)?/);t&&parseInt(t[1],10)<11&&(e=!1)}if(i.isMobile.android.device){const t=r.userAgent.match(/Android\s([0-9.]*)/);t&&parseInt(t[1],10)<7&&(e=!1)}}return e?t:4}},6404:(t,e,r)=>{var i;!function(t){!function(){var e="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(t){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(t){}}(),i=s(t);function s(t,e){return function(r,i){Object.defineProperty(t,r,{configurable:!0,writable:!0,value:i}),e&&e(r,i)}}void 0!==e.Reflect&&(i=s(e.Reflect,i)),function(t,e){var r=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,s=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",n=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,h=!o&&!a,l={create:o?function(){return j(Object.create(null))}:a?function(){return j({__proto__:null})}:function(){return j({})},has:h?function(t,e){return r.call(t,e)}:function(t,e){return e in t},get:h?function(t,e){return r.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},u=Object.getPrototypeOf(Function),c="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[n]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var r=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var i=this._keys.length,s=r+1;s<i;s++)this._keys[s-1]=this._keys[s],this._values[s-1]=this._values[s];return this._keys.length--,this._values.length--,B(e,this._cacheKey)&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new r(this._keys,this._values,i)},e.prototype.values=function(){return new r(this._keys,this._values,s)},e.prototype.entries=function(){return new r(this._keys,this._values,o)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[n]=function(){return this.entries()},e.prototype._find=function(t,e){if(!B(this._cacheKey,t)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(B(this._keys[r],t)){this._cacheIndex=r;break}}return this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function i(t,e){return t}function s(t,e){return e}function o(t,e){return[t,e]}}(),d="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function t(){this._map=new c}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.keys()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[n]=function(){return this.keys()},t}(),p="function"==typeof WeakMap?WeakMap:function(){var t=l.create(),e=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=s(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){var e=s(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return s(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=s(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var e;do{e="@@WeakMap@@"+o()}while(l.has(t,e));return t[e]=!0,e}function s(t,i){if(!r.call(t,e)){if(!i)return;Object.defineProperty(t,e,{value:l.create()})}return t[e]}function n(t,e){for(var r=0;r<e;++r)t[r]=255*Math.random()|0;return t}function o(){var t=function(t){if("function"==typeof Uint8Array){var e=new Uint8Array(t);return"undefined"!=typeof crypto?crypto.getRandomValues(e):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(e):n(e,t),e}return n(new Array(t),t)}(16);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var e="",r=0;r<16;++r){var i=t[r];4!==r&&6!==r&&8!==r||(e+="-"),i<16&&(e+="0"),e+=i.toString(16).toLowerCase()}return e}}(),f=i?Symbol.for("@reflect-metadata:registry"):void 0,m=function(){var t;return!S(f)&&P(e.Reflect)&&Object.isExtensible(e.Reflect)&&(t=e.Reflect[f]),S(t)&&(t=function(){var t,r,i,s;S(f)||void 0===e.Reflect||f in e.Reflect||"function"!=typeof e.Reflect.defineMetadata||(t=function(t){var e=t.defineMetadata,r=t.hasOwnMetadata,i=t.getOwnMetadata,s=t.getOwnMetadataKeys,n=t.deleteMetadata,o=new p;return{isProviderFor:function(t,e){var r=o.get(t);return!(S(r)||!r.has(e))||!!s(t,e).length&&(S(r)&&(r=new d,o.set(t,r)),r.add(e),!0)},OrdinaryDefineOwnMetadata:e,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:i,OrdinaryOwnMetadataKeys:s,OrdinaryDeleteMetadata:n}}(e.Reflect));var n=new p,o={registerProvider:a,getProvider:l,setProvider:m};return o;function a(e){if(!Object.isExtensible(o))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case t===e:break;case S(r):r=e;break;case r===e:break;case S(i):i=e;break;case i===e:break;default:void 0===s&&(s=new d),s.add(e)}}function h(e,n){if(!S(r)){if(r.isProviderFor(e,n))return r;if(!S(i)){if(i.isProviderFor(e,n))return r;if(!S(s))for(var o=N(s);;){var a=k(o);if(!a)return;var h=F(a);if(h.isProviderFor(e,n))return U(o),h}}}if(!S(t)&&t.isProviderFor(e,n))return t}function l(t,e){var r,i=n.get(t);return S(i)||(r=i.get(e)),S(r)?(S(r=h(t,e))||(S(i)&&(i=new c,n.set(t,i)),i.set(e,r)),r):r}function u(t){if(S(t))throw new TypeError;return r===t||i===t||!S(s)&&s.has(t)}function m(t,e,r){if(!u(r))throw new Error("Metadata provider not registered.");var i=l(t,e);if(i!==r){if(!S(i))return!1;var s=n.get(t);S(s)&&(s=new c,n.set(t,s)),s.set(e,r)}return!0}}()),!S(f)&&P(e.Reflect)&&Object.isExtensible(e.Reflect)&&Object.defineProperty(e.Reflect,f,{enumerable:!1,configurable:!1,writable:!1,value:t}),t}(),g=function(t){var e=new p,r={isProviderFor:function(t,r){var i=e.get(t);return!S(i)&&i.has(r)},OrdinaryDefineOwnMetadata:function(t,e,r,s){i(r,s,!0).set(t,e)},OrdinaryHasOwnMetadata:function(t,e,r){var s=i(e,r,!1);return!S(s)&&M(s.has(t))},OrdinaryGetOwnMetadata:function(t,e,r){var s=i(e,r,!1);if(!S(s))return s.get(t)},OrdinaryOwnMetadataKeys:function(t,e){var r=[],s=i(t,e,!1);if(S(s))return r;for(var n=N(s.keys()),o=0;;){var a=k(n);if(!a)return r.length=o,r;var h=F(a);try{r[o]=h}catch(t){try{U(n)}finally{throw t}}o++}},OrdinaryDeleteMetadata:function(t,r,s){var n=i(r,s,!1);if(S(n))return!1;if(!n.delete(t))return!1;if(0===n.size){var o=e.get(r);S(o)||(o.delete(s),0===o.size&&e.delete(o))}return!0}};return m.registerProvider(r),r;function i(i,s,n){var o=e.get(i),a=!1;if(S(o)){if(!n)return;o=new c,e.set(i,o),a=!0}var h=o.get(s);if(S(h)){if(!n)return;if(h=new c,o.set(s,h),!t.setProvider(i,s,r))throw o.delete(s),a&&e.delete(i),new Error("Wrong provider for target.")}return h}}(m);function y(t,e,r){if(_(t,e,r))return!0;var i=G(e);return!w(i)&&y(t,i,r)}function _(t,e,r){var i=H(e,r,!1);return!S(i)&&M(i.OrdinaryHasOwnMetadata(t,e,r))}function v(t,e,r){if(_(t,e,r))return x(t,e,r);var i=G(e);return w(i)?void 0:v(t,i,r)}function x(t,e,r){var i=H(e,r,!1);if(!S(i))return i.OrdinaryGetOwnMetadata(t,e,r)}function b(t,e,r,i){H(r,i,!0).OrdinaryDefineOwnMetadata(t,e,r,i)}function T(t,e){var r=E(t,e),i=G(t);if(null===i)return r;var s=T(i,e);if(s.length<=0)return r;if(r.length<=0)return s;for(var n=new d,o=[],a=0,h=r;a<h.length;a++){var l=h[a];n.has(l)||(n.add(l),o.push(l))}for(var u=0,c=s;u<c.length;u++)l=c[u],n.has(l)||(n.add(l),o.push(l));return o}function E(t,e){var r=H(t,e,!1);return r?r.OrdinaryOwnMetadataKeys(t,e):[]}function A(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function S(t){return void 0===t}function w(t){return null===t}function P(t){return"object"==typeof t?null!==t:"function"==typeof t}function R(t,e){switch(A(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var r=3===e?"string":5===e?"number":"default",i=L(t,s);if(void 0!==i){var n=i.call(t,r);if(P(n))throw new TypeError;return n}return function(t,e){if("string"===e){var r=t.toString;if(D(r)&&!P(s=r.call(t)))return s;if(D(i=t.valueOf)&&!P(s=i.call(t)))return s}else{var i;if(D(i=t.valueOf)&&!P(s=i.call(t)))return s;var s,n=t.toString;if(D(n)&&!P(s=n.call(t)))return s}throw new TypeError}(t,"default"===r?"number":r)}function M(t){return!!t}function C(t){var e=R(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function I(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function D(t){return"function"==typeof t}function O(t){return"function"==typeof t}function B(t,e){return t===e||t!=t&&e!=e}function L(t,e){var r=t[e];if(null!=r){if(!D(r))throw new TypeError;return r}}function N(t){var e=L(t,n);if(!D(e))throw new TypeError;var r=e.call(t);if(!P(r))throw new TypeError;return r}function F(t){return t.value}function k(t){var e=t.next();return!e.done&&e}function U(t){var e=t.return;e&&e.call(t)}function G(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===u)return e;if(e!==u)return e;var r=t.prototype,i=r&&Object.getPrototypeOf(r);if(null==i||i===Object.prototype)return e;var s=i.constructor;return"function"!=typeof s||s===t?e:s}function H(t,e,r){var i=m.getProvider(t,e);if(!S(i))return i;if(r){if(m.setProvider(t,e,g))return g;throw new Error("Illegal state.")}}function j(t){return t.__=void 0,delete t.__,t}t("decorate",(function(t,e,r,i){if(S(r)){if(!I(t))throw new TypeError;if(!O(e))throw new TypeError;return function(t,e){for(var r=t.length-1;r>=0;--r){var i=(0,t[r])(e);if(!S(i)&&!w(i)){if(!O(i))throw new TypeError;e=i}}return e}(t,e)}if(!I(t))throw new TypeError;if(!P(e))throw new TypeError;if(!P(i)&&!S(i)&&!w(i))throw new TypeError;return w(i)&&(i=void 0),function(t,e,r,i){for(var s=t.length-1;s>=0;--s){var n=(0,t[s])(e,r,i);if(!S(n)&&!w(n)){if(!P(n))throw new TypeError;i=n}}return i}(t,e,r=C(r),i)})),t("metadata",(function(t,e){return function(r,i){if(!P(r))throw new TypeError;if(!S(i)&&!function(t){switch(A(t)){case 3:case 4:return!0;default:return!1}}(i))throw new TypeError;b(t,e,r,i)}})),t("defineMetadata",(function(t,e,r,i){if(!P(r))throw new TypeError;return S(i)||(i=C(i)),b(t,e,r,i)})),t("hasMetadata",(function(t,e,r){if(!P(e))throw new TypeError;return S(r)||(r=C(r)),y(t,e,r)})),t("hasOwnMetadata",(function(t,e,r){if(!P(e))throw new TypeError;return S(r)||(r=C(r)),_(t,e,r)})),t("getMetadata",(function(t,e,r){if(!P(e))throw new TypeError;return S(r)||(r=C(r)),v(t,e,r)})),t("getOwnMetadata",(function(t,e,r){if(!P(e))throw new TypeError;return S(r)||(r=C(r)),x(t,e,r)})),t("getMetadataKeys",(function(t,e){if(!P(t))throw new TypeError;return S(e)||(e=C(e)),T(t,e)})),t("getOwnMetadataKeys",(function(t,e){if(!P(t))throw new TypeError;return S(e)||(e=C(e)),E(t,e)})),t("deleteMetadata",(function(t,e,r){if(!P(e))throw new TypeError;if(S(r)||(r=C(r)),!P(e))throw new TypeError;S(r)||(r=C(r));var i=H(e,r,!1);return!S(i)&&i.OrdinaryDeleteMetadata(t,e,r)}))}(i,e),void 0===e.Reflect&&(e.Reflect=t)}()}(i||(i={}))},6423:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},6441:(t,e)=>{"use strict";e.DATA_URI=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i},6455:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="// 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"},6469:t=>{"use strict";t.exports=RangeError},6484:(t,e,r)=>{"use strict";var i=r(8894),s=r(6238),n=r(1203);class o extends n.BaseImageResource{constructor(t,e){if(e=e||{},"string"==typeof t){const r=new Image;n.BaseImageResource.crossOrigin(r,t,e.crossorigin),r.src=t,t=r}super(t),!t.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=t.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(e.createBitmap??s.settings.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode="number"==typeof e.alphaMode?e.alphaMode:null,this.bitmap=null,this._load=null,!1!==e.autoLoad&&this.load()}load(t){return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise(((t,e)=>{const r=this.source;this.url=r.src;const i=()=>{this.destroyed||(r.onload=null,r.onerror=null,this.update(),this._load=null,this.createBitmap?t(this.process()):t(this))};r.complete&&r.src?i():(r.onload=i,r.onerror=t=>{e(t),this.onError.emit(t)})}))),this._load}process(){const t=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,r=!t.crossOrigin||"anonymous"===t.crossOrigin;return this._process=fetch(t.src,{mode:r?"cors":"no-cors"}).then((t=>t.blob())).then((r=>e(r,0,0,t.width,t.height,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===i.ALPHA_MODES.UNPACK?"premultiply":"none"}))).then((t=>this.destroyed?Promise.reject():(this.bitmap=t,this.update(),this._process=null,Promise.resolve(this)))),this._process}upload(t,e,r){if("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,r,this.bitmap),!this.preserveBitmap){let t=!0;const i=e._glTextures;for(const s in i){const n=i[s];if(n!==r&&n.dirtyId!==e.dirtyId){t=!1;break}}t&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&("string"==typeof t||t instanceof HTMLImageElement)}}e.ImageResource=o},6489:(t,e,r)=>{"use strict";var i=r(9878),s=r(8681);class n extends s.SimplePlane{constructor(t,e,r,s,n){super(i.Texture.WHITE,4,4),this._origWidth=t.orig.width,this._origHeight=t.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=e??t.defaultBorders?.left??10,this._rightWidth=s??t.defaultBorders?.right??10,this._topHeight=r??t.defaultBorders?.top??10,this._bottomHeight=n??t.defaultBorders?.bottom??10,this.texture=t}textureUpdated(){this._textureID=this.shader.texture._updateID,this._refresh()}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}updateHorizontalVertices(){const 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}updateVerticalVertices(){const 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}_getMinScale(){const 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)}get width(){return this._width}set width(t){this._width=t,this._refresh()}get height(){return this._height}set height(t){this._height=t,this._refresh()}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this._refresh()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this._refresh()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this._refresh()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this._refresh()}_refresh(){const t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;const 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()}}e.NineSlicePlane=n},6513:(t,e,r)=>{"use strict";var i=r(9878);e.Bounds=class{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((t=t||new i.Rectangle(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(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)}addPointMatrix(t,e){const{a:r,b:i,c:s,d:n,tx:o,ty:a}=t,h=r*e.x+s*e.y+o,l=i*e.x+n*e.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)}addQuad(t){let e=this.minX,r=this.minY,i=this.maxX,s=this.maxY,n=t[0],o=t[1];e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,n=t[2],o=t[3],e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,n=t[4],o=t[5],e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,n=t[6],o=t[7],e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,this.minX=e,this.minY=r,this.maxX=i,this.maxY=s}addFrame(t,e,r,i,s){this.addFrameMatrix(t.worldTransform,e,r,i,s)}addFrameMatrix(t,e,r,i,s){const n=t.a,o=t.b,a=t.c,h=t.d,l=t.tx,u=t.ty;let c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,m=n*e+a*r+l,g=o*e+h*r+u;c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,m=n*i+a*r+l,g=o*i+h*r+u,c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,m=n*e+a*s+l,g=o*e+h*s+u,c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,m=n*i+a*s+l,g=o*i+h*s+u,c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,this.minX=c,this.minY=d,this.maxX=p,this.maxY=f}addVertexData(t,e,r){let i=this.minX,s=this.minY,n=this.maxX,o=this.maxY;for(let a=e;a<r;a+=2){const e=t[a],r=t[a+1];i=e<i?e:i,s=r<s?r:s,n=e>n?e:n,o=r>o?r:o}this.minX=i,this.minY=s,this.maxX=n,this.maxY=o}addVertices(t,e,r,i){this.addVerticesMatrix(t.worldTransform,e,r,i)}addVerticesMatrix(t,e,r,i,s=0,n=s){const o=t.a,a=t.b,h=t.c,l=t.d,u=t.tx,c=t.ty;let d=this.minX,p=this.minY,f=this.maxX,m=this.maxY;for(let t=r;t<i;t+=2){const r=e[t],i=e[t+1],g=o*r+h*i+u,y=l*i+a*r+c;d=Math.min(d,g-s),f=Math.max(f,g+s),p=Math.min(p,y-n),m=Math.max(m,y+n)}this.minX=d,this.minY=p,this.maxX=f,this.maxY=m}addBounds(t){const e=this.minX,r=this.minY,i=this.maxX,s=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>s?t.maxY:s}addBoundsMask(t,e){const r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,s=t.maxX<e.maxX?t.maxX:e.maxX,n=t.maxY<e.maxY?t.maxY:e.maxY;if(r<=s&&i<=n){const t=this.minX,e=this.minY,o=this.maxX,a=this.maxY;this.minX=r<t?r:t,this.minY=i<e?i:e,this.maxX=s>o?s:o,this.maxY=n>a?n:a}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,s=t.maxX<e.x+e.width?t.maxX:e.x+e.width,n=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(r<=s&&i<=n){const t=this.minX,e=this.minY,o=this.maxX,a=this.maxY;this.minX=r<t?r:t,this.minY=i<e?i:e,this.maxX=s>o?s:o,this.maxY=n>a?n:a}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,r,i,s,n){t-=s,e-=n,r+=s,i+=n,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}}},6526:(t,e)=>{"use strict";e.extractCharCode=function(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}},6545:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799),n=r(1520);const o=new i.Matrix;s.DisplayObject.prototype._cacheAsBitmap=!1,s.DisplayObject.prototype._cacheData=null,s.DisplayObject.prototype._cacheAsBitmapResolution=null,s.DisplayObject.prototype._cacheAsBitmapMultisample=null;class a{constructor(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}}Object.defineProperties(s.DisplayObject.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(t){if(this._cacheAsBitmap===t)return;let e;this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new a),e=this._cacheData,e.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,e.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)}}}),s.DisplayObject.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},s.DisplayObject.prototype._initCachedDisplayObject=function(t){if(this._cacheData?.sprite)return;const e=this.alpha;this.alpha=1,t.batch.flush();const r=this.getLocalBounds(new i.Rectangle,!0);if(this.filters?.length){const t=this.filters[0].padding;r.pad(t)}const s=this.cacheAsBitmapResolution||t.resolution;r.ceil(s),r.width=Math.max(r.width,1/s),r.height=Math.max(r.height,1/s);const a=t.renderTexture.current,h=t.renderTexture.sourceFrame.clone(),l=t.renderTexture.destinationFrame.clone(),u=t.projection.transform,c=i.RenderTexture.create({width:r.width,height:r.height,resolution:s,multisample:this.cacheAsBitmapMultisample??t.multisample}),d=`cacheAsBitmap_${i.utils.uid()}`;this._cacheData.textureCacheId=d,i.BaseTexture.addToCache(c.baseTexture,d),i.Texture.addToCache(c,d);const p=this.transform.localTransform.copyTo(o).invert().translate(-r.x,-r.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:c,clear:!0,transform:p,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=u,t.renderTexture.bind(a,h,l),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=e;const f=new n.Sprite(c);f.transform.worldTransform=this.transform.worldTransform,f.anchor.x=-r.x/r.width,f.anchor.y=-r.y/r.height,f.alpha=e,f._bounds=this._bounds,this._cacheData.sprite=f,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=f.containsPoint.bind(f)},s.DisplayObject.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},s.DisplayObject.prototype._initCachedDisplayObjectCanvas=function(t){if(this._cacheData?.sprite)return;const e=this.getLocalBounds(new i.Rectangle,!0),r=this.alpha;this.alpha=1;const s=t.canvasContext.activeContext,a=t._projTransform,h=this.cacheAsBitmapResolution||t.resolution;e.ceil(h),e.width=Math.max(e.width,1/h),e.height=Math.max(e.height,1/h);const l=i.RenderTexture.create({width:e.width,height:e.height,resolution:h}),u=`cacheAsBitmap_${i.utils.uid()}`;this._cacheData.textureCacheId=u,i.BaseTexture.addToCache(l.baseTexture,u),i.Texture.addToCache(l,u);const c=o;this.transform.localTransform.copyTo(c),c.invert(),c.tx-=e.x,c.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:l,clear:!0,transform:c,skipUpdateTransform:!1}),t.canvasContext.activeContext=s,t._projTransform=a,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;const d=new n.Sprite(l);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-e.x/e.width,d.anchor.y=-e.y/e.height,d.alpha=r,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=d.containsPoint.bind(d)},s.DisplayObject.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},s.DisplayObject.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},s.DisplayObject.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,i.BaseTexture.removeFromCache(this._cacheData.textureCacheId),i.Texture.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},s.DisplayObject.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},e.CacheData=a},6552:(t,e,r)=>{"use strict";var i=r(8894);e.GLFramebuffer=class{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=i.MSAA_QUALITY.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}},6574:(t,e,r)=>{"use strict";var i=r(8894),s=r(238),n=r(4751),o=r(9115);class a{constructor(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)}push(t,e){let r=e;if(!r.isMaskData){const t=this.maskDataPool.pop()||new o.MaskData;t.pooled=!0,t.maskObject=e,r=t}const s=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(r.copyCountersOrReset(s),r._colorMask=s?s._colorMask:15,r.autoDetect&&this.detect(r),r._target=t,r.type!==i.MASK_TYPES.SPRITE&&this.maskStack.push(r),r.enabled)switch(r.type){case i.MASK_TYPES.SCISSOR:this.renderer.scissor.push(r);break;case i.MASK_TYPES.STENCIL:this.renderer.stencil.push(r);break;case i.MASK_TYPES.SPRITE:r.copyCountersOrReset(null),this.pushSpriteMask(r);break;case i.MASK_TYPES.COLOR:this.pushColorMask(r)}r.type===i.MASK_TYPES.SPRITE&&this.maskStack.push(r)}pop(t){const e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case i.MASK_TYPES.SCISSOR:this.renderer.scissor.pop(e);break;case i.MASK_TYPES.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case i.MASK_TYPES.SPRITE:this.popSpriteMask(e);break;case i.MASK_TYPES.COLOR:this.popColorMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){const t=this.maskStack[this.maskStack.length-1];t.type===i.MASK_TYPES.SPRITE&&t._filters&&(t._filters[0].maskSprite=t.maskObject)}}}detect(t){const e=t.maskObject;e?e.isSprite?t.type=i.MASK_TYPES.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=i.MASK_TYPES.SCISSOR:t.type=i.MASK_TYPES.STENCIL:t.type=i.MASK_TYPES.COLOR}pushSpriteMask(t){const{maskObject:e}=t,r=t._target;let i=t._filters;i||(i=this.alphaMaskPool[this.alphaMaskIndex],i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new n.SpriteMaskFilter])),i[0].resolution=t.resolution,i[0].multisample=t.multisample,i[0].maskSprite=e;const s=r.filterArea;r.filterArea=e.getBounds(!0),this.renderer.filter.push(r,i),r.filterArea=s,t._filters||this.alphaMaskIndex++}popSpriteMask(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(t){const e=t._colorMask,r=t._colorMask=e&t.colorMask;r!==e&&this.renderer.gl.colorMask(!!(1&r),!!(2&r),!!(4&r),!!(8&r))}popColorMask(t){const e=t._colorMask,r=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;r!==e&&this.renderer.gl.colorMask(!!(1&r),!!(2&r),!!(4&r),!!(8&r))}destroy(){this.renderer=null}}a.extension={type:s.ExtensionType.RendererSystem,name:"mask"},s.extensions.add(a),e.MaskSystem=a},6624:(t,e)=>{"use strict";e.AbstractMaskSystem=class{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,r=this.getStackLength();this.maskStack=t;const i=this.getStackLength();i!==r&&(0===i?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}},6669:(t,e,r)=>{"use strict";var i=r(928),s=r(2322);class n extends i.Texture{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,r=!0){const i=this.baseTexture.resolution,s=Math.round(t*i)/i,n=Math.round(e*i)/i;this.valid=s>0&&n>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=n,r&&this.baseTexture.resize(s,n),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new n(new s.BaseRenderTexture(t))}}e.RenderTexture=n},6716:(t,e,r)=>{"use strict";var i=r(6017);const s=(i.default??i)(globalThis.navigator);e.isMobile=s},6738:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799),n=r(8817),o=r(3046);s.DisplayObject.mixin(o.accessibleTarget);class a{constructor(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,(i.utils.isMobile.tablet||i.utils.isMobile.phone)&&this.createTouchHook();const e=document.createElement("div");e.style.width="100px",e.style.height="100px",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)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",(()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()})),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){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),this.renderer.view.parentNode?.appendChild(this.div))}deactivate(){!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),this.div.parentNode?.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const e=t.children;if(e)for(let t=0;t<e.length;t++)this.updateAccessibleObjects(e[t])}update(){const t=performance.now();if(i.utils.isMobile.android.device&&t<this.androidUpdateCount||(this.androidUpdateCount=t+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);const{x:e,y:r,width:s,height:n}=this.renderer.view.getBoundingClientRect(),{width:o,height:a,resolution:h}=this.renderer,l=s/o*h,u=n/a*h;let c=this.div;c.style.left=`${e}px`,c.style.top=`${r}px`,c.style.width=`${o}px`,c.style.height=`${a}px`;for(let t=0;t<this.children.length;t++){const e=this.children[t];if(e.renderId!==this.renderId)e._accessibleActive=!1,i.utils.removeItems(this.children,t,1),this.div.removeChild(e._accessibleDiv),this.pool.push(e._accessibleDiv),e._accessibleDiv=null,t--;else{c=e._accessibleDiv;let t=e.hitArea;const r=e.worldTransform;e.hitArea?(c.style.left=(r.tx+t.x*r.a)*l+"px",c.style.top=(r.ty+t.y*r.d)*u+"px",c.style.width=t.width*r.a*l+"px",c.style.height=t.height*r.d*u+"px"):(t=e.getBounds(),this.capHitArea(t),c.style.left=t.x*l+"px",c.style.top=t.y*u+"px",c.style.width=t.width*l+"px",c.style.height=t.height*u+"px",c.title!==e.accessibleTitle&&null!==e.accessibleTitle&&(c.title=e.accessibleTitle),c.getAttribute("aria-label")!==e.accessibleHint&&null!==e.accessibleHint&&c.setAttribute("aria-label",e.accessibleHint)),(e.accessibleTitle!==c.title||e.tabIndex!==c.tabIndex)&&(c.title=e.accessibleTitle,c.tabIndex=e.tabIndex,this.debug&&this.updateDebugHTML(c))}}this.renderId++}updateDebugHTML(t){t.innerHTML=`type: ${t.type}</br> title : ${t.title}</br> tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:r}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>r&&(t.height=r-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width="100px",e.style.height="100px",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().includes("chrome")?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}_dispatchEvent(t,e){const{displayObject:r}=t.target,i=this.renderer.events.rootBoundary,s=Object.assign(new n.FederatedEvent(i),{target:r});i.rootTarget=this.renderer.lastObjectRendered,e.forEach((t=>i.dispatchEvent(s,t)))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){9===t.keyCode&&this.activate()}_onMouseMove(t){0===t.movementX&&0===t.movementY||this.deactivate()}destroy(){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}}a.extension={name:"accessibility",type:[i.ExtensionType.RendererPlugin,i.ExtensionType.CanvasRendererPlugin]},i.extensions.add(a),e.AccessibilityManager=a},6782:(t,e)=>{"use strict";e.uniformParsers=[{test:t=>"float"===t.type&&1===t.size&&!t.isArray,code:t=>`\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:(t,e)=>!("sampler2D"!==t.type&&"samplerCube"!==t.type&&"sampler2DArray"!==t.type||1!==t.size||t.isArray||null!=e&&void 0===e.castToBaseTexture),code:t=>`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:(t,e)=>"mat3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.a,code:t=>`\n            gl.uniformMatrix3fv(ud["${t}"].location, false, uv["${t}"].toArray(true));\n            `,codeUbo:t=>`\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:(t,e)=>"vec2"===t.type&&1===t.size&&!t.isArray&&void 0!==e.x,code:t=>`\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:t=>`\n                v = uv.${t};\n\n                data[offset] = v.x;\n                data[offset+1] = v.y;\n            `},{test:t=>"vec2"===t.type&&1===t.size&&!t.isArray,code:t=>`\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:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.width,code:t=>`\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:t=>`\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:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n                cv = ud["${t}"].value;\n                v = uv["${t}"];\n\n                if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)\n                {\n                    cv[0] = v.red;\n                    cv[1] = v.green;\n                    cv[2] = v.blue;\n                    cv[3] = v.alpha;\n                    gl.uniform4f(ud["${t}"].location, v.red, v.green, v.blue, v.alpha)\n                }`,codeUbo:t=>`\n                    v = uv.${t};\n\n                    data[offset] = v.red;\n                    data[offset+1] = v.green;\n                    data[offset+2] = v.blue;\n                    data[offset+3] = v.alpha;\n                `},{test:(t,e)=>"vec3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n                cv = ud["${t}"].value;\n                v = uv["${t}"];\n\n                if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)\n                {\n                    cv[0] = v.red;\n                    cv[1] = v.green;\n                    cv[2] = v.blue;\n    \n                    gl.uniform3f(ud["${t}"].location, v.red, v.green, v.blue)\n                }`,codeUbo:t=>`\n                    v = uv.${t};\n\n                    data[offset] = v.red;\n                    data[offset+1] = v.green;\n                    data[offset+2] = v.blue;\n                `},{test:t=>"vec4"===t.type&&1===t.size&&!t.isArray,code:t=>`\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                }`}]},6803:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799);const n=new i.Point,o=new Uint16Array([0,1,2,0,2,3]);class a extends s.Container{constructor(t){super(),this._anchor=new i.ObservablePoint(this._onAnchorUpdate,this,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new i.Color(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=i.BLEND_MODES.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||i.Texture.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=o,this.pluginName="batch",this.isSprite=!0,this._roundPixels=i.settings.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=i.utils.sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=i.utils.sign(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const t=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===t._updateID)return;this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;const e=this.transform.worldTransform,r=e.a,s=e.b,n=e.c,o=e.d,a=e.tx,h=e.ty,l=this.vertexData,u=t.trim,c=t.orig,d=this._anchor;let p=0,f=0,m=0,g=0;if(u?(f=u.x-d._x*c.width,p=f+u.width,g=u.y-d._y*c.height,m=g+u.height):(f=-d._x*c.width,p=f+c.width,g=-d._y*c.height,m=g+c.height),l[0]=r*f+n*g+a,l[1]=o*g+s*f+h,l[2]=r*p+n*g+a,l[3]=o*g+s*p+h,l[4]=r*p+n*m+a,l[5]=o*m+s*p+h,l[6]=r*f+n*m+a,l[7]=o*m+s*f+h,this._roundPixels){const t=i.settings.RESOLUTION;for(let e=0;e<l.length;++e)l[e]=Math.round(l[e]*t)/t}}calculateTrimmedVertices(){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;const t=this._texture,e=this.vertexTrimmedData,r=t.orig,s=this._anchor,n=this.transform.worldTransform,o=n.a,a=n.b,h=n.c,l=n.d,u=n.tx,c=n.ty,d=-s._x*r.width,p=d+r.width,f=-s._y*r.height,m=f+r.height;if(e[0]=o*d+h*f+u,e[1]=l*f+a*d+c,e[2]=o*p+h*f+u,e[3]=l*f+a*p+c,e[4]=o*p+h*m+u,e[5]=l*m+a*p+c,e[6]=o*d+h*m+u,e[7]=l*m+a*d+c,this._roundPixels){const t=i.settings.RESOLUTION;for(let r=0;r<e.length;++r)e[r]=Math.round(e[r]*t)/t}}_render(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)}_calculateBounds(){const 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))}getLocalBounds(t){return 0===this.children.length?(this._localBounds||(this._localBounds=new s.Bounds),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),t||(this._localBoundsRect||(this._localBoundsRect=new i.Rectangle),t=this._localBoundsRect),this._localBounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,n);const e=this._texture.orig.width,r=this._texture.orig.height,i=-e*this.anchor.x;let s=0;return n.x>=i&&n.x<i+e&&(s=-r*this.anchor.y,n.y>=s&&n.y<s+r)}destroy(t){if(super.destroy(t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.baseTexture;this._texture.destroy(!!e)}this._texture=null}static from(t,e){const r=t instanceof i.Texture?t:i.Texture.from(t,e);return new a(r)}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1,this._transformTrimmedID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){const e=i.utils.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){const e=i.utils.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get anchor(){return this._anchor}set anchor(t){this._anchor.copyFrom(t)}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||i.Texture.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}e.Sprite=a},6853:(t,e,r)=>{"use strict";var i=r(9878);r(1799).DisplayObject.prototype.getGlobalPosition=function(t=new i.Point,e=!1){return this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t}},6861:(t,e,r)=>{"use strict";var i=r(1005);e.AnimatedSprite=i.AnimatedSprite},6871:(t,e)=>{"use strict";e.removeItems=function(t,e,r){const i=t.length;let s;if(e>=i||0===r)return;const n=i-(r=e+r>i?i-e:r);for(s=e;s<n;++s)t[s]=t[s+r];t.length=n}},6892:(t,e,r)=>{"use strict";var i=r(7858),s=r(9789);e.Application=i.Application,e.ResizePlugin=s.ResizePlugin},6921:(t,e)=>{"use strict";const r={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")};e.BrowserAdapter=r},6934:(t,e)=>{"use strict";e.testImageFormat=async function(t){if("Image"in globalThis)return new Promise((e=>{const r=new Image;r.onload=()=>{e(!0)},r.onerror=()=>{e(!1)},r.src=t}));if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(t)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}},6935:t=>{"use strict";function e(t,e,i){i=i||2;var n,o,a,h,c,d,f,m=e&&e.length,g=m?e[0]*i:t.length,y=r(t,0,g,i,!0),_=[];if(!y||y.next===y.prev)return _;if(m&&(y=function(t,e,i,s){var n,o,a,h=[];for(n=0,o=e.length;n<o;n++)(a=r(t,e[n]*s,n<o-1?e[n+1]*s:t.length,s,!1))===a.next&&(a.steiner=!0),h.push(p(a));for(h.sort(l),n=0;n<h.length;n++)i=u(h[n],i);return i}(t,e,y,i)),t.length>80*i){n=a=t[0],o=h=t[1];for(var v=i;v<g;v+=i)(c=t[v])<n&&(n=c),(d=t[v+1])<o&&(o=d),c>a&&(a=c),d>h&&(h=d);f=0!==(f=Math.max(a-n,h-o))?32767/f:0}return s(y,_,i,n,o,f,0),_}function r(t,e,r,i,s){var n,o;if(s===w(t,e,r,i)>0)for(n=e;n<r;n+=i)o=E(n,t[n],t[n+1],o);else for(n=r-i;n>=e;n-=i)o=E(n,t[n],t[n+1],o);return o&&y(o,o.next)&&(A(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!y(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(A(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function s(t,e,r,l,u,c,p){if(t){!p&&c&&function(t,e,r,i){var s=t;do{0===s.z&&(s.z=d(s.x,s.y,e,r,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,r,i,s,n,o,a,h,l=1;do{for(r=t,t=null,n=null,o=0;r;){for(o++,i=r,a=0,e=0;e<l&&(a++,i=i.nextZ);e++);for(h=l;a>0||h>0&&i;)0!==a&&(0===h||!i||r.z<=i.z)?(s=r,r=r.nextZ,a--):(s=i,i=i.nextZ,h--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;r=i}n.nextZ=null,l*=2}while(o>1)}(s)}(t,l,u,c);for(var f,m,g=t;t.prev!==t.next;)if(f=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(f.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),A(t),t=m.next,g=m.next;else if((t=m)===g){p?1===p?s(t=a(i(t),e,r),e,r,l,u,c,2):2===p&&h(t,e,r,l,u,c):s(i(t),e,r,l,u,c,1);break}}}function n(t){var e=t.prev,r=t,i=t.next;if(g(e,r,i)>=0)return!1;for(var s=e.x,n=r.x,o=i.x,a=e.y,h=r.y,l=i.y,u=s<n?s<o?s:o:n<o?n:o,c=a<h?a<l?a:l:h<l?h:l,d=s>n?s>o?s:o:n>o?n:o,p=a>h?a>l?a:l:h>l?h:l,m=i.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=p&&f(s,a,n,h,o,l,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,r,i){var s=t.prev,n=t,o=t.next;if(g(s,n,o)>=0)return!1;for(var a=s.x,h=n.x,l=o.x,u=s.y,c=n.y,p=o.y,m=a<h?a<l?a:l:h<l?h:l,y=u<c?u<p?u:p:c<p?c:p,_=a>h?a>l?a:l:h>l?h:l,v=u>c?u>p?u:p:c>p?c:p,x=d(m,y,e,r,i),b=d(_,v,e,r,i),T=t.prevZ,E=t.nextZ;T&&T.z>=x&&E&&E.z<=b;){if(T.x>=m&&T.x<=_&&T.y>=y&&T.y<=v&&T!==s&&T!==o&&f(a,u,h,c,l,p,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;if(T=T.prevZ,E.x>=m&&E.x<=_&&E.y>=y&&E.y<=v&&E!==s&&E!==o&&f(a,u,h,c,l,p,E.x,E.y)&&g(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(;T&&T.z>=x;){if(T.x>=m&&T.x<=_&&T.y>=y&&T.y<=v&&T!==s&&T!==o&&f(a,u,h,c,l,p,T.x,T.y)&&g(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=b;){if(E.x>=m&&E.x<=_&&E.y>=y&&E.y<=v&&E!==s&&E!==o&&f(a,u,h,c,l,p,E.x,E.y)&&g(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function a(t,e,r){var s=t;do{var n=s.prev,o=s.next.next;!y(n,o)&&_(n,s,s.next,o)&&b(n,o)&&b(o,n)&&(e.push(n.i/r|0),e.push(s.i/r|0),e.push(o.i/r|0),A(s),A(s.next),s=t=o),s=s.next}while(s!==t);return i(s)}function h(t,e,r,n,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&m(h,l)){var u=T(h,l);return h=i(h,h.next),u=i(u,u.next),s(h,e,r,n,o,a,0),void s(u,e,r,n,o,a,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var r=function(t,e){var r,i=e,s=t.x,n=t.y,o=-1/0;do{if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){var a=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=s&&a>o&&(o=a,r=i.x<i.next.x?i:i.next,a===s))return r}i=i.next}while(i!==e);if(!r)return null;var h,l=r,u=r.x,d=r.y,p=1/0;i=r;do{s>=i.x&&i.x>=u&&s!==i.x&&f(n<d?s:o,n,u,d,n<d?o:s,n,i.x,i.y)&&(h=Math.abs(n-i.y)/(s-i.x),b(i,t)&&(h<p||h===p&&(i.x>r.x||i.x===r.x&&c(r,i)))&&(r=i,p=h)),i=i.next}while(i!==l);return r}(t,e);if(!r)return e;var s=T(r,t);return i(s,s.next),i(r,r.next)}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,r,i,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(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 f(t,e,r,i,s,n,o,a){return(s-o)*(e-a)>=(t-o)*(n-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(n-a)>=(s-o)*(i-a)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(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&&_(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var r=t,i=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do{r.y>n!=r.next.y>n&&r.next.y!==r.y&&s<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||y(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,r,i){var s=x(g(t,e,r)),n=x(g(t,e,i)),o=x(g(r,i,t)),a=x(g(r,i,e));return s!==n&&o!==a||!(0!==s||!v(t,r,e))||!(0!==n||!v(t,i,e))||!(0!==o||!v(r,t,i))||!(0!==a||!v(r,e,i))}function v(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 x(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function T(t,e){var r=new S(t.i,t.x,t.y),i=new S(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,r.next=s,s.prev=r,i.next=r,r.prev=i,n.next=i,i.prev=n,i}function E(t,e,r,i){var s=new S(t,e,r);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function A(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 S(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 w(t,e,r,i){for(var s=0,n=e,o=r-i;n<r;n+=i)s+=(t[o]-t[n])*(t[n+1]+t[o+1]),o=n;return s}t.exports=e,t.exports.default=e,e.deviation=function(t,e,r,i){var s=e&&e.length,n=s?e[0]*r:t.length,o=Math.abs(w(t,0,n,r));if(s)for(var a=0,h=e.length;a<h;a++){var l=e[a]*r,u=a<h-1?e[a+1]*r:t.length;o-=Math.abs(w(t,l,u,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===o&&0===c?0:Math.abs((c-o)/o)},e.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,s=0;s<t.length;s++){for(var n=0;n<t[s].length;n++)for(var o=0;o<e;o++)r.vertices.push(t[s][n][o]);s>0&&(i+=t[s-1].length,r.holes.push(i))}return r}},6945:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},6969:()=>{},7052:(t,e,r)=>{"use strict";var i=r(238),s=r(7146),n=r(6238),o=r(6624);const a=new s.Matrix,h=[],l=class t extends o.AbstractMaskSystem{constructor(t){super(t),this.glConst=n.settings.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:r}=t,{renderer:i}=this,n=i.renderTexture,o=r.getBounds(!0,h.pop()??new s.Rectangle);this.roundFrameToPixels(o,n.current?n.current.resolution:i.resolution,n.sourceFrame,n.destinationFrame,i.projection.transform),e&&o.fit(e),t._scissorRectLocal=o}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:r,c:i,d:s}=t;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(s)>1e-4)}testScissor(e){const{maskObject:r}=e;if(!r.isFastRect||!r.isFastRect()||t.isMatrixRotated(r.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,r,i,s,n){t.isMatrixRotated(n)||((n=n?a.copyFrom(n):a.identity()).translate(-i.x,-i.y).scale(s.width/i.width,s.height/i.height).translate(s.x,s.y),this.renderer.filter.transformAABB(n,e),e.fit(s),e.x=Math.round(e.x*r),e.y=Math.round(e.y*r),e.width=Math.round(e.width*r),e.height=Math.round(e.height*r))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&h.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};l.extension={type:i.ExtensionType.RendererSystem,name:"scissor"};let u=l;i.extensions.add(u),e.ScissorSystem=u},7069:(t,e,r)=>{"use strict";var i=r(1799);i.DisplayObject.prototype.name=null,i.Container.prototype.getChildByName=function(t,e){for(let e=0,r=this.children.length;e<r;e++)if(this.children[e].name===t)return this.children[e];if(e)for(let e=0,r=this.children.length;e<r;e++){const r=this.children[e];if(!r.getChildByName)continue;const i=r.getChildByName(t,!0);if(i)return i}return null}},7092:(t,e)=>{"use strict";e.isSingleItem=t=>!Array.isArray(t)},7098:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799),n=r(1914);const o=new i.Point,a=new i.Polygon,h=class t extends s.Container{constructor(t,e,r,s=i.DRAW_MODES.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=r||i.State.for2d(),this.drawMode=s,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=i.settings.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(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)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(t){this.shader=t}get material(){return this.shader}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(t){this.shader.tint=t}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(t){this.shader.texture=t}_render(e){const r=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===i.DRAW_MODES.TRIANGLES&&r.length<2*t.BATCHABLE_SIZE?this._renderToBatch(e):this._renderDefault(e)}_renderDefault(t){const 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)}_renderToBatch(t){const 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;const i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].render(this)}calculateVertices(){const t=this.geometry.buffers[0],e=t.data,r=t._updateID;if(r===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));const s=this.transform.worldTransform,n=s.a,o=s.b,a=s.c,h=s.d,l=s.tx,u=s.ty,c=this.vertexData;for(let t=0;t<c.length/2;t++){const r=e[2*t],i=e[2*t+1];c[2*t]=n*r+a*i+l,c[2*t+1]=o*r+h*i+u}if(this._roundPixels){const t=i.settings.RESOLUTION;for(let e=0;e<c.length;++e)c[e]=Math.round(c[e]*t)/t}this.vertexDirty=r}calculateUvs(){const t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new n.MeshBatchUvs(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,o);const e=this.geometry.getBuffer("aVertexPosition").data,r=a.points,i=this.geometry.getIndex().data,s=i.length,n=4===this.drawMode?3:1;for(let t=0;t+2<s;t+=n){const s=2*i[t],n=2*i[t+1],h=2*i[t+2];if(r[0]=e[s],r[1]=e[s+1],r[2]=e[n],r[3]=e[n+1],r[4]=e[h],r[5]=e[h+1],a.contains(o.x,o.y))return!0}return!1}destroy(t){super.destroy(t),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}};h.BATCHABLE_SIZE=100;let l=h;e.Mesh=l},7100:(t,e)=>{"use strict";e.compileShader=function(t,e,r){const i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}},7125:(t,e,r)=>{"use strict";r(3240);var i=r(481),s=r(9488),n=r(246),o=r(390);e.BasePrepare=i.BasePrepare,e.CountLimiter=s.CountLimiter,e.Prepare=n.Prepare,e.TimeLimiter=o.TimeLimiter},7135:(t,e,r)=>{"use strict";var i=r(1133);e.FXAAFilter=i.FXAAFilter},7146:(t,e,r)=>{"use strict";var i=r(121),s=r(211),n=r(6071),o=r(8036),a=r(8531),h=r(9889);r(9199),r(6311);var l=r(3273),u=r(6247),c=r(4008),d=r(510),p=r(1537);e.Circle=i.Circle,e.Ellipse=s.Ellipse,e.Polygon=n.Polygon,e.Rectangle=o.Rectangle,e.RoundedRectangle=a.RoundedRectangle,e.groupD8=h.groupD8,e.Matrix=l.Matrix,e.ObservablePoint=u.ObservablePoint,e.Point=c.Point,e.Transform=d.Transform,e.DEG_TO_RAD=p.DEG_TO_RAD,e.PI_2=p.PI_2,e.RAD_TO_DEG=p.RAD_TO_DEG,e.SHAPES=p.SHAPES},7156:(t,e,r)=>{"use strict";var i=r(9878),s=r(3643),n=r(8599),o=r(74),a=r(1304);const h={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},l=class t{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new s.EventBoundary(null),n.EventsTicker.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new o.FederatedPointerEvent(null),this.rootWheelEvent=new a.FederatedWheelEvent(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...t.defaultEventFeatures},{set:(t,e,r)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=r),t[e]=r,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:r,resolution:i}=this.renderer;this.setTargetElement(r),this.resolution=i,t._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(t){t=t||"default";let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];if(r)switch(typeof r){case"string":e&&(this.domElement.style.cursor=r);break;case"function":r(t);break;case"object":e&&Object.assign(this.domElement.style,r)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this.rootPointerEvent}onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,r=e.length;t<r;t++){const r=e[t],i=this.bootstrapEvent(this.rootPointerEvent,r);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,n.EventsTicker.pointerMoved();const e=this.normalizeToPointerData(t);for(let t=0,r=e.length;t<r;t++){const r=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);const r=e!==this.domElement?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,e=i.length;t<e;t++){const e=this.bootstrapEvent(this.rootPointerEvent,i[t]);e.type+=r,this.rootBoundary.mapEvent(e)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);for(let t=0,r=e.length;t<r;t++){const r=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this.removeEvents(),this.domElement=t,n.EventsTicker.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;n.EventsTicker.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,!0),this.domElement.addEventListener("pointerdown",this.onPointerDown,!0),this.domElement.addEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this.onPointerOverOut,!0),globalThis.addEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,!0),this.domElement.addEventListener("mousedown",this.onPointerDown,!0),this.domElement.addEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this.onPointerOverOut,!0),globalThis.addEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this.onPointerDown,!0),this.domElement.addEventListener("touchend",this.onPointerUp,!0),this.domElement.addEventListener("touchmove",this.onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;n.EventsTicker.removeTickerListener();const t=this.domElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this.onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,!0),this.domElement.removeEventListener("mousedown",this.onPointerDown,!0),this.domElement.removeEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this.onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this.onPointerDown,!0),this.domElement.removeEventListener("touchend",this.onPointerUp,!0),this.domElement.removeEventListener("touchmove",this.onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(t,e,r){const i=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=1/this.resolution;t.x=(e-i.left)*(this.domElement.width/i.width)*s,t.y=(r-i.top)*(this.domElement.height/i.height)*s}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let r=0,i=t.changedTouches.length;r<i;r++){const i=t.changedTouches[r];typeof i.button>"u"&&(i.button=0),typeof i.buttons>"u"&&(i.buttons=1),typeof i.isPrimary>"u"&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),typeof i.width>"u"&&(i.width=i.radiusX||1),typeof i.height>"u"&&(i.height=i.radiusY||1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="touch"),typeof i.pointerId>"u"&&(i.pointerId=i.identifier||0),typeof i.pressure>"u"&&(i.pressure=i.force||.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),typeof i.layerX>"u"&&(i.layerX=i.offsetX=i.clientX),typeof i.layerY>"u"&&(i.layerY=i.offsetY=i.clientY),i.isNormalized=!0,i.type=t.type,e.push(i)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof globalThis.PointerEvent)){const r=t;typeof r.isPrimary>"u"&&(r.isPrimary=!0),typeof r.width>"u"&&(r.width=1),typeof r.height>"u"&&(r.height=1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="mouse"),typeof r.pointerId>"u"&&(r.pointerId=1),typeof r.pressure>"u"&&(r.pressure=.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),r.isNormalized=!0,e.push(r)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;return this.transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=h[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};l.extension={name:"events",type:[i.ExtensionType.RendererSystem,i.ExtensionType.CanvasRendererSystem]},l.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let u=l;i.extensions.add(u),e.EventSystem=u},7164:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",i=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),i&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),i&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,i,s,n){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(i)for(var a=0;a<this.length;a++){var h=this[a][0];null!=h&&(o[h]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);i&&o[u[0]]||(void 0!==n&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=n),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),s&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=s):u[4]="".concat(s)),e.push(u))}},e}},7239:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},7250:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},7255:(t,e,r)=>{"use strict";var i=r(8894);class s{constructor(t,e=0,r=!1,s=i.TYPES.FLOAT,n,o,a,h=1){this.buffer=t,this.size=e,this.normalized=r,this.type=s,this.stride=n,this.start=o,this.instance=a,this.divisor=h}destroy(){this.buffer=null}static from(t,e,r,i,n){return new s(t,e,r,i,n)}}e.Attribute=s},7259:(t,e,r)=>{"use strict";var i=r(9263),s=r(7425),n=r(9948);const o=[i.TextFormat,s.XMLFormat,n.XMLStringFormat];e.TextFormat=i.TextFormat,e.XMLFormat=s.XMLFormat,e.XMLStringFormat=n.XMLStringFormat,e.autoDetectFormat=function(t){for(let e=0;e<o.length;e++)if(o[e].test(t))return o[e];return null}},7279:(t,e,r)=>{"use strict";var i=r(9313);t.exports=function(t){return i(t)||0===t?t:t<0?-1:1}},7287:(t,e,r)=>{"use strict";var i=r(2935);class s{static curveLength(t,e,r,i,s,n){const o=t-2*r+s,a=e-2*i+n,h=2*r-2*t,l=2*i-2*e,u=4*(o*o+a*a),c=4*(o*h+a*l),d=h*h+l*l,p=2*Math.sqrt(u+c+d),f=Math.sqrt(u),m=2*u*f,g=2*Math.sqrt(d),y=c/f;return(m*p+f*c*(p-g)+(4*d*u-c*c)*Math.log((2*f+y+p)/(y+g)))/(4*m)}static curveTo(t,e,r,n,o){const a=o[o.length-2],h=o[o.length-1],l=i.curves._segmentsCount(s.curveLength(a,h,t,e,r,n));let u=0,c=0;for(let i=1;i<=l;++i){const s=i/l;u=a+(t-a)*s,c=h+(e-h)*s,o.push(u+(t+(r-t)*s-u)*s,c+(e+(n-e)*s-c)*s)}}}e.QuadraticUtils=s},7378:(t,e,r)=>{"use strict";var i=r(9878);e.ParticleBuffer=class{constructor(t,e,r){this.geometry=new i.Geometry,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(let r=0;r<t.length;++r){let s=t[r];s={attributeName:s.attributeName,size:s.size,uploadFunction:s.uploadFunction,type:s.type||i.TYPES.FLOAT,offset:s.offset},e[r]?this.dynamicProperties.push(s):this.staticProperties.push(s)}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()}initBuffers(){const t=this.geometry;let e=0;this.indexBuffer=new i.Buffer(i.utils.createIndicesForQuads(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(let t=0;t<this.dynamicProperties.length;++t){const r=this.dynamicProperties[t];r.offset=e,e+=r.size,this.dynamicStride+=r.size}const r=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(r),this.dynamicDataUint32=new Uint32Array(r),this.dynamicBuffer=new i.Buffer(this.dynamicData,!1,!1);let s=0;this.staticStride=0;for(let t=0;t<this.staticProperties.length;++t){const e=this.staticProperties[t];e.offset=s,s+=e.size,this.staticStride+=e.size}const n=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(n),this.staticDataUint32=new Uint32Array(n),this.staticBuffer=new i.Buffer(this.staticData,!0,!1);for(let e=0;e<this.dynamicProperties.length;++e){const r=this.dynamicProperties[e];t.addAttribute(r.attributeName,this.dynamicBuffer,0,r.type===i.TYPES.UNSIGNED_BYTE,r.type,4*this.dynamicStride,4*r.offset)}for(let e=0;e<this.staticProperties.length;++e){const r=this.staticProperties[e];t.addAttribute(r.attributeName,this.staticBuffer,0,r.type===i.TYPES.UNSIGNED_BYTE,r.type,4*this.staticStride,4*r.offset)}}uploadDynamic(t,e,r){for(let s=0;s<this.dynamicProperties.length;s++){const n=this.dynamicProperties[s];n.uploadFunction(t,e,r,n.type===i.TYPES.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++}uploadStatic(t,e,r){for(let s=0;s<this.staticProperties.length;s++){const n=this.staticProperties[s];n.uploadFunction(t,e,r,n.type===i.TYPES.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++}destroy(){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()}}},7384:t=>{"use strict";t.exports=Math.min},7391:(t,e,r)=>{"use strict";var i=r(9878);const s=class t{constructor(t,e,r){this.linkedSheets=[],(t instanceof i.BaseTexture||t instanceof i.Texture)&&(t={texture:t,data:e,resolutionFilename:r});const{texture:s,data:n,resolutionFilename:o=null,cachePrefix:a=""}=t;this.cachePrefix=a,this._texture=s instanceof i.Texture?s:null,this.baseTexture=s instanceof i.BaseTexture?s:this._texture.baseTexture,this.textures={},this.animations={},this.data=n;const h=this.baseTexture.resource;this.resolution=this._updateResolution(o||(h?h.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(t=null){const{scale:e}=this.data.meta;let r=i.utils.getResolutionOfUrl(t,null);return null===r&&(r="number"==typeof e?e:parseFloat(e??"1")),1!==r&&this.baseTexture.setResolution(r),r}parse(){return new Promise((e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()}))}_processFrames(e){let r=e;const s=t.BATCH_SIZE;for(;r-e<s&&r<this._frameKeys.length;){const t=this._frameKeys[r],e=this._frames[t],s=e.frame;if(s){let r=null,n=null;const o=!1!==e.trimmed&&e.sourceSize?e.sourceSize:e.frame,a=new i.Rectangle(0,0,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution);r=e.rotated?new i.Rectangle(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.h)/this.resolution,Math.floor(s.w)/this.resolution):new i.Rectangle(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution),!1!==e.trimmed&&e.spriteSourceSize&&(n=new i.Rectangle(Math.floor(e.spriteSourceSize.x)/this.resolution,Math.floor(e.spriteSourceSize.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution)),this.textures[t]=new i.Texture(this.baseTexture,r,a,n,e.rotated?2:0,e.anchor,e.borders),i.Texture.addToCache(this.textures[t],this.cachePrefix+t.toString())}r++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let r=0;r<t[e].length;r++){const i=t[e][r];this.animations[e].push(this.textures[i])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((()=>{this._batchIndex*t.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())}),0)}destroy(t=!1){for(const t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};s.BATCH_SIZE=1e3;let n=s;e.Spritesheet=n},7395:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799),n=r(4123),o=r(2014),a=r(6055),h=r(3308),l=r(5796);const u=new i.Point,c=class t extends i.BatchGeometry{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new s.Bounds,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){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(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),o.DRAW_CALL_POOL.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),o.BATCH_POOL.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,r=null,i=null){const s=new n.GraphicsData(t,e,r,i);return this.graphicsData.push(s),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const r=new n.GraphicsData(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].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}containsPoint(t){const e=this.graphicsData;for(let r=0;r<e.length;++r){const i=e[r];if(i.fillStyle.visible&&i.shape&&(i.matrix?i.matrix.applyInverse(t,u):u.copyFrom(t),i.shape.contains(u.x,u.y))){let t=!1;if(i.holes)for(let e=0;e<i.holes.length;e++)if(i.holes[e].shape.contains(u.x,u.y)){t=!0;break}if(!t)return!0}}return!1}updateBatches(){if(!this.graphicsData.length)return void(this.batchable=!0);if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let r=null,s=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],s=r.style);for(let n=this.shapeIndex;n<e.length;n++){this.shapeIndex++;const h=e[n],l=h.fillStyle,u=h.lineStyle;o.FILL_COMMANDS[h.type].build(h),h.matrix&&this.transformPoints(h.points,h.matrix),(l.visible||u.visible)&&this.processHoles(h.holes);for(let e=0;e<2;e++){const n=0===e?l:u;if(!n.visible)continue;const c=n.texture.baseTexture,d=this.indices.length,p=this.points.length/2;c.wrapMode=i.WRAP_MODES.REPEAT,0===e?this.processFill(h):this.processLine(h);const f=this.points.length/2-p;0!==f&&(r&&!this._compareStyles(s,n)&&(r.end(d,p),r=null),r||(r=o.BATCH_POOL.pop()||new a.BatchPart,r.begin(n,d,p),this.batches.push(r),s=n),this.addUvs(this.points,t,n.texture,p,f,n.matrix))}}const n=this.indices.length,h=this.points.length/2;if(r&&r.end(n,h),0===this.batches.length)return void(this.batchable=!0);const l=h>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&l===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=l?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const e=this.graphicsData[t],r=e.fillStyle,i=e.lineStyle;if(r&&!r.texture.baseTexture.valid||i&&!i.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,r=t.length;e<r;e++){const r=t[e];for(let t=0;t<r.size;t++){const e=r.start+t;this.indicesUint16[e]=this.indicesUint16[e]-r.attribStart}}}isBatchable(){if(this.points.length>131070)return!1;const e=this.batches;for(let t=0;t<e.length;t++)if(e[t].style.native)return!1;return this.points.length<2*t.BATCHABLE_SIZE}buildDrawCalls(){let t=++i.BaseTexture._globalBatch;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),o.DRAW_CALL_POOL.push(this.drawCalls[t]);this.drawCalls.length=0;const e=this.colors,r=this.textureIds;let s=o.DRAW_CALL_POOL.pop();s||(s=new i.BatchDrawCall,s.texArray=new i.BatchTextureArray),s.texArray.count=0,s.start=0,s.size=0,s.type=i.DRAW_MODES.TRIANGLES;let n=0,a=null,h=0,l=!1,u=i.DRAW_MODES.TRIANGLES,c=0;this.drawCalls.push(s);for(let d=0;d<this.batches.length;d++){const p=this.batches[d],f=8,m=p.style,g=m.texture.baseTexture;l!==!!m.native&&(l=!!m.native,u=l?i.DRAW_MODES.LINES:i.DRAW_MODES.TRIANGLES,a=null,n=f,t++),a!==g&&(a=g,g._batchEnabled!==t&&(n===f&&(t++,n=0,s.size>0&&(s=o.DRAW_CALL_POOL.pop(),s||(s=new i.BatchDrawCall,s.texArray=new i.BatchTextureArray),this.drawCalls.push(s)),s.start=c,s.size=0,s.texArray.count=0,s.type=u),g.touched=1,g._batchEnabled=t,g._batchLocation=n,g.wrapMode=i.WRAP_MODES.REPEAT,s.texArray.elements[s.texArray.count++]=g,n++)),s.size+=p.size,c+=p.size,h=g._batchLocation,this.addColors(e,m.color,m.alpha,p.attribSize,p.attribStart),this.addTextureIds(r,h,p.attribSize,p.attribStart)}i.BaseTexture._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,s=new ArrayBuffer(3*t.length*4),n=new Float32Array(s),o=new Uint32Array(s);let a=0;for(let s=0;s<t.length/2;s++)n[a++]=t[2*s],n[a++]=t[2*s+1],n[a++]=e[2*s],n[a++]=e[2*s+1],o[a++]=r[s],n[a++]=i[s];this._buffer.update(s),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?h.buildPoly.triangulate(t,this):o.FILL_COMMANDS[t.type].triangulate(t,this)}processLine(t){l.buildLine(t,this);for(let e=0;e<t.holes.length;e++)l.buildLine(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const r=t[e];o.FILL_COMMANDS[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let r=0;r<t.length/2;r++){const i=t[2*r],s=t[2*r+1];t[2*r]=e.a*i+e.c*s+e.tx,t[2*r+1]=e.b*i+e.d*s+e.ty}}addColors(t,e,r,s,n=0){const o=i.Color.shared.setValue(e).toLittleEndianNumber(),a=i.Color.shared.setValue(o).toPremultiplied(r);t.length=Math.max(t.length,n+s);for(let e=0;e<s;e++)t[n+e]=a}addTextureIds(t,e,r,i=0){t.length=Math.max(t.length,i+r);for(let s=0;s<r;s++)t[i+s]=e}addUvs(t,e,r,i,s,n=null){let o=0;const a=e.length,h=r.frame;for(;o<s;){let r=t[2*(i+o)],s=t[2*(i+o)+1];if(n){const t=n.a*r+n.c*s+n.tx;s=n.b*r+n.d*s+n.ty,r=t}o++,e.push(r/h.width,s/h.height)}const l=r.baseTexture;(h.width<l.width||h.height<l.height)&&this.adjustUvs(e,r,a,s)}adjustUvs(t,e,r,i){const s=e.baseTexture,n=1e-6,o=r+2*i,a=e.frame,h=a.width/s.width,l=a.height/s.height;let u=a.x/a.width,c=a.y/a.height,d=Math.floor(t[r]+n),p=Math.floor(t[r+1]+n);for(let e=r+2;e<o;e+=2)d=Math.min(d,Math.floor(t[e]+n)),p=Math.min(p,Math.floor(t[e+1]+n));u-=d,c-=p;for(let e=r;e<o;e+=2)t[e]=(t[e]+u)*h,t[e+1]=(t[e+1]+c)*l}};c.BATCHABLE_SIZE=100;let d=c;e.GraphicsGeometry=d},7397:t=>{"use strict";var e={};t.exports=function(t,r){var i=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(r)}},7398:(t,e)=>{"use strict";const r=Object.create(null),i=Object.create(null);e.BaseTextureCache=i,e.ProgramCache={},e.TextureCache=r,e.clearTextureCache=function(){let t;for(t in r)delete r[t];for(t in i)delete i[t]},e.destroyTextureCache=function(){let t;for(t in r)r[t].destroy();for(t in i)i[t].destroy()}},7412:t=>{"use strict";t.exports=Math.abs},7419:(t,e,r)=>{"use strict";var i=r(8894),s=r(238),n=r(7146),o=r(8287),a=r(8991),h=r(8969),l=r(3126),u=r(3393);const c=[new n.Point,new n.Point,new n.Point,new n.Point],d=new n.Matrix;class p{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new o.RenderTexturePool,this.statePool=[],this.quad=new h.Quad,this.quadUv=new l.QuadUv,this.tempRect=new n.Rectangle,this.activeState={},this.globalUniforms=new a.UniformGroup({outputFrame:new n.Rectangle,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}init(){this.texturePool.setScreenSize(this.renderer.view)}push(t,e){const r=this.renderer,i=this.defaultFilterStack,s=this.statePool.pop()||new u.FilterState,n=r.renderTexture;let o,a;if(n.current){const t=n.current;o=t.resolution,a=t.multisample}else o=r.resolution,a=r.multisample;let h=e[0].resolution||o,l=e[0].multisample??a,c=e[0].padding,p=e[0].autoFit,f=e[0].legacy??!0;for(let t=1;t<e.length;t++){const r=e[t];h=Math.min(h,r.resolution||o),l=Math.min(l,r.multisample??a),c=this.useMaxPadding?Math.max(c,r.padding):c+r.padding,p=p&&r.autoFit,f=f||(r.legacy??!0)}1===i.length&&(this.defaultFilterStack[0].renderTexture=n.current),i.push(s),s.resolution=h,s.multisample=l,s.legacy=f,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(c);const m=this.tempRect.copyFrom(n.sourceFrame);r.projection.transform&&this.transformAABB(d.copyFrom(r.projection.transform).invert(),m),p?(s.sourceFrame.fit(m),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(m)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,n.current?n.current.resolution:r.resolution,n.sourceFrame,n.destinationFrame,r.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,h,l),s.filters=e,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const g=this.tempRect;g.x=0,g.y=0,g.width=s.sourceFrame.width,g.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(n.sourceFrame),s.bindingDestinationFrame.copyFrom(n.destinationFrame),s.transform=r.projection.transform,r.projection.transform=null,n.bind(s.renderTexture,s.sourceFrame,g),r.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,e=t.pop(),r=e.filters;this.activeState=e;const s=this.globalUniforms.uniforms;s.outputFrame=e.sourceFrame,s.resolution=e.resolution;const n=s.inputSize,o=s.inputPixel,a=s.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],a[0]=.5*o[2],a[1]=.5*o[3],a[2]=e.sourceFrame.width*n[2]-.5*o[2],a[3]=e.sourceFrame.height*n[3]-.5*o[3],e.legacy){const t=s.filterArea;t[0]=e.destinationFrame.width,t[1]=e.destinationFrame.height,t[2]=e.sourceFrame.x,t[3]=e.sourceFrame.y,s.filterClamp=s.inputClamp}this.globalUniforms.update();const h=t[t.length-1];if(this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,e.renderTexture,h.renderTexture,i.CLEAR_MODES.BLEND,e),this.returnFilterTexture(e.renderTexture);else{let t=e.renderTexture,s=this.getOptimalFilterTexture(t.width,t.height,e.resolution);s.filterFrame=t.filterFrame;let n=0;for(n=0;n<r.length-1;++n){1===n&&e.multisample>1&&(s=this.getOptimalFilterTexture(t.width,t.height,e.resolution),s.filterFrame=t.filterFrame),r[n].apply(this,t,s,i.CLEAR_MODES.CLEAR,e);const o=t;t=s,s=o}r[n].apply(this,t,h.renderTexture,i.CLEAR_MODES.BLEND,e),n>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(t),this.returnFilterTexture(s)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=i.CLEAR_MODES.CLEAR){const{renderTexture:r,state:s}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t?.filterFrame){const e=this.tempRect;e.x=0,e.y=0,e.width=t.filterFrame.width,e.height=t.filterFrame.height,r.bind(t,t.filterFrame,e)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const n=1&s.stateId||this.forceClear;(e===i.CLEAR_MODES.CLEAR||e===i.CLEAR_MODES.BLIT&&n)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,r,s){const n=this.renderer;n.state.set(t.state),this.bindAndClear(r,s),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(i.DRAW_MODES.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(i.DRAW_MODES.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:r,destinationFrame:i}=this.activeState,{orig:s}=e._texture,o=t.set(i.width,0,0,i.height,r.x,r.y),a=e.worldTransform.copyTo(n.Matrix.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/s.width,1/s.height),o.translate(e.anchor.x,e.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,r=1,s=i.MSAA_QUALITY.NONE){return this.texturePool.getOptimalTexture(t,e,r,s)}getFilterTexture(t,e,r){if("number"==typeof t){const r=t;t=e,e=r}t=t||this.activeState.renderTexture;const s=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,r||i.MSAA_QUALITY.NONE);return s.filterFrame=t.filterFrame,s}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const r=c[0],i=c[1],s=c[2],n=c[3];r.set(e.left,e.top),i.set(e.left,e.bottom),s.set(e.right,e.top),n.set(e.right,e.bottom),t.apply(r,r),t.apply(i,i),t.apply(s,s),t.apply(n,n);const o=Math.min(r.x,i.x,s.x,n.x),a=Math.min(r.y,i.y,s.y,n.y),h=Math.max(r.x,i.x,s.x,n.x),l=Math.max(r.y,i.y,s.y,n.y);e.x=o,e.y=a,e.width=h-o,e.height=l-a}roundFrame(t,e,r,i,s){if(!(t.width<=0||t.height<=0||r.width<=0||r.height<=0)){if(s){const{a:t,b:e,c:r,d:i}=s;if((Math.abs(e)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4))return}(s=s?d.copyFrom(s):d.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}}}p.extension={type:s.ExtensionType.RendererSystem,name:"filter"},s.extensions.add(p),e.FilterSystem=p},7425:(t,e,r)=>{"use strict";var i=r(8456);e.XMLFormat=class{static test(t){const e=t;return"string"!=typeof t&&"getElementsByTagName"in t&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")}static parse(t){const e=new i.BitmapFontData,r=t.getElementsByTagName("info"),s=t.getElementsByTagName("common"),n=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),a=t.getElementsByTagName("kerning"),h=t.getElementsByTagName("distanceField");for(let t=0;t<r.length;t++)e.info.push({face:r[t].getAttribute("face"),size:parseInt(r[t].getAttribute("size"),10)});for(let t=0;t<s.length;t++)e.common.push({lineHeight:parseInt(s[t].getAttribute("lineHeight"),10)});for(let t=0;t<n.length;t++)e.page.push({id:parseInt(n[t].getAttribute("id"),10)||0,file:n[t].getAttribute("file")});for(let t=0;t<o.length;t++){const r=o[t];e.char.push({id:parseInt(r.getAttribute("id"),10),page:parseInt(r.getAttribute("page"),10)||0,x:parseInt(r.getAttribute("x"),10),y:parseInt(r.getAttribute("y"),10),width:parseInt(r.getAttribute("width"),10),height:parseInt(r.getAttribute("height"),10),xoffset:parseInt(r.getAttribute("xoffset"),10),yoffset:parseInt(r.getAttribute("yoffset"),10),xadvance:parseInt(r.getAttribute("xadvance"),10)})}for(let t=0;t<a.length;t++)e.kerning.push({first:parseInt(a[t].getAttribute("first"),10),second:parseInt(a[t].getAttribute("second"),10),amount:parseInt(a[t].getAttribute("amount"),10)});for(let t=0;t<h.length;t++)e.distanceField.push({fieldType:h[t].getAttribute("fieldType"),distanceRange:parseInt(h[t].getAttribute("distanceRange"),10)});return e}}},7450:(t,e,r)=>{"use strict";var i=r(4611),s=r(9441),n=r(3801);class o extends n.Resource{constructor(t,e){const{width:r,height:s}=e||{};super(r,s),this.items=[],this.itemDirtyIds=[];for(let e=0;e<t;e++){const t=new i.BaseTexture;this.items.push(t),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,e){for(let r=0;r<this.length;r++)t[r]&&(t[r].castToBaseTexture?this.addBaseTextureAt(t[r].castToBaseTexture(),r):t[r]instanceof n.Resource?this.addResourceAt(t[r],r):this.addResourceAt(s.autoDetectResource(t[r],e),r))}dispose(){for(let t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(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}bind(t){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");super.bind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=t,this.items[e].on("update",t.update,t)}unbind(t){super.unbind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=null,this.items[e].off("update",t.update,t)}load(){if(this._load)return this._load;const t=this.items.map((t=>t.resource)).filter((t=>t)).map((t=>t.load()));return this._load=Promise.all(t).then((()=>{const{realWidth:t,realHeight:e}=this.items[0];return this.resize(t,e),this.update(),Promise.resolve(this)})),this._load}}e.AbstractMultiResource=o},7460:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,":host{border-left:solid #000 2px;width:0;height:90%;transform:translateY(5%)}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},7476:(t,e,r)=>{"use strict";var i=r(9878),s=r(2501),n=r(856),o=r(7092);e.Resolver=class{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach((t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))})),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if("string"==typeof t)this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}}getAlias(t){const{alias:e,name:r,src:i,srcs:n}=t;return s.convertToList(e||r||i||n,(t=>"string"==typeof t?t:Array.isArray(t)?t.map((t=>t?.src??t?.srcs??t)):t?.src||t?.srcs?t.src??t.srcs:t),!0)}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach((t=>{this.addBundle(t.name,t.assets)}))}addBundle(t,e){const r=[];Array.isArray(e)?e.forEach((e=>{const i=e.src??e.srcs,s=e.alias??e.name;let n;if("string"==typeof s){const e=this._createBundleAssetId(t,s);r.push(e),n=[s,e]}else{const e=s.map((e=>this._createBundleAssetId(t,e)));r.push(...e),n=[...s,...e]}this.add({...e,alias:n,src:i})})):Object.keys(e).forEach((i=>{const s=[i,this._createBundleAssetId(t,i)];if("string"==typeof e[i])this.add({alias:s,src:e[i]});else if(Array.isArray(e[i]))this.add({alias:s,src:e[i]});else{const t=e[i],r=t.src??t.srcs;this.add({...t,alias:s,src:Array.isArray(r)?r:[r]})}r.push(...s)})),this._bundles[t]=r}add(t,e,r,o,a){const h=[];let l;"string"==typeof t||Array.isArray(t)&&"string"==typeof t[0]?(i.utils.deprecation("7.2.0","Assets.add now uses an object instead of individual parameters.\nPlease use Assets.add({ alias, src, data, format, loadParser }) instead."),h.push({alias:t,src:e,data:r,format:o,loadParser:a})):Array.isArray(t)?h.push(...t):h.push(t),l=t=>{this.hasKey(t)&&console.warn(`[Resolver] already has key: ${t} overwriting`)},s.convertToList(h).forEach((t=>{const{src:e,srcs:r}=t;let{data:i,format:o,loadParser:a}=t;const h=s.convertToList(e||r).map((t=>"string"==typeof t?n.createStringVariations(t):Array.isArray(t)?t:[t])),u=this.getAlias(t);Array.isArray(u)?u.forEach(l):l(u);const c=[];h.forEach((t=>{t.forEach((t=>{let e={};if("object"!=typeof t){e.src=t;for(let r=0;r<this._parsers.length;r++){const i=this._parsers[r];if(i.test(t)){e=i.parse(t);break}}}else i=t.data??i,o=t.format??o,a=t.loadParser??a,e={...e,...t};if(!u)throw new Error(`[Resolver] alias is undefined for this asset: ${e.src}`);e=this.buildResolvedAsset(e,{aliases:u,data:i,format:o,loadParser:a}),c.push(e)}))})),u.forEach((t=>{this._assetMap[t]=c}))}))}resolveBundle(t){const e=o.isSingleItem(t);t=s.convertToList(t);const r={};return t.forEach((t=>{const e=this._bundles[t];if(e){const i=this.resolve(e),s={};for(const e in i){const r=i[e];s[this._extractAssetIdFromBundle(t,e)]=r}r[t]=s}})),e?r[t[0]]:r}resolveUrl(t){const e=this.resolve(t);if("string"!=typeof t){const t={};for(const r in e)t[r]=e[r].src;return t}return e.src}resolve(t){const e=o.isSingleItem(t);t=s.convertToList(t);const r={};return t.forEach((t=>{if(!this._resolverHash[t])if(this._assetMap[t]){let e=this._assetMap[t];const r=e[0],i=this._getPreferredOrder(e);i?.priority.forEach((t=>{i.params[t].forEach((r=>{const i=e.filter((e=>!!e[t]&&e[t]===r));i.length&&(e=i)}))})),this._resolverHash[t]=e[0]??r}else this._resolverHash[t]=this.buildResolvedAsset({alias:[t],src:t},{});r[t]=this._resolverHash[t]})),e?r[t[0]]:r}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const e=t[0],r=this._preferredOrder.find((t=>t.params.format.includes(e.format)));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){return this._defaultSearchParams?`${t}${/\?/.test(t)?"&":"?"}${this._defaultSearchParams}`:t}buildResolvedAsset(t,e){const{aliases:r,data:s,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=i.utils.path.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=r??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...s||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??t.format??i.utils.path.extname(t.src).slice(1),t.srcs=t.src,t.name=t.alias,t}}},7480:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TemplateFactoryRootItem=e.TemplateFactory=void 0;const i=r(3943),s="*dhfor",n="*dhif",o={GET:{START:"[",END:"]"},EVENT:{START:"(",END:")"}};e.TemplateFactory=new class{build(t,e,r){return new l(t,e,r)}};const a=["host","__vars","event","abstract","arguments","await","boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","eval","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","of","instanceof","int","interface","let","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","var","void","volatile","while","with","yield","Array","Date","eval","function","hasOwnProperty","Infinity","isFinite","isNaN","isPrototypeOf","length","Math","NaN","name","Number","Object","prototype","String","toString","undefined","valueOf"];class h{static treeItemFactory(t,e){if(t.nodeType===Node.TEXT_NODE)return new u(t,e);if(t.nodeType!==Node.ELEMENT_NODE)return new h(t,e);const r=t;let i=r.hasAttribute(s),o=r.hasAttribute(n);if(i&&o){const a=e.template===t;for(let t=0;t<r.attributes.length;t++){const e=r.attributes.item(t);if(e.name===n){a?o=!1:i=!1;break}if(e.name===s){a?i=!1:o=!1;break}}}return!i||e instanceof c?!o||e instanceof d?new p(t,e):new d(r,e):new c(r,e)}parent;template;childTemplates;node_;providedData;subscriptionList;constructor(t,e){this.template=t,this.parent=e,this.childTemplates=[],this.providedData={},this.subscriptionList=[]}initialized=!1;init(){this.initialized||(this.initialized=!0,this.buildChildTemplates(),this.build(),this.childTemplates.forEach((t=>t.init())),this.connect())}getNode(){return this.node_}getPreviousNodeOf(t){const e=this.childTemplates.indexOf(t);if(e>0){for(let t=e-1;t>=0;t--)this.childTemplates[t].getNode();return this.childTemplates[e-1].getNode()}return null}buildChildTemplates(){const t=[];this.template.childNodes.forEach((e=>t.push(e))),this.childTemplates=t.map((t=>h.treeItemFactory(t,this)))}getHostElement(){return this.parent.getHostElement()}static formulaEvaluationFunctionMap=new Map;evaluateFormula(t,e,r){if(t=t.trim(),/^('[^']]*'|"[^"]*")$/.test(t))return JSON.parse(t);if(/^\w+$/.test(t)){if(/^true|false$/.test(t))return"true"===t;if(/^\d+(\.\d+)?$/.test(t))return+t;let e=this;for(;e;){if(e.providedData.hasOwnProperty(t))return e.providedData[t];if(e!=this){const r=e.childTemplates.find((e=>e.providedData.hasOwnProperty(t)));if(r)return r.providedData[t]}e=e.parent}return"host"===t?this.getHostElement():window[t]}let i=h.formulaEvaluationFunctionMap.get(t);if(!i){const e=t.replace(/('[^']*'|"[^"]*")/g,"").match(/(?<!\.|\w)[a-z$_#][\w$_#]+/g);let r=[...new Set(e)].filter((t=>-1===a.indexOf(t))).map((t=>`const ${t} = __vars["${t}"] ?? window["${t}"];`)).join(""),s=t.lastIndexOf(";");s===t.length-1&&(s=t.lastIndexOf(";",s-1)),-1===s||s===t.length-1?r+=`return ${t};`:r+=t,i=new Function("host, __vars, event",r),h.formulaEvaluationFunctionMap.set(t,i)}const s=this.getHostElement(),n={};let o=this;const l=t=>{for(const e in t.providedData)n.hasOwnProperty(e)||(n[e]=t.providedData[e])};for(;o;)l(o),o!=this&&o.childTemplates.forEach((t=>l(t))),o=o.parent;let u;try{window.evaluateFormulaCount++,u=i.apply(e,[s,n,r])}catch(r){throw console.error(r),new EvalError(`'${t}' could not evaluated \n\tat: ${e.outerHTML?.substr(0,e.outerHTML.indexOf(">")+1)||e.nodeValue}`)}return u}nextListenerIndex=0;updateViewListeners=new Map;addUpdateViewListener(t){const e=this.nextListenerIndex++;return this.updateViewListeners.set(e,t),e}removeUpdateViewListener(t){this.updateViewListeners.delete(t)}updateView(t=!0){let e=0;return this.updateViewListeners.forEach((t=>{t()&&e++})),t&&this.childTemplates.forEach((r=>{e+=r.updateView(t)})),e}detectChangesOnFormula(t,e){let r=this.evaluateFormula(t,e);if("function"==typeof r?.subscribe)return r.subscribe((()=>this.updateView())),r;if("function"==typeof r?.then)return i.from(r);const s=this instanceof c;let n,o;s&&Array.isArray(r)&&(n=[...r]);let a=[];const h=()=>{let i=!1;try{const o=this.evaluateFormula(t,e);i=o!==r,!i&&s&&(i=n.length!==o.length||n.findIndex(((t,e)=>t!==o[e]))>-1,n=[...o]),i&&(a.forEach((t=>t.next(o))),r=o)}catch(t){a.forEach((e=>e.error(t)))}return i};return new i.Observable((t=>{a.push(t),t.add((()=>{a.splice(a.indexOf(t),1),0===a.length&&this.removeUpdateViewListener(o)})),1===a.length&&(o=this.addUpdateViewListener(h)),t.next(r)}))}build(){this.node_=this.template.cloneNode()}connect(){if(!this.node_)return;const t=this.parent.getNode(),e=this.parent.getPreviousNodeOf(this);e?this.node_.previousSibling!==e&&e.after(this.node_):t.append(this.node_)}disconnectElements(){this.node_&&this.node_.remove()}disconnect(){this.subscriptionList.forEach((t=>{t.unsubscribe()})),this.subscriptionList=[],this.disconnectElements(),this.childTemplates.forEach((t=>{t.disconnect()})),this.childTemplates=[]}}class l extends h{targetElement;component;constructor(t,e,r){super(t,null),this.targetElement=e,this.component=r,this.init()}getNode(){return this.targetElement}getHostElement(){return this.component}build(){}updateView(t=!0){window.evaluateFormulaCount=0;const e=Date.now(),r=super.updateView(t);return r&&console.log("updated",window.evaluateFormulaCount,"formulas with",r,`changes in ${this.component.constructor.name} within ${Date.now()-e} ms`),r}}e.TemplateFactoryRootItem=l;class u extends h{build(){if(!this.template.nodeValue)return;const t=this.parent.getNode();let e=this.parent.getPreviousNodeOf(this);const r=r=>{e?e.after(r):t.append(r),e=r};let i=0;const s=/{{([^}]+)}}/g;let n;for(;null!==(n=s.exec(this.template.nodeValue));){const t=this.template.nodeValue.substring(i,n.index);t.length&&r(document.createTextNode(t));const e=this.template.nodeValue.substr(n.index+2,n[1].length).trim(),s=document.createTextNode("");r(s),this.subscriptionList.push(this.detectChangesOnFormula(e,this.template).subscribe((t=>{s.nodeValue=t}))),i=n.index+n[0].length}if(i!==this.template.nodeValue.length){const t=this.template.nodeValue.substr(i);r(document.createTextNode(t))}this.template.nodeValue.length>0&&(this.node_=e)}}class c extends h{basicChildTemplate;getNode(){if(this.childTemplates.length>0){let t=this.childTemplates[this.childTemplates.length-1].getNode();if(t)return t}return this.parent.getNode()}getPreviousNodeOf(t){return super.getPreviousNodeOf(t)||this.parent.getPreviousNodeOf(this)}buildChildTemplates(){}rebuildChildren(t,e,r){const i=this.childTemplates,s=[];this.childTemplates=t.map(((t,n)=>{let o=i.findIndex((r=>r.providedData[e]===t)),a=null;return-1===o?(a=h.treeItemFactory(this.template,this),s.push(a),a.providedData[e]=t):(a=i[o],i.splice(o,1)),r&&(a.providedData[r]=n),a})),i.forEach((t=>{t.disconnect()})),this.initialized&&s.forEach((t=>t.init())),s.length!==this.childTemplates.length&&this.childTemplates.forEach((t=>{t.connect()}))}build(){const t=this.template.getAttribute(s).trim(),e=t.match(/^let (?<itemName>\w+) (?<action>of|in) (?<listFormula>.+(?=, (\w+)$)|[^\n]+)(, (?<indexName>\w+))?$/);e&&e.groups||console.error(new SyntaxError(`${s}="${t}" doesn't match the right pattern. \n - Example: ${s}="item of list" or ${s}="member of group.members"`));const r=e.groups.listFormula,i=e.groups.indexName,n=e.groups.itemName,o=e.groups.action;this.subscriptionList.push(this.detectChangesOnFormula(r,this.template).subscribe((t=>{"of"!==o||Array.isArray(t)?"in"===o&&(t=Object.keys(t)):"object"==typeof t?t=Object.keys(t).map((e=>t[e])):(console.error(new TypeError(`formula ${r} must return an array to use it for ${s}`)),t=[]),this.rebuildChildren(t,n,i)})))}}class d extends h{basicChildTemplate;getNode(){return this.childTemplates.length>0?this.childTemplates[0].getNode():this.parent.getNode()}getPreviousNodeOf(t){return super.getPreviousNodeOf(t)||this.parent.getPreviousNodeOf(this)}buildChildTemplates(){}build(){let t,e=this.template.getAttribute(n),r=e.match(/(.*)as\s+(\w+)$/);r&&r.length>0&&(e=r[1],t=r[2]),this.subscriptionList.push(this.detectChangesOnFormula(e,this.template).subscribe((e=>{if(e)if(0===this.childTemplates.length){const r=d.treeItemFactory(this.template,this);t&&(r.providedData[t]=e),r.init(),this.childTemplates.push(r)}else t&&this.childTemplates.forEach((r=>{r.providedData[t]=e}));else this.childTemplates.forEach((t=>t.disconnect())),this.childTemplates=[]})))}}class p extends h{build(){let t;const e=window.customElements.get(this.template.tagName.toLowerCase());e?.prototype?.__resolve&&(t=e.prototype.__resolve),super.build(),t&&t.initProperties(this.node_);for(let e=0;e<this.template.attributes.length;e++){const r=this.template.attributes.item(e);if("#"!==r.name[0]||r.value){if(r.name[0]===o.EVENT.START&&r.name[r.name.length-1]===o.EVENT.END){const t=r.name.substring(1,r.name.length-1),e=this;this.node_.addEventListener(t,(function(t){try{return e.evaluateFormula(r.value,this,t)}catch(t){console.error(t)}}))}else if(r.name[0]===o.GET.START&&r.name[r.name.length-1]===o.GET.END){const e=r.name.substring(1,r.name.length-1);let i=t=>this.node_.setAttribute(e,t);t&&t.has(e)&&(i=r=>{t.setProperty(this.node_,e,r)}),this.subscriptionList.push(this.detectChangesOnFormula(r.value,this.node_).subscribe(i))}}else this.providedData[r.name.substr(1)]=this.node_}}}},7491:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799),n=r(2935),o=r(7395),a=r(865),h=r(3816);r(2014);var l=r(7287),u=r(4426),c=r(4093);const d={},p=class t extends s.Container{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new a.FillStyle,this._lineStyle=new h.LineStyle,this._matrix=null,this._holeMode=!1,this.state=i.State.for2d(),this._geometry=t||new o.GraphicsGeometry,this._geometry.refCount++,this._transformID=-1,this._tintColor=new i.Color(16777215),this.blendMode=i.BLEND_MODES.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new t(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,r,i=.5,s=!1){return"number"==typeof t&&(t={width:t,color:e,alpha:r,alignment:i,native:s}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:i.Texture.WHITE,color:t?.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:n.LINE_CAP.BUTT,join:n.LINE_JOIN.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.width>0&&t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:r},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new i.Polygon,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new i.Polygon,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const r=this.currentPath.points,i=r[r.length-2],s=r[r.length-1];return(i!==t||s!==e)&&r.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,r,i){this._initCurve();const s=this.currentPath.points;return 0===s.length&&this.moveTo(0,0),l.QuadraticUtils.curveTo(t,e,r,i,s),this}bezierCurveTo(t,e,r,i,s,n){return this._initCurve(),u.BezierUtils.curveTo(t,e,r,i,s,n,this.currentPath.points),this}arcTo(t,e,r,i,s){this._initCurve(t,e);const n=this.currentPath.points,o=c.ArcUtils.curveTo(t,e,r,i,s,n);if(o){const{cx:t,cy:e,radius:r,startAngle:i,endAngle:s,anticlockwise:n}=o;this.arc(t,e,r,i,s,n)}return this}arc(t,e,r,s,n,o=!1){if(s===n)return this;if(!o&&n<=s?n+=i.PI_2:o&&s<=n&&(s+=i.PI_2),n-s==0)return this;const a=t+Math.cos(s)*r,h=e+Math.sin(s)*r,l=this._geometry.closePointEps;let u=this.currentPath?this.currentPath.points:null;if(u){const t=Math.abs(u[u.length-2]-a),e=Math.abs(u[u.length-1]-h);t<l&&e<l||u.push(a,h)}else this.moveTo(a,h),u=this.currentPath.points;return c.ArcUtils.arc(a,h,t,e,r,s,n,o,u),this}beginFill(t=0,e){return this.beginTextureFill({texture:i.Texture.WHITE,color:t,alpha:e})}normalizeColor(t){const e=i.Color.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:i.Texture.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:r},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,r,s){return this.drawShape(new i.Rectangle(t,e,r,s))}drawRoundedRect(t,e,r,s,n){return this.drawShape(new i.RoundedRectangle(t,e,r,s,n))}drawCircle(t,e,r){return this.drawShape(new i.Circle(t,e,r))}drawEllipse(t,e,r,s){return this.drawShape(new i.Ellipse(t,e,r,s))}drawPolygon(...t){let e,r=!0;const s=t[0];s.points?(r=s.closeStroke,e=s.points):e=Array.isArray(t[0])?t[0]:t;const n=new i.Polygon(e);return n.closeStroke=r,this.drawShape(n),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return!(1!==t.length||t[0].shape.type!==i.SHAPES.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const 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(let s=0;s<r;s++){const r=t.batches[s],n=r.style.color,o=new Float32Array(this.vertexData.buffer,4*r.attribStart*2,2*r.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*r.attribStart*2,2*r.attribSize),h={vertexData:o,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*r.start,r.size),uvs:a,_batchRGB:i.Color.shared.setValue(n).toRgbArray(),_tintRGB:n,_texture:r.style.texture,alpha:r.style.alpha,worldAlpha:1};this.batches[s]=h}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,r=this.batches.length;e<r;e++){const r=this.batches[e];r.worldAlpha=this.worldAlpha*r.alpha,t.plugins[this.pluginName].render(r)}}}_renderDirect(t){const e=this._resolveDirectShader(t),r=this._geometry,s=this.worldAlpha,n=e.uniforms,o=r.drawCalls;n.translationMatrix=this.transform.worldTransform,i.Color.shared.setValue(this._tintColor).premultiply(s).toArray(n.tint),t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(let e=0,i=o.length;e<i;e++)this._renderDrawCallDirect(t,r.drawCalls[e])}_renderDrawCallDirect(t,e){const{texArray:r,type:i,size:s,start:n}=e,o=r.count;for(let e=0;e<o;e++)t.texture.bind(r.elements[e],e);t.geometry.draw(i,s,n)}_resolveDirectShader(t){let e=this.shader;const r=this.pluginName;if(!e){if(!d[r]){const{maxTextures:e}=t.plugins[r],s=new Int32Array(e);for(let t=0;t<e;t++)s[t]=t;const n={tint:new Float32Array([1,1,1,1]),translationMatrix:new i.Matrix,default:i.UniformGroup.from({uSamplers:s},!0)},o=t.plugins[r]._shader.program;d[r]=new i.Shader(o,n)}e=d[r]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:r,maxX:i,maxY:s}=t.bounds;this._bounds.addFrame(this.transform,e,r,i,s)}containsPoint(e){return this.worldTransform.applyInverse(e,t._TEMP_POINT),this._geometry.containsPoint(t._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=i.Color.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,r=e.a,i=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,h=this._geometry.points,l=this.vertexData;let u=0;for(let t=0;t<h.length;t+=2){const e=h[t],c=h[t+1];l[u++]=r*e+s*c+o,l[u++]=n*c+i*e+a}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){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,super.destroy(t)}};p.curves=n.curves,p._TEMP_POINT=new i.Point;let f=p;e.Graphics=f},7495:(t,e)=>{"use strict";const r={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};e.mapSize=function(t){return r[t]}},7500:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,"@keyframes spinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes hide{0%{opacity:1}100%{opacity:0;z-index:0;display:none}}*{padding:0;margin:0}img{border:none}.flexbox{width:fit-content;display:flex;flex-direction:row;flex-wrap:wrap}.spacer{display:inline;width:1px}.spacer-1{width:3px}.spacer-2{width:6px}.spacer-3{width:9px}.spacer-4{width:12px}.hide{display:none}[data-tooltip]:before{position:absolute;content:attr(data-tooltip);font-size:14px;background-color:#fff;border:#000 1px solid;transform:translate(10px, 32px);opacity:0;z-index:999;pointer-events:none;cursor:pointer}[data-tooltip]:hover:before{font-family:Segoe UI,Frutiger,Frutiger Linotype,Dejavu Sans,Helvetica Neue,Arial,sans-serif;animation:tooltip-invicible-frame 1000ms ease-in-out;max-width:388px;opacity:1}body,html{width:100%;height:100%}",""]);const a=o},7505:(t,e,r)=>{"use strict";var i=r(9878);const s={extension:i.ExtensionType.CacheParser,test:t=>Array.isArray(t)&&t.every((t=>t instanceof i.Texture)),getCacheableAssets:(t,e)=>{const r={};return t.forEach((t=>{e.forEach(((e,i)=>{r[t+(0===i?"":i+1)]=e}))})),r}};i.extensions.add(s),e.cacheTextureArray=s},7586:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,"*{padding:0;margin:0}img{border:none}.flexbox{width:fit-content;display:flex;flex-direction:row;flex-wrap:wrap}.spacer{display:inline;width:1px}.spacer-1{width:3px}.spacer-2{width:6px}.spacer-3{width:9px}.spacer-4{width:12px}.hide{display:none}[data-tooltip]:before{position:absolute;content:attr(data-tooltip);font-size:14px;background-color:#fff;border:#000 1px solid;transform:translate(10px, 32px);opacity:0;z-index:999;pointer-events:none;cursor:pointer}[data-tooltip]:hover:before{font-family:Segoe UI,Frutiger,Frutiger Linotype,Dejavu Sans,Helvetica Neue,Arial,sans-serif;animation:tooltip-invicible-frame 1000ms ease-in-out;max-width:388px;opacity:1}:host{width:fit-content;display:flex;flex-wrap:wrap;user-select:none}ul{list-style:none}li select{margin-top:5px;margin-bottom:5px}.control-container{padding:5px}.small-box{height:80%;transform:translateY(10%);resize:none}.overlap-wrapper{padding:3px 3px 0 0}.select-offset{padding:10px 0px 0px 0px}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},7601:(t,e,r)=>{"use strict";var i=r(5885),s=r(8049);e.parseDDS=i.parseDDS,e.FORMATS_TO_COMPONENTS=s.FORMATS_TO_COMPONENTS,e.TYPES_TO_BYTES_PER_COMPONENT=s.TYPES_TO_BYTES_PER_COMPONENT,e.TYPES_TO_BYTES_PER_PIXEL=s.TYPES_TO_BYTES_PER_PIXEL,e.parseKTX=s.parseKTX},7605:(t,e,r)=>{"use strict";var i=r(8894),s=r(3386),n=r(4611);e.Framebuffer=class{constructor(t,e){if(this.width=Math.round(t),this.height=Math.round(e),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");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 s.Runner("disposeFramebuffer"),this.multisample=i.MSAA_QUALITY.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new n.BaseTexture(null,{scaleMode:i.SCALE_MODES.NEAREST,resolution:1,mipmap:i.MIPMAP_MODES.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new n.BaseTexture(null,{scaleMode:i.SCALE_MODES.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:i.MIPMAP_MODES.OFF,format:i.FORMATS.DEPTH_COMPONENT,type:i.TYPES.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,e){if(t=Math.round(t),e=Math.round(e),!t||!e)throw new Error("Framebuffer width and height must not be zero");if(t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(let r=0;r<this.colorTextures.length;r++){const i=this.colorTextures[r],s=i.resolution;i.setSize(t/s,e/s)}if(this.depthTexture){const r=this.depthTexture.resolution;this.depthTexture.setSize(t/r,e/r)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}},7620:(t,e,r)=>{"use strict";var i=r(8894),s=r(238),n=r(5081),o=r(2307);const a=class t{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=i.BLEND_MODES.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 n.State,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=o.mapWebGLBlendModesToPixi(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,r=0;for(;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(e){this.updateCheck(t.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(t.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const 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))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const r=this.checks.indexOf(t);e&&-1===r?this.checks.push(t):!e&&-1!==r&&this.checks.splice(r,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};a.extension={type:s.ExtensionType.RendererSystem,name:"state"};let h=a;s.extensions.add(h),e.StateSystem=h},7647:(t,e,r)=>{"use strict";var i=r(9878),s=r(6048);const n={extension:{type:i.ExtensionType.DetectionParser,priority:0},test:async()=>s.testVideoFormat("video/webm"),add:async t=>[...t,"webm"],remove:async t=>t.filter((t=>"webm"!==t))};i.extensions.add(n),e.detectWebm=n},7664:(t,e,r)=>{"use strict";r(9440);var i=r(6782),s=r(7495);function n(t,e,r,i,s){r.buffer.update(s)}const o={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    "},a={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 h(t){const e=t.map((t=>({data:t,offset:0,dataLen:0,dirty:0})));let r=0,i=0,s=0;for(let t=0;t<e.length;t++){const n=e[t];if(r=a[n.data.type],n.data.size>1&&(r=Math.max(r,16)*n.data.size),n.dataLen=r,i%r!=0&&i<16){const t=i%r%16;i+=t,s+=t}i+r>16?(s=16*Math.ceil(s/16),n.offset=s,s+=r,i=r):(n.offset=s,i+=r,s+=r)}return s=16*Math.ceil(s/16),{uboElements:e,size:s}}function l(t,e){const r=[];for(const i in t)e[i]&&r.push(e[i]);return r.sort(((t,e)=>t.index-e.index)),r}e.createUBOElements=h,e.generateUniformBufferSync=function(t,e){if(!t.autoManage)return{size:0,syncFunc:n};const r=l(t.uniforms,e),{uboElements:u,size:c}=h(r),d=["\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    "];for(let e=0;e<u.length;e++){const r=u[e],n=t.uniforms[r.data.name],h=r.data.name;let l=!1;for(let t=0;t<i.uniformParsers.length;t++){const e=i.uniformParsers[t];if(e.codeUbo&&e.test(r.data,n)){d.push(`offset = ${r.offset/4};`,i.uniformParsers[t].codeUbo(r.data.name,n)),l=!0;break}}if(!l)if(r.data.size>1){const t=s.mapSize(r.data.type),e=Math.max(a[r.data.type]/16,1),i=t/e,n=(4-i%4)%4;d.push(`\n                cv = ud.${h}.value;\n                v = uv.${h};\n                offset = ${r.offset/4};\n\n                t = 0;\n\n                for(var i=0; i < ${r.data.size*e}; i++)\n                {\n                    for(var j = 0; j < ${i}; j++)\n                    {\n                        data[offset++] = v[t++];\n                    }\n                    offset += ${n};\n                }\n\n                `)}else{const t=o[r.data.type];d.push(`\n                cv = ud.${h}.value;\n                v = uv.${h};\n                offset = ${r.offset/4};\n                ${t};\n                `)}}return d.push("\n       renderer.buffer.update(buffer);\n    "),{size:c,syncFunc:new Function("ud","uv","renderer","syncData","buffer",d.join("\n"))}},e.getUBOData=l},7678:(t,e,r)=>{"use strict";var i,s=r(2427),n=r(5667);try{i=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var o=!!i&&n&&n(Object.prototype,"__proto__"),a=Object,h=a.getPrototypeOf;t.exports=o&&"function"==typeof o.get?s([o.get]):"function"==typeof h&&function(t){return h(null==t?t:a(t))}},7728:(t,e)=>{"use strict";const r={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]},i=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{","    gl_FragColor = vec4(0.0);","    %blur%","}"].join("\n");e.generateBlurFragSource=function(t){const e=r[t],s=e.length;let n,o=i,a="";for(let r=0;r<t;r++){let i="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",r.toString());n=r,r>=s&&(n=t-r-1),i=i.replace("%value%",e[n].toString()),a+=i,a+="\n"}return o=o.replace("%blur%",a),o=o.replace("%size%",t.toString()),o}},7737:(t,e,r)=>{"use strict";var i=r(3937),s=r(9878);const n=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],o=class t{constructor(t){this.styleID=0,this.reset(),l(this,t,t)}clone(){const e={};return l(e,this,t.defaultStyle),new t(e)}reset(){l(this,t.defaultStyle,t.defaultStyle)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){const e=h(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){const e=h(t);this._fill!==e&&(this._fill=e,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.styleID++)}get stroke(){return this._stroke}set stroke(t){const e=h(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}toFontString(){const t="number"==typeof this.fontSize?`${this.fontSize}px`:this.fontSize;let e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(let t=e.length-1;t>=0;t--){let r=e[t].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!n.includes(r)&&(r=`"${r}"`),e[t]=r}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};o.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:i.TEXT_GRADIENT.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let a=o;function h(t){const e=s.Color.shared,r=t=>{const r=e.setValue(t);return 1===r.alpha?r.toHex():r.toRgbaString()};return Array.isArray(t)?t.map(r):r(t)}function l(t,e,r){for(const i in r)Array.isArray(e[i])?t[i]=e[i].slice():t[i]=e[i]}e.TextStyle=a},7773:(t,e)=>{"use strict";var r=(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=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t))(r||{});e.INTERNAL_FORMATS=r,e.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1}},7785:(t,e,r)=>{"use strict";var i=r(9524),s=r(4811),n=r(6255),o=r(2728);t.exports=o||i.call(n,s)},7813:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799),n=r(8071),o=r(5648),a=r(3276),h=r(6455);r(8270);var l=r(104),u=r(6526);const c=[],d=[],p=[],f=class t extends s.Container{constructor(e,r={}){super();const{align:s,tint:n,maxWidth:a,letterSpacing:h,fontName:l,fontSize:u}=Object.assign({},t.styleDefaults,r);if(!o.BitmapFont.available[l])throw new Error(`Missing BitmapFont "${l}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=s,this._tintColor=new i.Color(n),this._font=void 0,this._fontName=l,this._fontSize=u,this.text=e,this._maxWidth=a,this._maxLineHeight=0,this._letterSpacing=h,this._anchor=new i.ObservablePoint((()=>{this.dirty=!0}),this,0,0),this._roundPixels=i.settings.ROUND_PIXELS,this.dirty=!0,this._resolution=i.settings.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){const t=o.BitmapFont.available[this._fontName],e=this.fontSize,r=e/t.size,s=new i.Point,f=[],m=[],g=[],y=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",_=l.splitTextToCharacters(y),v=this._maxWidth*t.size/e,x="none"===t.distanceFieldType?c:d;let b=null,T=0,E=0,A=0,S=-1,w=0,P=0,R=0,M=0;for(let e=0;e<_.length;e++){const r=_[e],n=u.extractCharCode(r);if(/(?:\s)/.test(r)&&(S=e,w=T,M++),"\r"===r||"\n"===r){m.push(T),g.push(-1),E=Math.max(E,T),++A,++P,s.x=0,s.y+=t.lineHeight,b=null,M=0;continue}const o=t.chars[n];if(!o)continue;b&&o.kerning[b]&&(s.x+=o.kerning[b]);const a=p.pop()||{texture:i.Texture.EMPTY,line:0,charCode:0,prevSpaces:0,position:new i.Point};a.texture=o.texture,a.line=A,a.charCode=n,a.position.x=Math.round(s.x+o.xOffset+this._letterSpacing/2),a.position.y=Math.round(s.y+o.yOffset),a.prevSpaces=M,f.push(a),T=a.position.x+Math.max(o.xAdvance-o.xOffset,o.texture.orig.width),s.x+=o.xAdvance+this._letterSpacing,R=Math.max(R,o.yOffset+o.texture.height),b=n,-1!==S&&v>0&&s.x>v&&(++P,i.utils.removeItems(f,1+S-P,1+e-S),e=S,S=-1,m.push(w),g.push(f.length>0?f[f.length-1].prevSpaces:0),E=Math.max(E,w),A++,s.x=0,s.y+=t.lineHeight,b=null,M=0)}const C=_[_.length-1];"\r"!==C&&"\n"!==C&&(/(?:\s)/.test(C)&&(T=w),m.push(T),E=Math.max(E,T),g.push(-1));const I=[];for(let t=0;t<=A;t++){let e=0;"right"===this._align?e=E-m[t]:"center"===this._align?e=(E-m[t])/2:"justify"===this._align&&(e=g[t]<0?0:(E-m[t])/g[t]),I.push(e)}const D=f.length,O={},B=[],L=this._activePagesMeshData;x.push(...L);for(let e=0;e<D;e++){const r=f[e].texture,s=r.baseTexture.uid;if(!O[s]){let e=x.pop();if(!e){const r=new n.MeshGeometry;let s,o;"none"===t.distanceFieldType?(s=new n.MeshMaterial(i.Texture.EMPTY),o=i.BLEND_MODES.NORMAL):(s=new n.MeshMaterial(i.Texture.EMPTY,{program:i.Program.from(h.default,a.default),uniforms:{uFWidth:0}}),o=i.BLEND_MODES.NORMAL_NPM);const l=new n.Mesh(r,s);l.blendMode=o,e={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:l,vertices:null,uvs:null,indices:null}}e.index=0,e.indexCount=0,e.vertexCount=0,e.uvsCount=0,e.total=0;const{_textureCache:o}=this;o[s]=o[s]||new i.Texture(r.baseTexture),e.mesh.texture=o[s],e.mesh.tint=this._tintColor.value,B.push(e),O[s]=e}O[s].total++}for(let t=0;t<L.length;t++)B.includes(L[t])||this.removeChild(L[t].mesh);for(let t=0;t<B.length;t++)B[t].mesh.parent!==this&&this.addChild(B[t].mesh);this._activePagesMeshData=B;for(const t in O){const e=O[t],r=e.total;if(!(e.indices?.length>6*r)||e.vertices.length<2*n.Mesh.BATCHABLE_SIZE)e.vertices=new Float32Array(8*r),e.uvs=new Float32Array(8*r),e.indices=new Uint16Array(6*r);else{const t=e.total,r=e.vertices;for(let e=4*t*2;e<r.length;e++)r[e]=0}e.mesh.size=6*r}for(let t=0;t<D;t++){const e=f[t];let i=e.position.x+I[e.line]*("justify"===this._align?e.prevSpaces:1);this._roundPixels&&(i=Math.round(i));const s=i*r,n=e.position.y*r,o=e.texture,a=O[o.baseTexture.uid],h=o.frame,l=o._uvs,u=a.index++;a.indices[6*u+0]=0+4*u,a.indices[6*u+1]=1+4*u,a.indices[6*u+2]=2+4*u,a.indices[6*u+3]=0+4*u,a.indices[6*u+4]=2+4*u,a.indices[6*u+5]=3+4*u,a.vertices[8*u+0]=s,a.vertices[8*u+1]=n,a.vertices[8*u+2]=s+h.width*r,a.vertices[8*u+3]=n,a.vertices[8*u+4]=s+h.width*r,a.vertices[8*u+5]=n+h.height*r,a.vertices[8*u+6]=s,a.vertices[8*u+7]=n+h.height*r,a.uvs[8*u+0]=l.x0,a.uvs[8*u+1]=l.y0,a.uvs[8*u+2]=l.x1,a.uvs[8*u+3]=l.y1,a.uvs[8*u+4]=l.x2,a.uvs[8*u+5]=l.y2,a.uvs[8*u+6]=l.x3,a.uvs[8*u+7]=l.y3}this._textWidth=E*r,this._textHeight=(s.y+t.lineHeight)*r;for(const t in O){const e=O[t];if(0!==this.anchor.x||0!==this.anchor.y){let t=0;const r=this._textWidth*this.anchor.x,i=this._textHeight*this.anchor.y;for(let s=0;s<e.total;s++)e.vertices[t++]-=r,e.vertices[t++]-=i,e.vertices[t++]-=r,e.vertices[t++]-=i,e.vertices[t++]-=r,e.vertices[t++]-=i,e.vertices[t++]-=r,e.vertices[t++]-=i}this._maxLineHeight=R*r;const i=e.mesh.geometry.getBuffer("aVertexPosition"),s=e.mesh.geometry.getBuffer("aTextureCoord"),n=e.mesh.geometry.getIndex();i.data=e.vertices,s.data=e.uvs,n.data=e.indices,i.update(),s.update(),n.update()}for(let t=0;t<f.length;t++)p.push(f[t]);this._font=t,this.dirty=!1}updateTransform(){this.validate(),this.containerUpdateTransform()}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0);const{distanceFieldRange:e,distanceFieldType:r,size:i}=o.BitmapFont.available[this._fontName];if("none"!==r){const{a:r,b:s,c:n,d:o}=this.worldTransform,a=Math.sqrt(r*r+s*s),h=Math.sqrt(n*n+o*o),l=(Math.abs(a)+Math.abs(h))/2,u=this.fontSize/i,c=t._view.resolution;for(const t of this._activePagesMeshData)t.mesh.shader.uniforms.uFWidth=l*e*u*c}super._render(t)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){const t=o.BitmapFont.available[this._fontName];if(!t)throw new Error(`Missing BitmapFont "${this._fontName}"`);this._font!==t&&(this.dirty=!0),this.dirty&&this.updateText()}get tint(){return this._tintColor.value}set tint(t){if(this.tint!==t){this._tintColor.setValue(t);for(let e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.dirty=!0)}get fontName(){return this._fontName}set fontName(t){if(!o.BitmapFont.available[t])throw new Error(`Missing BitmapFont "${t}"`);this._fontName!==t&&(this._fontName=t,this.dirty=!0)}get fontSize(){return this._fontSize??o.BitmapFont.available[this._fontName].size}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}get text(){return this._text}set text(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)}get maxLineHeight(){return this.validate(),this._maxLineHeight}get textWidth(){return this.validate(),this._textWidth}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)}get roundPixels(){return this._roundPixels}set roundPixels(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)}get textHeight(){return this.validate(),this._textHeight}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}destroy(t){const{_textureCache:e}=this,r="none"===o.BitmapFont.available[this._fontName].distanceFieldType?c:d;r.push(...this._activePagesMeshData);for(const t of this._activePagesMeshData)this.removeChild(t.mesh);this._activePagesMeshData=[],r.filter((t=>e[t.mesh.texture.baseTexture.uid])).forEach((t=>{t.mesh.texture=i.Texture.EMPTY}));for(const t in e)e[t].destroy(),delete e[t];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}};f.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};let m=f;e.BitmapText=m},7826:(t,e,r)=>{"use strict";var i=r(3386),s=r(8066);class n extends s.EventEmitter{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){this.addRunners(...t.runners);const e=(t.priority??[]).filter((e=>t.systems[e])),r=[...e,...Object.keys(t.systems).filter((t=>!e.includes(t)))];for(const e of r)this.addSystem(t.systems[e],e)}addRunners(...t){t.forEach((t=>{this.runners[t]=new i.Runner(t)}))}addSystem(t,e){const r=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=r,this._systemsHash[e]=r;for(const t in this.runners)this.runners[t].add(r);return this}emitWithCustomOptions(t,e){const r=Object.keys(this._systemsHash);t.items.forEach((i=>{const s=r.find((t=>this._systemsHash[t]===i));i[t.name](e[s])}))}destroy(){Object.values(this.runners).forEach((t=>{t.destroy()})),this._systemsHash={}}}e.SystemManager=n},7858:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799);const n=class t{constructor(e){this.stage=new s.Container,e=Object.assign({forceCanvas:!1},e),this.renderer=i.autoDetectRenderer(e),t._plugins.forEach((t=>{t.init.call(this,e)}))}render(){this.renderer.render(this.stage)}get view(){return this.renderer?.view}get screen(){return this.renderer?.screen}destroy(e,r){const i=t._plugins.slice(0);i.reverse(),i.forEach((t=>{t.destroy.call(this)})),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null}};n._plugins=[];let o=n;i.extensions.handleByList(i.ExtensionType.Application,o._plugins),e.Application=o},7902:(t,e,r)=>{"use strict";var i=r(521),s=r(9722);const n=class t{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new s.TickerListener(null,null,1/0),this.deltaMS=1/t.targetFPMS,this.elapsedMS=1/t.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=i.UPDATE_PRIORITY.NORMAL){return this._addListener(new s.TickerListener(t,e,r))}addOnce(t,e,r=i.UPDATE_PRIORITY.NORMAL){return this._addListener(new s.TickerListener(t,e,r,!0))}_addListener(t){let 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}remove(t,e){let r=this._head.next;for(;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let r;if(e>this.lastTime){if(r=this.elapsedMS=e-this.lastTime,r>this._maxElapsedMS&&(r=this._maxElapsedMS),r*=this.speed,this._minElapsedMS){const t=e-this._lastFrame|0;if(t<this._minElapsedMS)return;this._lastFrame=e-t%this._minElapsedMS}this.deltaMS=r,this.deltaTime=this.deltaMS*t.targetFPMS;const i=this._head;let s=i.next;for(;s;)s=s.emit(this.deltaTime);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const r=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,r)/1e3,t.targetFPMS);this._maxElapsedMS=1/i}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(0===t)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!t._shared){const e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared}static get system(){if(!t._system){const e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system}};n.targetFPMS=.06;let o=n;e.Ticker=o},7927:(t,e,r)=>{"use strict";var i=r(9878),s=r(8071),n=r(3604);class o extends s.Mesh{constructor(t,e,r=0){const o=new n.RopeGeometry(t.height,e,r),a=new s.MeshMaterial(t);r>0&&(t.baseTexture.wrapMode=i.WRAP_MODES.REPEAT),super(o,a),this.autoUpdate=!0}_render(t){const e=this.geometry;(this.autoUpdate||e._width!==this.shader.texture.height)&&(e._width=this.shader.texture.height,e.update()),super._render(t)}}e.SimpleRope=o},7958:t=>{"use strict";t.exports=Math.max},7970:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="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"},8004:t=>{"use strict";t.exports=EvalError},8017:(t,e,r)=>{"use strict";var i=r(6238),s=r(8066),n=r(7902);Object.defineProperties(i.settings,{TARGET_FPMS:{get:()=>n.Ticker.targetFPMS,set(t){s.deprecation("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),n.Ticker.targetFPMS=t}}}),Object.defineProperty(e,"settings",{enumerable:!0,get:function(){return i.settings}})},8036:(t,e,r)=>{"use strict";var i=r(1537),s=r(4008);const n=[new s.Point,new s.Point,new s.Point,new s.Point];class o{constructor(t=0,e=0,r=0,s=0){this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(s),this.type=i.SHAPES.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new o(0,0,0,0)}clone(){return new o(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(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}intersects(t,e){if(!e){const e=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=e)return!1;const r=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>r}const r=this.left,i=this.right,s=this.top,o=this.bottom;if(i<=r||o<=s)return!1;const a=n[0].set(t.left,t.top),h=n[1].set(t.left,t.bottom),l=n[2].set(t.right,t.top),u=n[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const c=Math.sign(e.a*e.d-e.b*e.c);if(0===c||(e.apply(a,a),e.apply(h,h),e.apply(l,l),e.apply(u,u),Math.max(a.x,h.x,l.x,u.x)<=r||Math.min(a.x,h.x,l.x,u.x)>=i||Math.max(a.y,h.y,l.y,u.y)<=s||Math.min(a.y,h.y,l.y,u.y)>=o))return!1;const d=c*(h.y-a.y),p=c*(a.x-h.x),f=d*r+p*s,m=d*i+p*s,g=d*r+p*o,y=d*i+p*o;if(Math.max(f,m,g,y)<=d*a.x+p*a.y||Math.min(f,m,g,y)>=d*u.x+p*u.y)return!1;const _=c*(a.y-l.y),v=c*(l.x-a.x),x=_*r+v*s,b=_*i+v*s,T=_*r+v*o,E=_*i+v*o;return!(Math.max(x,b,T,E)<=_*a.x+v*a.y||Math.min(x,b,T,E)>=_*u.x+v*u.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const 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),s=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(s-i,0),this}ceil(t=1,e=.001){const 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}enlarge(t){const 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),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=i,this.height=s-i,this}}o.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`},e.Rectangle=o},8049:(t,e,r)=>{"use strict";var i=r(9878),s=r(7773);r(8840);var n=r(2768);const o=[171,75,84,88,32,49,49,187,13,10,26,10],a={[i.TYPES.UNSIGNED_BYTE]:1,[i.TYPES.UNSIGNED_SHORT]:2,[i.TYPES.INT]:4,[i.TYPES.UNSIGNED_INT]:4,[i.TYPES.FLOAT]:4,[i.TYPES.HALF_FLOAT]:8},h={[i.FORMATS.RGBA]:4,[i.FORMATS.RGB]:3,[i.FORMATS.RG]:2,[i.FORMATS.RED]:1,[i.FORMATS.LUMINANCE]:1,[i.FORMATS.LUMINANCE_ALPHA]:2,[i.FORMATS.ALPHA]:1},l={[i.TYPES.UNSIGNED_SHORT_4_4_4_4]:2,[i.TYPES.UNSIGNED_SHORT_5_5_5_1]:2,[i.TYPES.UNSIGNED_SHORT_5_6_5]:2};function u(t){switch(t){case i.FORMATS.RGBA:return i.FORMATS.RGBA_INTEGER;case i.FORMATS.RGB:return i.FORMATS.RGB_INTEGER;case i.FORMATS.RG:return i.FORMATS.RG_INTEGER;case i.FORMATS.RED:return i.FORMATS.RED_INTEGER;default:return t}}e.FORMATS_TO_COMPONENTS=h,e.TYPES_TO_BYTES_PER_COMPONENT=a,e.TYPES_TO_BYTES_PER_PIXEL=l,e.parseKTX=function(t,e,r=!1){const c=new DataView(e);if(!function(t,e){for(let r=0;r<o.length;r++)if(e.getUint8(r)!==o[r])return console.error(`${t} is not a valid *.ktx file!`),!1;return!0}(t,c))return null;const d=67305985===c.getUint32(12,!0),p=c.getUint32(16,d),f=c.getUint32(24,d),m=c.getUint32(28,d),g=c.getUint32(36,d),y=c.getUint32(40,d)||1,_=c.getUint32(44,d)||1,v=c.getUint32(48,d)||1,x=c.getUint32(52,d),b=c.getUint32(56,d),T=c.getUint32(60,d);if(0===y||1!==_)throw new Error("Only 2D textures are supported");if(1!==x)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==v)throw new Error("WebGL does not support array textures");const E=g+3&-4,A=y+3&-4,S=new Array(v);let w,P=g*y;if(0===p&&(P=E*A),w=0!==p?a[p]?a[p]*h[f]:l[p]:s.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[m],void 0===w)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const R=r?function(t,e,r){const i=new Map;let s=0;for(;s<e;){const n=t.getUint32(64+s,r),o=64+s+4,a=3-(n+3)%4;if(0===n||n>e-s){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h<n&&0!==t.getUint8(o+h);h++);if(-1===h){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const l=(new TextDecoder).decode(new Uint8Array(t.buffer,o,h)),u=new DataView(t.buffer,o+h+1,n-h-1);i.set(l,u),s+=4+n+a}return i}(c,T,d):null;let M=P*w,C=g,I=y,D=E,O=A,B=64+T;for(let t=0;t<b;t++){const r=c.getUint32(B,d);let i=B+4;for(let r=0;r<v;r++){let s=S[r];s||(s=S[r]=new Array(b)),s[t]={levelID:t,levelWidth:b>1||0!==p?C:D,levelHeight:b>1||0!==p?I:O,levelBuffer:new Uint8Array(e,i,M)},i+=M}B+=r+4,B=B%4!=0?B+4-B%4:B,C=C>>1||1,I=I>>1||1,D=C+4-1&-4,O=I+4-1&-4,M=D*O*w}return 0!==p?{uncompressed:S.map((t=>{let e=t[0].levelBuffer,r=!1;return p===i.TYPES.FLOAT?e=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):p===i.TYPES.UNSIGNED_INT?(r=!0,e=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):p===i.TYPES.INT&&(r=!0,e=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new i.BufferResource(e,{width:t[0].levelWidth,height:t[0].levelHeight}),type:p,format:r?u(f):f}})),kvData:R}:{compressed:S.map((t=>new n.CompressedTextureResource(null,{format:m,width:g,height:y,levels:b,levelBuffers:t}))),kvData:R}}},8066:(t,e,r)=>{"use strict";r(1153);var i=r(6238),s=r(2579),n=r(6935),o=r(2115),a=r(4691),h=r(3064),l=r(9861),u=r(508),c=r(5231),d=r(1991),p=r(6441),f=r(6267),m=r(3701),g=r(5034),y=r(3279),_=r(6871),v=r(2446),x=r(8169),b=r(4778),T=r(8564),E=r(7398),A=r(8820),S=r(9156),w=r(949),P=r(3042),R=r(37),M=r(3219);r(6152),Object.defineProperty(e,"isMobile",{enumerable:!0,get:function(){return i.isMobile}}),e.EventEmitter=s,e.earcut=n,e.url=o.url,e.path=a.path,e.detectVideoAlphaMode=h.detectVideoAlphaMode,e.sayHello=l.sayHello,e.skipHello=l.skipHello,e.isWebGLSupported=u.isWebGLSupported,e.hex2rgb=c.hex2rgb,e.hex2string=c.hex2string,e.rgb2hex=c.rgb2hex,e.string2hex=c.string2hex,e.correctBlendMode=d.correctBlendMode,e.premultiplyBlendMode=d.premultiplyBlendMode,e.premultiplyRgba=d.premultiplyRgba,e.premultiplyTint=d.premultiplyTint,e.premultiplyTintToRgba=d.premultiplyTintToRgba,e.DATA_URI=p.DATA_URI,e.createIndicesForQuads=f.createIndicesForQuads,e.getBufferType=m.getBufferType,e.interleaveTypedArrays=g.interleaveTypedArrays,e.isPow2=y.isPow2,e.log2=y.log2,e.nextPow2=y.nextPow2,e.removeItems=_.removeItems,e.sign=v.sign,e.uid=x.uid,e.deprecation=b.deprecation,e.BoundingBox=T.BoundingBox,e.BaseTextureCache=E.BaseTextureCache,e.ProgramCache=E.ProgramCache,e.TextureCache=E.TextureCache,e.clearTextureCache=E.clearTextureCache,e.destroyTextureCache=E.destroyTextureCache,e.CanvasRenderTarget=A.CanvasRenderTarget,e.getCanvasBoundingBox=S.getCanvasBoundingBox,e.trimCanvas=w.trimCanvas,e.decomposeDataUri=P.decomposeDataUri,e.determineCrossOrigin=R.determineCrossOrigin,e.getResolutionOfUrl=M.getResolutionOfUrl},8071:(t,e,r)=>{"use strict";var i=r(7098),s=r(1914),n=r(1278),o=r(5219);e.Mesh=i.Mesh,e.MeshBatchUvs=s.MeshBatchUvs,e.MeshGeometry=n.MeshGeometry,e.MeshMaterial=o.MeshMaterial},8085:t=>{"use strict";var e=String.prototype.replace,r=/%20/g,i="RFC3986";t.exports={default:i,formatters:{RFC1738:function(t){return e.call(t,r,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:i}},8099:(t,e)=>{"use strict";const r=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function i(t){let e="";for(let r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}e.checkMaxIfStatementsInShader=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const s=e.createShader(e.FRAGMENT_SHADER);for(;;){const n=r.replace(/%forloop%/gi,i(t));if(e.shaderSource(s,n),e.compileShader(s),e.getShaderParameter(s,e.COMPILE_STATUS))break;t=t/2|0}return t}},8116:(t,e,r)=>{"use strict";var i=r(2498),s=r(4783),n=r(9736),o=r(7419),a=r(9624),h=r(2074),l=r(6574),u=r(7052),c=r(1298),d=r(9612),p=r(5936),f=r(9050),m=r(4496),g=r(4224),y=r(2152),_=r(7620),v=r(7826),x=r(8323),b=r(8221),T=r(3e3),E=r(4816);e.BackgroundSystem=i.BackgroundSystem,e.BatchSystem=s.BatchSystem,e.ContextSystem=n.ContextSystem,e.FilterSystem=o.FilterSystem,e.FramebufferSystem=a.FramebufferSystem,e.GeometrySystem=h.GeometrySystem,e.MaskSystem=l.MaskSystem,e.ScissorSystem=u.ScissorSystem,e.StencilSystem=c.StencilSystem,e.PluginSystem=d.PluginSystem,e.ProjectionSystem=p.ProjectionSystem,e.GenerateTextureSystem=f.GenerateTextureSystem,e.RenderTextureSystem=m.RenderTextureSystem,e.ShaderSystem=g.ShaderSystem,e.StartupSystem=y.StartupSystem,e.StateSystem=_.StateSystem,e.SystemManager=v.SystemManager,e.TextureGCSystem=x.TextureGCSystem,e.TextureSystem=b.TextureSystem,e.TransformFeedbackSystem=T.TransformFeedbackSystem,e.ViewSystem=E.ViewSystem},8162:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,":host{width:fit-content;padding:8px}.row{width:fit-content;margin:auto}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},8169:(t,e)=>{"use strict";let r=0;e.uid=function(){return++r}},8221:(t,e,r)=>{"use strict";var i=r(8894),s=r(238),n=r(8066),o=r(4611),a=r(4333),h=r(1770),l=r(1610);class u{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new o.BaseTexture,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=l.mapTypeAndFormatToInternalFormat(t),this.samplerTypes=h.mapInternalFormatToSamplerType(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let t=0;t<e;t++)this.boundTextures[t]=null;this.emptyTextures={};const r=new a.GLTexture(t.createTexture());t.bindTexture(t.TEXTURE_2D,r.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]=r,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new a.GLTexture(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(let e=0;e<6;e++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,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(let t=0;t<this.boundTextures.length;t++)this.bind(null,t)}bind(t,e=0){const{gl:r}=this;if(t=t?.castToBaseTexture(),t?.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;const 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)):i.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(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}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture}unbind(t){const{gl:e,boundTextures:r}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let t=0;t<r.length;t++)r[t]===this.unknownTexture&&this.bind(null,t)}for(let 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)}ensureSamplerType(t){const{boundTextures:e,hasIntegerTextures:r,CONTEXT_UID:s}=this;if(r)for(let r=t-1;r>=0;--r){const t=e[r];t&&t._glTextures[s].samplerType!==i.SAMPLER_TYPES.FLOAT&&this.renderer.texture.unbind(t)}}initTexture(t){const e=new a.GLTexture(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){e.internalFormat=this.internalFormats[t.type]?.[t.format]??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??i.SAMPLER_TYPES.FLOAT,2===this.webGLVersion&&t.type===i.TYPES.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){const e=t._glTextures[this.CONTEXT_UID];if(!e)return;const r=this.renderer;if(this.initTextureType(t,e),t.resource?.upload(r,t,e))e.samplerType!==i.SAMPLER_TYPES.FLOAT&&(this.hasIntegerTextures=!0);else{const i=t.realWidth,s=t.realHeight,n=r.gl;(e.width!==i||e.height!==s||e.dirtyId<0)&&(e.width=i,e.height=s,n.texImage2D(t.target,0,e.internalFormat,i,s,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:r}=this;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)){const e=this.managedTextures.indexOf(t);-1!==e&&n.removeItems(this.managedTextures,e,1)}}updateTextureStyle(t){const e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==i.MIPMAP_MODES.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=i.WRAP_MODES.CLAMP,t.resource?.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const r=this.gl;if(e.mipmap&&t.mipmap!==i.MIPMAP_MODES.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===i.SCALE_MODES.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);const e=this.renderer.context.extensions.anisotropicFiltering;if(e&&t.anisotropicLevel>0&&t.scaleMode===i.SCALE_MODES.LINEAR){const i=Math.min(t.anisotropicLevel,r.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY_EXT,i)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===i.SCALE_MODES.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===i.SCALE_MODES.LINEAR?r.LINEAR:r.NEAREST)}destroy(){this.renderer=null}}u.extension={type:s.ExtensionType.RendererSystem,name:"texture"},s.extensions.add(u),e.TextureSystem=u},8225:(t,e,r)=>{"use strict";var i=r(9878),s=r(2366),n=r(2573),o=r(9139);const a={name:"loadTxt",extension:{type:i.ExtensionType.LoadParser,priority:o.LoaderParserPriority.Low},test:t=>s.checkDataUrl(t,"text/plain")||n.checkExtension(t,".txt"),load:async t=>await(await i.settings.ADAPTER.fetch(t)).text()};i.extensions.add(a),e.loadTxt=a},8229:(t,e,r)=>{"use strict";var i=r(1517);e.NoiseFilter=i.NoiseFilter},8270:(t,e,r)=>{"use strict";var i=r(862),s=r(6526),n=r(669),o=r(2118),a=r(104);e.drawGlyph=i.drawGlyph,e.extractCharCode=s.extractCharCode,e.generateFillStyle=n.generateFillStyle,e.resolveCharacters=o.resolveCharacters,e.splitTextToCharacters=a.splitTextToCharacters},8287:(t,e,r)=>{"use strict";var i=r(8894),s=r(8066),n=r(2322),o=r(6669);class a{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,r=i.MSAA_QUALITY.NONE){const s=new n.BaseRenderTexture(Object.assign({width:t,height:e,resolution:1,multisample:r},this.textureOptions));return new o.RenderTexture(s)}getOptimalTexture(t,e,r=1,n=i.MSAA_QUALITY.NONE){let o;t=Math.max(Math.ceil(t*r-1e-6),1),e=Math.max(Math.ceil(e*r-1e-6),1),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?o=n>1?-n:-1:(o=((65535&(t=s.nextPow2(t)))<<16|65535&(e=s.nextPow2(e)))>>>0,n>1&&(o+=4294967296*n)),this.texturePool[o]||(this.texturePool[o]=[]);let a=this.texturePool[o].pop();return a||(a=this.createTexture(t,e,n)),a.filterPoolKey=o,a.setResolution(r),a}getFilterTexture(t,e,r){const s=this.getOptimalTexture(t.width,t.height,e||t.resolution,r||i.MSAA_QUALITY.NONE);return s.filterFrame=t.filterFrame,s}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=!1!==t)for(const t in this.texturePool){const e=this.texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0)}this.texturePool={}}setScreenSize(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){this.enableFullScreen=t.width>0&&t.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const e=this.texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0);this.texturePool[t]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}a.SCREEN_KEY=-1,e.RenderTexturePool=a},8311:(t,e,r)=>{var i="function"==typeof Map&&Map.prototype,s=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,n=i&&s&&"function"==typeof s.get?s.get:null,o=i&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,h=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=a&&h&&"function"==typeof h.get?h.get:null,u=a&&Set.prototype.forEach,c="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,_=String.prototype.slice,v=String.prototype.replace,x=String.prototype.toUpperCase,b=String.prototype.toLowerCase,T=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,S=Array.prototype.slice,w=Math.floor,P="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,C="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,D=Object.prototype.propertyIsEnumerable,O=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function B(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||T.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var i=t<0?-w(-t):w(t);if(i!==t){var s=String(i),n=_.call(e,s.length+1);return v.call(s,r,"$&_")+"."+v.call(v.call(n,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var L=r(4058),N=L.custom,F=X(N)?N:null,k={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function G(t,e,r){var i=r.quoteStyle||e,s=k[i];return s+t+s}function H(t){return v.call(String(t),/"/g,"&quot;")}function j(t){return!I||!("object"==typeof t&&(I in t||void 0!==t[I]))}function V(t){return"[object Array]"===Y(t)&&j(t)}function $(t){return"[object RegExp]"===Y(t)&&j(t)}function X(t){if(C)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!M)return!1;try{return M.call(t),!0}catch(t){}return!1}t.exports=function t(e,i,s,a){var h=i||{};if(W(h,"quoteStyle")&&!W(k,h.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(h,"maxStringLength")&&("number"==typeof h.maxStringLength?h.maxStringLength<0&&h.maxStringLength!==1/0:null!==h.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!W(h,"customInspect")||h.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(h,"indent")&&null!==h.indent&&"\t"!==h.indent&&!(parseInt(h.indent,10)===h.indent&&h.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(h,"numericSeparator")&&"boolean"!=typeof h.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var x=h.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return K(e,h);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var T=String(e);return x?B(e,T):T}if("bigint"==typeof e){var w=String(e)+"n";return x?B(e,w):w}var R=void 0===h.depth?5:h.depth;if(void 0===s&&(s=0),s>=R&&R>0&&"object"==typeof e)return V(e)?"[Array]":"[Object]";var N,U=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(h,s);if(void 0===a)a=[];else if(q(a,e)>=0)return"[Circular]";function z(e,r,i){if(r&&(a=S.call(a)).push(r),i){var n={depth:h.depth};return W(h,"quoteStyle")&&(n.quoteStyle=h.quoteStyle),t(e,n,s+1,a)}return t(e,h,s+1,a)}if("function"==typeof e&&!$(e)){var Z=function(t){if(t.name)return t.name;var e=y.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),it=rt(e,z);return"[Function"+(Z?": "+Z:" (anonymous)")+"]"+(it.length>0?" { "+A.call(it,", ")+" }":"")}if(X(e)){var st=C?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):M.call(e);return"object"!=typeof e||C?st:Q(st)}if((N=e)&&"object"==typeof N&&("undefined"!=typeof HTMLElement&&N instanceof HTMLElement||"string"==typeof N.nodeName&&"function"==typeof N.getAttribute)){for(var nt="<"+b.call(String(e.nodeName)),ot=e.attributes||[],at=0;at<ot.length;at++)nt+=" "+ot[at].name+"="+G(H(ot[at].value),"double",h);return nt+=">",e.childNodes&&e.childNodes.length&&(nt+="..."),nt+"</"+b.call(String(e.nodeName))+">"}if(V(e)){if(0===e.length)return"[]";var ht=rt(e,z);return U&&!function(t){for(var e=0;e<t.length;e++)if(q(t[e],"\n")>=0)return!1;return!0}(ht)?"["+et(ht,U)+"]":"[ "+A.call(ht,", ")+" ]"}if(function(t){return"[object Error]"===Y(t)&&j(t)}(e)){var lt=rt(e,z);return"cause"in Error.prototype||!("cause"in e)||D.call(e,"cause")?0===lt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(lt,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+z(e.cause),lt),", ")+" }"}if("object"==typeof e&&m){if(F&&"function"==typeof e[F]&&L)return L(e,{depth:R-s});if("symbol"!==m&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!n||!t||"object"!=typeof t)return!1;try{n.call(t);try{l.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ut=[];return o&&o.call(e,(function(t,r){ut.push(z(r,e,!0)+" => "+z(t,e))})),tt("Map",n.call(e),ut,U)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t);try{n.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return u&&u.call(e,(function(t){ct.push(z(t,e))})),tt("Set",l.call(e),ct,U)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t,c);try{d.call(t,d)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return J("WeakMap");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{d.call(t,d);try{c.call(t,c)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return J("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return J("WeakRef");if(function(t){return"[object Number]"===Y(t)&&j(t)}(e))return Q(z(Number(e)));if(function(t){if(!t||"object"!=typeof t||!P)return!1;try{return P.call(t),!0}catch(t){}return!1}(e))return Q(z(P.call(e)));if(function(t){return"[object Boolean]"===Y(t)&&j(t)}(e))return Q(f.call(e));if(function(t){return"[object String]"===Y(t)&&j(t)}(e))return Q(z(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==r.g&&e===r.g)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===Y(t)&&j(t)}(e)&&!$(e)){var dt=rt(e,z),pt=O?O(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",mt=!pt&&I&&Object(e)===e&&I in e?_.call(Y(e),8,-1):ft?"Object":"",gt=(pt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(mt||ft?"["+A.call(E.call([],mt||[],ft||[]),": ")+"] ":"");return 0===dt.length?gt+"{}":U?gt+"{"+et(dt,U)+"}":gt+"{ "+A.call(dt,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function W(t,e){return z.call(t,e)}function Y(t){return m.call(t)}function q(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}function K(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return K(_.call(t,0,e.maxStringLength),e)+i}var s=U[e.quoteStyle||"single"];return s.lastIndex=0,G(v.call(v.call(t,s,"\\$1"),/[\x00-\x1f]/g,Z),"single",e)}function Z(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+x.call(e.toString(16))}function Q(t){return"Object("+t+")"}function J(t){return t+" { ? }"}function tt(t,e,r,i){return t+" ("+e+") {"+(i?et(r,i):A.call(r,", "))+"}"}function et(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function rt(t,e){var r=V(t),i=[];if(r){i.length=t.length;for(var s=0;s<t.length;s++)i[s]=W(t,s)?e(t[s],t):""}var n,o="function"==typeof R?R(t):[];if(C){n={};for(var a=0;a<o.length;a++)n["$"+o[a]]=o[a]}for(var h in t)W(t,h)&&(r&&String(Number(h))===h&&h<t.length||C&&n["$"+h]instanceof Symbol||(T.call(/[^\w$]/,h)?i.push(e(h,t)+": "+e(t[h],t)):i.push(h+": "+e(t[h],t))));if("function"==typeof R)for(var l=0;l<o.length;l++)D.call(t,o[l])&&i.push("["+e(o[l])+"]: "+e(t[o[l]],t));return i}},8323:(t,e,r)=>{"use strict";var i=r(8894),s=r(238);const n=class t{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=t.defaultMaxIdle,this.checkCountMax=t.defaultCheckCountMax,this.mode=t.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==i.GC_MODES.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let r=!1;for(let i=0;i<e.length;i++){const s=e[i];s.resource&&this.count-s.touched>this.maxIdle&&(t.destroyTexture(s,!0),e[i]=null,r=!0)}if(r){let t=0;for(let r=0;r<e.length;r++)null!==e[r]&&(e[t++]=e[r]);e.length=t}}unload(t){const e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(let e=t.children.length-1;e>=0;e--)this.unload(t.children[e])}destroy(){this.renderer=null}};n.defaultMode=i.GC_MODES.AUTO,n.defaultMaxIdle=3600,n.defaultCheckCountMax=600,n.extension={type:s.ExtensionType.RendererSystem,name:"textureGC"};let o=n;s.extensions.add(o),e.TextureGCSystem=o},8379:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},8388:(t,e,r)=>{"use strict";r.d(e,{A:()=>h});var i=r(2147),s=r.n(i),n=r(7164),o=r.n(n)()(s());o.push([t.id,":host{position:absolute;right:0;top:0;padding:30px;display:flex;flex-wrap:wrap;flex-direction:row}button{user-select:none;display:inline-block;width:auto;height:40px;border:none;margin:auto 10px auto 10px;padding:15px;border-radius:5px;outline:none;box-shadow:none;transition:.3s ease-in-out}button:hover{background-color:#ffa000;color:#000;box-shadow:0px 1px 5px rgba(0,0,0,.5)}button:active{border:none}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const h=a},8452:()=>{},8456:(t,e)=>{"use strict";e.BitmapFontData=class{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}},8465:(t,e,r)=>{"use strict";var i=r(6221),s=r(522);i.extend([s]);const n=class t{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(e){if(e instanceof t)this._value=this.cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(null===e)throw new Error("Cannot set PIXI.Color#value to null");(null===this._value||!this.isSourceEqual(this._value,e))&&(this.normalize(e),this._value=this.cloneSource(e))}}get value(){return this._value}cloneSource(t){return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?{...t}:t}isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if("number"===r||"string"===r||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every(((t,r)=>t===e[r]));if(null!==t&&null!==e){const r=Object.keys(t),i=Object.keys(e);return r.length===i.length&&r.every((r=>t[r]===e[r]))}return t===e}toRgba(){const[t,e,r,i]=this._components;return{r:t,g:e,b:r,a:i}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,i]=this._components;return(t=t??[])[0]=Math.round(255*e),t[1]=Math.round(255*r),t[2]=Math.round(255*i),t}toRgbArray(t){t=t??[];const[e,r,i]=this._components;return t[0]=e,t[1]=r,t[2]=i,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(e){const[r,i,s,n]=t.temp.setValue(e)._components;return this._components[0]*=r,this._components[1]*=i,this._components[2]*=s,this._components[3]*=n,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let r=this._int>>16&255,i=this._int>>8&255,s=255&this._int;return e&&(r=r*t+.5|0,i=i*t+.5|0,s=s*t+.5|0),(255*t<<24)+(r<<16)+(i<<8)+s}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,r,i]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(r*t)/t,this._components[2]=Math.round(i*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,r,i,s]=this._components;return t[0]=e,t[1]=r,t[2]=i,t[3]=s,t}normalize(e){let r,s,n,o;if(("number"==typeof e||e instanceof Number)&&e>=0&&e<=16777215)r=(e>>16&255)/255,s=(e>>8&255)/255,n=(255&e)/255,o=1;else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[r,s,n,o=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[r,s,n,o=255]=e,r/=255,s/=255,n/=255,o/=255;else if("string"==typeof e||"object"==typeof e){if("string"==typeof e){const r=t.HEX_PATTERN.exec(e);r&&(e=`#${r[2]}`)}const a=i.colord(e);a.isValid()&&(({r,g:s,b:n,a:o}=a.rgba),r/=255,s/=255,n/=255)}if(void 0===r)throw new Error(`Unable to convert color ${e}`);this._components[0]=r,this._components[1]=s,this._components[2]=n,this._components[3]=o,this.refreshInt()}refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*r|0)}_clamp(t,e=0,r=1){return"number"==typeof t?Math.min(Math.max(t,e),r):(t.forEach(((i,s)=>{t[s]=Math.min(Math.max(i,e),r)})),t)}};n.shared=new n,n.temp=new n,n.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let o=n;e.Color=o},8488:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="#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"},8507:(t,e,r)=>{"use strict";var i=r(8894),s=r(6238),n=r(1203);class o extends n.BaseImageResource{constructor(t,e){let r,i,s;e=e||{},"string"==typeof t?(r=o.EMPTY,i=t,s=!0):(r=t,i=null,s=!1),super(r),this.url=i,this.crossOrigin=e.crossOrigin??!0,this.alphaMode="number"==typeof e.alphaMode?e.alphaMode:null,this.ownsImageBitmap=e.ownsImageBitmap??s,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise((async(t,e)=>{if(null!==this.url)try{const e=await s.settings.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const r=await e.blob();if(this.destroyed)return;const n=await createImageBitmap(r,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===i.ALPHA_MODES.UNPACK?"premultiply":"none"});if(this.destroyed)return void n.close();this.source=n,this.update(),t(this)}catch(t){if(this.destroyed)return;e(t),this.onError.emit(t)}else t(this)}))),this._load}upload(t,e,r){return this.source instanceof ImageBitmap?("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),super.upload(t,e,r)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&("string"==typeof t||t instanceof ImageBitmap)}static get EMPTY(){return o._EMPTY=o._EMPTY??s.settings.ADAPTER.createCanvas(0,0),o._EMPTY}}e.ImageBitmapResource=o},8531:(t,e,r)=>{"use strict";var i=r(1537);class s{constructor(t=0,e=0,r=0,s=0,n=20){this.x=t,this.y=e,this.width=r,this.height=s,this.radius=n,this.type=i.SHAPES.RREC}clone(){return new s(this.x,this.y,this.width,this.height,this.radius)}contains(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){const 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;let i=t-(this.x+r),s=e-(this.y+r);const n=r*r;if(i*i+s*s<=n||(i=t-(this.x+this.width-r),i*i+s*s<=n)||(s=e-(this.y+this.height-r),i*i+s*s<=n)||(i=t-(this.x+r),i*i+s*s<=n))return!0}return!1}}s.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`},e.RoundedRectangle=s},8564:(t,e)=>{"use strict";const r=class{constructor(t,e,r,i){this.left=t,this.top=e,this.right=r,this.bottom=i}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};r.EMPTY=new r(0,0,0,0);let i=r;e.BoundingBox=i},8588:(t,e,r)=>{"use strict";var i=r(2629),s=r(9878),n=r(5648);r(7259);var o=r(9263),a=r(9948);const h=[".xml",".fnt"],l={extension:{type:s.ExtensionType.LoadParser,priority:i.LoaderParserPriority.Normal},name:"loadBitmapFont",test:t=>h.includes(s.utils.path.extname(t).toLowerCase()),testParse:async t=>o.TextFormat.test(t)||a.XMLStringFormat.test(t),async parse(t,e,r){const h=o.TextFormat.test(t)?o.TextFormat.parse(t):a.XMLStringFormat.parse(t),{src:l}=e,{page:u}=h,c=[];for(let t=0;t<u.length;++t){const e=u[t].file;let r=s.utils.path.join(s.utils.path.dirname(l),e);r=i.copySearchParams(r,l),c.push(r)}const d=await r.load(c),p=c.map((t=>d[t]));return n.BitmapFont.install(h,p,!0)},load:async(t,e)=>(await s.settings.ADAPTER.fetch(t)).text(),unload(t){t.destroy()}};s.extensions.add(l),e.loadBitmapFont=l},8599:(t,e,r)=>{"use strict";var i=r(9878);const s=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(i.Ticker.system.add(this.tickerUpdate,this,i.UPDATE_PRIORITY.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(i.Ticker.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}};e.EventsTicker=s},8602:(t,e)=>{"use strict";e.BatchTextureArray=class{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let t=0;t<this.count;t++)this.elements[t]=null;this.count=0}}},8616:(t,e,r)=>{"use strict";var i=r(9878),s=r(6048);const n={extension:{type:i.ExtensionType.DetectionParser,priority:0},test:async()=>s.testVideoFormat("video/ogg"),add:async t=>[...t,"ogv"],remove:async t=>t.filter((t=>"ogv"!==t))};i.extensions.add(n),e.detectOgv=n},8626:(t,e,r)=>{"use strict";var i=r(3298),s=r(1573);e.TilingSprite=i.TilingSprite,e.TilingSpriteRenderer=s.TilingSpriteRenderer},8681:(t,e,r)=>{"use strict";var i=r(9878),s=r(8071),n=r(4676);class o extends s.Mesh{constructor(t,e,r){super(new n.PlaneGeometry(t.width,t.height,e,r),new s.MeshMaterial(i.Texture.WHITE)),this.texture=t,this.autoResize=!0}textureUpdated(){this._textureID=this.shader.texture._updateID;const t=this.geometry,{width:e,height:r}=this.shader.texture;this.autoResize&&(t.width!==e||t.height!==r)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())}set texture(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))}get texture(){return this.shader.texture}_render(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),super._render(t)}destroy(t){this.shader.texture.off("update",this.textureUpdated,this),super.destroy(t)}}e.SimplePlane=o},8788:(t,e)=>{"use strict";e.ViewableBuffer=class{constructor(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)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(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`)}}}},8792:(t,e,r)=>{"use strict";var i=r(8894),s=r(7450);class n extends s.AbstractMultiResource{constructor(t,e){const{width:r,height:i}=e||{};let s,n;Array.isArray(t)?(s=t,n=t.length):n=t,super(n,{width:r,height:i}),s&&this.initFromArray(s,e)}addBaseTextureAt(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this}bind(t){super.bind(t),t.target=i.TARGETS.TEXTURE_2D_ARRAY}upload(t,e,r){const{length:i,itemDirtyIds:s,items:n}=this,{gl:o}=t;r.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,i,0,e.format,r.type,null);for(let t=0;t<i;t++){const i=n[t];s[t]<i.dirtyId&&(s[t]=i.dirtyId,i.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,t,i.resource.width,i.resource.height,1,e.format,r.type,i.resource.source))}return!0}}e.ArrayResource=n},8795:(t,e,r)=>{"use strict";var i=r(9878),s=r(2366),n=r(2573),o=r(9139),a=r(3859),h=r(2774);const l=[".jpeg",".jpg",".png",".webp",".avif"],u=["image/jpeg","image/png","image/webp","image/avif"];async function c(t){const e=await i.settings.ADAPTER.fetch(t);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${t}: ${e.status} ${e.statusText}`);const r=await e.blob();return await createImageBitmap(r)}const d={name:"loadTextures",extension:{type:i.ExtensionType.LoadParser,priority:o.LoaderParserPriority.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test:t=>s.checkDataUrl(t,u)||n.checkExtension(t,l),async load(t,e,r){const s=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;n=s?this.config.preferWorkers&&await a.WorkerManager.isImageBitmapSupported()?await a.WorkerManager.loadImageBitmap(t):await c(t):await new Promise(((e,r)=>{const i=new Image;i.crossOrigin=this.config.crossOrigin,i.src=t,i.complete?e(i):(i.onload=()=>e(i),i.onerror=t=>r(t))}));const o={...e.data};o.resolution??(o.resolution=i.utils.getResolutionOfUrl(t)),s&&void 0===o.resourceOptions?.ownsImageBitmap&&(o.resourceOptions={...o.resourceOptions},o.resourceOptions.ownsImageBitmap=!0);const l=new i.BaseTexture(n,o);return l.resource.src=t,h.createTexture(l,r,t)},unload(t){t.destroy(!0)}};i.extensions.add(d),e.loadImageBitmap=c,e.loadTextures=d},8817:(t,e,r)=>{"use strict";var i=r(3643),s=r(7156),n=r(4993);r(3487);var o=r(9668),a=r(6320),h=r(74),l=r(1304);e.EventBoundary=i.EventBoundary,e.EventSystem=s.EventSystem,e.FederatedEvent=n.FederatedEvent,e.FederatedDisplayObject=o.FederatedDisplayObject,e.FederatedMouseEvent=a.FederatedMouseEvent,e.FederatedPointerEvent=h.FederatedPointerEvent,e.FederatedWheelEvent=l.FederatedWheelEvent},8820:(t,e,r)=>{"use strict";var i=r(6238);e.CanvasRenderTarget=class{constructor(t,e,r){this._canvas=i.settings.ADAPTER.createCanvas(),this._context=this._canvas.getContext("2d"),this.resolution=r||i.settings.RESOLUTION,this.resize(t,e)}clear(){this._checkDestroyed(),this._context.setTransform(1,0,0,1,0,0),this._context.clearRect(0,0,this._canvas.width,this._canvas.height)}resize(t,e){this._checkDestroyed(),this._canvas.width=Math.round(t*this.resolution),this._canvas.height=Math.round(e*this.resolution)}destroy(){this._context=null,this._canvas=null}get width(){return this._checkDestroyed(),this._canvas.width}set width(t){this._checkDestroyed(),this._canvas.width=Math.round(t)}get height(){return this._checkDestroyed(),this._canvas.height}set height(t){this._checkDestroyed(),this._canvas.height=Math.round(t)}get canvas(){return this._checkDestroyed(),this._canvas}get context(){return this._checkDestroyed(),this._context}_checkDestroyed(){if(null===this._canvas)throw new TypeError("The CanvasRenderTarget has already been destroyed")}}},8837:(t,e,r)=>{"use strict";var i=r(2774);e.createTexture=i.createTexture},8840:(t,e,r)=>{"use strict";var i=r(3869),s=r(2768);e.BlobResource=i.BlobResource,e.CompressedTextureResource=s.CompressedTextureResource},8869:(t,e,r)=>{"use strict";var i=r(3386);e.TransformFeedback=class{constructor(){this._glTransformFeedbacks={},this.buffers=[],this.disposeRunner=new i.Runner("disposeTransformFeedback")}bindBuffer(t,e){this.buffers[t]=e}destroy(){this.disposeRunner.emit(this,!1)}}},8894:(t,e)=>{"use strict";var r=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(r||{}),i=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(i||{}),s=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(s||{}),n=(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",t))(n||{}),o=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(o||{}),a=(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",t))(a||{}),h=(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",t))(h||{}),l=(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",t))(l||{}),u=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(u||{}),c=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(c||{}),d=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(d||{}),p=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(p||{}),f=(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.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(f||{}),m=(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",t))(m||{}),g=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(g||{}),y=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(y||{}),_=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(_||{}),v=(t=>(t[t.RED=1]="RED",t[t.GREEN=2]="GREEN",t[t.BLUE=4]="BLUE",t[t.ALPHA=8]="ALPHA",t))(v||{}),x=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(x||{}),b=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(b||{});e.ALPHA_MODES=f,e.BLEND_MODES=n,e.BUFFER_BITS=s,e.BUFFER_TYPE=b,e.CLEAR_MODES=m,e.COLOR_MASK_BITS=v,e.DRAW_MODES=o,e.ENV=r,e.FORMATS=a,e.GC_MODES=g,e.MASK_TYPES=_,e.MIPMAP_MODES=p,e.MSAA_QUALITY=x,e.PRECISION=y,e.RENDERER_TYPE=i,e.SAMPLER_TYPES=u,e.SCALE_MODES=c,e.TARGETS=h,e.TYPES=l,e.WRAP_MODES=d},8913:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},8925:(t,e,r)=>{"use strict";var i=r(2044),s=r(706);e.getUniformData=function(t,e){const r={},n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let o=0;o<n;o++){const n=e.getActiveUniform(t,o),a=n.name.replace(/\[.*?\]$/,""),h=!!n.name.match(/\[.*?\]$/),l=s.mapType(e,n.type);r[a]={name:a,index:o,type:l,size:n.size,isArray:h,value:i.defaultValue(l,n.size)}}return r}},8932:(t,e,r)=>{"use strict";var i=r(8894),s=r(238);class n{constructor(t){this.renderer=t}contextChange(t){let e;if(1===this.renderer.context.webGLVersion){const r=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,r)}else{const r=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,r)}e>=i.MSAA_QUALITY.HIGH?this.multisample=i.MSAA_QUALITY.HIGH:e>=i.MSAA_QUALITY.MEDIUM?this.multisample=i.MSAA_QUALITY.MEDIUM:e>=i.MSAA_QUALITY.LOW?this.multisample=i.MSAA_QUALITY.LOW:this.multisample=i.MSAA_QUALITY.NONE}destroy(){}}n.extension={type:s.ExtensionType.RendererSystem,name:"_multisample"},s.extensions.add(n),e.MultisampleSystem=n},8938:()=>{},8969:(t,e,r)=>{"use strict";var i=r(599);class s extends i.Geometry{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}e.Quad=s},8988:(t,e,r)=>{"use strict";r(339),r(6969)},8991:(t,e,r)=>{"use strict";var i=r(8894),s=r(2229);let n=0;class o{constructor(t,e,r){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=n++,this.static=!!e,this.ubo=!!r,t instanceof s.Buffer?(this.buffer=t,this.buffer.type=i.BUFFER_TYPE.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new s.Buffer(new Float32Array(1)),this.buffer.type=i.BUFFER_TYPE.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(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 o(e,r)}static from(t,e,r){return new o(t,e,r)}static uboFrom(t,e){return new o(t,e??!0,!0)}}e.UniformGroup=o},9045:(t,e,r)=>{"use strict";var i=r(238),s=r(521),n=r(7902);class o{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,s.UPDATE_PRIORITY.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?n.Ticker.shared:new n.Ticker,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}o.extension=i.ExtensionType.Application,i.extensions.add(o),e.TickerPlugin=o},9050:(t,e,r)=>{"use strict";var i=r(238),s=r(7146),n=r(6669);const o=new s.Transform,a=new s.Rectangle;class h{constructor(t){this.renderer=t,this._tempMatrix=new s.Matrix}generateTexture(t,e){const{region:r,...i}=e||{},s=r?.copyTo(a)||t.getLocalBounds(a,!0),h=i.resolution||this.renderer.resolution;s.width=Math.max(s.width,1/h),s.height=Math.max(s.height,1/h),i.width=s.width,i.height=s.height,i.resolution=h,i.multisample??(i.multisample=this.renderer.multisample);const l=n.RenderTexture.create(i);this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const u=t.transform;return t.transform=o,this.renderer.render(t,{renderTexture:l,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=u,l}destroy(){}}h.extension={type:[i.ExtensionType.RendererSystem,i.ExtensionType.CanvasRendererSystem],name:"textureGenerator"},i.extensions.add(h),e.GenerateTextureSystem=h},9064:(t,e,r)=>{"use strict";var i=r(9878),s=r(9346);const n=new i.Matrix;function o(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const a=class t extends s.DisplayObject{constructor(){super(),this.children=[],this.sortableChildren=t.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(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}swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}getChildIndex(t){const e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(t);i.utils.removeItems(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],r=this.children.indexOf(e);if(-1===r)return null;e.parent=null,e.transform._parentID=-1,i.utils.removeItems(this.children,r,1),this._boundsID++,this.onChildrenChange(r),e.emit("removed",this),this.emit("childRemoved",e,this,r)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,i.utils.removeItems(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const r=t,i=e-r;let s;if(i>0&&i<=e){s=this.children.splice(r,i);for(let t=0;t<s.length;++t)s[t].parent=null,s[t].transform&&(s[t].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let t=0;t<s.length;++t)s[t].emit("removed",this),this.emit("childRemoved",s[t],this,t);return s}if(0===i&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,r=this.children.length;e<r;++e){const r=this.children[e];r._lastSortedIndex=e,!t&&0!==r.zIndex&&(t=!0)}t&&this.children.length>1&&this.children.sort(o),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t){const e=this.children[t];e.visible&&e.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){const t=e._mask.isMaskData?e._mask.maskObject:e._mask;t?(t.calculateBounds(),this._bounds.addBoundsMask(e._bounds,t._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const r=super.getLocalBounds(t);if(!e)for(let t=0,e=this.children.length;t<e;++t){const e=this.children[t];e.visible&&e.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(e){const r=e.renderTexture.sourceFrame;if(!(r.width>0&&r.height>0))return;let i,s;this.cullArea?(i=this.cullArea,s=this.worldTransform):this._render!==t.prototype._render&&(i=this.getBounds(!0));const o=e.projection.transform;if(o&&(s?(s=n.copyFrom(s),s.prepend(o)):s=o),i&&r.intersects(i,s))this._render(e);else if(this.cullArea)return;for(let t=0,r=this.children.length;t<r;++t){const r=this.children[t],i=r.cullable;r.cullable=i||!this.cullArea,r.render(e),r.cullable=i}}render(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters?.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}}renderAdvanced(t){const e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let t=0;t<e.length;t++)e[t].enabled&&this._enabledFilters.push(e[t])}const s=e&&this._enabledFilters?.length||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==i.MASK_TYPES.NONE));if(s&&t.batch.flush(),e&&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);for(let e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}s&&t.batch.flush(),r&&t.mask.pop(this),e&&this._enabledFilters?.length&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e="boolean"==typeof t?t:t?.children,r=this.removeChildren(0,this.children.length);if(e)for(let e=0;e<r.length;++e)r[e].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}};a.defaultSortableChildren=!1;let h=a;h.prototype.containerUpdateTransform=h.prototype.updateTransform,e.Container=h},9115:(t,e,r)=>{"use strict";var i=r(8894),s=r(5577);e.MaskData=class{constructor(t=null){this.type=i.MASK_TYPES.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=s.Filter.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=i.MASK_TYPES.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}},9116:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="#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"},9139:(t,e)=>{"use strict";var r=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(r||{});e.LoaderParserPriority=r},9156:(t,e,r)=>{"use strict";var i=r(8564);function s(t,e,r){for(let i=0,s=4*r*e;i<e;++i,s+=4)if(0!==t[s+3])return!1;return!0}function n(t,e,r,i,s){const n=4*e;for(let e=i,o=i*n+4*r;e<=s;++e,o+=n)if(0!==t[o+3])return!1;return!0}e.getCanvasBoundingBox=function(t){const{width:e,height:r}=t,o=t.getContext("2d",{willReadFrequently:!0});if(null===o)throw new TypeError("Failed to get canvas 2D context");const a=o.getImageData(0,0,e,r).data;let h=0,l=0,u=e-1,c=r-1;for(;l<r&&s(a,e,l);)++l;if(l===r)return i.BoundingBox.EMPTY;for(;s(a,e,c);)--c;for(;n(a,e,h,l,c);)++h;for(;n(a,e,u,l,c);)--u;return++u,++c,new i.BoundingBox(h,l,u,c)}},9199:()=>{},9263:(t,e,r)=>{"use strict";var i=r(8456);e.TextFormat=class{static test(t){return"string"==typeof t&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const t in e){const i=e[t].match(/^[a-z]+/gm)[0],s=e[t].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),n={};for(const t in s){const e=s[t].split("="),r=e[0],i=e[1].replace(/"/gm,""),o=parseFloat(i),a=isNaN(o)?i:o;n[r]=a}r[i].push(n)}const s=new i.BitmapFontData;return r.info.forEach((t=>s.info.push({face:t.face,size:parseInt(t.size,10)}))),r.common.forEach((t=>s.common.push({lineHeight:parseInt(t.lineHeight,10)}))),r.page.forEach((t=>s.page.push({id:parseInt(t.id,10),file:t.file}))),r.char.forEach((t=>s.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((t=>s.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)}))),r.distanceField.forEach((t=>s.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType}))),s}}},9265:(t,e,r)=>{"use strict";r(4350)},9277:(t,e,r)=>{"use strict";var i=r(9878),s=r(2366),n=r(2573),o=r(9139),a=r(8795),h=r(2774);const l={extension:{type:i.ExtensionType.LoadParser,priority:o.LoaderParserPriority.High},name:"loadSVG",test:t=>s.checkDataUrl(t,"image/svg+xml")||n.checkExtension(t,".svg"),testParse:async t=>i.SVGResource.test(t),async parse(t,e,r){const s=new i.SVGResource(t,e?.data?.resourceOptions);await s.load();const n=new i.BaseTexture(s,{resolution:i.utils.getResolutionOfUrl(t),...e?.data});return n.resource.src=e.src,h.createTexture(n,r,e.src)},load:async(t,e)=>(await i.settings.ADAPTER.fetch(t)).text(),unload:a.loadTextures.unload};i.extensions.add(l),e.loadSVG=l},9313:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},9346:(t,e,r)=>{"use strict";var i=r(9878),s=r(6513);class n extends i.utils.EventEmitter{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new i.Transform,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new s.Bounds,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let r=0;r<e.length;++r){const i=e[r];Object.defineProperty(n.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(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 i.Rectangle),e=this._boundsRect),this._bounds.getRectangle(e)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new i.Rectangle),t=this._localBoundsRect),this._localBounds||(this._localBounds=new s.Bounds);const e=this.transform,r=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=r?.worldAlpha??1,this.transform=this._tempDisplayObjectParent.transform;const n=this._bounds,o=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,t);return this.parent=r,this.transform=e,this._bounds=n,this._bounds.updateID+=this._boundsID-o,a}toGlobal(t,e,r=!1){return r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)}toLocal(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)}setParent(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t}removeFromParent(){this.parent?.removeChild(this)}setTransform(t=0,e=0,r=1,i=1,s=0,n=0,o=0,a=0,h=0){return this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=i||1,this.rotation=s,this.skew.x=n,this.skew.y=o,this.pivot.x=a,this.pivot.y=h,this}destroy(t){this.removeFromParent(),this._destroyed=!0,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.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new o),this.tempDisplayObjectParent}enableTempParent(){const t=this.parent;return this.parent=this._tempDisplayObjectParent,t}disableTempParent(t){this.parent=t}get x(){return this.position.x}set x(t){this.transform.position.x=t}get y(){return this.position.y}set y(t){this.transform.position.y=t}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(t){this.transform.position.copyFrom(t)}get scale(){return this.transform.scale}set scale(t){this.transform.scale.copyFrom(t)}get pivot(){return this.transform.pivot}set pivot(t){this.transform.pivot.copyFrom(t)}get skew(){return this.transform.skew}set skew(t){this.transform.skew.copyFrom(t)}get rotation(){return this.transform.rotation}set rotation(t){this.transform.rotation=t}get angle(){return this.transform.rotation*i.RAD_TO_DEG}set angle(t){this.transform.rotation=t*i.DEG_TO_RAD}get zIndex(){return this._zIndex}set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.parent&&(this.parent.sortDirty=!0))}get worldVisible(){let t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}get mask(){return this._mask}set mask(t){if(this._mask!==t){if(this._mask){const t=this._mask.isMaskData?this._mask.maskObject:this._mask;t&&(t._maskRefCount--,0===t._maskRefCount&&(t.renderable=!0,t.isMask=!1))}if(this._mask=t,this._mask){const t=this._mask.isMaskData?this._mask.maskObject:this._mask;t&&(0===t._maskRefCount&&(t.renderable=!1,t.isMask=!0),t._maskRefCount++)}}}}class o extends n{constructor(){super(...arguments),this.sortDirty=null}}n.prototype.displayObjectUpdateTransform=n.prototype.updateTransform,e.DisplayObject=n,e.TemporaryDisplayObject=o},9440:(t,e,r)=>{"use strict";var i=r(8099),s=r(7100),n=r(2044),o=r(3647),a=r(1306),h=r(9525),l=r(1916),u=r(7495),c=r(706),d=r(3086),p=r(6782),f=r(194);e.checkMaxIfStatementsInShader=i.checkMaxIfStatementsInShader,e.compileShader=s.compileShader,e.defaultValue=n.defaultValue,e.generateUniformsSync=o.generateUniformsSync,e.getMaxFragmentPrecision=a.getMaxFragmentPrecision,e.getTestContext=h.getTestContext,e.logProgramError=l.logProgramError,e.mapSize=u.mapSize,e.mapType=c.mapType,e.setPrecision=d.setPrecision,e.uniformParsers=p.uniformParsers,e.unsafeEvalSupported=f.unsafeEvalSupported},9441:(t,e)=>{"use strict";const r=[];e.INSTALLED=r,e.autoDetectResource=function(t,e){if(!t)return null;let i="";if("string"==typeof t){const e=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);e&&(i=e[1].toLowerCase())}for(let s=r.length-1;s>=0;--s){const n=r[s];if(n.test&&n.test(t,i))return new n(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}},9455:(t,e,r)=>{"use strict";var i=r(7391),s=r(5575);e.Spritesheet=i.Spritesheet,e.spritesheetAsset=s.spritesheetAsset},9488:(t,e)=>{"use strict";e.CountLimiter=class{constructor(t){this.maxItemsPerFrame=t,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}},9494:(t,e,r)=>{"use strict";t.exports=function(t){var e=r.nc;e&&t.setAttribute("nonce",e)}},9510:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default="\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"},9511:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InjectionHandler=void 0,r(5929),e.InjectionHandler=class{injectables=[];injections=[];resolve(t){return new t(...this.resolveInjections(t))}resolveInjections(t){return(Reflect.getMetadata("design:paramtypes",t)||[]).map((t=>this.getInjectable(t)))}getInjectable(t){let e=this.injections.find((e=>e instanceof t));return e||(e=this.resolve(t),-1!==this.injectables.indexOf(t)&&this.injections.push(e)),e}registerAsSingleInstance(t){this.injectables.push(t)}}},9519:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var i="";r.supports&&(i+="@supports (".concat(r.supports,") {")),r.media&&(i+="@media ".concat(r.media," {"));var s=void 0!==r.layer;s&&(i+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),i+=r.css,s&&(i+="}"),r.media&&(i+="}"),r.supports&&(i+="}");var n=r.sourceMap;n&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),e.styleTagTransform(i,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},9524:(t,e,r)=>{"use strict";var i=r(9992);t.exports=Function.prototype.bind||i},9525:(t,e,r)=>{"use strict";var i=r(8894),s=r(6238);const n={};let o=n;e.getTestContext=function(){if(o===n||o?.isContextLost()){const t=s.settings.ADAPTER.createCanvas();let e;s.settings.PREFER_ENV>=i.ENV.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),o=e}return o}},9567:(t,e,r)=>{"use strict";var i=r(9878),s=r(3457),n=r(4175),o=r(21),a=r(2471),h=r(7135),l=r(8229);const u={AlphaFilter:s.AlphaFilter,BlurFilter:n.BlurFilter,BlurFilterPass:n.BlurFilterPass,ColorMatrixFilter:o.ColorMatrixFilter,DisplacementFilter:a.DisplacementFilter,FXAAFilter:h.FXAAFilter,NoiseFilter:l.NoiseFilter};Object.entries(u).forEach((([t,e])=>{Object.defineProperty(u,t,{get:()=>(i.utils.deprecation("7.1.0",`filters.${t} has moved to ${t}`),e)})})),e.filters=u},9612:(t,e,r)=>{"use strict";var i=r(238),s=r(8066);class n{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get:()=>(s.deprecation("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract)},prepare:{enumerable:!1,get:()=>(s.deprecation("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare)},interaction:{enumerable:!1,get:()=>(s.deprecation("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events)}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}n.extension={type:[i.ExtensionType.RendererSystem,i.ExtensionType.CanvasRendererSystem],name:"_plugin"},i.extensions.add(n),e.PluginSystem=n},9624:(t,e,r)=>{"use strict";var i=r(8894),s=r(238),n=r(7146),o=r(6238),a=r(7605),h=r(6552);const l=new n.Rectangle;class u{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new a.Framebuffer(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new n.Rectangle,this.hasMRT=!0,this.writeDepthTexture=!0,1===this.renderer.context.webGLVersion){let e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;o.settings.PREFER_ENV===i.ENV.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=t=>e.drawBuffersWEBGL(t):(this.hasMRT=!1,t.drawBuffers=()=>{}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,r=0){const{gl:i}=this;if(t){const s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=r),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let e=0;e<t.colorTextures.length;e++){const r=t.colorTextures[e];this.renderer.texture.unbind(r.parentTextureArray||r)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){const t=e.width>>r,i=e.height>>r,s=t/e.width;this.setViewport(e.x*s,e.y*s,t,i)}else{const e=t.width>>r,i=t.height>>r;this.setViewport(0,0,e,i)}}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)}setViewport(t,e,r,i){const s=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),(s.width!==r||s.height!==i||s.x!==t||s.y!==e)&&(s.x=t,s.y=e,s.width=r,s.height=i,this.gl.viewport(t,e,r,i))}get size(){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}}clear(t,e,r,s,n=i.BUFFER_BITS.COLOR|i.BUFFER_BITS.DEPTH){const{gl:o}=this;o.clearColor(t,e,r,s),o.clear(n)}initFramebuffer(t){const{gl:e}=this,r=new h.GLFramebuffer(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r}resizeFramebuffer(t){const{gl:e}=this,r=t.glFramebuffers[this.CONTEXT_UID];if(r.stencil){let i;e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),i=1===this.renderer.context.webGLVersion?e.DEPTH_STENCIL:t.depth&&t.stencil?e.DEPTH24_STENCIL8:t.depth?e.DEPTH_COMPONENT24:e.STENCIL_INDEX8,r.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,i,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,i,t.width,t.height)}const i=t.colorTextures;let s=i.length;e.drawBuffers||(s=Math.min(s,1));for(let n=0;n<s;n++){const s=i[n],o=s.parentTextureArray||s;this.renderer.texture.bind(o,0),0===n&&r.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,o._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height))}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)}updateFramebuffer(t,e){const{gl:r}=this,i=t.glFramebuffers[this.CONTEXT_UID],s=t.colorTextures;let n=s.length;r.drawBuffers||(n=Math.min(n,1)),i.multisample>1&&this.canMultisampleFramebuffer(t)?i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer():i.msaaBuffer&&(r.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const o=[];for(let a=0;a<n;a++){const n=s[a],h=n.parentTextureArray||n;this.renderer.texture.bind(h,0),0===a&&i.msaaBuffer?(r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,h._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i.msaaBuffer)):(r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+a,n.target,h._glTextures[this.CONTEXT_UID].texture,e),o.push(r.COLOR_ATTACHMENT0+a))}if(o.length>1&&r.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const i=t.depthTexture;this.renderer.texture.bind(i,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,i._glTextures[this.CONTEXT_UID].texture,e)}if(!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture)i.stencil&&(r.deleteRenderbuffer(i.stencil),i.stencil=null);else{let e,s;i.stencil=i.stencil||r.createRenderbuffer(),1===this.renderer.context.webGLVersion?(e=r.DEPTH_STENCIL_ATTACHMENT,s=r.DEPTH_STENCIL):t.depth&&t.stencil?(e=r.DEPTH_STENCIL_ATTACHMENT,s=r.DEPTH24_STENCIL8):t.depth?(e=r.DEPTH_ATTACHMENT,s=r.DEPTH_COMPONENT24):(e=r.STENCIL_ATTACHMENT,s=r.STENCIL_INDEX8),r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,s,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,s,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,e,r.RENDERBUFFER,i.stencil)}}canMultisampleFramebuffer(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let r=i.MSAA_QUALITY.NONE;if(t<=1||null===e)return r;for(let i=0;i<e.length;i++)if(e[i]<=t){r=e[i];break}return 1===r&&(r=i.MSAA_QUALITY.NONE),r}blit(t,e,r){const{current:i,renderer:s,gl:n,CONTEXT_UID:o}=this;if(2!==s.context.webGLVersion||!i)return;const h=i.glFramebuffers[o];if(!h)return;if(!t){if(!h.msaaBuffer)return;const e=i.colorTextures[0];if(!e)return;h.blitFramebuffer||(h.blitFramebuffer=new a.Framebuffer(i.width,i.height),h.blitFramebuffer.addColorTexture(0,e)),(t=h.blitFramebuffer).colorTextures[0]!==e&&(t.colorTextures[0]=e,t.dirtyId++,t.dirtyFormat++),(t.width!==i.width||t.height!==i.height)&&(t.width=i.width,t.height=i.height,t.dirtyId++,t.dirtySize++)}e||((e=l).width=i.width,e.height=i.height),r||(r=e);const u=e.width===r.width&&e.height===r.height;this.bind(t),n.bindFramebuffer(n.READ_FRAMEBUFFER,h.framebuffer),n.blitFramebuffer(e.left,e.top,e.right,e.bottom,r.left,r.top,r.right,r.bottom,n.COLOR_BUFFER_BIT,u?n.NEAREST:n.LINEAR),n.bindFramebuffer(n.READ_FRAMEBUFFER,t.glFramebuffers[this.CONTEXT_UID].framebuffer)}disposeFramebuffer(t,e){const r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(!r)return;delete t.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(t);s>=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&this.disposeFramebuffer(r.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let r=0;r<e.length;r++)this.disposeFramebuffer(e[r],t)}forceStencil(){const t=this.current;if(!t)return;const e=t.glFramebuffers[this.CONTEXT_UID];if(!e||e.stencil&&t.stencil)return;t.stencil=!0;const r=t.width,i=t.height,s=this.gl,n=e.stencil=s.createRenderbuffer();let o,a;s.bindRenderbuffer(s.RENDERBUFFER,n),1===this.renderer.context.webGLVersion?(o=s.DEPTH_STENCIL_ATTACHMENT,a=s.DEPTH_STENCIL):t.depth?(o=s.DEPTH_STENCIL_ATTACHMENT,a=s.DEPTH24_STENCIL8):(o=s.STENCIL_ATTACHMENT,a=s.STENCIL_INDEX8),e.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,e.multisample,a,r,i):s.renderbufferStorage(s.RENDERBUFFER,a,r,i),s.framebufferRenderbuffer(s.FRAMEBUFFER,o,s.RENDERBUFFER,n)}reset(){this.current=this.unknownFramebuffer,this.viewport=new n.Rectangle}destroy(){this.renderer=null}}u.extension={type:s.ExtensionType.RendererSystem,name:"framebuffer"},s.extensions.add(u),e.FramebufferSystem=u},9645:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Service=void 0;const i=r(394);e.Service=()=>t=>{i.globalInjectionHandler.registerAsSingleInstance(t)}},9662:(t,e,r)=>{"use strict";var i=r(2802),s=r(1203);const n=class t extends s.BaseImageResource{constructor(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");!1!==r.autoLoad&&i.setAttribute("preload","auto"),!1!==r.playsinline&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),!0===r.muted&&(i.setAttribute("muted",""),i.muted=!0),!0===r.loop&&i.setAttribute("loop",""),!1!==r.autoPlay&&i.setAttribute("autoplay",""),"string"==typeof e&&(e=[e]);const n=e[0].src||e[0];s.BaseImageResource.crossOrigin(i,n,r.crossorigin);for(let r=0;r<e.length;++r){const s=document.createElement("source");let{src:n,mime:o}=e[r];if(n=n||e[r],n.startsWith("data:"))o=n.slice(5,n.indexOf(";"));else if(!n.startsWith("blob:")){const e=n.split("?").shift().toLowerCase(),r=e.slice(e.lastIndexOf(".")+1);o=o||t.MIME_TYPES[r]||`video/${r}`}s.src=n,o&&(s.type=o),i.appendChild(s)}e=i}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=r.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==r.autoPlay,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),!1!==r.autoLoad&&this.load()}update(t=0){if(!this.destroyed){if(this._updateFPS){const t=i.Ticker.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise(((e,r)=>{this.valid?e(this):(this._resolve=e,this._reject=r,t.load())})),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!e&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._configureAutoUpdate();const t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(i.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(i.Ticker.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(i.Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,r){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.includes(r)}};n.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],n.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let o=n;e.VideoResource=o},9668:(t,e,r)=>{"use strict";var i=r(9878),s=r(1799),n=r(7156),o=r(4993);function a(t){return"dynamic"===t||"static"===t}const h={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??a(n.EventSystem.defaultEventMode)},set interactive(t){i.utils.deprecation("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=t,this.eventMode=t?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??n.EventSystem.defaultEventMode},set eventMode(t){this._internalInteractive=a(t),this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,r){const i="boolean"==typeof r&&r||"object"==typeof r&&r.capture,s="object"==typeof r?r.signal:void 0,n="object"==typeof r&&!0===r.once,o="function"==typeof e?void 0:e;t=i?`${t}capture`:t;const a="function"==typeof e?e:e.handleEvent,h=this;s&&s.addEventListener("abort",(()=>{h.off(t,a,o)})),n?h.once(t,a,o):h.on(t,a,o)},removeEventListener(t,e,r){const i="function"==typeof e?void 0:e;t="boolean"==typeof r&&r||"object"==typeof r&&r.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,i)},dispatchEvent(t){if(!(t instanceof o.FederatedEvent))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};s.DisplayObject.mixin(h),e.FederatedDisplayObject=h},9693:(t,e,r)=>{"use strict";var i=r(3386),s=r(5610),n=r(8991);class o{constructor(t,e){this.uniformBindCount=0,this.program=t,e?e instanceof n.UniformGroup?this.uniformGroup=e:this.uniformGroup=new n.UniformGroup(e):this.uniformGroup=new n.UniformGroup({}),this.disposeRunner=new i.Runner("disposeShader")}checkUniformExists(t,e){if(e.uniforms[t])return!0;for(const r in e.uniforms){const i=e.uniforms[r];if(!0===i.group&&this.checkUniformExists(t,i))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(t,e,r){const i=s.Program.from(t,e);return new o(i,r)}}e.Shader=o},9712:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var s=Object.getOwnPropertySymbols(t);if(1!==s.length||s[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(t,e);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},9722:(t,e)=>{"use strict";e.TickerListener=class{constructor(t,e=null,r=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=i}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(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);const e=this.next;return this.next=t?null:e,this.previous=null,e}}},9736:(t,e,r)=>{"use strict";var i=r(8894),s=r(238),n=r(6238);let o=0;class a{constructor(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)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=o++}init(t){if(t.context)this.initFromContext(t.context);else{const e=this.renderer.background.alpha<1,r=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:e,premultipliedAlpha:r,antialias:t.antialias,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference})}}initFromContext(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=o++,this.renderer.runners.contextChange.emit(t);const e=this.renderer.view;void 0!==e.addEventListener&&(e.addEventListener("webglcontextlost",this.handleContextLost,!1),e.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(t){const e=this.createContext(this.renderer.view,t);this.initFromContext(e)}createContext(t,e){let r;if(n.settings.PREFER_ENV>=i.ENV.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),!r)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),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"),bptc:t.getExtension("EXT_texture_compression_bptc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),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")})}handleContextLost(t){t.preventDefault(),setTimeout((()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()}),0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,void 0!==t.removeEventListener&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const e=t.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const 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")}}a.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},a.extension={type:s.ExtensionType.RendererSystem,name:"context"},s.extensions.add(a),e.ContextSystem=a},9789:(t,e,r)=>{"use strict";var i=r(9878);class s{static init(t){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame((()=>this.resize())))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;let t,e;if(this.cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,e=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:i}=this._resizeTo;t=r,e=i}this.renderer.resize(t,e),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}s.extension=i.ExtensionType.Application,i.extensions.add(s),e.ResizePlugin=s},9861:(t,e,r)=>{"use strict";var i=r(4778);e.sayHello=function(){i.deprecation("7.0.0",'sayHello is deprecated, please use Renderer\'s "hello" option')},e.skipHello=function(){i.deprecation("7.0.0","skipHello is deprecated, please use settings.RENDER_OPTIONS.hello")}},9878:(t,e,r)=>{"use strict";r(61);var i=r(622),s=r(8894),n=r(238),o=r(7146),a=r(3386),h=r(6238),l=r(2802),u=r(8066),c=r(155),d=r(2498),p=r(5023),f=r(189),m=r(5574),g=r(4923),y=r(4783),_=r(8602),v=r(4405),x=r(9736),b=r(5577),T=r(3393),E=r(7419);r(842);var A=r(4751),S=r(1196),w=r(7605),P=r(9624),R=r(6552),M=r(8932),C=r(7255),I=r(2229),D=r(1816),O=r(599),B=r(2074),L=r(8788);r(8938);var N=r(9115),F=r(6574),k=r(7052),U=r(1298),G=r(9612),H=r(5936),j=r(270),V=r(5415),$=r(2322),X=r(9050),z=r(6669),W=r(8287),Y=r(4496),q=r(6119),K=r(5610),Z=r(9693),Q=r(4224),J=r(8991),tt=r(8099),et=r(3445),rt=r(7664),it=r(9525),st=r(6782),nt=r(194),ot=r(2152),at=r(5081),ht=r(7620);r(1188),r(8116);var lt=r(4611),ut=r(4333);r(1613);var ct=r(928),dt=r(8323),pt=r(5881),ft=r(8221),mt=r(6318),gt=r(8869),yt=r(3e3),_t=r(8969),vt=r(3126),xt=r(4816),bt=r(7826),Tt=r(1203),Et=r(3801),At=r(7450),St=r(8792),wt=r(9441),Pt=r(1515),Rt=r(6021),Mt=r(4476),Ct=r(8507),It=r(6484),Dt=r(479),Ot=r(9662);function Bt(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,e}var Lt=Bt(u);e.utils=Lt,e.autoDetectRenderer=c.autoDetectRenderer,e.BackgroundSystem=d.BackgroundSystem,e.BatchDrawCall=p.BatchDrawCall,e.BatchGeometry=f.BatchGeometry,e.BatchRenderer=m.BatchRenderer,e.BatchShaderGenerator=g.BatchShaderGenerator,e.BatchSystem=y.BatchSystem,e.BatchTextureArray=_.BatchTextureArray,e.ObjectRenderer=v.ObjectRenderer,e.ContextSystem=x.ContextSystem,e.Filter=b.Filter,e.FilterState=T.FilterState,e.FilterSystem=E.FilterSystem,e.SpriteMaskFilter=A.SpriteMaskFilter,e.defaultFilterVertex=S.defaultFilterVertex,e.defaultVertex=S.defaultVertex,e.Framebuffer=w.Framebuffer,e.FramebufferSystem=P.FramebufferSystem,e.GLFramebuffer=R.GLFramebuffer,e.MultisampleSystem=M.MultisampleSystem,e.Attribute=C.Attribute,e.Buffer=I.Buffer,e.BufferSystem=D.BufferSystem,e.Geometry=O.Geometry,e.GeometrySystem=B.GeometrySystem,e.ViewableBuffer=L.ViewableBuffer,e.MaskData=N.MaskData,e.MaskSystem=F.MaskSystem,e.ScissorSystem=k.ScissorSystem,e.StencilSystem=U.StencilSystem,e.PluginSystem=G.PluginSystem,e.ProjectionSystem=H.ProjectionSystem,e.ObjectRendererSystem=j.ObjectRendererSystem,e.Renderer=V.Renderer,e.BaseRenderTexture=$.BaseRenderTexture,e.GenerateTextureSystem=X.GenerateTextureSystem,e.RenderTexture=z.RenderTexture,e.RenderTexturePool=W.RenderTexturePool,e.RenderTextureSystem=Y.RenderTextureSystem,e.GLProgram=q.GLProgram,e.IGLUniformData=q.IGLUniformData,e.Program=K.Program,e.Shader=Z.Shader,e.ShaderSystem=Q.ShaderSystem,e.UniformGroup=J.UniformGroup,e.checkMaxIfStatementsInShader=tt.checkMaxIfStatementsInShader,e.generateProgram=et.generateProgram,e.createUBOElements=rt.createUBOElements,e.generateUniformBufferSync=rt.generateUniformBufferSync,e.getUBOData=rt.getUBOData,e.getTestContext=it.getTestContext,e.uniformParsers=st.uniformParsers,e.unsafeEvalSupported=nt.unsafeEvalSupported,e.StartupSystem=ot.StartupSystem,e.State=at.State,e.StateSystem=ht.StateSystem,e.BaseTexture=lt.BaseTexture,e.GLTexture=ut.GLTexture,e.Texture=ct.Texture,e.TextureGCSystem=dt.TextureGCSystem,e.TextureMatrix=pt.TextureMatrix,e.TextureSystem=ft.TextureSystem,e.TextureUvs=mt.TextureUvs,e.TransformFeedback=gt.TransformFeedback,e.TransformFeedbackSystem=yt.TransformFeedbackSystem,e.Quad=_t.Quad,e.QuadUv=vt.QuadUv,e.ViewSystem=xt.ViewSystem,e.SystemManager=bt.SystemManager,e.BaseImageResource=Tt.BaseImageResource,e.Resource=Et.Resource,e.AbstractMultiResource=At.AbstractMultiResource,e.ArrayResource=St.ArrayResource,e.INSTALLED=wt.INSTALLED,e.autoDetectResource=wt.autoDetectResource,e.BufferResource=Pt.BufferResource,e.CanvasResource=Rt.CanvasResource,e.CubeResource=Mt.CubeResource,e.ImageBitmapResource=Ct.ImageBitmapResource,e.ImageResource=It.ImageResource,e.SVGResource=Dt.SVGResource,e.VideoResource=Ot.VideoResource,e.VERSION="7.4.3",Object.keys(i).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return i[t]}})})),Object.keys(s).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return s[t]}})})),Object.keys(n).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})),Object.keys(o).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})})),Object.keys(a).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return a[t]}})})),Object.keys(h).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return h[t]}})})),Object.keys(l).forEach((function(t){"default"!==t&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return l[t]}})}))},9882:(t,e)=>{"use strict";class r{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,r,i,s,n,o,a){if(arguments.length>8)throw new Error("max arguments reached");const{name:h,items:l}=this;this._aliasCount++;for(let u=0,c=l.length;u<c;u++)l[u][h](t,e,r,i,s,n,o,a);return l===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return 0===this.items.length}get name(){return this._name}}Object.defineProperties(r.prototype,{dispatch:{value:r.prototype.emit},run:{value:r.prototype.emit}}),e.Runner=r},9886:t=>{"use strict";var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}t.exports=e},9889:(t,e,r)=>{"use strict";var i=r(3273);const s=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],n=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],o=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],a=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],h=[],l=[],u=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];h.push(e);for(let r=0;r<16;r++){const i=u(s[t]*s[r]+o[t]*n[r]),h=u(n[t]*s[r]+a[t]*n[r]),l=u(s[t]*o[r]+o[t]*a[r]),c=u(n[t]*o[r]+a[t]*a[r]);for(let t=0;t<16;t++)if(s[t]===i&&n[t]===h&&o[t]===l&&a[t]===c){e.push(t);break}}}for(let t=0;t<16;t++){const e=new i.Matrix;e.set(s[t],n[t],o[t],a[t],0,0),l.push(e)}}();const c={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:t=>s[t],uY:t=>n[t],vX:t=>o[t],vY:t=>a[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>h[t][e],sub:(t,e)=>h[t][c.inv(e)],rotate180:t=>4^t,isVertical:t=>2==(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?c.S:c.N:2*Math.abs(e)<=Math.abs(t)?t>0?c.E:c.W:e>0?t>0?c.SE:c.SW:t>0?c.NE:c.NW,matrixAppendRotationInv:(t,e,r=0,i=0)=>{const s=l[c.inv(e)];s.tx=r,s.ty=i,t.append(s)}};e.groupD8=c},9948:(t,e,r)=>{"use strict";var i=r(9878),s=r(7425);e.XMLStringFormat=class{static test(t){return!("string"!=typeof t||!t.includes("<font>"))&&s.XMLFormat.test(i.settings.ADAPTER.parseXML(t))}static parse(t){return s.XMLFormat.parse(i.settings.ADAPTER.parseXML(t))}}},9954:(t,e,r)=>{"use strict";var i=r(9878),s=r(9064);Object.defineProperties(i.settings,{SORTABLE_CHILDREN:{get:()=>s.Container.defaultSortableChildren,set(t){i.utils.deprecation("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),s.Container.defaultSortableChildren=t}}}),Object.defineProperty(e,"settings",{enumerable:!0,get:function(){return i.settings}})},9976:(t,e,r)=>{"use strict";var i=r(3306);const s={build(t){i.buildCircle.build(t)},triangulate(t,e){i.buildCircle.triangulate(t,e)}};e.buildRoundedRectangle=s},9992:t=>{"use strict";var e=Object.prototype.toString,r=Math.max,i=function(t,e){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var s=0;s<e.length;s+=1)r[s+t.length]=e[s];return r};t.exports=function(t){var s=this;if("function"!=typeof s||"[object Function]"!==e.apply(s))throw new TypeError("Function.prototype.bind called on incompatible "+s);for(var n,o=function(t){for(var e=[],r=1,i=0;r<t.length;r+=1,i+=1)e[i]=t[r];return e}(arguments),a=r(0,s.length-o.length),h=[],l=0;l<a;l++)h[l]="$"+l;if(n=Function("binder","return function ("+function(t){for(var e="",r=0;r<t.length;r+=1)e+=t[r],r+1<t.length&&(e+=",");return e}(h)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof n){var e=s.apply(this,i(o,arguments));return Object(e)===e?e:this}return s.apply(t,i(o,arguments))})),s.prototype){var u=function(){};u.prototype=s.prototype,n.prototype=new u,u.prototype=null}return n}}},e={};function r(i){var s=e[i];if(void 0!==s)return s.exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),r.nc=void 0,(()=>{"use strict";var t;r(6404),function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"}(t||(t={}));const e=t,i="injectionTokens";function s(t){const e=Reflect.getMetadata("design:paramtypes",t)||[],r=Reflect.getOwnMetadata(i,t)||{};return Object.keys(r).forEach((t=>{e[+t]=r[t]})),e}var n=r(5927);function o(t){return!!t.useToken}function a(t){return null!=t.useValue}function h(t){return!!t.useFactory}class l{constructor(t){this.wrap=t,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(t){let e,r=!1;return new Proxy({},this.createHandler((()=>(r||(e=t(this.wrap()),r=!0),e))))}createHandler(t){const e={};return this.reflectMethods.forEach((r=>{e[r]=(...e)=>(e[0]=t(),(0,Reflect[r])(...e))})),e}}function u(t){return"string"==typeof t||"symbol"==typeof t}function c(t){return"object"==typeof t&&"token"in t&&"multiple"in t}function d(t){return"object"==typeof t&&"token"in t&&"transform"in t}function p(t){return!!t.useClass}class f{constructor(){this._registryMap=new Map}entries(){return this._registryMap.entries()}getAll(t){return this.ensure(t),this._registryMap.get(t)}get(t){this.ensure(t);const e=this._registryMap.get(t);return e[e.length-1]||null}set(t,e){this.ensure(t),this._registryMap.get(t).push(e)}setAll(t,e){this._registryMap.set(t,e)}has(t){return this.ensure(t),this._registryMap.get(t).length>0}clear(){this._registryMap.clear()}ensure(t){this._registryMap.has(t)||this._registryMap.set(t,[])}}class m extends f{}class g{constructor(){this.scopedResolutions=new Map}}function y(t,e,r){const[,i=null]=t.toString().match(/constructor\(([\w, ]+)\)/)||[],s=function(t,e){return null===t?`at position #${e}`:`"${t.split(",")[e].trim()}" at position #${e}`}(i,e);return function(t,e,r="    "){return[t,...e.message.split("\n").map((t=>r+t))].join("\n")}(`Cannot inject the dependency ${s} of "${t.name}" constructor. Reason:`,r)}class _ extends f{}class v extends f{}class x{constructor(){this.preResolution=new _,this.postResolution=new v}}const b=new Map;class T{constructor(t){this.parent=t,this._registry=new m,this.interceptors=new x,this.disposed=!1,this.disposables=new Set}register(t,r,i={lifecycle:e.Transient}){let s;if(this.ensureNotDisposed(),s=function(t){return p(t)||a(t)||o(t)||h(t)}(r)?r:{useClass:r},o(s)){const e=[t];let r=s;for(;null!=r;){const t=r.useToken;if(e.includes(t))throw new Error(`Token registration cycle detected! ${[...e,t].join(" -> ")}`);e.push(t);const i=this._registry.get(t);r=i&&o(i.provider)?i.provider:null}}if((i.lifecycle===e.Singleton||i.lifecycle==e.ContainerScoped||i.lifecycle==e.ResolutionScoped)&&(a(s)||h(s)))throw new Error(`Cannot use lifecycle "${e[i.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(t,{provider:s,options:i}),this}registerType(t,e){return this.ensureNotDisposed(),u(e)?this.register(t,{useToken:e}):this.register(t,{useClass:e})}registerInstance(t,e){return this.ensureNotDisposed(),this.register(t,{useValue:e})}registerSingleton(t,r){if(this.ensureNotDisposed(),u(t)){if(u(r))return this.register(t,{useToken:r},{lifecycle:e.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:e.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let i=t;return r&&!u(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:e.Singleton})}resolve(t,e=new g,r=!1){this.ensureNotDisposed();const i=this.getRegistration(t);if(!i&&u(t)){if(r)return;throw new Error(`Attempted to resolve unregistered dependency token: "${t.toString()}"`)}if(this.executePreResolutionInterceptor(t,"Single"),i){const r=this.resolveRegistration(i,e);return this.executePostResolutionInterceptor(t,r,"Single"),r}if(function(t){return"function"==typeof t||t instanceof l}(t)){const r=this.construct(t,e);return this.executePostResolutionInterceptor(t,r,"Single"),r}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(t,e){if(this.interceptors.preResolution.has(t)){const r=[];for(const i of this.interceptors.preResolution.getAll(t))"Once"!=i.options.frequency&&r.push(i),i.callback(t,e);this.interceptors.preResolution.setAll(t,r)}}executePostResolutionInterceptor(t,e,r){if(this.interceptors.postResolution.has(t)){const i=[];for(const s of this.interceptors.postResolution.getAll(t))"Once"!=s.options.frequency&&i.push(s),s.callback(t,e,r);this.interceptors.postResolution.setAll(t,i)}}resolveRegistration(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===e.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);const i=t.options.lifecycle===e.Singleton,s=t.options.lifecycle===e.ContainerScoped,n=i||s;let l;return l=a(t.provider)?t.provider.useValue:o(t.provider)?n?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):p(t.provider)?n?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):h(t.provider)?t.provider.useFactory(this):this.construct(t.provider,r),t.options.lifecycle===e.ResolutionScoped&&r.scopedResolutions.set(t,l),l}resolveAll(t,e=new g,r=!1){this.ensureNotDisposed();const i=this.getAllRegistrations(t);if(!i&&u(t)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${t.toString()}"`)}if(this.executePreResolutionInterceptor(t,"All"),i){const r=i.map((t=>this.resolveRegistration(t,e)));return this.executePostResolutionInterceptor(t,r,"All"),r}const s=[this.construct(t,e)];return this.executePostResolutionInterceptor(t,s,"All"),s}isRegistered(t,e=!1){return this.ensureNotDisposed(),this._registry.has(t)||e&&(this.parent||!1)&&this.parent.isRegistered(t,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(const[t,e]of this._registry.entries())this._registry.setAll(t,e.filter((t=>!a(t.provider))).map((t=>(t.instance=void 0,t))))}createChildContainer(){this.ensureNotDisposed();const t=new T(this);for(const[r,i]of this._registry.entries())i.some((({options:t})=>t.lifecycle===e.ContainerScoped))&&t._registry.setAll(r,i.map((t=>t.options.lifecycle===e.ContainerScoped?{provider:t.provider,options:t.options}:t)));return t}beforeResolution(t,e,r={frequency:"Always"}){this.interceptors.preResolution.set(t,{callback:e,options:r})}afterResolution(t,e,r={frequency:"Always"}){this.interceptors.postResolution.set(t,{callback:e,options:r})}dispose(){return(0,n.sH)(this,void 0,void 0,(function*(){this.disposed=!0;const t=[];this.disposables.forEach((e=>{const r=e.dispose();r&&t.push(r)})),yield Promise.all(t)}))}getRegistration(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null}getAllRegistrations(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null}construct(t,e){if(t instanceof l)return t.createProxy((t=>this.resolve(t,e)));const r=(()=>{const r=b.get(t);if(!r||0===r.length){if(0===t.length)return new t;throw new Error(`TypeInfo not known for "${t.name}"`)}const i=r.map(this.resolveParams(e,t));return new t(...i)})();var i;return"function"!=typeof(i=r).dispose||i.dispose.length>0||this.disposables.add(r),r}resolveParams(t,e){return(r,i)=>{try{return c(r)?d(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new g,r.isOptional),...r.transformArgs):this.resolve(r.transform).transform(this.resolve(r.token,t,r.isOptional),...r.transformArgs):r.multiple?this.resolveAll(r.token,new g,r.isOptional):this.resolve(r.token,t,r.isOptional):d(r)?this.resolve(r.transform,t).transform(this.resolve(r.token,t),...r.transformArgs):this.resolve(r,t)}catch(t){throw new Error(y(e,i,t))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}}const E=new T,A=function(){return function(t){const e=s(t);return class extends t{constructor(...r){super(...r.concat(e.slice(r.length).map(((e,i)=>{try{return c(e)?d(e)?e.multiple?E.resolve(e.transform).transform(E.resolveAll(e.token),...e.transformArgs):E.resolve(e.transform).transform(E.resolve(e.token),...e.transformArgs):e.multiple?E.resolveAll(e.token):E.resolve(e.token):d(e)?E.resolve(e.transform).transform(E.resolve(e.token),...e.transformArgs):E.resolve(e)}catch(e){const s=i+r.length;throw new Error(y(t,s,e))}}))))}}}},S=function(t,e){return r={token:t,multiple:!1,isOptional:e&&e.isOptional},function(t,e,s){const n=Reflect.getOwnMetadata(i,t)||{};n[s]=r,Reflect.defineMetadata(i,n,t)};var r},w=function(){return function(t){(function(t){return function(e){b.set(e,s(e)),t&&t.token&&(Array.isArray(t.token)?t.token.forEach((t=>{E.register(t,e)})):E.register(t.token,e))}})()(t),E.registerSingleton(t)}};if("undefined"==typeof Reflect||!Reflect.getMetadata)throw new Error("tsyringe requires a reflect polyfill. Please add 'import \"reflect-metadata\"' to the top of your entry point.");var P=r(394);class R extends P.DhToolsSocketBase{constructor(){super(),this.setRoute("/redlining")}async getLanguageText(t,e=""){return this.send("get-language-text",{key:t,default:e})}async logChannel(t,e=46){return this.send("log-to-channel",{channel:e,message:t})}async getCanvasData(){return this.send("get-canvas-data",{Channel:"Redlining",Command:"GetCanvasData"})}async sendData(t){return await this.send("get-canvas-data",{Channel:"Redlining",Command:"CanvasDataResponse",data:t}).then((t=>console.log(t)))}async explodeGraphController(t){await this.send("get-canvas-data",{Channel:"Redlining",Command:"ExplodeGC",data:JSON.stringify(t)})}}window.addEventListener("message",(t=>console.log(t.data)));const M=new URL(window.location.href),C=M.searchParams.get("client")||"furnplan",I=M.searchParams.get("p")||"20000",D=M.searchParams.get("endpoint")||`http://localhost:${I}/api/image/`;E.register("Client",{useValue:C}),E.register("ImageServiceEndpointUrl",{useValue:D}),"furnview"===C?E.register("RedliningSocketServiceInterface",{useClass:class{toHex(t){return t.toString(16)}getMessageId(){return"redlining:"+this.toHex(Date.now())+this.toHex(Math.floor(1e3*Math.random()))}async send(t,e){return new Promise(((r,i)=>{const s=this.getMessageId(),n=t=>{const{id:e,data:i}=t.data;s===e&&(window.removeEventListener("message",n),r(i))};window.parent.postMessage({id:s,data:{command:t,data:e}}),window.addEventListener("message",n)}))}async getLanguageText(t,e=""){return this.send("get-language-text",{key:t,default:e})}async logChannel(t,e=46){return this.send("log-to-channel",{channel:e,message:t})}async getCanvasData(){return this.send("get-canvas-data",{Channel:"Redlining",Command:"GetCanvasData"})}async sendData(t){return await this.send("get-canvas-data",{Channel:"Redlining",Command:"CanvasDataResponse",data:t}).then((t=>console.log(t)))}async explodeGraphController(t){await this.send("get-canvas-data",{Channel:"Redlining",Command:"ExplodeGC",data:JSON.stringify(t)})}}},{lifecycle:e.Singleton}):E.register("RedliningSocketServiceInterface",{useClass:R},{lifecycle:e.Singleton});var O=r(3314);const B=t=>(e,r)=>{void 0!==r?r.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)},L=globalThis,N=L.ShadowRoot&&(void 0===L.ShadyCSS||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,F=Symbol(),k=new WeakMap;class U{constructor(t,e,r){if(this._$cssResult$=!0,r!==F)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(N&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=k.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&k.set(e,t))}return t}toString(){return this.cssText}}const G=N?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new U("string"==typeof t?t:t+"",void 0,F))(e)})(t):t,{is:H,defineProperty:j,getOwnPropertyDescriptor:V,getOwnPropertyNames:$,getOwnPropertySymbols:X,getPrototypeOf:z}=Object,W=globalThis,Y=W.trustedTypes,q=Y?Y.emptyScript:"",K=W.reactiveElementPolyfillSupport,Z=(t,e)=>t,Q={toAttribute(t,e){switch(e){case Boolean:t=t?q:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},J=(t,e)=>!H(t,e),tt={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:J};Symbol.metadata??=Symbol("metadata"),W.litPropertyMetadata??=new WeakMap;class et extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=tt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(t,r,e);void 0!==i&&j(this.prototype,t,i)}}static getPropertyDescriptor(t,e,r){const{get:i,set:s}=V(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const n=i?.call(this);s.call(this,e),this.requestUpdate(t,n,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??tt}static _$Ei(){if(this.hasOwnProperty(Z("elementProperties")))return;const t=z(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Z("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Z("properties"))){const t=this.properties,e=[...$(t),...X(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(G(t))}else void 0!==t&&e.push(G(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(N)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const r of e){const e=document.createElement("style"),i=L.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=r.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EC(t,e){const r=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,r);if(void 0!==i&&!0===r.reflect){const s=(void 0!==r.converter?.toAttribute?r.converter:Q).toAttribute(e,r.type);this._$Em=t,null==s?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(t,e){const r=this.constructor,i=r._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=r.getPropertyOptions(i),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:Q;this._$Em=i,this[i]=s.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,r){if(void 0!==t){if(r??=this.constructor.getPropertyOptions(t),!(r.hasChanged??J)(this[t],e))return;this.P(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,r){this._$AL.has(t)||this._$AL.set(t,e),!0===r.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t)!0!==r.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],r)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}et.elementStyles=[],et.shadowRootOptions={mode:"open"},et[Z("elementProperties")]=new Map,et[Z("finalized")]=new Map,K?.({ReactiveElement:et}),(W.reactiveElementVersions??=[]).push("2.0.4");const rt=(t,e,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,r),r);function it(t,e){return(r,i,s)=>{const n=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof i?r:s??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return rt(r,i,{get(){let r=t.call(this);return void 0===r&&(r=n(this),(null!==r||this.hasUpdated)&&e.call(this,r)),r}})}return rt(r,i,{get(){return n(this)}})}}const st=globalThis,nt=st.trustedTypes,ot=nt?nt.createPolicy("lit-html",{createHTML:t=>t}):void 0,at="$lit$",ht=`lit$${Math.random().toFixed(9).slice(2)}$`,lt="?"+ht,ut=`<${lt}>`,ct=document,dt=()=>ct.createComment(""),pt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ft=Array.isArray,mt=t=>ft(t)||"function"==typeof t?.[Symbol.iterator],gt="[ \t\n\f\r]",yt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_t=/-->/g,vt=/>/g,xt=RegExp(`>|${gt}(?:([^\\s"'>=/]+)(${gt}*=${gt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),bt=/'/g,Tt=/"/g,Et=/^(?:script|style|textarea|title)$/i,At=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),St=At(1),wt=(At(2),At(3),Symbol.for("lit-noChange")),Pt=Symbol.for("lit-nothing"),Rt=new WeakMap,Mt=ct.createTreeWalker(ct,129);function Ct(t,e){if(!ft(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==ot?ot.createHTML(e):e}const It=(t,e)=>{const r=t.length-1,i=[];let s,n=2===e?"<svg>":3===e?"<math>":"",o=yt;for(let e=0;e<r;e++){const r=t[e];let a,h,l=-1,u=0;for(;u<r.length&&(o.lastIndex=u,h=o.exec(r),null!==h);)u=o.lastIndex,o===yt?"!--"===h[1]?o=_t:void 0!==h[1]?o=vt:void 0!==h[2]?(Et.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=xt):void 0!==h[3]&&(o=xt):o===xt?">"===h[0]?(o=s??yt,l=-1):void 0===h[1]?l=-2:(l=o.lastIndex-h[2].length,a=h[1],o=void 0===h[3]?xt:'"'===h[3]?Tt:bt):o===Tt||o===bt?o=xt:o===_t||o===vt?o=yt:(o=xt,s=void 0);const c=o===xt&&t[e+1].startsWith("/>")?" ":"";n+=o===yt?r+ut:l>=0?(i.push(a),r.slice(0,l)+at+r.slice(l)+ht+c):r+ht+(-2===l?e:c)}return[Ct(t,n+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class Dt{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let s=0,n=0;const o=t.length-1,a=this.parts,[h,l]=It(t,e);if(this.el=Dt.createElement(h,r),Mt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=Mt.nextNode())&&a.length<o;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(at)){const e=l[n++],r=i.getAttribute(t).split(ht),o=/([.?@])?(.*)/.exec(e);a.push({type:1,index:s,name:o[2],strings:r,ctor:"."===o[1]?Ft:"?"===o[1]?kt:"@"===o[1]?Ut:Nt}),i.removeAttribute(t)}else t.startsWith(ht)&&(a.push({type:6,index:s}),i.removeAttribute(t));if(Et.test(i.tagName)){const t=i.textContent.split(ht),e=t.length-1;if(e>0){i.textContent=nt?nt.emptyScript:"";for(let r=0;r<e;r++)i.append(t[r],dt()),Mt.nextNode(),a.push({type:2,index:++s});i.append(t[e],dt())}}}else if(8===i.nodeType)if(i.data===lt)a.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(ht,t+1));)a.push({type:7,index:s}),t+=ht.length-1}s++}}static createElement(t,e){const r=ct.createElement("template");return r.innerHTML=t,r}}function Ot(t,e,r=t,i){if(e===wt)return e;let s=void 0!==i?r._$Co?.[i]:r._$Cl;const n=pt(e)?void 0:e._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),void 0===n?s=void 0:(s=new n(t),s._$AT(t,r,i)),void 0!==i?(r._$Co??=[])[i]=s:r._$Cl=s),void 0!==s&&(e=Ot(t,s._$AS(t,e.values),s,i)),e}class Bt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,i=(t?.creationScope??ct).importNode(e,!0);Mt.currentNode=i;let s=Mt.nextNode(),n=0,o=0,a=r[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new Lt(s,s.nextSibling,this,t):1===a.type?e=new a.ctor(s,a.name,a.strings,this,t):6===a.type&&(e=new Gt(s,this,t)),this._$AV.push(e),a=r[++o]}n!==a?.index&&(s=Mt.nextNode(),n++)}return Mt.currentNode=ct,i}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class Lt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,i){this.type=2,this._$AH=Pt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Ot(this,t,e),pt(t)?t===Pt||null==t||""===t?(this._$AH!==Pt&&this._$AR(),this._$AH=Pt):t!==this._$AH&&t!==wt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):mt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==Pt&&pt(this._$AH)?this._$AA.nextSibling.data=t:this.T(ct.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,i="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Dt.createElement(Ct(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new Bt(i,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=Rt.get(t.strings);return void 0===e&&Rt.set(t.strings,e=new Dt(t)),e}k(t){ft(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const s of t)i===e.length?e.push(r=new Lt(this.O(dt()),this.O(dt()),this,this.options)):r=e[i],r._$AI(s),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Nt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,s){this.type=1,this._$AH=Pt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Pt}_$AI(t,e=this,r,i){const s=this.strings;let n=!1;if(void 0===s)t=Ot(this,t,e,0),n=!pt(t)||t!==this._$AH&&t!==wt,n&&(this._$AH=t);else{const i=t;let o,a;for(t=s[0],o=0;o<s.length-1;o++)a=Ot(this,i[r+o],e,o),a===wt&&(a=this._$AH[o]),n||=!pt(a)||a!==this._$AH[o],a===Pt?t=Pt:t!==Pt&&(t+=(a??"")+s[o+1]),this._$AH[o]=a}n&&!i&&this.j(t)}j(t){t===Pt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ft extends Nt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Pt?void 0:t}}class kt extends Nt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Pt)}}class Ut extends Nt{constructor(t,e,r,i,s){super(t,e,r,i,s),this.type=5}_$AI(t,e=this){if((t=Ot(this,t,e,0)??Pt)===wt)return;const r=this._$AH,i=t===Pt&&r!==Pt||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==Pt&&(r===Pt||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Gt{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Ot(this,t)}}const Ht={M:at,P:ht,A:lt,C:1,L:It,R:Bt,D:mt,V:Ot,I:Lt,H:Nt,N:kt,U:Ut,B:Ft,F:Gt},jt=st.litHtmlPolyfillSupport;jt?.(Dt,Lt),(st.litHtmlVersions??=[]).push("3.2.1");class Vt extends et{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const i=r?.renderBefore??e;let s=i._$litPart$;if(void 0===s){const t=r?.renderBefore??null;i._$litPart$=s=new Lt(e.insertBefore(dt(),t),t,void 0,r??{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return wt}}Vt._$litElement$=!0,Vt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:Vt});const $t=globalThis.litElementPolyfillSupport;$t?.({LitElement:Vt}),(globalThis.litElementVersions??=[]).push("4.1.1");let Xt=class extends Vt{static{this.styles=O.A}render(){return St`
+            <navigation-wrapper id='navigation-wrapper'></navigation-wrapper>
+            <canvas-wrapper id="canvas-wrapper"></canvas-wrapper>
+        `}};Xt=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([B("app-component")],Xt);var zt=r(3210);let Wt=class extends Vt{static{this.styles=zt.A}render(){return St`
+            <div class="wrapper">
+                <div class="loader centered"></div>
+            </div>
+        `}hide(){Object.entries(this.getElementsByClassName("wrapper")).forEach((t=>{t[1].classList.add("hide"),t[1].addEventListener("animationend",(()=>{this.remove()}))}))}};Wt=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([B("loader-component")],Wt);var Yt=(t=>(t[t.Unknown=0]="Unknown",t[t.Line=1]="Line",t[t.Circle=3]="Circle",t[t.Text=4]="Text",t[t.Polygon=5]="Polygon",t[t.Image=6]="Image",t[t.InfoPoint=7]="InfoPoint",t[t.Block=8]="Block",t))(Yt||{}),qt=(t=>(t[t.Unknown=0]="Unknown",t[t.Scope=-1]="Scope",t[t.Arrow=-2]="Arrow",t[t.Rectangle=-4]="Rectangle",t))(qt||{});function Kt(t){return 1===t.Type}function Zt(t){return 3===t.Type}function Qt(t){return 4===t.Type}function Jt(t){return 5===t.Type}function te(t){return 6===t.Type}function ee(t){return 8===t.Type}var re=(t=>(t[t.PICK=0]="PICK",t[t.MANIPULATION=1]="MANIPULATION",t[t.DELETION=2]="DELETION",t[t.EXPLODE=3]="EXPLODE",t[t.LINE=4]="LINE",t[t.CIRCLE=5]="CIRCLE",t[t.RECTANGLE=6]="RECTANGLE",t[t.SCOPE=7]="SCOPE",t[t.ARROW=8]="ARROW",t[t.TEXT=9]="TEXT",t[t.IMAGE=10]="IMAGE",t))(re||{}),ie=(t=>(t[t.THIN=0]="THIN",t[t.MEDIUM=1]="MEDIUM",t[t.THICK=2]="THICK",t))(ie||{}),se=(t=>(t[t.SOLID=0]="SOLID",t[t.DOTTED=1]="DOTTED",t))(se||{}),ne=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(ne||{}),oe=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(oe||{}),ae=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(ae||{}),he=(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",t))(he||{}),le=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(le||{}),ue=(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",t))(ue||{}),ce=(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",t))(ce||{}),de=(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",t))(de||{}),pe=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(pe||{}),fe=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(fe||{}),me=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(me||{}),ge=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(ge||{}),ye=(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.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(ye||{}),_e=(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",t))(_e||{}),ve=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(ve||{}),xe=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(xe||{}),be=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(be||{}),Te=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(Te||{}),Ee=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(Ee||{});const Ae={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")},Se={ADAPTER:Ae,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var we=r(1831);const Pe=(we.A.default??we.A)(globalThis.navigator);Se.RETINA_PREFIX=/@([0-9\.]+)x/,Se.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Re=r(2579),Me=r(6935);r(1481);const Ce={};function Ie(t,e,r=3){if(Ce[e])return;let i=(new Error).stack;typeof i>"u"?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))),Ce[e]=!0}function De(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function Oe(t){return t.split("?")[0].split("#")[0]}const Be={toPosix:t=>t.replace(new RegExp("\\".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),"/"),isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),isBlobUrl:t=>t.startsWith("blob:"),hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){De(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const r=/^[^/:]+:\/{0,2}/.exec(t);return r?r[0]:""},toAbsolute(t,e,r){if(De(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const i=Oe(this.toPosix(e??Se.ADAPTER.getBaseUrl())),s=Oe(this.toPosix(r??this.rootname(i)));return(t=this.toPosix(t)).startsWith("/")?Be.join(s,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize(t){if(De(t),0===t.length)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;let e="";const r=(t=this.toPosix(t)).startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return(t=function(t){let e="",r=0,i=-1,s=0,n=-1;for(let o=0;o<=t.length;++o){if(o<t.length)n=t.charCodeAt(o);else{if(47===n)break;n=47}if(47===n){if(i!==o-1&&1!==s)if(i!==o-1&&2===s){if(e.length<2||2!==r||46!==e.charCodeAt(e.length-1)||46!==e.charCodeAt(e.length-2))if(e.length>2){const t=e.lastIndexOf("/");if(t!==e.length-1){-1===t?(e="",r=0):(e=e.slice(0,t),r=e.length-1-e.lastIndexOf("/")),i=o,s=0;continue}}else if(2===e.length||1===e.length){e="",r=0,i=o,s=0;continue}}else e.length>0?e+=`/${t.slice(i+1,o)}`:e=t.slice(i+1,o),r=o-i-1;i=o,s=0}else 46===n&&-1!==s?++s:s=-1}return e}(t)).length>0&&i&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return De(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){if(0===t.length)return".";let e;for(let r=0;r<t.length;++r){const i=t[r];if(De(i),i.length>0)if(void 0===e)e=i;else{const s=t[r-1]??"";this.joinExtensions.includes(this.extname(s).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return void 0===e?".":this.normalize(e)},dirname(t){if(De(t),0===t.length)return".";let e=(t=this.toPosix(t)).charCodeAt(0);const r=47===e;let i=-1,s=!0;const n=this.getProtocol(t),o=t;for(let r=(t=t.slice(n.length)).length-1;r>=1;--r)if(e=t.charCodeAt(r),47===e){if(!s){i=r;break}}else s=!1;return-1===i?r?"/":this.isUrl(o)?n+t:n:r&&1===i?"//":n+t.slice(0,i)},rootname(t){De(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);e=-1!==r?t.slice(0,r):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){De(t),e&&De(e),t=Oe(this.toPosix(t));let r,i=0,s=-1,n=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let o=e.length-1,a=-1;for(r=t.length-1;r>=0;--r){const h=t.charCodeAt(r);if(47===h){if(!n){i=r+1;break}}else-1===a&&(n=!1,a=r+1),o>=0&&(h===e.charCodeAt(o)?-1==--o&&(s=r):(o=-1,s=a))}return i===s?s=a:-1===s&&(s=t.length),t.slice(i,s)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!n){i=r+1;break}}else-1===s&&(n=!1,s=r+1);return-1===s?"":t.slice(i,s)},extname(t){De(t);let e=-1,r=0,i=-1,s=!0,n=0;for(let o=(t=Oe(this.toPosix(t))).length-1;o>=0;--o){const a=t.charCodeAt(o);if(47!==a)-1===i&&(s=!1,i=o+1),46===a?-1===e?e=o:1!==n&&(n=1):-1!==e&&(n=-1);else if(!s){r=o+1;break}}return-1===e||-1===i||0===n||1===n&&e===i-1&&e===r+1?"":t.slice(e,i)},parse(t){De(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let r=(t=Oe(this.toPosix(t))).charCodeAt(0);const i=this.isAbsolute(t);let s;e.root=this.rootname(t),s=i||this.hasProtocol(t)?1:0;let n=-1,o=0,a=-1,h=!0,l=t.length-1,u=0;for(;l>=s;--l)if(r=t.charCodeAt(l),47!==r)-1===a&&(h=!1,a=l+1),46===r?-1===n?n=l:1!==u&&(u=1):-1!==n&&(u=-1);else if(!h){o=l+1;break}return-1===n||-1===a||0===u||1===u&&n===a-1&&n===o+1?-1!==a&&(e.base=e.name=0===o&&i?t.slice(1,a):t.slice(o,a)):(0===o&&i?(e.name=t.slice(1,n),e.base=t.slice(1,a)):(e.name=t.slice(o,n),e.base=t.slice(o,a)),e.ext=t.slice(n,a)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let Le,Ne;async function Fe(){return Le??(Le=(async()=>{const t=document.createElement("canvas").getContext("webgl");if(!t)return ye.UNPACK;const e=await new Promise((t=>{const e=document.createElement("video");e.onloadeddata=()=>t(e),e.onerror=()=>t(null),e.autoplay=!1,e.crossOrigin="anonymous",e.preload="auto",e.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",e.load()}));if(!e)return ye.UNPACK;const r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);const i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const s=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,s),t.deleteFramebuffer(i),t.deleteTexture(r),t.getExtension("WEBGL_lose_context")?.loseContext(),s[0]<=s[3]?ye.PMA:ye.UNPACK})()),Le}var ke,Ue={grad:.9,turn:360,rad:360/(2*Math.PI)},Ge=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},He=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},je=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),t>r?r:t>e?t:e},Ve=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},$e=function(t){return{r:je(t.r,0,255),g:je(t.g,0,255),b:je(t.b,0,255),a:je(t.a)}},Xe=function(t){return{r:He(t.r),g:He(t.g),b:He(t.b),a:He(t.a,3)}},ze=/^#([0-9a-f]{3,8})$/i,We=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},Ye=function(t){var e=t.r,r=t.g,i=t.b,s=t.a,n=Math.max(e,r,i),o=n-Math.min(e,r,i),a=o?n===e?(r-i)/o:n===r?2+(i-e)/o:4+(e-r)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:s}},qe=function(t){var e=t.h,r=t.s,i=t.v,s=t.a;e=e/360*6,r/=100,i/=100;var n=Math.floor(e),o=i*(1-r),a=i*(1-(e-n)*r),h=i*(1-(1-e+n)*r),l=n%6;return{r:255*[i,a,o,o,h,i][l],g:255*[h,i,i,a,o,o][l],b:255*[o,o,h,i,i,a][l],a:s}},Ke=function(t){return{h:Ve(t.h),s:je(t.s,0,100),l:je(t.l,0,100),a:je(t.a)}},Ze=function(t){return{h:He(t.h),s:He(t.s),l:He(t.l),a:He(t.a,3)}},Qe=function(t){return qe((r=(e=t).s,{h:e.h,s:(r*=((i=e.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:e.a}));var e,r,i},Je=function(t){return{h:(e=Ye(t)).h,s:(s=(200-(r=e.s))*(i=e.v)/100)>0&&s<200?r*i/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,r,i,s},tr=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,er=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rr=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ir=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,sr={string:[[function(t){var e=ze.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?He(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?He(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=rr.exec(t)||ir.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:$e({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=tr.exec(t)||er.exec(t);if(!e)return null;var r,i,s=Ke({h:(r=e[1],i=e[2],void 0===i&&(i="deg"),Number(r)*(Ue[i]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return Qe(s)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,i=t.b,s=t.a,n=void 0===s?1:s;return Ge(e)&&Ge(r)&&Ge(i)?$e({r:Number(e),g:Number(r),b:Number(i),a:Number(n)}):null},"rgb"],[function(t){var e=t.h,r=t.s,i=t.l,s=t.a,n=void 0===s?1:s;if(!Ge(e)||!Ge(r)||!Ge(i))return null;var o=Ke({h:Number(e),s:Number(r),l:Number(i),a:Number(n)});return Qe(o)},"hsl"],[function(t){var e=t.h,r=t.s,i=t.v,s=t.a,n=void 0===s?1:s;if(!Ge(e)||!Ge(r)||!Ge(i))return null;var o=function(t){return{h:Ve(t.h),s:je(t.s,0,100),v:je(t.v,0,100),a:je(t.a)}}({h:Number(e),s:Number(r),v:Number(i),a:Number(n)});return qe(o)},"hsv"]]},nr=function(t,e){for(var r=0;r<e.length;r++){var i=e[r][0](t);if(i)return[i,e[r][1]]}return[null,void 0]},or=function(t,e){var r=Je(t);return{h:r.h,s:je(r.s+100*e,0,100),l:r.l,a:r.a}},ar=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},hr=function(t,e){var r=Je(t);return{h:r.h,s:r.s,l:je(r.l+100*e,0,100),a:r.a}},lr=function(){function t(t){this.parsed=function(t){return"string"==typeof t?nr(t.trim(),sr.string):"object"==typeof t&&null!==t?nr(t,sr.object):[null,void 0]}(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return null!==this.parsed},t.prototype.brightness=function(){return He(ar(this.rgba),2)},t.prototype.isDark=function(){return ar(this.rgba)<.5},t.prototype.isLight=function(){return ar(this.rgba)>=.5},t.prototype.toHex=function(){return e=(t=Xe(this.rgba)).r,r=t.g,i=t.b,n=(s=t.a)<1?We(He(255*s)):"","#"+We(e)+We(r)+We(i)+n;var t,e,r,i,s,n},t.prototype.toRgb=function(){return Xe(this.rgba)},t.prototype.toRgbString=function(){return e=(t=Xe(this.rgba)).r,r=t.g,i=t.b,(s=t.a)<1?"rgba("+e+", "+r+", "+i+", "+s+")":"rgb("+e+", "+r+", "+i+")";var t,e,r,i,s},t.prototype.toHsl=function(){return Ze(Je(this.rgba))},t.prototype.toHslString=function(){return e=(t=Ze(Je(this.rgba))).h,r=t.s,i=t.l,(s=t.a)<1?"hsla("+e+", "+r+"%, "+i+"%, "+s+")":"hsl("+e+", "+r+"%, "+i+"%)";var t,e,r,i,s},t.prototype.toHsv=function(){return t=Ye(this.rgba),{h:He(t.h),s:He(t.s),v:He(t.v),a:He(t.a,3)};var t},t.prototype.invert=function(){return ur({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),ur(or(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),ur(or(this.rgba,-t))},t.prototype.grayscale=function(){return ur(or(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),ur(hr(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),ur(hr(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?ur({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):He(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=Je(this.rgba);return"number"==typeof t?ur({h:t,s:e.s,l:e.l,a:e.a}):He(e.h)},t.prototype.isEqual=function(t){return this.toHex()===ur(t).toHex()},t}(),ur=function(t){return t instanceof lr?t:new lr(t)},cr=[];ke=[function(t,e){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var s in r)i[r[s]]=s;var n={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,o,a=i[this.toHex()];if(a)return a;if(null==e?void 0:e.closest){var h=this.toRgb(),l=1/0,u="black";if(!n.length)for(var c in r)n[c]=new t(r[c]).toRgb();for(var d in r){var p=(s=h,o=n[d],Math.pow(s.r-o.r,2)+Math.pow(s.g-o.g,2)+Math.pow(s.b-o.b,2));p<l&&(l=p,u=d)}return u}},e.string.push([function(e){var i=e.toLowerCase(),s="transparent"===i?"#0000":r[i];return s?new t(s).toRgb():null},"name"])}],ke.forEach((function(t){cr.indexOf(t)<0&&(t(lr,sr),cr.push(t))}));const dr=class t{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(e){if(e instanceof t)this._value=this.cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(null===e)throw new Error("Cannot set PIXI.Color#value to null");(null===this._value||!this.isSourceEqual(this._value,e))&&(this.normalize(e),this._value=this.cloneSource(e))}}get value(){return this._value}cloneSource(t){return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?{...t}:t}isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if("number"===r||"string"===r||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every(((t,r)=>t===e[r]));if(null!==t&&null!==e){const r=Object.keys(t),i=Object.keys(e);return r.length===i.length&&r.every((r=>t[r]===e[r]))}return t===e}toRgba(){const[t,e,r,i]=this._components;return{r:t,g:e,b:r,a:i}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,i]=this._components;return(t=t??[])[0]=Math.round(255*e),t[1]=Math.round(255*r),t[2]=Math.round(255*i),t}toRgbArray(t){t=t??[];const[e,r,i]=this._components;return t[0]=e,t[1]=r,t[2]=i,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(e){const[r,i,s,n]=t.temp.setValue(e)._components;return this._components[0]*=r,this._components[1]*=i,this._components[2]*=s,this._components[3]*=n,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let r=this._int>>16&255,i=this._int>>8&255,s=255&this._int;return e&&(r=r*t+.5|0,i=i*t+.5|0,s=s*t+.5|0),(255*t<<24)+(r<<16)+(i<<8)+s}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,r,i]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(r*t)/t,this._components[2]=Math.round(i*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,r,i,s]=this._components;return t[0]=e,t[1]=r,t[2]=i,t[3]=s,t}normalize(e){let r,i,s,n;if(("number"==typeof e||e instanceof Number)&&e>=0&&e<=16777215)r=(e>>16&255)/255,i=(e>>8&255)/255,s=(255&e)/255,n=1;else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[r,i,s,n=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[r,i,s,n=255]=e,r/=255,i/=255,s/=255,n/=255;else if("string"==typeof e||"object"==typeof e){if("string"==typeof e){const r=t.HEX_PATTERN.exec(e);r&&(e=`#${r[2]}`)}const o=ur(e);o.isValid()&&(({r,g:i,b:s,a:n}=o.rgba),r/=255,i/=255,s/=255)}if(void 0===r)throw new Error(`Unable to convert color ${e}`);this._components[0]=r,this._components[1]=i,this._components[2]=s,this._components[3]=n,this.refreshInt()}refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*r|0)}_clamp(t,e=0,r=1){return"number"==typeof t?Math.min(Math.max(t,e),r):(t.forEach(((i,s)=>{t[s]=Math.min(Math.max(i,e),r)})),t)}};dr.shared=new dr,dr.temp=new dr,dr.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let pr=dr;const fr=function(){const t=[],e=[];for(let r=0;r<32;r++)t[r]=r,e[r]=r;t[he.NORMAL_NPM]=he.NORMAL,t[he.ADD_NPM]=he.ADD,t[he.SCREEN_NPM]=he.SCREEN,e[he.NORMAL]=he.NORMAL_NPM,e[he.ADD]=he.ADD_NPM,e[he.SCREEN]=he.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}();function mr(t,e){return fr[e?1:0][t]}function gr(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 yr(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,1+(t|=t>>>16)}function _r(t){return!(t&t-1||!t)}function vr(t){let e=(t>65535?1:0)<<4,r=((t>>>=e)>255?1:0)<<3;return e|=r,r=((t>>>=r)>15?1:0)<<2,e|=r,r=((t>>>=r)>3?1:0)<<1,e|=r,e|(t>>>=r)>>1}function xr(t,e,r){const i=t.length;let s;if(e>=i||0===r)return;const n=i-(r=e+r>i?i-e:r);for(s=e;s<n;++s)t[s]=t[s+r];t.length=n}function br(t){return 0===t?0:t<0?-1:1}Float32Array,Uint32Array,Int32Array,Uint8Array;let Tr=0;function Er(){return++Tr}const Ar=class{constructor(t,e,r,i){this.left=t,this.top=e,this.right=r,this.bottom=i}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};Ar.EMPTY=new Ar(0,0,0,0);let Sr=Ar;const wr={},Pr=Object.create(null),Rr=Object.create(null);class Mr{constructor(t,e,r){this._canvas=Se.ADAPTER.createCanvas(),this._context=this._canvas.getContext("2d"),this.resolution=r||Se.RESOLUTION,this.resize(t,e)}clear(){this._checkDestroyed(),this._context.setTransform(1,0,0,1,0,0),this._context.clearRect(0,0,this._canvas.width,this._canvas.height)}resize(t,e){this._checkDestroyed(),this._canvas.width=Math.round(t*this.resolution),this._canvas.height=Math.round(e*this.resolution)}destroy(){this._context=null,this._canvas=null}get width(){return this._checkDestroyed(),this._canvas.width}set width(t){this._checkDestroyed(),this._canvas.width=Math.round(t)}get height(){return this._checkDestroyed(),this._canvas.height}set height(t){this._checkDestroyed(),this._canvas.height=Math.round(t)}get canvas(){return this._checkDestroyed(),this._canvas}get context(){return this._checkDestroyed(),this._context}_checkDestroyed(){if(null===this._canvas)throw new TypeError("The CanvasRenderTarget has already been destroyed")}}function Cr(t,e,r){for(let i=0,s=4*r*e;i<e;++i,s+=4)if(0!==t[s+3])return!1;return!0}function Ir(t,e,r,i,s){const n=4*e;for(let e=i,o=i*n+4*r;e<=s;++e,o+=n)if(0!==t[o+3])return!1;return!0}function Dr(t,e=1){const r=Se.RETINA_PREFIX?.exec(t);return r?parseFloat(r[1]):e}var Or=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(Or||{});const Br=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={..."object"!=typeof t.extension?{type:t.extension}:t.extension,ref:t}}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t={...t}).type&&(t.type=[t.type]),t},Lr=(t,e)=>Br(t).priority??e,Nr={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(Br).forEach((t=>{t.type.forEach((e=>this._removeHandlers[e]?.(t)))})),this},add(...t){return t.map(Br).forEach((t=>{t.type.forEach((e=>{const r=this._addHandlers,i=this._queue;r[e]?r[e]?.(t):(i[e]=i[e]||[],i[e]?.push(t))}))})),this},handle(t,e,r){const i=this._addHandlers,s=this._removeHandlers;if(i[t]||s[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,s[t]=r;const n=this._queue;return n[t]&&(n[t]?.forEach((t=>e(t))),delete n[t]),this},handleByMap(t,e){return this.handle(t,(t=>{t.name&&(e[t.name]=t.ref)}),(t=>{t.name&&delete e[t.name]}))},handleByList(t,e,r=-1){return this.handle(t,(t=>{e.includes(t.ref)||(e.push(t.ref),e.sort(((t,e)=>Lr(e,r)-Lr(t,r))))}),(t=>{const r=e.indexOf(t.ref);-1!==r&&e.splice(r,1)}))}};class Fr{constructor(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)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(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`)}}}const kr=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function Ur(t){let e="";for(let r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}class Gr{constructor(){this.data=0,this.blendMode=he.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(t){!!(1&this.data)!==t&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(t){!!(2&this.data)!==t&&(this.data^=2)}get culling(){return!!(4&this.data)}set culling(t){!!(4&this.data)!==t&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(t){!!(8&this.data)!==t&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(t){!!(32&this.data)!==t&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(t){!!(16&this.data)!==t&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==he.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}static for2d(){const t=new Gr;return t.depthTest=!1,t.blend=!0,t}}Gr.prototype.toString=function(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`};const Hr=[];function jr(t,e){if(!t)return null;let r="";if("string"==typeof t){const e=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);e&&(r=e[1].toLowerCase())}for(let i=Hr.length-1;i>=0;--i){const s=Hr[i];if(s.test&&s.test(t,r))return new s(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Vr{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,r,i,s,n,o,a){if(arguments.length>8)throw new Error("max arguments reached");const{name:h,items:l}=this;this._aliasCount++;for(let u=0,c=l.length;u<c;u++)l[u][h](t,e,r,i,s,n,o,a);return l===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return 0===this.items.length}get name(){return this._name}}Object.defineProperties(Vr.prototype,{dispatch:{value:Vr.prototype.emit},run:{value:Vr.prototype.emit}});class $r{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new Vr("setRealSize"),this.onUpdate=new Vr("update"),this.onError=new Vr("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,r){return!1}dispose(){}destroy(){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)}static test(t,e){return!1}}class Xr extends $r{constructor(t,e){const{width:r,height:i}=e||{};if(!r||!i)throw new Error("BufferResource width or height invalid");super(r,i),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,r){const i=t.gl;i.pixelStorei(i.UNPACK_ALIGNMENT,this.unpackAlignment),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===ye.UNPACK);const s=e.realWidth,n=e.realHeight;return r.width===s&&r.height===n?i.texSubImage2D(e.target,0,0,0,s,n,e.format,r.type,this.data):(r.width=s,r.height=n,i.texImage2D(e.target,0,r.internalFormat,s,n,0,e.format,r.type,this.data)),!0}dispose(){this.data=null}static test(t){return null===t||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}const zr={scaleMode:fe.NEAREST,alphaMode:ye.NPM},Wr=class t extends Re{constructor(e=null,r=null){super(),r=Object.assign({},t.defaultOptions,r);const{alphaMode:i,mipmap:s,anisotropicLevel:n,scaleMode:o,width:a,height:h,wrapMode:l,format:u,type:c,target:d,resolution:p,resourceOptions:f}=r;e&&!(e instanceof $r)&&((e=jr(e,f)).internal=!0),this.resolution=p||Se.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((h||0)*this.resolution)/this.resolution,this._mipmap=s,this.anisotropicLevel=n,this._wrapMode=l,this._scaleMode=o,this.format=u,this.type=c,this.target=d,this.alphaMode=i,this.uid=Er(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&h>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let 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}setSize(t,e,r){return r=r||this.resolution,this.setRealSize(t*r,e*r,r)}setRealSize(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}_refreshPOT(){this.isPowerOfTwo=_r(this.realWidth)&&_r(this.realHeight)}setResolution(t){const 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}setResource(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}update(){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))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Rr[this.cacheId],delete Pr[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,r,i=Se.STRICT_TEXTURE_CACHE){const s="string"==typeof e;let n=null;if(s)n=e;else{if(!e._pixiId){const t=r?.pixiIdPrefix||"pixiid";e._pixiId=`${t}_${Er()}`}n=e._pixiId}let o=Rr[n];if(s&&i&&!o)throw new Error(`The cacheId "${n}" does not exist in BaseTextureCache.`);return o||(o=new t(e,r),o.cacheId=n,t.addToCache(o,n)),o}static fromBuffer(e,r,i,s){e=e||new Float32Array(r*i*4);const n=new Xr(e,{width:r,height:i,...s?.resourceOptions});let o,a;return e instanceof Float32Array?(o=ue.RGBA,a=de.FLOAT):e instanceof Int32Array?(o=ue.RGBA_INTEGER,a=de.INT):e instanceof Uint32Array?(o=ue.RGBA_INTEGER,a=de.UNSIGNED_INT):e instanceof Int16Array?(o=ue.RGBA_INTEGER,a=de.SHORT):e instanceof Uint16Array?(o=ue.RGBA_INTEGER,a=de.UNSIGNED_SHORT):e instanceof Int8Array?(o=ue.RGBA,a=de.BYTE):(o=ue.RGBA,a=de.UNSIGNED_BYTE),n.internal=!0,new t(n,Object.assign({},zr,{type:a,format:o},s))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Rr[e]&&Rr[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),Rr[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=Rr[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete Rr[t],e}}else if(t?.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete Rr[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};Wr.defaultOptions={mipmap:ge.POW2,anisotropicLevel:0,scaleMode:fe.LINEAR,wrapMode:me.CLAMP,alphaMode:ye.UNPACK,target:ce.TEXTURE_2D,format:ue.RGBA,type:de.UNSIGNED_BYTE},Wr._globalBatch=0;let Yr=Wr;class qr{constructor(){this.texArray=null,this.blend=0,this.type=le.TRIANGLES,this.start=0,this.size=0,this.data=null}}let Kr=0;class Zr{constructor(t,e=!0,r=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=r,this.static=e,this.id=Kr++,this.disposeRunner=new Vr("disposeBuffer")}update(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(t){this.type=t?Ee.ELEMENT_ARRAY_BUFFER:Ee.ARRAY_BUFFER}get index(){return this.type===Ee.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new Zr(t)}}class Qr{constructor(t,e=0,r=!1,i=de.FLOAT,s,n,o,a=1){this.buffer=t,this.size=e,this.normalized=r,this.type=i,this.stride=s,this.start=n,this.instance=o,this.divisor=a}destroy(){this.buffer=null}static from(t,e,r,i,s){return new Qr(t,e,r,i,s)}}const Jr={Float32Array,Uint32Array,Int32Array,Uint8Array},ti={5126:4,5123:2,5121:1};let ei=0;const ri={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class ii{constructor(t=[],e={}){this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=ei++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Vr("disposeGeometry"),this.refCount=0}addAttribute(t,e,r=0,i=!1,s,n,o,a=!1){if(!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof Zr||(e instanceof Array&&(e=new Float32Array(e)),e=new Zr(e));const h=t.split("|");if(h.length>1){for(let t=0;t<h.length;t++)this.addAttribute(h[t],e,r,i,s);return this}let l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new Qr(l,r,i,s,n,o,a),this.instanced=this.instanced||a,this}getAttribute(t){return this.attributes[t]}getBuffer(t){return this.buffers[this.getAttribute(t).buffer]}addIndex(t){return t instanceof Zr||(t instanceof Array&&(t=new Uint16Array(t)),t=new Zr(t)),t.type=Ee.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.includes(t)||this.buffers.push(t),this}getIndex(){return this.indexBuffer}interleave(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;const t=[],e=[],r=new Zr;let i;for(i in this.attributes){const r=this.attributes[i],s=this.buffers[r.buffer];t.push(s.data),e.push(r.size*ti[r.type]/4),r.buffer=0}for(r.data=function(t,e){let r=0,i=0;const s={};for(let s=0;s<t.length;s++)i+=e[s],r+=t[s].length;const n=new ArrayBuffer(4*r);let o=null,a=0;for(let r=0;r<t.length;r++){const h=e[r],l=t[r],u=gr(l);s[u]||(s[u]=new Jr[u](n)),o=s[u];for(let t=0;t<l.length;t++)o[(t/h|0)*i+a+t%h]=l[t];a+=h}return new Float32Array(n)}(t,e),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[r],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const t in this.attributes){const e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const t=new ii;for(let e=0;e<this.buffers.length;e++)t.buffers[e]=new Zr(this.buffers[e].data.slice(0));for(const e in this.attributes){const r=this.attributes[e];t.attributes[e]=new Qr(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=Ee.ELEMENT_ARRAY_BUFFER),t}static merge(t){const e=new ii,r=[],i=[],s=[];let n;for(let e=0;e<t.length;e++){n=t[e];for(let t=0;t<n.buffers.length;t++)i[t]=i[t]||0,i[t]+=n.buffers[t].data.length,s[t]=0}for(let t=0;t<n.buffers.length;t++)r[t]=new(ri[gr(n.buffers[t].data)])(i[t]),e.buffers[t]=new Zr(r[t]);for(let e=0;e<t.length;e++){n=t[e];for(let t=0;t<n.buffers.length;t++)r[t].set(n.buffers[t].data,s[t]),s[t]+=n.buffers[t].data.length}if(e.attributes=n.attributes,n.indexBuffer){e.indexBuffer=e.buffers[n.buffers.indexOf(n.indexBuffer)],e.indexBuffer.type=Ee.ELEMENT_ARRAY_BUFFER;let r=0,i=0,s=0,o=0;for(let t=0;t<n.buffers.length;t++)if(n.buffers[t]!==n.indexBuffer){o=t;break}for(const t in n.attributes){const e=n.attributes[t];(0|e.buffer)===o&&(i+=e.size*ti[e.type]/4)}for(let n=0;n<t.length;n++){const a=t[n].indexBuffer.data;for(let t=0;t<a.length;t++)e.indexBuffer.data[t+s]+=r;r+=t[n].buffers[o].data.length/i,s+=a.length}}return e}}class si extends ii{constructor(t=!1){super(),this._buffer=new Zr(null,t,!1),this._indexBuffer=new Zr(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,de.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,de.FLOAT).addAttribute("aColor",this._buffer,4,!0,de.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,de.FLOAT).addIndex(this._indexBuffer)}}const ni=2*Math.PI,oi=180/Math.PI,ai=Math.PI/180;var hi=(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",t))(hi||{});class li{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new li(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}}li.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const ui=[new li,new li,new li,new li];class ci{constructor(t=0,e=0,r=0,i=0){this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=hi.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new ci(0,0,0,0)}clone(){return new ci(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(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}intersects(t,e){if(!e){const e=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=e)return!1;const r=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>r}const r=this.left,i=this.right,s=this.top,n=this.bottom;if(i<=r||n<=s)return!1;const o=ui[0].set(t.left,t.top),a=ui[1].set(t.left,t.bottom),h=ui[2].set(t.right,t.top),l=ui[3].set(t.right,t.bottom);if(h.x<=o.x||a.y<=o.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(0===u||(e.apply(o,o),e.apply(a,a),e.apply(h,h),e.apply(l,l),Math.max(o.x,a.x,h.x,l.x)<=r||Math.min(o.x,a.x,h.x,l.x)>=i||Math.max(o.y,a.y,h.y,l.y)<=s||Math.min(o.y,a.y,h.y,l.y)>=n))return!1;const c=u*(a.y-o.y),d=u*(o.x-a.x),p=c*r+d*s,f=c*i+d*s,m=c*r+d*n,g=c*i+d*n;if(Math.max(p,f,m,g)<=c*o.x+d*o.y||Math.min(p,f,m,g)>=c*l.x+d*l.y)return!1;const y=u*(o.y-h.y),_=u*(h.x-o.x),v=y*r+_*s,x=y*i+_*s,b=y*r+_*n,T=y*i+_*n;return!(Math.max(v,x,b,T)<=y*o.x+_*o.y||Math.min(v,x,b,T)>=y*l.x+_*l.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const 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),s=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(s-i,0),this}ceil(t=1,e=.001){const 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}enlarge(t){const 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),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=i,this.height=s-i,this}}ci.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class di{constructor(t=0,e=0,r=0){this.x=t,this.y=e,this.radius=r,this.type=hi.CIRC}clone(){return new di(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const r=this.radius*this.radius;let i=this.x-t,s=this.y-e;return i*=i,s*=s,i+s<=r}getBounds(){return new ci(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}}di.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class pi{constructor(t=0,e=0,r=0,i=0){this.x=t,this.y=e,this.width=r,this.height=i,this.type=hi.ELIP}clone(){return new pi(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,r+i<=1}getBounds(){return new ci(this.x-this.width,this.y-this.height,this.width,this.height)}}pi.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class fi{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let r=0,i=e.length;r<i;r++)t.push(e[r].x,e[r].y);e=t}this.points=e,this.type=hi.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),e=new fi(t);return e.closeStroke=this.closeStroke,e}contains(t,e){let r=!1;const i=this.points.length/2;for(let s=0,n=i-1;s<i;n=s++){const i=this.points[2*s],o=this.points[2*s+1],a=this.points[2*n],h=this.points[2*n+1];o>e!=h>e&&t<(e-o)/(h-o)*(a-i)+i&&(r=!r)}return r}}fi.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce(((t,e)=>`${t}, ${e}`),"")}]`};class mi{constructor(t=0,e=0,r=0,i=0,s=20){this.x=t,this.y=e,this.width=r,this.height=i,this.radius=s,this.type=hi.RREC}clone(){return new mi(this.x,this.y,this.width,this.height,this.radius)}contains(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){const 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;let i=t-(this.x+r),s=e-(this.y+r);const n=r*r;if(i*i+s*s<=n||(i=t-(this.x+this.width-r),i*i+s*s<=n)||(s=e-(this.y+this.height-r),i*i+s*s<=n)||(i=t-(this.x+r),i*i+s*s<=n))return!0}return!1}}mi.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class gi{constructor(t=1,e=0,r=0,i=1,s=0,n=0){this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=s,this.ty=n}fromArray(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]}set(t,e,r,i,s,n){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=s,this.ty=n,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const 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}apply(t,e){e=e||new li;const 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}applyInverse(t,e){e=e||new li;const r=1/(this.a*this.d+this.c*-this.b),i=t.x,s=t.y;return e.x=this.d*r*i+-this.c*r*s+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*s+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),r=Math.sin(t),i=this.a,s=this.c,n=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=s*e-this.d*r,this.d=s*r+this.d*e,this.tx=n*e-this.ty*r,this.ty=n*r+this.ty*e,this}append(t){const e=this.a,r=this.b,i=this.c,s=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*s,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*s,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*s+this.ty,this}setTransform(t,e,r,i,s,n,o,a,h){return this.a=Math.cos(o+h)*s,this.b=Math.sin(o+h)*s,this.c=-Math.sin(o-a)*n,this.d=Math.cos(o-a)*n,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,r=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*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}decompose(t){const e=this.a,r=this.b,i=this.c,s=this.d,n=t.pivot,o=-Math.atan2(-i,s),a=Math.atan2(r,e),h=Math.abs(o+a);return h<1e-5||Math.abs(ni-h)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=a),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+s*s),t.position.x=this.tx+(n.x*e+n.y*i),t.position.y=this.ty+(n.x*r+n.y*s),t}invert(){const t=this.a,e=this.b,r=this.c,i=this.d,s=this.tx,n=t*i-e*r;return this.a=i/n,this.b=-e/n,this.c=-r/n,this.d=t/n,this.tx=(r*this.ty-i*s)/n,this.ty=-(t*this.ty-e*s)/n,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new gi;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}copyTo(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}copyFrom(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}static get IDENTITY(){return new gi}static get TEMP_MATRIX(){return new gi}}gi.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}]`};const yi=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],_i=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],vi=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],xi=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],bi=[],Ti=[],Ei=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];bi.push(e);for(let r=0;r<16;r++){const i=Ei(yi[t]*yi[r]+vi[t]*_i[r]),s=Ei(_i[t]*yi[r]+xi[t]*_i[r]),n=Ei(yi[t]*vi[r]+vi[t]*xi[r]),o=Ei(_i[t]*vi[r]+xi[t]*xi[r]);for(let t=0;t<16;t++)if(yi[t]===i&&_i[t]===s&&vi[t]===n&&xi[t]===o){e.push(t);break}}}for(let t=0;t<16;t++){const e=new gi;e.set(yi[t],_i[t],vi[t],xi[t],0,0),Ti.push(e)}}();const Ai={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:t=>yi[t],uY:t=>_i[t],vX:t=>vi[t],vY:t=>xi[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>bi[t][e],sub:(t,e)=>bi[t][Ai.inv(e)],rotate180:t=>4^t,isVertical:t=>2==(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?Ai.S:Ai.N:2*Math.abs(e)<=Math.abs(t)?t>0?Ai.E:Ai.W:e>0?t>0?Ai.SE:Ai.SW:t>0?Ai.NE:Ai.NW,matrixAppendRotationInv:(t,e,r=0,i=0)=>{const s=Ti[Ai.inv(e)];s.tx=r,s.ty=i,t.append(s)}};class Si{constructor(t,e,r=0,i=0){this._x=r,this._y=i,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new Si(t,e,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}Si.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const wi=class{constructor(){this.worldTransform=new gi,this.localTransform=new gi,this.position=new Si(this.onChange,this,0,0),this.scale=new Si(this.onChange,this,1,1),this.pivot=new Si(this.onChange,this,0,0),this.skew=new Si(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}onChange(){this._localID++}updateSkew(){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++}updateLocalTransform(){const 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)}updateTransform(t){const 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){const 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++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};wi.IDENTITY=new wi;let Pi=wi;Pi.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}) ]`};const Ri=[{test:t=>"float"===t.type&&1===t.size&&!t.isArray,code:t=>`\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:(t,e)=>!("sampler2D"!==t.type&&"samplerCube"!==t.type&&"sampler2DArray"!==t.type||1!==t.size||t.isArray||null!=e&&void 0===e.castToBaseTexture),code:t=>`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:(t,e)=>"mat3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.a,code:t=>`\n            gl.uniformMatrix3fv(ud["${t}"].location, false, uv["${t}"].toArray(true));\n            `,codeUbo:t=>`\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:(t,e)=>"vec2"===t.type&&1===t.size&&!t.isArray&&void 0!==e.x,code:t=>`\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:t=>`\n                v = uv.${t};\n\n                data[offset] = v.x;\n                data[offset+1] = v.y;\n            `},{test:t=>"vec2"===t.type&&1===t.size&&!t.isArray,code:t=>`\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:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.width,code:t=>`\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:t=>`\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:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n                cv = ud["${t}"].value;\n                v = uv["${t}"];\n\n                if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)\n                {\n                    cv[0] = v.red;\n                    cv[1] = v.green;\n                    cv[2] = v.blue;\n                    cv[3] = v.alpha;\n                    gl.uniform4f(ud["${t}"].location, v.red, v.green, v.blue, v.alpha)\n                }`,codeUbo:t=>`\n                    v = uv.${t};\n\n                    data[offset] = v.red;\n                    data[offset+1] = v.green;\n                    data[offset+2] = v.blue;\n                    data[offset+3] = v.alpha;\n                `},{test:(t,e)=>"vec3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n                cv = ud["${t}"].value;\n                v = uv["${t}"];\n\n                if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)\n                {\n                    cv[0] = v.red;\n                    cv[1] = v.green;\n                    cv[2] = v.blue;\n    \n                    gl.uniform3f(ud["${t}"].location, v.red, v.green, v.blue)\n                }`,codeUbo:t=>`\n                    v = uv.${t};\n\n                    data[offset] = v.red;\n                    data[offset+1] = v.green;\n                    data[offset+2] = v.blue;\n                `},{test:t=>"vec4"===t.type&&1===t.size&&!t.isArray,code:t=>`\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                }`}],Mi={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:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",samplerCube:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }",sampler2DArray:"\n    if (cv !== v)\n    {\n        cu.value = v;\n\n        gl.uniform1i(location, v);\n    }"},Ci={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)"},Ii={};let Di,Oi=Ii;const Bi={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 Li(t){return Bi[t]}let Ni=null;const Fi={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 ki(t,e){if(!Ni){const e=Object.keys(Fi);Ni={};for(let r=0;r<e.length;++r){const i=e[r];Ni[t[i]]=Fi[i]}}return Ni[e]}function Ui(t,e,r){if("precision"!==t.substring(0,9)){let i=e;return e===xe.HIGH&&r!==xe.HIGH&&(i=xe.MEDIUM),`precision ${i} float;\n${t}`}return r!==xe.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}let Gi=0;const Hi={},ji=class t{constructor(e,r,i="pixi-shader",s={}){this.extra={},this.id=Gi++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=r||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=s,"#version"!==this.vertexSrc.substring(0,8)&&(i=i.replace(/\s+/g,"-"),Hi[i]?(Hi[i]++,i+=`-${Hi[i]}`):Hi[i]=1,this.vertexSrc=`#define SHADER_NAME ${i}\n${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${i}\n${this.fragmentSrc}`,this.vertexSrc=Ui(this.vertexSrc,t.defaultVertexPrecision,xe.HIGH),this.fragmentSrc=Ui(this.fragmentSrc,t.defaultFragmentPrecision,function(){if(!Di){Di=xe.MEDIUM;const t=function(){if(Oi===Ii||Oi?.isContextLost()){const t=Se.ADAPTER.createCanvas();let e;Se.PREFER_ENV>=ne.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Oi=e}return Oi}();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);e&&(Di=e.precision?xe.HIGH:xe.MEDIUM)}}return Di}())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){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"}static get defaultFragmentSrc(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"}static from(e,r,i){const s=e+r;let n=wr[s];return n||(wr[s]=n=new t(e,r,i)),n}};ji.defaultVertexPrecision=xe.HIGH,ji.defaultFragmentPrecision=Pe.apple.device?xe.HIGH:xe.MEDIUM;let Vi=ji,$i=0;class Xi{constructor(t,e,r){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=$i++,this.static=!!e,this.ubo=!!r,t instanceof Zr?(this.buffer=t,this.buffer.type=Ee.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new Zr(new Float32Array(1)),this.buffer.type=Ee.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(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 Xi(e,r)}static from(t,e,r){return new Xi(t,e,r)}static uboFrom(t,e){return new Xi(t,e??!0,!0)}}class zi{constructor(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof Xi?e:new Xi(e):new Xi({}),this.disposeRunner=new Vr("disposeShader")}checkUniformExists(t,e){if(e.uniforms[t])return!0;for(const r in e.uniforms){const i=e.uniforms[r];if(!0===i.group&&this.checkUniformExists(t,i))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(t,e,r){const i=Vi.from(t,e);return new zi(i,r)}}class Wi{constructor(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},!e.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!e.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(t){if(!this.programCache[t]){const e=new Int32Array(t);for(let r=0;r<t;r++)e[r]=r;this.defaultGroupCache[t]=Xi.from({uSamplers:e},!0);let r=this.fragTemplate;r=r.replace(/%count%/gi,`${t}`),r=r.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new Vi(this.vertexSrc,r)}const e={tint:new Float32Array([1,1,1,1]),translationMatrix:new gi,default:this.defaultGroupCache[t]};return new zi(this.programCache[t],e)}generateSampleSrc(t){let e="";e+="\n",e+="\n";for(let 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",e}}class Yi{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let t=0;t<this.count;t++)this.elements[t]=null;this.count=0}}class qi{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}const Ki=class t extends qi{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=si,this.vertexSize=6,this.state=Gr.for2d(),this.size=4*t.defaultBatchSize,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??function(){let t=!0;const e=Se.ADAPTER.getNavigator();if(Pe.tablet||Pe.phone){if(Pe.apple.device){const r=e.userAgent.match(/OS (\d+)_(\d+)?/);r&&parseInt(r[1],10)<11&&(t=!1)}if(Pe.android.device){const r=e.userAgent.match(/Android\s([0-9.]*)/);r&&parseInt(r[1],10)<7&&(t=!1)}}return t?32:4}(),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??!Pe.apple.device,this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return Ie("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return"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"}static get defaultFragmentTemplate(){return"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"}setShaderGenerator({vertex:e=t.defaultVertexSrc,fragment:r=t.defaultFragmentTemplate}={}){this.shaderGenerator=new Wi(e,r)}contextChange(){const e=this.renderer.gl;Se.PREFER_ENV===ne.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),t.defaultMaxTextures),this.maxTextures=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);for(;;){const i=kr.replace(/%forloop%/gi,Ur(t));if(e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.maxTextures,e)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:e,_textureArrayPool:r}=t,i=this.size/4,s=Math.floor(i/this.maxTextures)+1;for(;e.length<i;)e.push(new qr);for(;r.length<s;)r.push(new Yi);for(let t=0;t<this.maxTextures;t++)this._tempBoundTextures[t]=null}onPrerender(){this._flushId=0}render(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)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:r}=this,i=t._textureArrayPool,s=this.renderer.batch,n=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++Yr._globalBatch,h=0,l=i[0],u=0;s.copyBoundTextures(n,r);for(let t=0;t<this._bufferSize;++t){const c=e[t];e[t]=null,c._batchEnabled!==a&&(l.count>=r&&(s.boundArray(l,n,a,r),this.buildDrawCalls(l,u,t),u=t,l=i[++h],++a),c._batchEnabled=a,c.touched=o,l.elements[l.count++]=c)}l.count>0&&(s.boundArray(l,n,a,r),this.buildDrawCalls(l,u,this._bufferSize),++h,++a);for(let t=0;t<n.length;t++)n[t]=null;Yr._globalBatch=a}buildDrawCalls(e,r,i){const{_bufferedElements:s,_attributeBuffer:n,_indexBuffer:o,vertexSize:a}=this,h=t._drawCallPool;let l=this._dcIndex,u=this._aIndex,c=this._iIndex,d=h[l];d.start=this._iIndex,d.texArray=e;for(let t=r;t<i;++t){const i=s[t],p=i._texture.baseTexture,f=fr[p.alphaMode?1:0][i.blendMode];s[t]=null,r<t&&d.blend!==f&&(d.size=c-d.start,r=t,d=h[++l],d.texArray=e,d.start=c),this.packInterleavedGeometry(i,n,o,u,c),u+=i.vertexData.length/2*a,c+=i.indices.length,d.blend=f}r<i&&(d.size=c-d.start,++l),this._dcIndex=l,this._aIndex=u,this._iIndex=c}bindAndClearTexArray(t){const e=this.renderer.texture;for(let r=0;r<t.count;r++)e.bind(t.elements[r],t.ids[r]),t.elements[r]=null;t.count=0}updateGeometry(){const{_packedGeometries:e,_attributeBuffer:r,_indexBuffer:i}=this;t.canUploadSameBuffer?(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++)}drawBatches(){const e=this._dcIndex,{gl:r,state:i}=this.renderer,s=t._drawCallPool;let n=null;for(let t=0;t<e;t++){const{texArray:e,type:o,size:a,start:h,blend:l}=s[t];n!==e&&(n=e,this.bindAndClearTexArray(e)),this.state.blendMode=l,i.set(this.state),r.drawElements(o,a,r.UNSIGNED_SHORT,2*h)}}flush(){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)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),t.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].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),super.destroy()}getAttributeBuffer(t){const e=yr(Math.ceil(t/8)),r=vr(e),i=8*e;this._aBuffers.length<=r&&(this._iBuffers.length=r+1);let s=this._aBuffers[i];return s||(this._aBuffers[i]=s=new Fr(i*this.vertexSize*4)),s}getIndexBuffer(t){const e=yr(Math.ceil(t/12)),r=vr(e),i=12*e;this._iBuffers.length<=r&&(this._iBuffers.length=r+1);let s=this._iBuffers[r];return s||(this._iBuffers[r]=s=new Uint16Array(i)),s}packInterleavedGeometry(t,e,r,i,s){const{uint32View:n,float32View:o}=e,a=i/this.vertexSize,h=t.uvs,l=t.indices,u=t.vertexData,c=t._texture.baseTexture._batchLocation,d=Math.min(t.worldAlpha,1),p=pr.shared.setValue(t._tintRGB).toPremultiplied(d,t._texture.baseTexture.alphaMode>0);for(let t=0;t<u.length;t+=2)o[i++]=u[t],o[i++]=u[t+1],o[i++]=h[t],o[i++]=h[t+1],n[i++]=p,o[i++]=c;for(let t=0;t<l.length;t++)r[s++]=a+l[t]}};Ki.defaultBatchSize=4096,Ki.extension={name:"batch",type:Or.RendererPlugin},Ki._drawCallPool=[],Ki._textureArrayPool=[];let Zi=Ki;Nr.add(Zi);const Qi=class t extends zi{constructor(e,r,i){super(Vi.from(e||t.defaultVertexSrc,r||t.defaultFragmentSrc),i),this.padding=0,this.resolution=t.defaultResolution,this.multisample=t.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new Gr}apply(t,e,r,i,s){t.applyFilter(this,e,r,i)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){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"}static get defaultFragmentSrc(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"}};Qi.defaultResolution=1,Qi.defaultMultisample=Te.NONE;let Ji=Qi;class ts{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new pr(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:e,background:r,backgroundAlpha:i}=t,s=r??e;void 0!==s&&(this.color=s),this.alpha=i}get color(){return this._backgroundColor.value}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get backgroundColor(){return this._backgroundColor}destroy(){}}ts.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},ts.extension={type:[Or.RendererSystem,Or.CanvasRendererSystem],name:"background"},Nr.add(ts);class es{constructor(t){this.renderer=t,this.emptyRenderer=new qi(t),this.currentRenderer=this.emptyRenderer}setObjectRenderer(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(t,e){const{boundTextures:r}=this.renderer.texture;for(let i=e-1;i>=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)}boundArray(t,e,r,i){const{elements:s,ids:n,count:o}=t;let a=0;for(let t=0;t<o;t++){const o=s[t],h=o._batchLocation;if(h>=0&&h<i&&e[h]===o)n[t]=h;else for(;a<i;){const i=e[a];if(!i||i._batchEnabled!==r||i._batchLocation!==a){n[t]=a,o._batchLocation=a,e[a]=o;break}a++}}}destroy(){this.renderer=null}}es.extension={type:Or.RendererSystem,name:"batch"},Nr.add(es);let rs=0;class is{constructor(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)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=rs++}init(t){if(t.context)this.initFromContext(t.context);else{const e=this.renderer.background.alpha<1,r=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:e,premultipliedAlpha:r,antialias:t.antialias,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference})}}initFromContext(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=rs++,this.renderer.runners.contextChange.emit(t);const e=this.renderer.view;void 0!==e.addEventListener&&(e.addEventListener("webglcontextlost",this.handleContextLost,!1),e.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(t){const e=this.createContext(this.renderer.view,t);this.initFromContext(e)}createContext(t,e){let r;if(Se.PREFER_ENV>=ne.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),!r)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),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"),bptc:t.getExtension("EXT_texture_compression_bptc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),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")})}handleContextLost(t){t.preventDefault(),setTimeout((()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()}),0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,void 0!==t.removeEventListener&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const e=t.getContextAttributes(),r="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;r&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const 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")}}is.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},is.extension={type:Or.RendererSystem,name:"context"},Nr.add(is);class ss{constructor(t,e){if(this.width=Math.round(t),this.height=Math.round(e),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");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 Vr("disposeFramebuffer"),this.multisample=Te.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new Yr(null,{scaleMode:fe.NEAREST,resolution:1,mipmap:ge.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new Yr(null,{scaleMode:fe.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:ge.OFF,format:ue.DEPTH_COMPONENT,type:de.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,e){if(t=Math.round(t),e=Math.round(e),!t||!e)throw new Error("Framebuffer width and height must not be zero");if(t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(let r=0;r<this.colorTextures.length;r++){const i=this.colorTextures[r],s=i.resolution;i.setSize(t/s,e/s)}if(this.depthTexture){const r=this.depthTexture.resolution;this.depthTexture.setSize(t/r,e/r)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class ns extends Yr{constructor(t={}){"number"==typeof t&&(t={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),t.width=t.width??100,t.height=t.height??100,t.multisample??(t.multisample=Te.NONE),super(null,t),this.mipmap=ge.OFF,this.valid=!0,this._clear=new pr([0,0,0,0]),this.framebuffer=new ss(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=t.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(t){this._clear.setValue(t)}get clearColor(){return this._clear.value}get clear(){return this._clear}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class os extends $r{constructor(t){const e=t;super(e.naturalWidth||e.videoWidth||e.displayWidth||e.width,e.naturalHeight||e.videoHeight||e.displayHeight||e.height),this.source=t,this.noSubImage=!1}static crossOrigin(t,e,r){void 0!==r||e.startsWith("data:")?!1!==r&&(t.crossOrigin="string"==typeof r?r:"anonymous"):t.crossOrigin=function(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location;const r=new URL(t,document.baseURI);return r.hostname!==e.hostname||r.port!==e.port||r.protocol!==e.protocol?"anonymous":""}(e)}upload(t,e,r,i){const s=t.gl,n=e.realWidth,o=e.realHeight;if(i=i||this.source,typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement){if(!i.complete||0===i.naturalWidth)return!1}else if(typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement&&i.readyState<=1)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===ye.UNPACK),this.noSubImage||e.target!==s.TEXTURE_2D||r.width!==n||r.height!==o?(r.width=n,r.height=o,s.texImage2D(e.target,0,r.internalFormat,e.format,r.type,i)):s.texSubImage2D(s.TEXTURE_2D,0,0,0,e.format,r.type,i),!0}update(){if(this.destroyed)return;const t=this.source,e=t.naturalWidth||t.videoWidth||t.width,r=t.naturalHeight||t.videoHeight||t.height;this.resize(e,r),super.update()}dispose(){this.source=null}}class as extends os{constructor(t,e){if(e=e||{},"string"==typeof t){const r=new Image;os.crossOrigin(r,t,e.crossorigin),r.src=t,t=r}super(t),!t.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=t.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(e.createBitmap??Se.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode="number"==typeof e.alphaMode?e.alphaMode:null,this.bitmap=null,this._load=null,!1!==e.autoLoad&&this.load()}load(t){return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise(((t,e)=>{const r=this.source;this.url=r.src;const i=()=>{this.destroyed||(r.onload=null,r.onerror=null,this.update(),this._load=null,this.createBitmap?t(this.process()):t(this))};r.complete&&r.src?i():(r.onload=i,r.onerror=t=>{e(t),this.onError.emit(t)})}))),this._load}process(){const t=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,r=!t.crossOrigin||"anonymous"===t.crossOrigin;return this._process=fetch(t.src,{mode:r?"cors":"no-cors"}).then((t=>t.blob())).then((r=>e(r,0,0,t.width,t.height,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===ye.UNPACK?"premultiply":"none"}))).then((t=>this.destroyed?Promise.reject():(this.bitmap=t,this.update(),this._process=null,Promise.resolve(this)))),this._process}upload(t,e,r){if("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,r);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,r,this.bitmap),!this.preserveBitmap){let t=!0;const i=e._glTextures;for(const s in i){const n=i[s];if(n!==r&&n.dirtyId!==e.dirtyId){t=!1;break}}t&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&("string"==typeof t||t instanceof HTMLImageElement)}}class hs{constructor(){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)}set(t,e,r){const i=e.width,s=e.height;if(r){const e=t.width/2/i,n=t.height/2/s,o=t.x/i+e,a=t.y/s+n;r=Ai.add(r,Ai.NW),this.x0=o+e*Ai.uX(r),this.y0=a+n*Ai.uY(r),r=Ai.add(r,2),this.x1=o+e*Ai.uX(r),this.y1=a+n*Ai.uY(r),r=Ai.add(r,2),this.x2=o+e*Ai.uX(r),this.y2=a+n*Ai.uY(r),r=Ai.add(r,2),this.x3=o+e*Ai.uX(r),this.y3=a+n*Ai.uY(r)}else this.x0=t.x/i,this.y0=t.y/s,this.x1=(t.x+t.width)/i,this.y1=t.y/s,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/s,this.x3=t.x/i,this.y3=(t.y+t.height)/s;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}}hs.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}]`};const ls=new hs;function us(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class cs extends Re{constructor(t,e,r,i,s,n,o){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new ci(0,0,1,1)),t instanceof cs&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=i,this.valid=!1,this.destroyed=!1,this._uvs=ls,this.uvMatrix=null,this.orig=r||e,this._rotate=Number(s||0),!0===s)this._rotate=2;else if(this._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=n?new li(n.x,n.y):new li(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(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)}destroy(t){if(this.baseTexture){if(t){const{resource:t}=this.baseTexture;t?.url&&Pr[t.url]&&cs.removeFromCache(t.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,cs.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){const t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),r=new cs(this.baseTexture,!this.noFrame&&t,e,this.trim?.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(r._frame=t),r}updateUvs(){this._uvs===ls&&(this._uvs=new hs),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},r=Se.STRICT_TEXTURE_CACHE){const i="string"==typeof t;let s=null;if(i)s=t;else if(t instanceof Yr){if(!t.cacheId){const r=e?.pixiIdPrefix||"pixiid";t.cacheId=`${r}-${Er()}`,Yr.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){const r=e?.pixiIdPrefix||"pixiid";t._pixiId=`${r}_${Er()}`}s=t._pixiId}let n=Pr[s];if(i&&r&&!n)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return n||t instanceof Yr?!n&&t instanceof Yr&&(n=new cs(t),cs.addToCache(n,s)):(e.resolution||(e.resolution=Dr(t)),n=new cs(new Yr(t,e)),n.baseTexture.cacheId=s,Yr.addToCache(n.baseTexture,s),cs.addToCache(n,s)),n}static fromURL(t,e){const r=Object.assign({autoLoad:!1},e?.resourceOptions),i=cs.from(t,Object.assign({resourceOptions:r},e),!1),s=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):s.load().then((()=>Promise.resolve(i)))}static fromBuffer(t,e,r,i){return new cs(Yr.fromBuffer(t,e,r,i))}static fromLoader(t,e,r,i){const s=new Yr(t,Object.assign({scaleMode:Yr.defaultOptions.scaleMode,resolution:Dr(e)},i)),{resource:n}=s;n instanceof as&&(n.url=e);const o=new cs(s);return r||(r=e),Yr.addToCache(o.baseTexture,r),cs.addToCache(o,r),r!==e&&(Yr.addToCache(o.baseTexture,e),cs.addToCache(o,e)),o.baseTexture.valid?Promise.resolve(o):new Promise((t=>{o.baseTexture.once("loaded",(()=>t(o)))}))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Pr[e]&&Pr[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),Pr[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=Pr[t];if(e){const r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete Pr[t],e}}else if(t?.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)Pr[t.textureCacheIds[e]]===t&&delete Pr[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(t){this._frame=t,this.noFrame=!1;const{x:e,y:r,width:i,height:s}=t,n=e+i>this.baseTexture.width,o=r+s>this.baseTexture.height;if(n||o){const t=n&&o?"and":"or",a=`X: ${e} + ${i} = ${e+i} > ${this.baseTexture.width}`,h=`Y: ${r} + ${s} = ${r+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${a} ${t} ${h}`)}this.valid=i&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return cs._EMPTY||(cs._EMPTY=new cs(new Yr),us(cs._EMPTY),us(cs._EMPTY.baseTexture)),cs._EMPTY}static get WHITE(){if(!cs._WHITE){const t=Se.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),cs._WHITE=new cs(Yr.from(t)),us(cs._WHITE),us(cs._WHITE.baseTexture)}return cs._WHITE}}class ds extends cs{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,r=!0){const i=this.baseTexture.resolution,s=Math.round(t*i)/i,n=Math.round(e*i)/i;this.valid=s>0&&n>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=n,r&&this.baseTexture.resize(s,n),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new ds(new ns(t))}}class ps{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,r=Te.NONE){const i=new ns(Object.assign({width:t,height:e,resolution:1,multisample:r},this.textureOptions));return new ds(i)}getOptimalTexture(t,e,r=1,i=Te.NONE){let s;t=Math.max(Math.ceil(t*r-1e-6),1),e=Math.max(Math.ceil(e*r-1e-6),1),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?s=i>1?-i:-1:(s=((65535&(t=yr(t)))<<16|65535&(e=yr(e)))>>>0,i>1&&(s+=4294967296*i)),this.texturePool[s]||(this.texturePool[s]=[]);let n=this.texturePool[s].pop();return n||(n=this.createTexture(t,e,i)),n.filterPoolKey=s,n.setResolution(r),n}getFilterTexture(t,e,r){const i=this.getOptimalTexture(t.width,t.height,e||t.resolution,r||Te.NONE);return i.filterFrame=t.filterFrame,i}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=!1!==t)for(const t in this.texturePool){const e=this.texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0)}this.texturePool={}}setScreenSize(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){this.enableFullScreen=t.width>0&&t.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const e=this.texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0);this.texturePool[t]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}ps.SCREEN_KEY=-1;class fs extends ii{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class ms extends ii{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Zr(this.vertices),this.uvBuffer=new Zr(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,e){let 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}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class gs{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Te.NONE,this.sourceFrame=new ci,this.destinationFrame=new ci,this.bindingSourceFrame=new ci,this.bindingDestinationFrame=new ci,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const ys=[new li,new li,new li,new li],_s=new gi;class vs{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new ps,this.statePool=[],this.quad=new fs,this.quadUv=new ms,this.tempRect=new ci,this.activeState={},this.globalUniforms=new Xi({outputFrame:new ci,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}init(){this.texturePool.setScreenSize(this.renderer.view)}push(t,e){const r=this.renderer,i=this.defaultFilterStack,s=this.statePool.pop()||new gs,n=r.renderTexture;let o,a;if(n.current){const t=n.current;o=t.resolution,a=t.multisample}else o=r.resolution,a=r.multisample;let h=e[0].resolution||o,l=e[0].multisample??a,u=e[0].padding,c=e[0].autoFit,d=e[0].legacy??!0;for(let t=1;t<e.length;t++){const r=e[t];h=Math.min(h,r.resolution||o),l=Math.min(l,r.multisample??a),u=this.useMaxPadding?Math.max(u,r.padding):u+r.padding,c=c&&r.autoFit,d=d||(r.legacy??!0)}1===i.length&&(this.defaultFilterStack[0].renderTexture=n.current),i.push(s),s.resolution=h,s.multisample=l,s.legacy=d,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(u);const p=this.tempRect.copyFrom(n.sourceFrame);r.projection.transform&&this.transformAABB(_s.copyFrom(r.projection.transform).invert(),p),c?(s.sourceFrame.fit(p),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(p)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,n.current?n.current.resolution:r.resolution,n.sourceFrame,n.destinationFrame,r.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,h,l),s.filters=e,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const f=this.tempRect;f.x=0,f.y=0,f.width=s.sourceFrame.width,f.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(n.sourceFrame),s.bindingDestinationFrame.copyFrom(n.destinationFrame),s.transform=r.projection.transform,r.projection.transform=null,n.bind(s.renderTexture,s.sourceFrame,f),r.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,e=t.pop(),r=e.filters;this.activeState=e;const i=this.globalUniforms.uniforms;i.outputFrame=e.sourceFrame,i.resolution=e.resolution;const s=i.inputSize,n=i.inputPixel,o=i.inputClamp;if(s[0]=e.destinationFrame.width,s[1]=e.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],n[0]=Math.round(s[0]*e.resolution),n[1]=Math.round(s[1]*e.resolution),n[2]=1/n[0],n[3]=1/n[1],o[0]=.5*n[2],o[1]=.5*n[3],o[2]=e.sourceFrame.width*s[2]-.5*n[2],o[3]=e.sourceFrame.height*s[3]-.5*n[3],e.legacy){const t=i.filterArea;t[0]=e.destinationFrame.width,t[1]=e.destinationFrame.height,t[2]=e.sourceFrame.x,t[3]=e.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();const a=t[t.length-1];if(this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,e.renderTexture,a.renderTexture,_e.BLEND,e),this.returnFilterTexture(e.renderTexture);else{let t=e.renderTexture,i=this.getOptimalFilterTexture(t.width,t.height,e.resolution);i.filterFrame=t.filterFrame;let s=0;for(s=0;s<r.length-1;++s){1===s&&e.multisample>1&&(i=this.getOptimalFilterTexture(t.width,t.height,e.resolution),i.filterFrame=t.filterFrame),r[s].apply(this,t,i,_e.CLEAR,e);const n=t;t=i,i=n}r[s].apply(this,t,a.renderTexture,_e.BLEND,e),s>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(t),this.returnFilterTexture(i)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=_e.CLEAR){const{renderTexture:r,state:i}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t?.filterFrame){const e=this.tempRect;e.x=0,e.y=0,e.width=t.filterFrame.width,e.height=t.filterFrame.height,r.bind(t,t.filterFrame,e)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?r.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=1&i.stateId||this.forceClear;(e===_e.CLEAR||e===_e.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,r,i){const s=this.renderer;s.state.set(t.state),this.bindAndClear(r,i),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(le.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(le.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:r,destinationFrame:i}=this.activeState,{orig:s}=e._texture,n=t.set(i.width,0,0,i.height,r.x,r.y),o=e.worldTransform.copyTo(gi.TEMP_MATRIX);return o.invert(),n.prepend(o),n.scale(1/s.width,1/s.height),n.translate(e.anchor.x,e.anchor.y),n}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,r=1,i=Te.NONE){return this.texturePool.getOptimalTexture(t,e,r,i)}getFilterTexture(t,e,r){if("number"==typeof t){const r=t;t=e,e=r}t=t||this.activeState.renderTexture;const i=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,r||Te.NONE);return i.filterFrame=t.filterFrame,i}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const r=ys[0],i=ys[1],s=ys[2],n=ys[3];r.set(e.left,e.top),i.set(e.left,e.bottom),s.set(e.right,e.top),n.set(e.right,e.bottom),t.apply(r,r),t.apply(i,i),t.apply(s,s),t.apply(n,n);const o=Math.min(r.x,i.x,s.x,n.x),a=Math.min(r.y,i.y,s.y,n.y),h=Math.max(r.x,i.x,s.x,n.x),l=Math.max(r.y,i.y,s.y,n.y);e.x=o,e.y=a,e.width=h-o,e.height=l-a}roundFrame(t,e,r,i,s){if(!(t.width<=0||t.height<=0||r.width<=0||r.height<=0)){if(s){const{a:t,b:e,c:r,d:i}=s;if((Math.abs(e)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(i)>1e-4))return}(s=s?_s.copyFrom(s):_s.identity()).translate(-r.x,-r.y).scale(i.width/r.width,i.height/r.height).translate(i.x,i.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}}}vs.extension={type:Or.RendererSystem,name:"filter"},Nr.add(vs);class xs{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Te.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const bs=new ci;class Ts{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new ss(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new ci,this.hasMRT=!0,this.writeDepthTexture=!0,1===this.renderer.context.webGLVersion){let e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;Se.PREFER_ENV===ne.WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=t=>e.drawBuffersWEBGL(t):(this.hasMRT=!1,t.drawBuffers=()=>{}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,r=0){const{gl:i}=this;if(t){const s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==r&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=r),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,r)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let e=0;e<t.colorTextures.length;e++){const r=t.colorTextures[e];this.renderer.texture.unbind(r.parentTextureArray||r)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){const t=e.width>>r,i=e.height>>r,s=t/e.width;this.setViewport(e.x*s,e.y*s,t,i)}else{const e=t.width>>r,i=t.height>>r;this.setViewport(0,0,e,i)}}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)}setViewport(t,e,r,i){const s=this.viewport;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),(s.width!==r||s.height!==i||s.x!==t||s.y!==e)&&(s.x=t,s.y=e,s.width=r,s.height=i,this.gl.viewport(t,e,r,i))}get size(){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}}clear(t,e,r,i,s=ae.COLOR|ae.DEPTH){const{gl:n}=this;n.clearColor(t,e,r,i),n.clear(s)}initFramebuffer(t){const{gl:e}=this,r=new xs(e.createFramebuffer());return r.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=r,this.managedFramebuffers.push(t),t.disposeRunner.add(this),r}resizeFramebuffer(t){const{gl:e}=this,r=t.glFramebuffers[this.CONTEXT_UID];if(r.stencil){let i;e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),i=1===this.renderer.context.webGLVersion?e.DEPTH_STENCIL:t.depth&&t.stencil?e.DEPTH24_STENCIL8:t.depth?e.DEPTH_COMPONENT24:e.STENCIL_INDEX8,r.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,i,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,i,t.width,t.height)}const i=t.colorTextures;let s=i.length;e.drawBuffers||(s=Math.min(s,1));for(let n=0;n<s;n++){const s=i[n],o=s.parentTextureArray||s;this.renderer.texture.bind(o,0),0===n&&r.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,o._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height))}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)}updateFramebuffer(t,e){const{gl:r}=this,i=t.glFramebuffers[this.CONTEXT_UID],s=t.colorTextures;let n=s.length;r.drawBuffers||(n=Math.min(n,1)),i.multisample>1&&this.canMultisampleFramebuffer(t)?i.msaaBuffer=i.msaaBuffer||r.createRenderbuffer():i.msaaBuffer&&(r.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const o=[];for(let a=0;a<n;a++){const n=s[a],h=n.parentTextureArray||n;this.renderer.texture.bind(h,0),0===a&&i.msaaBuffer?(r.bindRenderbuffer(r.RENDERBUFFER,i.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,h._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,i.msaaBuffer)):(r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+a,n.target,h._glTextures[this.CONTEXT_UID].texture,e),o.push(r.COLOR_ATTACHMENT0+a))}if(o.length>1&&r.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const i=t.depthTexture;this.renderer.texture.bind(i,0),r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,i._glTextures[this.CONTEXT_UID].texture,e)}if(!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture)i.stencil&&(r.deleteRenderbuffer(i.stencil),i.stencil=null);else{let e,s;i.stencil=i.stencil||r.createRenderbuffer(),1===this.renderer.context.webGLVersion?(e=r.DEPTH_STENCIL_ATTACHMENT,s=r.DEPTH_STENCIL):t.depth&&t.stencil?(e=r.DEPTH_STENCIL_ATTACHMENT,s=r.DEPTH24_STENCIL8):t.depth?(e=r.DEPTH_ATTACHMENT,s=r.DEPTH_COMPONENT24):(e=r.STENCIL_ATTACHMENT,s=r.STENCIL_INDEX8),r.bindRenderbuffer(r.RENDERBUFFER,i.stencil),i.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,i.multisample,s,t.width,t.height):r.renderbufferStorage(r.RENDERBUFFER,s,t.width,t.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,e,r.RENDERBUFFER,i.stencil)}}canMultisampleFramebuffer(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let r=Te.NONE;if(t<=1||null===e)return r;for(let i=0;i<e.length;i++)if(e[i]<=t){r=e[i];break}return 1===r&&(r=Te.NONE),r}blit(t,e,r){const{current:i,renderer:s,gl:n,CONTEXT_UID:o}=this;if(2!==s.context.webGLVersion||!i)return;const a=i.glFramebuffers[o];if(!a)return;if(!t){if(!a.msaaBuffer)return;const e=i.colorTextures[0];if(!e)return;a.blitFramebuffer||(a.blitFramebuffer=new ss(i.width,i.height),a.blitFramebuffer.addColorTexture(0,e)),(t=a.blitFramebuffer).colorTextures[0]!==e&&(t.colorTextures[0]=e,t.dirtyId++,t.dirtyFormat++),(t.width!==i.width||t.height!==i.height)&&(t.width=i.width,t.height=i.height,t.dirtyId++,t.dirtySize++)}e||((e=bs).width=i.width,e.height=i.height),r||(r=e);const h=e.width===r.width&&e.height===r.height;this.bind(t),n.bindFramebuffer(n.READ_FRAMEBUFFER,a.framebuffer),n.blitFramebuffer(e.left,e.top,e.right,e.bottom,r.left,r.top,r.right,r.bottom,n.COLOR_BUFFER_BIT,h?n.NEAREST:n.LINEAR),n.bindFramebuffer(n.READ_FRAMEBUFFER,t.glFramebuffers[this.CONTEXT_UID].framebuffer)}disposeFramebuffer(t,e){const r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(!r)return;delete t.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(t);s>=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.msaaBuffer&&i.deleteRenderbuffer(r.msaaBuffer),r.stencil&&i.deleteRenderbuffer(r.stencil)),r.blitFramebuffer&&this.disposeFramebuffer(r.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let r=0;r<e.length;r++)this.disposeFramebuffer(e[r],t)}forceStencil(){const t=this.current;if(!t)return;const e=t.glFramebuffers[this.CONTEXT_UID];if(!e||e.stencil&&t.stencil)return;t.stencil=!0;const r=t.width,i=t.height,s=this.gl,n=e.stencil=s.createRenderbuffer();let o,a;s.bindRenderbuffer(s.RENDERBUFFER,n),1===this.renderer.context.webGLVersion?(o=s.DEPTH_STENCIL_ATTACHMENT,a=s.DEPTH_STENCIL):t.depth?(o=s.DEPTH_STENCIL_ATTACHMENT,a=s.DEPTH24_STENCIL8):(o=s.STENCIL_ATTACHMENT,a=s.STENCIL_INDEX8),e.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,e.multisample,a,r,i):s.renderbufferStorage(s.RENDERBUFFER,a,r,i),s.framebufferRenderbuffer(s.FRAMEBUFFER,o,s.RENDERBUFFER,n)}reset(){this.current=this.unknownFramebuffer,this.viewport=new ci}destroy(){this.renderer=null}}Ts.extension={type:Or.RendererSystem,name:"framebuffer"},Nr.add(Ts);const Es={5126:4,5123:2,5121:1};class As{constructor(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){let e=this.renderer.context.extensions.vertexArrayObject;Se.PREFER_ENV===ne.WEBGL_LEGACY&&(e=null),e?(t.createVertexArray=()=>e.createVertexArrayOES(),t.bindVertexArray=t=>e.bindVertexArrayOES(t),t.deleteVertexArray=t=>e.deleteVertexArrayOES(t)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(2!==e.webGLVersion){const e=t.getExtension("ANGLE_instanced_arrays");e?(t.vertexAttribDivisor=(t,r)=>e.vertexAttribDivisorANGLE(t,r),t.drawElementsInstanced=(t,r,i,s,n)=>e.drawElementsInstancedANGLE(t,r,i,s,n),t.drawArraysInstanced=(t,r,i,s)=>e.drawArraysInstancedANGLE(t,r,i,s)):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:r}=this;let i=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;i||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=i={},s=!0);const n=i[e.program.id]||this.initGeometryVao(t,e,s);this._activeGeometry=t,this._activeVao!==n&&(this._activeVao=n,this.hasVao?r.bindVertexArray(n):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let r=0;r<t.buffers.length;r++){const i=t.buffers[r];e.update(i)}}checkCompatibility(t,e){const r=t.attributes,i=e.attributeData;for(const t in i)if(!r[t])throw new Error(`shader and geometry incompatible, geometry missing the "${t}" attribute`)}getSignature(t,e){const r=t.attributes,i=e.attributeData,s=["g",t.id];for(const t in r)i[t]&&s.push(t,i[t].location);return s.join("-")}initGeometryVao(t,e,r=!0){const i=this.gl,s=this.CONTEXT_UID,n=this.renderer.buffer,o=e.program;o.glPrograms[s]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,o);const a=this.getSignature(t,o),h=t.glVertexArrayObjects[this.CONTEXT_UID];let l=h[a];if(l)return h[o.id]=l,l;const u=t.buffers,c=t.attributes,d={},p={};for(const t in u)d[t]=0,p[t]=0;for(const t in c)!c[t].size&&o.attributeData[t]?c[t].size=o.attributeData[t].size:c[t].size||console.warn(`PIXI Geometry attribute '${t}' size cannot be determined (likely the bound shader does not have the attribute)`),d[c[t].buffer]+=c[t].size*Es[c[t].type];for(const t in c){const e=c[t],r=e.size;void 0===e.stride&&(d[e.buffer]===r*Es[e.type]?e.stride=0:e.stride=d[e.buffer]),void 0===e.start&&(e.start=p[e.buffer],p[e.buffer]+=r*Es[e.type])}l=i.createVertexArray(),i.bindVertexArray(l);for(let t=0;t<u.length;t++){const e=u[t];n.bind(e),r&&e._glBuffers[s].refCount++}return this.activateVao(t,o),h[o.id]=l,h[a]=l,i.bindVertexArray(null),n.unbind(Ee.ARRAY_BUFFER),l}disposeGeometry(t,e){if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const r=t.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,s=t.buffers,n=this.renderer?.buffer;if(t.disposeRunner.remove(this),r){if(n)for(let t=0;t<s.length;t++){const r=s[t]._glBuffers[this.CONTEXT_UID];r&&(r.refCount--,0===r.refCount&&!e&&n.dispose(s[t],e))}if(!e)for(const t in r)if("g"===t[0]){const e=r[t];this._activeVao===e&&this.unbind(),i.deleteVertexArray(e)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(t){const e=Object.keys(this.managedGeometries);for(let r=0;r<e.length;r++)this.disposeGeometry(this.managedGeometries[e[r]],t)}activateVao(t,e){const r=this.gl,i=this.CONTEXT_UID,s=this.renderer.buffer,n=t.buffers,o=t.attributes;t.indexBuffer&&s.bind(t.indexBuffer);let a=null;for(const t in o){const h=o[t],l=n[h.buffer],u=l._glBuffers[i];if(e.attributeData[t]){a!==u&&(s.bind(l),a=u);const i=e.attributeData[t].location;if(r.enableVertexAttribArray(i),r.vertexAttribPointer(i,h.size,h.type||r.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");r.vertexAttribDivisor(i,h.divisor)}}}}draw(t,e,r,i){const{gl:s}=this,n=this._activeGeometry;if(n.indexBuffer){const o=n.indexBuffer.data.BYTES_PER_ELEMENT,a=2===o?s.UNSIGNED_SHORT:s.UNSIGNED_INT;2===o||4===o&&this.canUseUInt32ElementIndex?n.instanced?s.drawElementsInstanced(t,e||n.indexBuffer.data.length,a,(r||0)*o,i||1):s.drawElements(t,e||n.indexBuffer.data.length,a,(r||0)*o):console.warn("unsupported index buffer type: uint32")}else n.instanced?s.drawArraysInstanced(t,r,e||n.getSize(),i||1):s.drawArrays(t,r,e||n.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}As.extension={type:Or.RendererSystem,name:"geometry"},Nr.add(As);const Ss=new gi;class ws{constructor(t,e){this._texture=t,this.mapCoord=new gi,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof e>"u"?.5:e,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,e){void 0===e&&(e=t);const r=this.mapCoord;for(let i=0;i<t.length;i+=2){const s=t[i],n=t[i+1];e[i]=s*r.a+n*r.c+r.tx,e[i+1]=s*r.b+n*r.d+r.ty}return e}update(t){const e=this._texture;if(!e||!e.valid||!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;const 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);const i=e.orig,s=e.trim;s&&(Ss.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Ss));const n=e.baseTexture,o=this.uClampFrame,a=this.clampMargin/n.resolution,h=this.clampOffset;return o[0]=(e._frame.x+a+h)/n.width,o[1]=(e._frame.y+a+h)/n.height,o[2]=(e._frame.x+e._frame.width-a+h)/n.width,o[3]=(e._frame.y+e._frame.height-a+h)/n.height,this.uClampOffset[0]=h/n.realWidth,this.uClampOffset[1]=h/n.realHeight,this.isSimple=e._frame.width===n.width&&e._frame.height===n.height&&0===e.rotate,!0}}class Ps extends Ji{constructor(t,e,r){let i=null;"string"!=typeof t&&void 0===e&&void 0===r&&(i=t,t=void 0,e=void 0,r=void 0),super(t||"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",e||"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",r),this.maskSprite=i,this.maskMatrix=new gi}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,e,r,i){const s=this._maskSprite,n=s._texture;n.valid&&(n.uvMatrix||(n.uvMatrix=new ws(n,0)),n.uvMatrix.update(),this.uniforms.npmAlpha=n.baseTexture.alphaMode?0:1,this.uniforms.mask=n,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,s).prepend(n.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=n.uvMatrix.uClampFrame,t.applyFilter(this,e,r,i))}}class Rs{constructor(t=null){this.type=be.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Ji.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=be.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class Ms{constructor(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)}push(t,e){let r=e;if(!r.isMaskData){const t=this.maskDataPool.pop()||new Rs;t.pooled=!0,t.maskObject=e,r=t}const i=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(r.copyCountersOrReset(i),r._colorMask=i?i._colorMask:15,r.autoDetect&&this.detect(r),r._target=t,r.type!==be.SPRITE&&this.maskStack.push(r),r.enabled)switch(r.type){case be.SCISSOR:this.renderer.scissor.push(r);break;case be.STENCIL:this.renderer.stencil.push(r);break;case be.SPRITE:r.copyCountersOrReset(null),this.pushSpriteMask(r);break;case be.COLOR:this.pushColorMask(r)}r.type===be.SPRITE&&this.maskStack.push(r)}pop(t){const e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case be.SCISSOR:this.renderer.scissor.pop(e);break;case be.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case be.SPRITE:this.popSpriteMask(e);break;case be.COLOR:this.popColorMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){const t=this.maskStack[this.maskStack.length-1];t.type===be.SPRITE&&t._filters&&(t._filters[0].maskSprite=t.maskObject)}}}detect(t){const e=t.maskObject;e?e.isSprite?t.type=be.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=be.SCISSOR:t.type=be.STENCIL:t.type=be.COLOR}pushSpriteMask(t){const{maskObject:e}=t,r=t._target;let i=t._filters;i||(i=this.alphaMaskPool[this.alphaMaskIndex],i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new Ps])),i[0].resolution=t.resolution,i[0].multisample=t.multisample,i[0].maskSprite=e;const s=r.filterArea;r.filterArea=e.getBounds(!0),this.renderer.filter.push(r,i),r.filterArea=s,t._filters||this.alphaMaskIndex++}popSpriteMask(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(t){const e=t._colorMask,r=t._colorMask=e&t.colorMask;r!==e&&this.renderer.gl.colorMask(!!(1&r),!!(2&r),!!(4&r),!!(8&r))}popColorMask(t){const e=t._colorMask,r=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;r!==e&&this.renderer.gl.colorMask(!!(1&r),!!(2&r),!!(4&r),!!(8&r))}destroy(){this.renderer=null}}Ms.extension={type:Or.RendererSystem,name:"mask"},Nr.add(Ms);class Cs{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,r=this.getStackLength();this.maskStack=t;const i=this.getStackLength();i!==r&&(0===i?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const Is=new gi,Ds=[],Os=class t extends Cs{constructor(t){super(t),this.glConst=Se.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:r}=t,{renderer:i}=this,s=i.renderTexture,n=r.getBounds(!0,Ds.pop()??new ci);this.roundFrameToPixels(n,s.current?s.current.resolution:i.resolution,s.sourceFrame,s.destinationFrame,i.projection.transform),e&&n.fit(e),t._scissorRectLocal=n}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:r,c:i,d:s}=t;return(Math.abs(r)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(s)>1e-4)}testScissor(e){const{maskObject:r}=e;if(!r.isFastRect||!r.isFastRect()||t.isMatrixRotated(r.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const i=e._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(e,r,i,s,n){t.isMatrixRotated(n)||((n=n?Is.copyFrom(n):Is.identity()).translate(-i.x,-i.y).scale(s.width/i.width,s.height/i.height).translate(s.x,s.y),this.renderer.filter.transformAABB(n,e),e.fit(s),e.x=Math.round(e.x*r),e.y=Math.round(e.y*r),e.width=Math.round(e.width*r),e.height=Math.round(e.height*r))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&Ds.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};Os.extension={type:Or.RendererSystem,name:"scissor"};let Bs=Os;Nr.add(Bs);class Ls extends Cs{constructor(t){super(t),this.glConst=Se.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:r}=this.renderer,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++;const s=t._colorMask;0!==s&&(t._colorMask=0,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,0!==s&&(t._colorMask=s,r.colorMask(!!(1&s),!!(2&s),!!(4&s),!!(8&s))),this._useCurrent()}pop(t){const e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{const r=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,i=r?r._colorMask:15;0!==i&&(r._colorMask=0,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,0!==i&&(r._colorMask=i,e.colorMask(!!(1&i),!!(2&i),!!(4&i),!!(8&i))),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}Ls.extension={type:Or.RendererSystem,name:"stencil"},Nr.add(Ls);class Ns{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get:()=>(Ie("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract)},prepare:{enumerable:!1,get:()=>(Ie("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare)},interaction:{enumerable:!1,get:()=>(Ie("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events)}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}Ns.extension={type:[Or.RendererSystem,Or.CanvasRendererSystem],name:"_plugin"},Nr.add(Ns);class Fs{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new gi,this.transform=null}update(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);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(t,e,r,i){const s=this.projectionMatrix,n=i?-1:1;s.identity(),s.a=1/e.width*2,s.d=n*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-n-e.y*s.d}setTransform(t){}destroy(){this.renderer=null}}Fs.extension={type:Or.RendererSystem,name:"projection"},Nr.add(Fs);const ks=new Pi,Us=new ci;class Gs{constructor(t){this.renderer=t,this._tempMatrix=new gi}generateTexture(t,e){const{region:r,...i}=e||{},s=r?.copyTo(Us)||t.getLocalBounds(Us,!0),n=i.resolution||this.renderer.resolution;s.width=Math.max(s.width,1/n),s.height=Math.max(s.height,1/n),i.width=s.width,i.height=s.height,i.resolution=n,i.multisample??(i.multisample=this.renderer.multisample);const o=ds.create(i);this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const a=t.transform;return t.transform=ks,this.renderer.render(t,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=a,o}destroy(){}}Gs.extension={type:[Or.RendererSystem,Or.CanvasRendererSystem],name:"textureGenerator"},Nr.add(Gs);const Hs=new ci,js=new ci;class Vs{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new ci,this.destinationFrame=new ci,this.viewportFrame=new ci}contextChange(){const t=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,e,r){const i=this.renderer;let s,n,o;this.current=t,t?(s=t.baseTexture,o=s.resolution,e||(Hs.width=t.frame.width,Hs.height=t.frame.height,e=Hs),r||(js.x=t.frame.x,js.y=t.frame.y,js.width=e.width,js.height=e.height,r=js),n=s.framebuffer):(o=i.resolution,e||(Hs.width=i._view.screen.width,Hs.height=i._view.screen.height,e=Hs),r||((r=Hs).width=e.width,r.height=e.height));const 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=i.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(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(r)}clear(t,e){const r=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,i=pr.shared.setValue(t||r);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&i.premultiply(i.alpha);const s=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer._view.screen,o=s.width!==n.width||s.height!==n.height;if(o){let{x:t,y:e,width:r,height:i}=this.viewportFrame;t=Math.round(t),e=Math.round(e),r=Math.round(r),i=Math.round(i),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(t,e,r,i)}this.renderer.framebuffer.clear(i.red,i.green,i.blue,i.alpha,e),o&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Vs.extension={type:Or.RendererSystem,name:"renderTexture"},Nr.add(Vs);class $s{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function Xs(t,e,r){const i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),i}function zs(t){const e=new Array(t);for(let t=0;t<e.length;t++)e[t]=!1;return e}function Ws(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 zs(2*e);case"bvec3":return zs(3*e);case"bvec4":return zs(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}function Ys(t,e){const r=t.getShaderSource(e).split("\n").map(((t,e)=>`${e}: ${t}`)),i=t.getShaderInfoLog(e),s=i.split("\n"),n={},o=s.map((t=>parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1")))).filter((t=>!(!t||n[t]||(n[t]=!0,0)))),a=[""];o.forEach((t=>{r[t-1]=`%c${r[t-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));const h=r.join("\n");a[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function qs(t,e,r,i,s){r.buffer.update(s)}const Ks={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    "},Zs={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};let Qs,Js=0;const tn={textureCount:0,uboCount:0};class en{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Js++}systemCheck(){if(!function(){if("boolean"==typeof Qs)return Qs;try{Qs=!0===new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")}catch{Qs=!1}return Qs}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const 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||(tn.textureCount=0,tn.uboCount=0,this.syncUniformGroup(t.uniformGroup,tn)),i}setUniforms(t){const e=this.shader.program,r=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(r.uniformData,t,this.renderer)}syncUniformGroup(t,e){const r=this.getGlProgram();(!t.static||t.dirtyId!==r.uniformDirtyGroups[t.id])&&(r.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,r,e))}syncUniforms(t,e,r){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,r)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){const r=["\n        var v = null;\n        var cv = null;\n        var cu = null;\n        var t = 0;\n        var gl = renderer.gl;\n    "];for(const i in t.uniforms){const s=e[i];if(!s){!0===t.uniforms[i]?.group&&(t.uniforms[i].ubo?r.push(`\n                        renderer.shader.syncUniformBufferGroup(uv.${i}, '${i}');\n                    `):r.push(`\n                        renderer.shader.syncUniformGroup(uv.${i}, syncData);\n                    `));continue}const n=t.uniforms[i];let o=!1;for(let t=0;t<Ri.length;t++)if(Ri[t].test(s,n)){r.push(Ri[t].code(i,n)),o=!0;break}if(!o){const t=(1!==s.size||s.isArray?Ci:Mi)[s.type].replace("location",`ud["${i}"].location`);r.push(`\n            cu = ud["${i}"];\n            cv = cu.value;\n            v = uv["${i}"];\n            ${t};`)}}return new Function("ud","uv","renderer","syncData",r.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const r=this.getGlProgram();if(!t.static||0!==t.dirtyId||!r.uniformGroups[t.id]){t.dirtyId=0;const i=r.uniformGroups[t.id]||this.createSyncBufferGroup(t,r,e);t.buffer.update(),i(r.uniformData,t.uniforms,this.renderer,tn,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,r.uniformBufferBindings[e])}createSyncBufferGroup(t,e,r){const{gl:i}=this.renderer;this.renderer.buffer.bind(t.buffer);const s=this.gl.getUniformBlockIndex(e.program,r);e.uniformBufferBindings[r]=this.shader.uniformBindCount,i.uniformBlockBinding(e.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const n=this.getSignature(t,this.shader.program.uniformData,"ubo");let o=this._uboCache[n];if(o||(o=this._uboCache[n]=function(t,e){if(!t.autoManage)return{size:0,syncFunc:qs};const r=function(t,e){const r=[];for(const i in t)e[i]&&r.push(e[i]);return r.sort(((t,e)=>t.index-e.index)),r}(t.uniforms,e),{uboElements:i,size:s}=function(t){const e=t.map((t=>({data:t,offset:0,dataLen:0,dirty:0})));let r=0,i=0,s=0;for(let t=0;t<e.length;t++){const n=e[t];if(r=Zs[n.data.type],n.data.size>1&&(r=Math.max(r,16)*n.data.size),n.dataLen=r,i%r!=0&&i<16){const t=i%r%16;i+=t,s+=t}i+r>16?(s=16*Math.ceil(s/16),n.offset=s,s+=r,i=r):(n.offset=s,i+=r,s+=r)}return s=16*Math.ceil(s/16),{uboElements:e,size:s}}(r),n=["\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    "];for(let e=0;e<i.length;e++){const r=i[e],s=t.uniforms[r.data.name],o=r.data.name;let a=!1;for(let t=0;t<Ri.length;t++){const e=Ri[t];if(e.codeUbo&&e.test(r.data,s)){n.push(`offset = ${r.offset/4};`,Ri[t].codeUbo(r.data.name,s)),a=!0;break}}if(!a)if(r.data.size>1){const t=Li(r.data.type),e=Math.max(Zs[r.data.type]/16,1),i=t/e,s=(4-i%4)%4;n.push(`\n                cv = ud.${o}.value;\n                v = uv.${o};\n                offset = ${r.offset/4};\n\n                t = 0;\n\n                for(var i=0; i < ${r.data.size*e}; i++)\n                {\n                    for(var j = 0; j < ${i}; j++)\n                    {\n                        data[offset++] = v[t++];\n                    }\n                    offset += ${s};\n                }\n\n                `)}else{const t=Ks[r.data.type];n.push(`\n                cv = ud.${o}.value;\n                v = uv.${o};\n                offset = ${r.offset/4};\n                ${t};\n                `)}}return n.push("\n       renderer.buffer.update(buffer);\n    "),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join("\n"))}}(t,this.shader.program.uniformData)),t.autoManage){const e=new Float32Array(o.size/4);t.buffer.update(e)}return e.uniformGroups[t.id]=o.syncFunc,e.uniformGroups[t.id]}getSignature(t,e,r){const i=t.uniforms,s=[`${r}-`];for(const t in i)s.push(t),e[t]&&s.push(e[t].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const e=this.gl,r=t.program,i=function(t,e){const r=Xs(t,t.VERTEX_SHADER,e.vertexSrc),i=Xs(t,t.FRAGMENT_SHADER,e.fragmentSrc),s=t.createProgram();t.attachShader(s,r),t.attachShader(s,i);const n=e.extra?.transformFeedbackVaryings;if(n&&("function"!=typeof t.transformFeedbackVaryings?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(s,n.names,"separate"===n.bufferMode?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||function(t,e,r,i){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||Ys(t,r),t.getShaderParameter(i,t.COMPILE_STATUS)||Ys(t,i),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,s,r,i),e.attributeData=function(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let s=0;s<i;s++){const i=e.getActiveAttrib(t,s);if(i.name.startsWith("gl_"))continue;const n=ki(e,i.type),o={type:n,name:i.name,size:Li(n),location:e.getAttribLocation(t,i.name)};r[i.name]=o}return r}(s,t),e.uniformData=function(t,e){const r={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<i;s++){const i=e.getActiveUniform(t,s),n=i.name.replace(/\[.*?\]$/,""),o=!!i.name.match(/\[.*?\]$/),a=ki(e,i.type);r[n]={name:n,index:s,type:a,size:i.size,isArray:o,value:Ws(a,i.size)}}return r}(s,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const r=Object.keys(e.attributeData);r.sort(((t,e)=>t>e?1:-1));for(let i=0;i<r.length;i++)e.attributeData[r[i]].location=i,t.bindAttribLocation(s,i,r[i]);t.linkProgram(s)}t.deleteShader(r),t.deleteShader(i);const o={};for(const r in e.uniformData){const i=e.uniformData[r];o[r]={location:t.getUniformLocation(s,r),value:Ws(i.type,i.size)}}return new $s(s,o)}(e,r);return r.glPrograms[this.renderer.CONTEXT_UID]=i,i}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}en.extension={type:Or.RendererSystem,name:"shader"},Nr.add(en);class rn{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.4.3 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}rn.defaultOptions={hello:!1},rn.extension={type:[Or.RendererSystem,Or.CanvasRendererSystem],name:"startup"},Nr.add(rn);const sn=class t{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=he.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 Gr,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=function(t,e=[]){return e[he.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.ADD]=[t.ONE,t.ONE],e[he.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.NONE]=[0,0],e[he.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[he.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[he.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[he.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[he.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[he.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[he.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[he.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[he.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[he.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[he.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,r=0;for(;e;)1&e&&this.map[r].call(this,!!(t.data&1<<r)),e>>=1,r++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(e){this.updateCheck(t.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(t.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const 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))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const r=this.checks.indexOf(t);e&&-1===r?this.checks.push(t):!e&&-1!==r&&this.checks.splice(r,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};sn.extension={type:Or.RendererSystem,name:"state"};let nn=sn;Nr.add(nn);class on extends Re{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){this.addRunners(...t.runners);const e=(t.priority??[]).filter((e=>t.systems[e])),r=[...e,...Object.keys(t.systems).filter((t=>!e.includes(t)))];for(const e of r)this.addSystem(t.systems[e],e)}addRunners(...t){t.forEach((t=>{this.runners[t]=new Vr(t)}))}addSystem(t,e){const r=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=r,this._systemsHash[e]=r;for(const t in this.runners)this.runners[t].add(r);return this}emitWithCustomOptions(t,e){const r=Object.keys(this._systemsHash);t.items.forEach((i=>{const s=r.find((t=>this._systemsHash[t]===i));i[t.name](e[s])}))}destroy(){Object.values(this.runners).forEach((t=>{t.destroy()})),this._systemsHash={}}}const an=class t{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=t.defaultMaxIdle,this.checkCountMax=t.defaultCheckCountMax,this.mode=t.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==ve.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let r=!1;for(let i=0;i<e.length;i++){const s=e[i];s.resource&&this.count-s.touched>this.maxIdle&&(t.destroyTexture(s,!0),e[i]=null,r=!0)}if(r){let t=0;for(let r=0;r<e.length;r++)null!==e[r]&&(e[t++]=e[r]);e.length=t}}unload(t){const e=this.renderer.texture,r=t._texture;r&&!r.framebuffer&&e.destroyTexture(r);for(let e=t.children.length-1;e>=0;e--)this.unload(t.children[e])}destroy(){this.renderer=null}};an.defaultMode=ve.AUTO,an.defaultMaxIdle=3600,an.defaultCheckCountMax=600,an.extension={type:Or.RendererSystem,name:"textureGC"};let hn=an;Nr.add(hn);class ln{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=de.UNSIGNED_BYTE,this.internalFormat=ue.RGBA,this.samplerType=0}}class un{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Yr,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){let e;return e="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?{[de.UNSIGNED_BYTE]:{[ue.RGBA]:t.RGBA8,[ue.RGB]:t.RGB8,[ue.RG]:t.RG8,[ue.RED]:t.R8,[ue.RGBA_INTEGER]:t.RGBA8UI,[ue.RGB_INTEGER]:t.RGB8UI,[ue.RG_INTEGER]:t.RG8UI,[ue.RED_INTEGER]:t.R8UI,[ue.ALPHA]:t.ALPHA,[ue.LUMINANCE]:t.LUMINANCE,[ue.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[de.BYTE]:{[ue.RGBA]:t.RGBA8_SNORM,[ue.RGB]:t.RGB8_SNORM,[ue.RG]:t.RG8_SNORM,[ue.RED]:t.R8_SNORM,[ue.RGBA_INTEGER]:t.RGBA8I,[ue.RGB_INTEGER]:t.RGB8I,[ue.RG_INTEGER]:t.RG8I,[ue.RED_INTEGER]:t.R8I},[de.UNSIGNED_SHORT]:{[ue.RGBA_INTEGER]:t.RGBA16UI,[ue.RGB_INTEGER]:t.RGB16UI,[ue.RG_INTEGER]:t.RG16UI,[ue.RED_INTEGER]:t.R16UI,[ue.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[de.SHORT]:{[ue.RGBA_INTEGER]:t.RGBA16I,[ue.RGB_INTEGER]:t.RGB16I,[ue.RG_INTEGER]:t.RG16I,[ue.RED_INTEGER]:t.R16I},[de.UNSIGNED_INT]:{[ue.RGBA_INTEGER]:t.RGBA32UI,[ue.RGB_INTEGER]:t.RGB32UI,[ue.RG_INTEGER]:t.RG32UI,[ue.RED_INTEGER]:t.R32UI,[ue.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[de.INT]:{[ue.RGBA_INTEGER]:t.RGBA32I,[ue.RGB_INTEGER]:t.RGB32I,[ue.RG_INTEGER]:t.RG32I,[ue.RED_INTEGER]:t.R32I},[de.FLOAT]:{[ue.RGBA]:t.RGBA32F,[ue.RGB]:t.RGB32F,[ue.RG]:t.RG32F,[ue.RED]:t.R32F,[ue.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[de.HALF_FLOAT]:{[ue.RGBA]:t.RGBA16F,[ue.RGB]:t.RGB16F,[ue.RG]:t.RG16F,[ue.RED]:t.R16F},[de.UNSIGNED_SHORT_5_6_5]:{[ue.RGB]:t.RGB565},[de.UNSIGNED_SHORT_4_4_4_4]:{[ue.RGBA]:t.RGBA4},[de.UNSIGNED_SHORT_5_5_5_1]:{[ue.RGBA]:t.RGB5_A1},[de.UNSIGNED_INT_2_10_10_10_REV]:{[ue.RGBA]:t.RGB10_A2,[ue.RGBA_INTEGER]:t.RGB10_A2UI},[de.UNSIGNED_INT_10F_11F_11F_REV]:{[ue.RGB]:t.R11F_G11F_B10F},[de.UNSIGNED_INT_5_9_9_9_REV]:{[ue.RGB]:t.RGB9_E5},[de.UNSIGNED_INT_24_8]:{[ue.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[de.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[ue.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:{[de.UNSIGNED_BYTE]:{[ue.RGBA]:t.RGBA,[ue.RGB]:t.RGB,[ue.ALPHA]:t.ALPHA,[ue.LUMINANCE]:t.LUMINANCE,[ue.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[de.UNSIGNED_SHORT_5_6_5]:{[ue.RGB]:t.RGB},[de.UNSIGNED_SHORT_4_4_4_4]:{[ue.RGBA]:t.RGBA},[de.UNSIGNED_SHORT_5_5_5_1]:{[ue.RGBA]:t.RGBA}},e}(t),this.samplerTypes=function(t){let e;return e="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?{[t.RGB]:pe.FLOAT,[t.RGBA]:pe.FLOAT,[t.ALPHA]:pe.FLOAT,[t.LUMINANCE]:pe.FLOAT,[t.LUMINANCE_ALPHA]:pe.FLOAT,[t.R8]:pe.FLOAT,[t.R8_SNORM]:pe.FLOAT,[t.RG8]:pe.FLOAT,[t.RG8_SNORM]:pe.FLOAT,[t.RGB8]:pe.FLOAT,[t.RGB8_SNORM]:pe.FLOAT,[t.RGB565]:pe.FLOAT,[t.RGBA4]:pe.FLOAT,[t.RGB5_A1]:pe.FLOAT,[t.RGBA8]:pe.FLOAT,[t.RGBA8_SNORM]:pe.FLOAT,[t.RGB10_A2]:pe.FLOAT,[t.RGB10_A2UI]:pe.FLOAT,[t.SRGB8]:pe.FLOAT,[t.SRGB8_ALPHA8]:pe.FLOAT,[t.R16F]:pe.FLOAT,[t.RG16F]:pe.FLOAT,[t.RGB16F]:pe.FLOAT,[t.RGBA16F]:pe.FLOAT,[t.R32F]:pe.FLOAT,[t.RG32F]:pe.FLOAT,[t.RGB32F]:pe.FLOAT,[t.RGBA32F]:pe.FLOAT,[t.R11F_G11F_B10F]:pe.FLOAT,[t.RGB9_E5]:pe.FLOAT,[t.R8I]:pe.INT,[t.R8UI]:pe.UINT,[t.R16I]:pe.INT,[t.R16UI]:pe.UINT,[t.R32I]:pe.INT,[t.R32UI]:pe.UINT,[t.RG8I]:pe.INT,[t.RG8UI]:pe.UINT,[t.RG16I]:pe.INT,[t.RG16UI]:pe.UINT,[t.RG32I]:pe.INT,[t.RG32UI]:pe.UINT,[t.RGB8I]:pe.INT,[t.RGB8UI]:pe.UINT,[t.RGB16I]:pe.INT,[t.RGB16UI]:pe.UINT,[t.RGB32I]:pe.INT,[t.RGB32UI]:pe.UINT,[t.RGBA8I]:pe.INT,[t.RGBA8UI]:pe.UINT,[t.RGBA16I]:pe.INT,[t.RGBA16UI]:pe.UINT,[t.RGBA32I]:pe.INT,[t.RGBA32UI]:pe.UINT,[t.DEPTH_COMPONENT16]:pe.FLOAT,[t.DEPTH_COMPONENT24]:pe.FLOAT,[t.DEPTH_COMPONENT32F]:pe.FLOAT,[t.DEPTH_STENCIL]:pe.FLOAT,[t.DEPTH24_STENCIL8]:pe.FLOAT,[t.DEPTH32F_STENCIL8]:pe.FLOAT}:{[t.RGB]:pe.FLOAT,[t.RGBA]:pe.FLOAT,[t.ALPHA]:pe.FLOAT,[t.LUMINANCE]:pe.FLOAT,[t.LUMINANCE_ALPHA]:pe.FLOAT,[t.DEPTH_STENCIL]:pe.FLOAT},e}(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let t=0;t<e;t++)this.boundTextures[t]=null;this.emptyTextures={};const r=new ln(t.createTexture());t.bindTexture(t.TEXTURE_2D,r.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]=r,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new ln(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(let e=0;e<6;e++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,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(let t=0;t<this.boundTextures.length;t++)this.bind(null,t)}bind(t,e=0){const{gl:r}=this;if(t=t?.castToBaseTexture(),t?.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;const 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)):i.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(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}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture}unbind(t){const{gl:e,boundTextures:r}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let t=0;t<r.length;t++)r[t]===this.unknownTexture&&this.bind(null,t)}for(let 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)}ensureSamplerType(t){const{boundTextures:e,hasIntegerTextures:r,CONTEXT_UID:i}=this;if(r)for(let r=t-1;r>=0;--r){const t=e[r];t&&t._glTextures[i].samplerType!==pe.FLOAT&&this.renderer.texture.unbind(t)}}initTexture(t){const e=new ln(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){e.internalFormat=this.internalFormats[t.type]?.[t.format]??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??pe.FLOAT,2===this.webGLVersion&&t.type===de.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){const e=t._glTextures[this.CONTEXT_UID];if(!e)return;const r=this.renderer;if(this.initTextureType(t,e),t.resource?.upload(r,t,e))e.samplerType!==pe.FLOAT&&(this.hasIntegerTextures=!0);else{const i=t.realWidth,s=t.realHeight,n=r.gl;(e.width!==i||e.height!==s||e.dirtyId<0)&&(e.width=i,e.height=s,n.texImage2D(t.target,0,e.internalFormat,i,s,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:r}=this;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)){const e=this.managedTextures.indexOf(t);-1!==e&&xr(this.managedTextures,e,1)}}updateTextureStyle(t){const e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==ge.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=me.CLAMP,t.resource?.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const r=this.gl;if(e.mipmap&&t.mipmap!==ge.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===fe.LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);const e=this.renderer.context.extensions.anisotropicFiltering;if(e&&t.anisotropicLevel>0&&t.scaleMode===fe.LINEAR){const i=Math.min(t.anisotropicLevel,r.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY_EXT,i)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===fe.LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===fe.LINEAR?r.LINEAR:r.NEAREST)}destroy(){this.renderer=null}}un.extension={type:Or.RendererSystem,name:"texture"},Nr.add(un);class cn{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glTransformFeedbacks[r]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:r,renderer:i}=this;e&&i.shader.bind(e),r.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:r,CONTEXT_UID:i}=this,s=e.createTransformFeedback();t._glTransformFeedbacks[i]=s,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,s);for(let s=0;s<t.buffers.length;s++){const n=t.buffers[s];n&&(r.buffer.update(n),n._glBuffers[i].refCount++,e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER,s,n._glBuffers[i].buffer||null))}return e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null),t.disposeRunner.add(this),s}disposeTransformFeedback(t,e){const r=t._glTransformFeedbacks[this.CONTEXT_UID],i=this.gl;t.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let r=0;r<t.buffers.length;r++){const i=t.buffers[r];if(!i)continue;const n=i._glBuffers[this.CONTEXT_UID];n&&(n.refCount--,0===n.refCount&&!e&&s.dispose(i,e))}r&&(e||i.deleteTransformFeedback(r),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}cn.extension={type:Or.RendererSystem,name:"transformFeedback"},Nr.add(cn);class dn{constructor(t){this.renderer=t}init(t){this.screen=new ci(0,0,t.width,t.height),this.element=t.view||Se.ADAPTER.createCanvas(),this.resolution=t.resolution||Se.RESOLUTION,this.autoDensity=!!t.autoDensity}resizeView(t,e){this.element.width=Math.round(t*this.resolution),this.element.height=Math.round(e*this.resolution);const r=this.element.width/this.resolution,i=this.element.height/this.resolution;this.screen.width=r,this.screen.height=i,this.autoDensity&&(this.element.style.width=`${r}px`,this.element.style.height=`${i}px`),this.renderer.emit("resize",r,i),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(t){t&&this.element.parentNode?.removeChild(this.element),this.renderer=null,this.element=null,this.screen=null}}dn.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},dn.extension={type:[Or.RendererSystem,Or.CanvasRendererSystem],name:"_view"},Nr.add(dn),Se.PREFER_ENV=ne.WEBGL2,Se.STRICT_TEXTURE_CACHE=!1,Se.RENDER_OPTIONS={...is.defaultOptions,...ts.defaultOptions,...dn.defaultOptions,...rn.defaultOptions},Object.defineProperties(Se,{WRAP_MODE:{get:()=>Yr.defaultOptions.wrapMode,set(t){Ie("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),Yr.defaultOptions.wrapMode=t}},SCALE_MODE:{get:()=>Yr.defaultOptions.scaleMode,set(t){Ie("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),Yr.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get:()=>Yr.defaultOptions.mipmap,set(t){Ie("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),Yr.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get:()=>Yr.defaultOptions.anisotropicLevel,set(t){Ie("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),Yr.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get:()=>(Ie("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Ji.defaultResolution),set(t){Ji.defaultResolution=t}},FILTER_MULTISAMPLE:{get:()=>(Ie("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Ji.defaultMultisample),set(t){Ji.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get:()=>Zi.defaultMaxTextures,set(t){Ie("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),Zi.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get:()=>Zi.defaultBatchSize,set(t){Ie("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),Zi.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get:()=>Zi.canUploadSameBuffer,set(t){Ie("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),Zi.canUploadSameBuffer=t}},GC_MODE:{get:()=>hn.defaultMode,set(t){Ie("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),hn.defaultMode=t}},GC_MAX_IDLE:{get:()=>hn.defaultMaxIdle,set(t){Ie("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),hn.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get:()=>hn.defaultCheckCountMax,set(t){Ie("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),hn.defaultCheckCountMax=t}},PRECISION_VERTEX:{get:()=>Vi.defaultVertexPrecision,set(t){Ie("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Vi.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get:()=>Vi.defaultFragmentPrecision,set(t){Ie("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Vi.defaultFragmentPrecision=t}}});var pn=(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",t))(pn||{});class fn{constructor(t,e=null,r=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=r,this.once=i}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(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);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const mn=class t{constructor(){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 fn(null,null,1/0),this.deltaMS=1/t.targetFPMS,this.elapsedMS=1/t.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=pn.NORMAL){return this._addListener(new fn(t,e,r))}addOnce(t,e,r=pn.NORMAL){return this._addListener(new fn(t,e,r,!0))}_addListener(t){let 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}remove(t,e){let r=this._head.next;for(;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let r;if(e>this.lastTime){if(r=this.elapsedMS=e-this.lastTime,r>this._maxElapsedMS&&(r=this._maxElapsedMS),r*=this.speed,this._minElapsedMS){const t=e-this._lastFrame|0;if(t<this._minElapsedMS)return;this._lastFrame=e-t%this._minElapsedMS}this.deltaMS=r,this.deltaTime=this.deltaMS*t.targetFPMS;const i=this._head;let s=i.next;for(;s;)s=s.emit(this.deltaTime);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const r=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,r)/1e3,t.targetFPMS);this._maxElapsedMS=1/i}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(0===t)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!t._shared){const e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared}static get system(){if(!t._system){const e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system}};mn.targetFPMS=.06;let gn=mn;Object.defineProperties(Se,{TARGET_FPMS:{get:()=>gn.targetFPMS,set(t){Ie("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),gn.targetFPMS=t}}});class yn{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,pn.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?gn.shared:new gn,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}yn.extension=Or.Application,Nr.add(yn);const _n=[];Nr.handleByList(Or.Renderer,_n);const vn="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";class xn{constructor(t){this.renderer=t}contextChange(t){let e;if(1===this.renderer.context.webGLVersion){const r=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,r)}else{const r=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,r)}e>=Te.HIGH?this.multisample=Te.HIGH:e>=Te.MEDIUM?this.multisample=Te.MEDIUM:e>=Te.LOW?this.multisample=Te.LOW:this.multisample=Te.NONE}destroy(){}}xn.extension={type:Or.RendererSystem,name:"_multisample"},Nr.add(xn);class bn{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Tn{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glBuffers[r]||this.createGLBuffer(t);e.bindBuffer(t.type,i.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:r,CONTEXT_UID:i}=this;if(this.boundBufferBases[e]!==t){const s=t._glBuffers[i]||this.createGLBuffer(t);this.boundBufferBases[e]=t,r.bindBufferBase(r.UNIFORM_BUFFER,e,s.buffer)}}bindBufferRange(t,e,r){const{gl:i,CONTEXT_UID:s}=this;r=r||0;const n=t._glBuffers[s]||this.createGLBuffer(t);i.bindBufferRange(i.UNIFORM_BUFFER,e||0,n.buffer,256*r,256)}update(t){const{gl:e,CONTEXT_UID:r}=this,i=t._glBuffers[r]||this.createGLBuffer(t);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{const r=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;i.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,r)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const 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])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let r=0;r<e.length;r++)this.dispose(this.managedBuffers[e[r]],t)}createGLBuffer(t){const{CONTEXT_UID:e,gl:r}=this;return t._glBuffers[e]=new bn(r.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]}}Tn.extension={type:Or.RendererSystem,name:"buffer"},Nr.add(Tn);class En{constructor(t){this.renderer=t}render(t,e){const r=this.renderer;let i,s,n,o;if(e&&(i=e.renderTexture,s=e.clear,n=e.transform,o=e.skipUpdateTransform),this.renderingToScreen=!i,r.runners.prerender.emit(),r.emit("prerender"),r.projection.transform=n,!r.context.isLost){if(i||(this.lastObjectRendered=t),!o){const e=t.enableTempParent();t.updateTransform(),t.disableTempParent(e)}r.renderTexture.bind(i),r.batch.currentRenderer.start(),(s??r.background.clearBeforeRender)&&r.renderTexture.clear(),t.render(r),r.batch.currentRenderer.flush(),i&&(e.blit&&r.framebuffer.blit(),i.baseTexture.update()),r.runners.postrender.emit(),r.projection.transform=null,r.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}En.extension={type:Or.RendererSystem,name:"objectRenderer"},Nr.add(En);const An=class t extends on{constructor(e){super(),this.type=oe.WEBGL,e=Object.assign({},Se.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new Xi({projectionMatrix:new gi},!0);const r={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:t.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(r),"useContextAlpha"in e&&(Ie("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&"notMultiplied"!==e.useContextAlpha,e.backgroundAlpha=!1===e.useContextAlpha?1:e.backgroundAlpha),this._plugin.rendererPlugins=t.__plugins,this.options=e,this.startup.run(this.options)}static test(t){return!t?.forceCanvas&&(typeof Ne>"u"&&(Ne=function(){const t={stencil:!0,failIfMajorPerformanceCaveat:Se.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Se.ADAPTER.getWebGLRenderingContext())return!1;const e=Se.ADAPTER.createCanvas();let r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);const i=!!r?.getContextAttributes()?.stencil;if(r){const t=r.getExtension("WEBGL_lose_context");t&&t.loseContext()}return r=null,i}catch{return!1}}()),Ne)}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return Ie("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return Ie("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return Ie("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return Ie("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){Ie("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return Ie("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){Ie("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return Ie("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};An.extension={type:Or.Renderer,priority:1},An.__plugins={},An.__systems={};let Sn=An;Nr.handleByMap(Or.RendererPlugin,Sn.__plugins),Nr.handleByMap(Or.RendererSystem,Sn.__systems),Nr.add(Sn);class wn extends $r{constructor(t,e){const{width:r,height:i}=e||{};super(r,i),this.items=[],this.itemDirtyIds=[];for(let e=0;e<t;e++){const t=new Yr;this.items.push(t),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,e){for(let r=0;r<this.length;r++)t[r]&&(t[r].castToBaseTexture?this.addBaseTextureAt(t[r].castToBaseTexture(),r):t[r]instanceof $r?this.addResourceAt(t[r],r):this.addResourceAt(jr(t[r],e),r))}dispose(){for(let t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(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}bind(t){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");super.bind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=t,this.items[e].on("update",t.update,t)}unbind(t){super.unbind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=null,this.items[e].off("update",t.update,t)}load(){if(this._load)return this._load;const t=this.items.map((t=>t.resource)).filter((t=>t)).map((t=>t.load()));return this._load=Promise.all(t).then((()=>{const{realWidth:t,realHeight:e}=this.items[0];return this.resize(t,e),this.update(),Promise.resolve(this)})),this._load}}const Pn=class t extends wn{constructor(e,r){const{width:i,height:s,autoLoad:n,linkBaseTexture:o}=r||{};if(e&&e.length!==t.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:i,height:s});for(let e=0;e<t.SIDES;e++)this.items[e].target=ce.TEXTURE_CUBE_MAP_POSITIVE_X+e;this.linkBaseTexture=!1!==o,e&&this.initFromArray(e,r),!1!==n&&this.load()}bind(t){super.bind(t),t.target=ce.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,r){if(void 0===r&&(r=this.linkBaseTexture),!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=ce.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}upload(e,r,i){const s=this.itemDirtyIds;for(let n=0;n<t.SIDES;n++){const t=this.items[n];(s[n]<t.dirtyId||i.dirtyId<r.dirtyId)&&(t.valid&&t.resource?(t.resource.upload(e,t,i),s[n]=t.dirtyId):s[n]<-1&&(e.gl.texImage2D(t.target,0,i.internalFormat,r.realWidth,r.realHeight,0,r.format,i.type,null),s[n]=-1))}return!0}static test(e){return Array.isArray(e)&&e.length===t.SIDES}};Pn.SIDES=6;let Rn=Pn;class Mn extends os{constructor(t,e){let r,i,s;e=e||{},"string"==typeof t?(r=Mn.EMPTY,i=t,s=!0):(r=t,i=null,s=!1),super(r),this.url=i,this.crossOrigin=e.crossOrigin??!0,this.alphaMode="number"==typeof e.alphaMode?e.alphaMode:null,this.ownsImageBitmap=e.ownsImageBitmap??s,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise((async(t,e)=>{if(null!==this.url)try{const e=await Se.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const r=await e.blob();if(this.destroyed)return;const i=await createImageBitmap(r,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===ye.UNPACK?"premultiply":"none"});if(this.destroyed)return void i.close();this.source=i,this.update(),t(this)}catch(t){if(this.destroyed)return;e(t),this.onError.emit(t)}else t(this)}))),this._load}upload(t,e,r){return this.source instanceof ImageBitmap?("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),super.upload(t,e,r)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&("string"==typeof t||t instanceof ImageBitmap)}static get EMPTY(){return Mn._EMPTY=Mn._EMPTY??Se.ADAPTER.createCanvas(0,0),Mn._EMPTY}}const Cn=class t extends os{constructor(t,e){e=e||{},super(Se.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise((e=>{if(this._resolve=()=>{this.update(),e(this)},t.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}))),this._load}_loadSvg(){const t=new Image;os.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,r=t.height;if(!e||!r)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let i=e*this.scale,s=r*this.scale;(this._overrideWidth||this._overrideHeight)&&(i=this._overrideWidth||this._overrideHeight/r*e,s=this._overrideHeight||this._overrideWidth/e*r),i=Math.round(i),s=Math.round(s);const n=this.source;n.width=i,n.height=s,n._pixiId=`canvas_${Er()}`,n.getContext("2d").drawImage(t,0,0,e,r,0,0,i,s),this._resolve(),this._resolve=null}}static getSize(e){const r=t.SVG_SIZE.exec(e),i={};return r&&(i[r[1]]=Math.round(parseFloat(r[3])),i[r[5]]=Math.round(parseFloat(r[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,r){return"svg"===r||"string"==typeof e&&e.startsWith("data:image/svg+xml")||"string"==typeof e&&t.SVG_XML.test(e)}};Cn.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Cn.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let In=Cn;const Dn=class t extends os{constructor(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){const i=document.createElement("video");!1!==r.autoLoad&&i.setAttribute("preload","auto"),!1!==r.playsinline&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),!0===r.muted&&(i.setAttribute("muted",""),i.muted=!0),!0===r.loop&&i.setAttribute("loop",""),!1!==r.autoPlay&&i.setAttribute("autoplay",""),"string"==typeof e&&(e=[e]);const s=e[0].src||e[0];os.crossOrigin(i,s,r.crossorigin);for(let r=0;r<e.length;++r){const s=document.createElement("source");let{src:n,mime:o}=e[r];if(n=n||e[r],n.startsWith("data:"))o=n.slice(5,n.indexOf(";"));else if(!n.startsWith("blob:")){const e=n.split("?").shift().toLowerCase(),r=e.slice(e.lastIndexOf(".")+1);o=o||t.MIME_TYPES[r]||`video/${r}`}s.src=n,o&&(s.type=o),i.appendChild(s)}e=i}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=r.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==r.autoPlay,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),!1!==r.autoLoad&&this.load()}update(t=0){if(!this.destroyed){if(this._updateFPS){const t=gn.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise(((e,r)=>{this.valid?e(this):(this._resolve=e,this._reject=r,t.load())})),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!e&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._configureAutoUpdate();const t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(gn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(gn.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(gn.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,r){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.includes(r)}};Dn.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Dn.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let On=Dn;Hr.push(Mn,as,class extends os{constructor(t){super(t)}static test(t){const{OffscreenCanvas:e}=globalThis;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}},On,class extends os{constructor(t){super(t)}static test(t){return!!globalThis.VideoFrame&&t instanceof globalThis.VideoFrame}},In,Xr,Rn,class extends wn{constructor(t,e){const{width:r,height:i}=e||{};let s,n;Array.isArray(t)?(s=t,n=t.length):n=t,super(n,{width:r,height:i}),s&&this.initFromArray(s,e)}addBaseTextureAt(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this}bind(t){super.bind(t),t.target=ce.TEXTURE_2D_ARRAY}upload(t,e,r){const{length:i,itemDirtyIds:s,items:n}=this,{gl:o}=t;r.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,r.internalFormat,this._width,this._height,i,0,e.format,r.type,null);for(let t=0;t<i;t++){const i=n[t];s[t]<i.dirtyId&&(s[t]=i.dirtyId,i.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,t,i.resource.width,i.resource.height,1,e.format,r.type,i.resource.source))}return!0}});class Bn{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?ci.EMPTY:((t=t||new ci(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(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)}addPointMatrix(t,e){const{a:r,b:i,c:s,d:n,tx:o,ty:a}=t,h=r*e.x+s*e.y+o,l=i*e.x+n*e.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)}addQuad(t){let e=this.minX,r=this.minY,i=this.maxX,s=this.maxY,n=t[0],o=t[1];e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,n=t[2],o=t[3],e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,n=t[4],o=t[5],e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,n=t[6],o=t[7],e=n<e?n:e,r=o<r?o:r,i=n>i?n:i,s=o>s?o:s,this.minX=e,this.minY=r,this.maxX=i,this.maxY=s}addFrame(t,e,r,i,s){this.addFrameMatrix(t.worldTransform,e,r,i,s)}addFrameMatrix(t,e,r,i,s){const n=t.a,o=t.b,a=t.c,h=t.d,l=t.tx,u=t.ty;let c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,m=n*e+a*r+l,g=o*e+h*r+u;c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,m=n*i+a*r+l,g=o*i+h*r+u,c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,m=n*e+a*s+l,g=o*e+h*s+u,c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,m=n*i+a*s+l,g=o*i+h*s+u,c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,this.minX=c,this.minY=d,this.maxX=p,this.maxY=f}addVertexData(t,e,r){let i=this.minX,s=this.minY,n=this.maxX,o=this.maxY;for(let a=e;a<r;a+=2){const e=t[a],r=t[a+1];i=e<i?e:i,s=r<s?r:s,n=e>n?e:n,o=r>o?r:o}this.minX=i,this.minY=s,this.maxX=n,this.maxY=o}addVertices(t,e,r,i){this.addVerticesMatrix(t.worldTransform,e,r,i)}addVerticesMatrix(t,e,r,i,s=0,n=s){const o=t.a,a=t.b,h=t.c,l=t.d,u=t.tx,c=t.ty;let d=this.minX,p=this.minY,f=this.maxX,m=this.maxY;for(let t=r;t<i;t+=2){const r=e[t],i=e[t+1],g=o*r+h*i+u,y=l*i+a*r+c;d=Math.min(d,g-s),f=Math.max(f,g+s),p=Math.min(p,y-n),m=Math.max(m,y+n)}this.minX=d,this.minY=p,this.maxX=f,this.maxY=m}addBounds(t){const e=this.minX,r=this.minY,i=this.maxX,s=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>s?t.maxY:s}addBoundsMask(t,e){const r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,s=t.maxX<e.maxX?t.maxX:e.maxX,n=t.maxY<e.maxY?t.maxY:e.maxY;if(r<=s&&i<=n){const t=this.minX,e=this.minY,o=this.maxX,a=this.maxY;this.minX=r<t?r:t,this.minY=i<e?i:e,this.maxX=s>o?s:o,this.maxY=n>a?n:a}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,s=t.maxX<e.x+e.width?t.maxX:e.x+e.width,n=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(r<=s&&i<=n){const t=this.minX,e=this.minY,o=this.maxX,a=this.maxY;this.minX=r<t?r:t,this.minY=i<e?i:e,this.maxX=s>o?s:o,this.maxY=n>a?n:a}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,r,i,s,n){t-=s,e-=n,r+=s,i+=n,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}}class Ln extends Re{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Pi,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Bn,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let r=0;r<e.length;++r){const i=e[r];Object.defineProperty(Ln.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(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 ci),e=this._boundsRect),this._bounds.getRectangle(e)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new ci),t=this._localBoundsRect),this._localBounds||(this._localBounds=new Bn);const e=this.transform,r=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=r?.worldAlpha??1,this.transform=this._tempDisplayObjectParent.transform;const i=this._bounds,s=this._boundsID;this._bounds=this._localBounds;const n=this.getBounds(!1,t);return this.parent=r,this.transform=e,this._bounds=i,this._bounds.updateID+=this._boundsID-s,n}toGlobal(t,e,r=!1){return r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)}toLocal(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)}setParent(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t}removeFromParent(){this.parent?.removeChild(this)}setTransform(t=0,e=0,r=1,i=1,s=0,n=0,o=0,a=0,h=0){return this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=i||1,this.rotation=s,this.skew.x=n,this.skew.y=o,this.pivot.x=a,this.pivot.y=h,this}destroy(t){this.removeFromParent(),this._destroyed=!0,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.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new Nn),this.tempDisplayObjectParent}enableTempParent(){const t=this.parent;return this.parent=this._tempDisplayObjectParent,t}disableTempParent(t){this.parent=t}get x(){return this.position.x}set x(t){this.transform.position.x=t}get y(){return this.position.y}set y(t){this.transform.position.y=t}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(t){this.transform.position.copyFrom(t)}get scale(){return this.transform.scale}set scale(t){this.transform.scale.copyFrom(t)}get pivot(){return this.transform.pivot}set pivot(t){this.transform.pivot.copyFrom(t)}get skew(){return this.transform.skew}set skew(t){this.transform.skew.copyFrom(t)}get rotation(){return this.transform.rotation}set rotation(t){this.transform.rotation=t}get angle(){return this.transform.rotation*oi}set angle(t){this.transform.rotation=t*ai}get zIndex(){return this._zIndex}set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.parent&&(this.parent.sortDirty=!0))}get worldVisible(){let t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}get mask(){return this._mask}set mask(t){if(this._mask!==t){if(this._mask){const t=this._mask.isMaskData?this._mask.maskObject:this._mask;t&&(t._maskRefCount--,0===t._maskRefCount&&(t.renderable=!0,t.isMask=!1))}if(this._mask=t,this._mask){const t=this._mask.isMaskData?this._mask.maskObject:this._mask;t&&(0===t._maskRefCount&&(t.renderable=!1,t.isMask=!0),t._maskRefCount++)}}}}class Nn extends Ln{constructor(){super(...arguments),this.sortDirty=null}}Ln.prototype.displayObjectUpdateTransform=Ln.prototype.updateTransform;const Fn=new gi;function kn(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const Un=class t extends Ln{constructor(){super(),this.children=[],this.sortableChildren=t.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(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}swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}getChildIndex(t){const e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const r=this.getChildIndex(t);xr(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],r=this.children.indexOf(e);if(-1===r)return null;e.parent=null,e.transform._parentID=-1,xr(this.children,r,1),this._boundsID++,this.onChildrenChange(r),e.emit("removed",this),this.emit("childRemoved",e,this,r)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,xr(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const r=t,i=e-r;let s;if(i>0&&i<=e){s=this.children.splice(r,i);for(let t=0;t<s.length;++t)s[t].parent=null,s[t].transform&&(s[t].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let t=0;t<s.length;++t)s[t].emit("removed",this),this.emit("childRemoved",s[t],this,t);return s}if(0===i&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,r=this.children.length;e<r;++e){const r=this.children[e];r._lastSortedIndex=e,!t&&0!==r.zIndex&&(t=!0)}t&&this.children.length>1&&this.children.sort(kn),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t){const e=this.children[t];e.visible&&e.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){const t=e._mask.isMaskData?e._mask.maskObject:e._mask;t?(t.calculateBounds(),this._bounds.addBoundsMask(e._bounds,t._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const r=super.getLocalBounds(t);if(!e)for(let t=0,e=this.children.length;t<e;++t){const e=this.children[t];e.visible&&e.updateTransform()}return r}_calculateBounds(){}_renderWithCulling(e){const r=e.renderTexture.sourceFrame;if(!(r.width>0&&r.height>0))return;let i,s;this.cullArea?(i=this.cullArea,s=this.worldTransform):this._render!==t.prototype._render&&(i=this.getBounds(!0));const n=e.projection.transform;if(n&&(s?(s=Fn.copyFrom(s),s.prepend(n)):s=n),i&&r.intersects(i,s))this._render(e);else if(this.cullArea)return;for(let t=0,r=this.children.length;t<r;++t){const r=this.children[t],i=r.cullable;r.cullable=i||!this.cullArea,r.render(e),r.cullable=i}}render(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters?.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}}renderAdvanced(t){const e=this.filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let t=0;t<e.length;t++)e[t].enabled&&this._enabledFilters.push(e[t])}const i=e&&this._enabledFilters?.length||r&&(!r.isMaskData||r.enabled&&(r.autoDetect||r.type!==be.NONE));if(i&&t.batch.flush(),e&&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);for(let e=0,r=this.children.length;e<r;++e)this.children[e].render(t)}i&&t.batch.flush(),r&&t.mask.pop(this),e&&this._enabledFilters?.length&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e="boolean"==typeof t?t:t?.children,r=this.removeChildren(0,this.children.length);if(e)for(let e=0;e<r.length;++e)r[e].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}};Un.defaultSortableChildren=!1;let Gn=Un;Gn.prototype.containerUpdateTransform=Gn.prototype.updateTransform,Object.defineProperties(Se,{SORTABLE_CHILDREN:{get:()=>Gn.defaultSortableChildren,set(t){Ie("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),Gn.defaultSortableChildren=t}}});const Hn=new li,jn=new Uint16Array([0,1,2,0,2,3]);class Vn extends Gn{constructor(t){super(),this._anchor=new Si(this._onAnchorUpdate,this,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new pr(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=he.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||cs.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=jn,this.pluginName="batch",this.isSprite=!0,this._roundPixels=Se.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=br(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=br(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const t=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===t._updateID)return;this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;const e=this.transform.worldTransform,r=e.a,i=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,h=this.vertexData,l=t.trim,u=t.orig,c=this._anchor;let d=0,p=0,f=0,m=0;if(l?(p=l.x-c._x*u.width,d=p+l.width,m=l.y-c._y*u.height,f=m+l.height):(p=-c._x*u.width,d=p+u.width,m=-c._y*u.height,f=m+u.height),h[0]=r*p+s*m+o,h[1]=n*m+i*p+a,h[2]=r*d+s*m+o,h[3]=n*m+i*d+a,h[4]=r*d+s*f+o,h[5]=n*f+i*d+a,h[6]=r*p+s*f+o,h[7]=n*f+i*p+a,this._roundPixels){const t=Se.RESOLUTION;for(let e=0;e<h.length;++e)h[e]=Math.round(h[e]*t)/t}}calculateTrimmedVertices(){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;const t=this._texture,e=this.vertexTrimmedData,r=t.orig,i=this._anchor,s=this.transform.worldTransform,n=s.a,o=s.b,a=s.c,h=s.d,l=s.tx,u=s.ty,c=-i._x*r.width,d=c+r.width,p=-i._y*r.height,f=p+r.height;if(e[0]=n*c+a*p+l,e[1]=h*p+o*c+u,e[2]=n*d+a*p+l,e[3]=h*p+o*d+u,e[4]=n*d+a*f+l,e[5]=h*f+o*d+u,e[6]=n*c+a*f+l,e[7]=h*f+o*c+u,this._roundPixels){const t=Se.RESOLUTION;for(let r=0;r<e.length;++r)e[r]=Math.round(e[r]*t)/t}}_render(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)}_calculateBounds(){const 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))}getLocalBounds(t){return 0===this.children.length?(this._localBounds||(this._localBounds=new Bn),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),t||(this._localBoundsRect||(this._localBoundsRect=new ci),t=this._localBoundsRect),this._localBounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,Hn);const e=this._texture.orig.width,r=this._texture.orig.height,i=-e*this.anchor.x;let s=0;return Hn.x>=i&&Hn.x<i+e&&(s=-r*this.anchor.y,Hn.y>=s&&Hn.y<s+r)}destroy(t){if(super.destroy(t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.baseTexture;this._texture.destroy(!!e)}this._texture=null}static from(t,e){const r=t instanceof cs?t:cs.from(t,e);return new Vn(r)}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1,this._transformTrimmedID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){const e=br(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){const e=br(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get anchor(){return this._anchor}set anchor(t){this._anchor.copyFrom(t)}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||cs.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}const $n=new gi;Ln.prototype._cacheAsBitmap=!1,Ln.prototype._cacheData=null,Ln.prototype._cacheAsBitmapResolution=null,Ln.prototype._cacheAsBitmapMultisample=null;class Xn{constructor(){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(Ln.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(t){if(this._cacheAsBitmap===t)return;let e;this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Xn),e=this._cacheData,e.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,e.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)}}}),Ln.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},Ln.prototype._initCachedDisplayObject=function(t){if(this._cacheData?.sprite)return;const e=this.alpha;this.alpha=1,t.batch.flush();const r=this.getLocalBounds(new ci,!0);if(this.filters?.length){const t=this.filters[0].padding;r.pad(t)}const i=this.cacheAsBitmapResolution||t.resolution;r.ceil(i),r.width=Math.max(r.width,1/i),r.height=Math.max(r.height,1/i);const s=t.renderTexture.current,n=t.renderTexture.sourceFrame.clone(),o=t.renderTexture.destinationFrame.clone(),a=t.projection.transform,h=ds.create({width:r.width,height:r.height,resolution:i,multisample:this.cacheAsBitmapMultisample??t.multisample}),l=`cacheAsBitmap_${Er()}`;this._cacheData.textureCacheId=l,Yr.addToCache(h.baseTexture,l),cs.addToCache(h,l);const u=this.transform.localTransform.copyTo($n).invert().translate(-r.x,-r.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:h,clear:!0,transform:u,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=a,t.renderTexture.bind(s,n,o),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=e;const c=new Vn(h);c.transform.worldTransform=this.transform.worldTransform,c.anchor.x=-r.x/r.width,c.anchor.y=-r.y/r.height,c.alpha=e,c._bounds=this._bounds,this._cacheData.sprite=c,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=c.containsPoint.bind(c)},Ln.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},Ln.prototype._initCachedDisplayObjectCanvas=function(t){if(this._cacheData?.sprite)return;const e=this.getLocalBounds(new ci,!0),r=this.alpha;this.alpha=1;const i=t.canvasContext.activeContext,s=t._projTransform,n=this.cacheAsBitmapResolution||t.resolution;e.ceil(n),e.width=Math.max(e.width,1/n),e.height=Math.max(e.height,1/n);const o=ds.create({width:e.width,height:e.height,resolution:n}),a=`cacheAsBitmap_${Er()}`;this._cacheData.textureCacheId=a,Yr.addToCache(o.baseTexture,a),cs.addToCache(o,a);const h=$n;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=e.x,h.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:o,clear:!0,transform:h,skipUpdateTransform:!1}),t.canvasContext.activeContext=i,t._projTransform=s,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;const l=new Vn(o);l.transform.worldTransform=this.transform.worldTransform,l.anchor.x=-e.x/e.width,l.anchor.y=-e.y/e.height,l.alpha=r,l._bounds=this._bounds,this._cacheData.sprite=l,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=l.containsPoint.bind(l)},Ln.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Ln.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Ln.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,Yr.removeFromCache(this._cacheData.textureCacheId),cs.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ln.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},Ln.prototype.name=null,Gn.prototype.getChildByName=function(t,e){for(let e=0,r=this.children.length;e<r;e++)if(this.children[e].name===t)return this.children[e];if(e)for(let e=0,r=this.children.length;e<r;e++){const r=this.children[e];if(!r.getChildByName)continue;const i=r.getChildByName(t,!0);if(i)return i}return null},Ln.prototype.getGlobalPosition=function(t=new li,e=!1){return this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};const zn={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]},Wn=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{","    gl_FragColor = vec4(0.0);","    %blur%","}"].join("\n");class Yn extends Ji{constructor(t,e=8,r=4,i=Ji.defaultResolution,s=5){const n=function(t,e){const r=Math.ceil(t/2);let i,s="\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    }",n="";i=e?"vBlurTexCoords[%index%] =  textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] =  textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let e=0;e<t;e++){let t=i.replace("%index%",e.toString());t=t.replace("%sampleIndex%",e-(r-1)+".0"),n+=t,n+="\n"}return s=s.replace("%blur%",n),s=s.replace("%size%",t.toString()),s}(s,t),o=function(t){const e=zn[t],r=e.length;let i,s=Wn,n="";for(let s=0;s<t;s++){let o="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",s.toString());i=s,s>=r&&(i=t-s-1),o=o.replace("%value%",e[i].toString()),n+=o,n+="\n"}return s=s.replace("%blur%",n),s=s.replace("%size%",t.toString()),s}(s);super(n,o),this.horizontal=t,this.resolution=i,this._quality=0,this.quality=r,this.blur=e}apply(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{const s=t.getFilterTexture(),n=t.renderer;let o=e,a=s;this.state.blend=!1,t.applyFilter(this,o,a,_e.CLEAR);for(let e=1;e<this.passes-1;e++){t.bindAndClear(o,_e.BLIT),this.uniforms.uSampler=a;const e=a;a=o,o=e,n.shader.bind(this),n.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,a,r,i),t.returnFilterTexture(s)}}get blur(){return this.strength}set blur(t){this.padding=1+2*Math.abs(t),this.strength=t}get quality(){return this._quality}set quality(t){this._quality=t,this.passes=t}}class qn extends Ji{constructor(){const t={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};super(vn,"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",t),this.alpha=1}_loadMatrix(t,e=!1){let r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r}_multiply(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}_colorMatrix(t){const e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e}brightness(t,e){const 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)}tint(t,e){const[r,i,s]=pr.shared.setValue(t).toArray(),n=[r,0,0,0,0,0,i,0,0,0,0,0,s,0,0,0,0,0,1,0];this._loadMatrix(n,e)}greyscale(t,e){const 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)}blackAndWhite(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)}hue(t,e){t=(t||0)/180*Math.PI;const r=Math.cos(t),i=Math.sin(t),s=1/3,n=(0,Math.sqrt)(s),o=[r+(1-r)*s,s*(1-r)-n*i,s*(1-r)+n*i,0,0,s*(1-r)+n*i,r+s*(1-r),s*(1-r)-n*i,0,0,s*(1-r)-n*i,s*(1-r)+n*i,r+s*(1-r),0,0,0,0,0,1,0];this._loadMatrix(o,e)}contrast(t,e){const r=(t||0)+1,i=-.5*(r-1),s=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(s,e)}saturate(t=0,e){const r=2*t/3+1,i=-.5*(r-1),s=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(s,e)}desaturate(){this.saturate(-1)}negative(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)}sepia(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)}technicolor(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)}polaroid(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)}toBGR(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)}kodachrome(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)}browni(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)}vintage(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)}colorTone(t,e,r,i,s){t=t||.2,e=e||.15,r=r||16770432,i=i||3375104;const n=pr.shared,[o,a,h]=n.setValue(r).toArray(),[l,u,c]=n.setValue(i).toArray(),d=[.3,.59,.11,0,0,o,a,h,t,0,l,u,c,e,0,o-l,a-u,h-c,0,0];this._loadMatrix(d,s)}night(t,e){const 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)}predator(t,e){const 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)}lsd(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)}reset(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)}get matrix(){return this.uniforms.m}set matrix(t){this.uniforms.m=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}qn.prototype.grayscale=qn.prototype.greyscale;const Kn={AlphaFilter:class extends Ji{constructor(t=1){super("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.alpha=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}},BlurFilter:class extends Ji{constructor(t=8,e=4,r=Ji.defaultResolution,i=5){super(),this._repeatEdgePixels=!1,this.blurXFilter=new Yn(!0,t,e,r,i),this.blurYFilter=new Yn(!1,t,e,r,i),this.resolution=r,this.quality=e,this.blur=t,this.repeatEdgePixels=!1}apply(t,e,r,i){const s=Math.abs(this.blurXFilter.strength),n=Math.abs(this.blurYFilter.strength);if(s&&n){const s=t.getFilterTexture();this.blurXFilter.apply(t,e,s,_e.CLEAR),this.blurYFilter.apply(t,s,r,i),t.returnFilterTexture(s)}else n?this.blurYFilter.apply(t,e,r,i):this.blurXFilter.apply(t,e,r,i)}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))}get blur(){return this.blurXFilter.blur}set blur(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(t){this.blurXFilter.quality=this.blurYFilter.quality=t}get blurX(){return this.blurXFilter.blur}set blurX(t){this.blurXFilter.blur=t,this.updatePadding()}get blurY(){return this.blurYFilter.blur}set blurY(t){this.blurYFilter.blur=t,this.updatePadding()}get blendMode(){return this.blurYFilter.blendMode}set blendMode(t){this.blurYFilter.blendMode=t}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(t){this._repeatEdgePixels=t,this.updatePadding()}},BlurFilterPass:Yn,ColorMatrixFilter:qn,DisplacementFilter:class extends Ji{constructor(t,e){const r=new gi;t.renderable=!1,super("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:t._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=r,null==e&&(e=20),this.scale=new li(e,e)}apply(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;const s=this.maskSprite.worldTransform,n=Math.sqrt(s.a*s.a+s.b*s.b),o=Math.sqrt(s.c*s.c+s.d*s.d);0!==n&&0!==o&&(this.uniforms.rotation[0]=s.a/n,this.uniforms.rotation[1]=s.b/n,this.uniforms.rotation[2]=s.c/o,this.uniforms.rotation[3]=s.d/o),t.applyFilter(this,e,r,i)}get map(){return this.uniforms.mapSampler}set map(t){this.uniforms.mapSampler=t}},FXAAFilter:class extends Ji{constructor(){super("\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')}},NoiseFilter:class extends Ji{constructor(t=.5,e=Math.random()){super(vn,"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.noise=t,this.seed=e}get noise(){return this.uniforms.uNoise}set noise(t){this.uniforms.uNoise=t}get seed(){return this.uniforms.uSeed}set seed(t){this.uniforms.uSeed=t}}};Object.entries(Kn).forEach((([t,e])=>{Object.defineProperty(Kn,t,{get:()=>(Ie("7.1.0",`filters.${t} has moved to ${t}`),e)})}));const Zn=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(gn.system.add(this.tickerUpdate,this,pn.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(gn.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}};class Qn{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=Qn.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new li,this.page=new li,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,r){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,r,i,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class Jn extends Qn{constructor(){super(...arguments),this.client=new li,this.movement=new li,this.offset=new li,this.global=new li,this.screen=new li}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,r,i,s,n,o,a,h,l,u,c,d,p,f){throw new Error("Method not implemented.")}}class to extends Jn{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class eo extends Jn{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}eo.DOM_DELTA_PIXEL=0,eo.DOM_DELTA_LINE=1,eo.DOM_DELTA_PAGE=2;const ro=new li,io=new li;class so{constructor(t){this.dispatch=new Re,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let r=0,i=e.length;r<i;r++)e[r].fn(t);else console.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){Zn.pauseUpdate=!0;const r=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,ro.set(t,e),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(t,e){if(!t.target)return;const r=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,s=r.length-1;i<s;i++)if(t.currentTarget=r[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let i=r.length-2;i>=0;i--)if(t.currentTarget=r[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,r=this._allInteractiveElements){if(0===r.length)return;t.eventPhase=t.BUBBLING_PHASE;const i=Array.isArray(e)?e:[e];for(let e=r.length-1;e>=0;e--)i.forEach((i=>{t.currentTarget=r[e],this.notifyTarget(t,i)}))}propagationPath(t){const e=[t];for(let r=0;r<2048&&t!==this.rootTarget;r++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,r,i,s,n=!1){let o=!1;if(this._interactivePrune(t))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(Zn.pauseUpdate=!1),t.interactiveChildren&&t.children){const a=t.children;for(let h=a.length-1;h>=0;h--){const l=a[h],u=this.hitTestMoveRecursive(l,this._isInteractive(e)?e:l.eventMode,r,i,s,n||s(t,r));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const e=t.isInteractive();(u.length>0||e)&&(e&&this._allInteractiveElements.push(t),u.push(t)),0===this._hitElements.length&&(this._hitElements=u),o=!0}}}const a=this._isInteractive(e),h=t.isInteractive();return a&&h&&this._allInteractiveElements.push(t),n||this._hitElements.length>0?null:o?this._hitElements:a&&!s(t,r)&&i(t,r)?h?[t]:[]:null}hitTestRecursive(t,e,r,i,s){if(this._interactivePrune(t)||s(t,r))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(Zn.pauseUpdate=!1),t.interactiveChildren&&t.children){const n=t.children;for(let o=n.length-1;o>=0;o--){const a=n[o],h=this.hitTestRecursive(a,this._isInteractive(e)?e:a.eventMode,r,i,s);if(h){if(h.length>0&&!h[h.length-1].parent)continue;const e=t.isInteractive();return(h.length>0||e)&&h.push(t),h}}}const n=this._isInteractive(e),o=t.isInteractive();return n&&i(t,r)?o?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&!t.isMask&&t.visible&&t.renderable&&"none"!==t.eventMode&&("passive"!==t.eventMode||t.interactiveChildren)&&!t.isMask)}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,io),!t.hitArea.contains(io.x,io.y)))return!0;if(t._mask){const r=t._mask.isMaskData?t._mask.maskObject:t._mask;if(r&&!r.containsPoint?.(e))return!0}return!1}hitTestFn(t,e){return"passive"!==t.eventMode&&(!!t.hitArea||!!t.containsPoint&&t.containsPoint(e))}notifyTarget(t,e){const r=`on${e=e??t.type}`;t.currentTarget[r]?.(t);const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof to))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)this.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){const t=2===e.button;this.dispatchEvent(e,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){if(!(t instanceof to))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const r="mouse"===e.pointerType||"pen"===e.pointerType,i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.overTargets);if(i.overTargets?.length>0&&s!==e.target){const i="mousemove"===t.type?"mouseout":"pointerout",n=this.createPointerEvent(t,i,s);if(this.dispatchEvent(n,"pointerout"),r&&this.dispatchEvent(n,"mouseout"),!e.composedPath().includes(s)){const i=this.createPointerEvent(t,"pointerleave",s);for(i.eventPhase=i.AT_TARGET;i.target&&!e.composedPath().includes(i.target);)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,"mouseleave"),i.target=i.target.parent;this.freeEvent(i)}this.freeEvent(n)}if(s!==e.target){const i="mousemove"===t.type?"mouseover":"pointerover",n=this.clonePointerEvent(e,i);this.dispatchEvent(n,"pointerover"),r&&this.dispatchEvent(n,"mouseover");let o=s?.parent;for(;o&&o!==this.rootTarget.parent&&o!==e.target;)o=o.parent;if(!o||o===this.rootTarget.parent){const t=this.clonePointerEvent(e,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==s&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}const n=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?n.push("pointermove"):this.dispatchEvent(e,"pointermove"),o&&n.push("globalpointermove"),"touch"===e.pointerType&&(this.moveOnAll?n.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),o&&n.push("globaltouchmove")),r&&(this.moveOnAll?n.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),o&&n.push("globalmousemove"),this.cursor=e.target?.cursor),n.length>0&&this.all(e,n),this._allInteractiveElements.length=0,this._hitElements.length=0,i.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){if(!(t instanceof to))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),r=this.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;this.dispatchEvent(r,"pointerover"),i&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursor=r.target?.cursor);const s=this.clonePointerEvent(r,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),i&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;e.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(s)}mapPointerOut(t){if(!(t instanceof to))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId);if(e.overTargets){const r="mouse"===t.pointerType||"pen"===t.pointerType,i=this.findMountedTarget(e.overTargets),s=this.createPointerEvent(t,"pointerout",i);this.dispatchEvent(s),r&&this.dispatchEvent(s,"mouseout");const n=this.createPointerEvent(t,"pointerleave",i);for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),r&&this.notifyTarget(n,"mouseleave"),n.target=n.target.parent;e.overTargets=null,this.freeEvent(s),this.freeEvent(n)}this.cursor=null}mapPointerUp(t){if(!(t instanceof to))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=performance.now(),r=this.createPointerEvent(t);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){const t=2===r.button;this.dispatchEvent(r,t?"rightup":"mouseup")}const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]);let n=s;if(s&&!r.composedPath().includes(s)){let e=s;for(;e&&!r.composedPath().includes(e);){if(r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){const t=2===r.button;this.notifyTarget(r,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete i.pressTargetsByButton[t.button],n=e}if(n){const s=this.clonePointerEvent(r,"click");s.target=n,s.path=null,i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:s.target,timeStamp:e});const o=i.clicksByButton[t.button];if(o.target===s.target&&e-o.timeStamp<200?++o.clickCount:o.clickCount=1,o.target=s.target,o.timeStamp=e,s.detail=o.clickCount,"mouse"===s.pointerType){const t=2===s.button;this.dispatchEvent(s,t?"rightclick":"click")}else"touch"===s.pointerType&&this.dispatchEvent(s,"tap");this.dispatchEvent(s,"pointertap"),this.freeEvent(s)}this.freeEvent(r)}mapPointerUpOutside(t){if(!(t instanceof to))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),r=this.findMountedTarget(e.pressTargetsByButton[t.button]),i=this.createPointerEvent(t);if(r){let s=r;for(;s;)i.currentTarget=s,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?this.notifyTarget(i,"touchendoutside"):("mouse"===i.pointerType||"pen"===i.pointerType)&&this.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),s=s.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(i)}mapWheel(t){if(!(t instanceof eo))return void console.warn("EventBoundary cannot map a non-wheel event as a wheel event");const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let r=1;r<t.length&&t[r].parent===e;r++)e=t[r];return e}createPointerEvent(t,e,r){const i=this.allocateEvent(to);return this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=r??this.hitTest(i.global.x,i.global.y)??this._hitElements[0],"string"==typeof e&&(i.type=e),i}createWheelEvent(t){const e=this.allocateEvent(eo);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const r=this.allocateEvent(to);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=e??r.type,r}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof to&&e instanceof to&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof Jn&&e instanceof Jn&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}notifyListeners(t,e){const r=t.currentTarget._events[e];if(r&&t.currentTarget.isInteractive())if("fn"in r)r.once&&t.currentTarget.removeListener(e,r.fn,void 0,!0),r.fn.call(r.context,t);else for(let i=0,s=r.length;i<s&&!t.propagationImmediatelyStopped;i++)r[i].once&&t.currentTarget.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(r[i].context,t)}}const no={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},oo=class t{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new so(null),Zn.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new to(null),this.rootWheelEvent=new eo(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...t.defaultEventFeatures},{set:(t,e,r)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=r),t[e]=r,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:r,resolution:i}=this.renderer;this.setTargetElement(r),this.resolution=i,t._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(t){t=t||"default";let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];if(r)switch(typeof r){case"string":e&&(this.domElement.style.cursor=r);break;case"function":r(t);break;case"object":e&&Object.assign(this.domElement.style,r)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this.rootPointerEvent}onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,r=e.length;t<r;t++){const r=e[t],i=this.bootstrapEvent(this.rootPointerEvent,r);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,Zn.pointerMoved();const e=this.normalizeToPointerData(t);for(let t=0,r=e.length;t<r;t++){const r=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);const r=e!==this.domElement?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,e=i.length;t<e;t++){const e=this.bootstrapEvent(this.rootPointerEvent,i[t]);e.type+=r,this.rootBoundary.mapEvent(e)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);for(let t=0,r=e.length;t<r;t++){const r=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this.removeEvents(),this.domElement=t,Zn.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;Zn.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,!0),this.domElement.addEventListener("pointerdown",this.onPointerDown,!0),this.domElement.addEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this.onPointerOverOut,!0),globalThis.addEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,!0),this.domElement.addEventListener("mousedown",this.onPointerDown,!0),this.domElement.addEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this.onPointerOverOut,!0),globalThis.addEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this.onPointerDown,!0),this.domElement.addEventListener("touchend",this.onPointerUp,!0),this.domElement.addEventListener("touchmove",this.onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;Zn.removeTickerListener();const t=this.domElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this.onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,!0),this.domElement.removeEventListener("mousedown",this.onPointerDown,!0),this.domElement.removeEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this.onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this.onPointerDown,!0),this.domElement.removeEventListener("touchend",this.onPointerUp,!0),this.domElement.removeEventListener("touchmove",this.onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(t,e,r){const i=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=1/this.resolution;t.x=(e-i.left)*(this.domElement.width/i.width)*s,t.y=(r-i.top)*(this.domElement.height/i.height)*s}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let r=0,i=t.changedTouches.length;r<i;r++){const i=t.changedTouches[r];typeof i.button>"u"&&(i.button=0),typeof i.buttons>"u"&&(i.buttons=1),typeof i.isPrimary>"u"&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),typeof i.width>"u"&&(i.width=i.radiusX||1),typeof i.height>"u"&&(i.height=i.radiusY||1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="touch"),typeof i.pointerId>"u"&&(i.pointerId=i.identifier||0),typeof i.pressure>"u"&&(i.pressure=i.force||.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),typeof i.layerX>"u"&&(i.layerX=i.offsetX=i.clientX),typeof i.layerY>"u"&&(i.layerY=i.offsetY=i.clientY),i.isNormalized=!0,i.type=t.type,e.push(i)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof globalThis.PointerEvent)){const r=t;typeof r.isPrimary>"u"&&(r.isPrimary=!0),typeof r.width>"u"&&(r.width=1),typeof r.height>"u"&&(r.height=1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="mouse"),typeof r.pointerId>"u"&&(r.pointerId=1),typeof r.pressure>"u"&&(r.pressure=.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),r.isNormalized=!0,e.push(r)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;return this.transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=no[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};oo.extension={name:"events",type:[Or.RendererSystem,Or.CanvasRendererSystem]},oo.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let ao=oo;function ho(t){return"dynamic"===t||"static"===t}Nr.add(ao);const lo={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??ho(ao.defaultEventMode)},set interactive(t){Ie("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=t,this.eventMode=t?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??ao.defaultEventMode},set eventMode(t){this._internalInteractive=ho(t),this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,r){const i="boolean"==typeof r&&r||"object"==typeof r&&r.capture,s="object"==typeof r?r.signal:void 0,n="object"==typeof r&&!0===r.once,o="function"==typeof e?void 0:e;t=i?`${t}capture`:t;const a="function"==typeof e?e:e.handleEvent,h=this;s&&s.addEventListener("abort",(()=>{h.off(t,a,o)})),n?h.once(t,a,o):h.on(t,a,o)},removeEventListener(t,e,r){const i="function"==typeof e?void 0:e;t="boolean"==typeof r&&r||"object"==typeof r&&r.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,i)},dispatchEvent(t){if(!(t instanceof Qn))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};Ln.mixin(lo),Ln.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});class uo{constructor(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,(Pe.tablet||Pe.phone)&&this.createTouchHook();const e=document.createElement("div");e.style.width="100px",e.style.height="100px",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)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",(()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()})),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){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),this.renderer.view.parentNode?.appendChild(this.div))}deactivate(){!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),this.div.parentNode?.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const e=t.children;if(e)for(let t=0;t<e.length;t++)this.updateAccessibleObjects(e[t])}update(){const t=performance.now();if(Pe.android.device&&t<this.androidUpdateCount||(this.androidUpdateCount=t+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);const{x:e,y:r,width:i,height:s}=this.renderer.view.getBoundingClientRect(),{width:n,height:o,resolution:a}=this.renderer,h=i/n*a,l=s/o*a;let u=this.div;u.style.left=`${e}px`,u.style.top=`${r}px`,u.style.width=`${n}px`,u.style.height=`${o}px`;for(let t=0;t<this.children.length;t++){const e=this.children[t];if(e.renderId!==this.renderId)e._accessibleActive=!1,xr(this.children,t,1),this.div.removeChild(e._accessibleDiv),this.pool.push(e._accessibleDiv),e._accessibleDiv=null,t--;else{u=e._accessibleDiv;let t=e.hitArea;const r=e.worldTransform;e.hitArea?(u.style.left=(r.tx+t.x*r.a)*h+"px",u.style.top=(r.ty+t.y*r.d)*l+"px",u.style.width=t.width*r.a*h+"px",u.style.height=t.height*r.d*l+"px"):(t=e.getBounds(),this.capHitArea(t),u.style.left=t.x*h+"px",u.style.top=t.y*l+"px",u.style.width=t.width*h+"px",u.style.height=t.height*l+"px",u.title!==e.accessibleTitle&&null!==e.accessibleTitle&&(u.title=e.accessibleTitle),u.getAttribute("aria-label")!==e.accessibleHint&&null!==e.accessibleHint&&u.setAttribute("aria-label",e.accessibleHint)),(e.accessibleTitle!==u.title||e.tabIndex!==u.tabIndex)&&(u.title=e.accessibleTitle,u.tabIndex=e.tabIndex,this.debug&&this.updateDebugHTML(u))}}this.renderId++}updateDebugHTML(t){t.innerHTML=`type: ${t.type}</br> title : ${t.title}</br> tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:r}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>r&&(t.height=r-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width="100px",e.style.height="100px",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().includes("chrome")?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}_dispatchEvent(t,e){const{displayObject:r}=t.target,i=this.renderer.events.rootBoundary,s=Object.assign(new Qn(i),{target:r});i.rootTarget=this.renderer.lastObjectRendered,e.forEach((t=>i.dispatchEvent(s,t)))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){9===t.keyCode&&this.activate()}_onMouseMove(t){0===t.movementX&&0===t.movementY||this.deactivate()}destroy(){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}}uo.extension={name:"accessibility",type:[Or.RendererPlugin,Or.CanvasRendererPlugin]},Nr.add(uo);const co=class t{constructor(e){this.stage=new Gn,e=Object.assign({forceCanvas:!1},e),this.renderer=function(t){for(const e of _n)if(e.test(t))return new e(t);throw new Error("Unable to auto-detect a suitable renderer.")}(e),t._plugins.forEach((t=>{t.init.call(this,e)}))}render(){this.renderer.render(this.stage)}get view(){return this.renderer?.view}get screen(){return this.renderer?.screen}destroy(e,r){const i=t._plugins.slice(0);i.reverse(),i.forEach((t=>{t.destroy.call(this)})),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null}};co._plugins=[];let po=co;Nr.handleByList(Or.Application,po._plugins);class fo{static init(t){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame((()=>this.resize())))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;let t,e;if(this.cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,e=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:i}=this._resizeTo;t=r,e=i}this.renderer.resize(t,e),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}fo.extension=Or.Application,Nr.add(fo);const mo={loader:Or.LoadParser,resolver:Or.ResolveParser,cache:Or.CacheParser,detection:Or.DetectionParser};Nr.handle(Or.Asset,(t=>{const e=t.ref;Object.entries(mo).filter((([t])=>!!e[t])).forEach((([t,r])=>Nr.add(Object.assign(e[t],{extension:e[t].extension??r}))))}),(t=>{const e=t.ref;Object.keys(mo).filter((t=>!!e[t])).forEach((t=>Nr.remove(e[t])))}));class go{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach((t=>{this._assetList.push(t)})),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let r=0;r<e;r++)t.push(this._assetList.pop());await this._loader.load(t),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}function yo(t,e){const r=t.split("?")[0],i=Be.extname(r).toLowerCase();return Array.isArray(e)?e.includes(i):i===e}const _o=(t,e,r=!1)=>(Array.isArray(t)||(t=[t]),e?t.map((t=>"string"==typeof t||r?e(t):t)):t),vo=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const r=_o(t);let i;for(let t=0;t<this.parsers.length;t++){const s=this.parsers[t];if(s.test(e)){i=s.getCacheableAssets(r,e);break}}i||(i={},r.forEach((t=>{i[t]=e})));const s=Object.keys(i),n={cacheKeys:s,keys:r};if(r.forEach((t=>{this._cacheMap.set(t,n)})),s.forEach((t=>{const r=i?i[t]:e;this._cache.has(t)&&this._cache.get(t)!==r&&console.warn("[Cache] already has key:",t),this._cache.set(t,i[t])})),e instanceof cs){const t=e;r.forEach((e=>{t.baseTexture!==cs.EMPTY.baseTexture&&Yr.addToCache(t.baseTexture,e),cs.addToCache(t,e)}))}}remove(t){if(!this._cacheMap.has(t))return void console.warn(`[Assets] Asset id ${t} was not found in the Cache`);const e=this._cacheMap.get(t);e.cacheKeys.forEach((t=>{this._cache.delete(t)})),e.keys.forEach((t=>{this._cacheMap.delete(t)}))}get parsers(){return this._parsers}},xo=t=>!Array.isArray(t);class bo{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,r)=>(this._parsersValidated=!1,t[e]=r,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const r={promise:null,parser:null};return r.promise=(async()=>{let i=null,s=null;if(e.loadParser&&(s=this._parserHash[e.loadParser],s||console.warn(`[Assets] specified load parser "${e.loadParser}" not found while loading ${t}`)),!s){for(let r=0;r<this.parsers.length;r++){const i=this.parsers[r];if(i.load&&i.test?.(t,e,this)){s=i;break}}if(!s)return console.warn(`[Assets] ${t} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}i=await s.load(t,e,this),r.parser=s;for(let t=0;t<this.parsers.length;t++){const s=this.parsers[t];s.parse&&s.parse&&await(s.testParse?.(i,e,this))&&(i=await s.parse(i,e,this)||i,r.parser=s)}return i})(),r}async load(t,e){this._parsersValidated||this._validateParsers();let r=0;const i={},s=xo(t),n=_o(t,(t=>({alias:[t],src:t}))),o=n.length,a=n.map((async t=>{const s=Be.toAbsolute(t.src);if(!i[t.src])try{this.promiseCache[s]||(this.promiseCache[s]=this._getLoadPromiseAndParser(s,t)),i[t.src]=await this.promiseCache[s].promise,e&&e(++r/o)}catch(e){throw delete this.promiseCache[s],delete i[t.src],new Error(`[Loader.load] Failed to load ${s}.\n${e}`)}}));return await Promise.all(a),s?i[n[0].src]:i}async unload(t){const e=_o(t,(t=>({alias:[t],src:t}))).map((async t=>{const e=Be.toAbsolute(t.src),r=this.promiseCache[e];if(r){const i=await r.promise;delete this.promiseCache[e],r.parser?.unload?.(i,t,this)}}));await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter((t=>t.name)).reduce(((t,e)=>(t[e.name]&&console.warn(`[Assets] loadParser name conflict "${e.name}"`),{...t,[e.name]:e})),{})}}var To=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(To||{});function Eo(t,e){if(Array.isArray(e)){for(const r of e)if(t.startsWith(`data:${r}`))return!0;return!1}return t.startsWith(`data:${e}`)}const Ao={extension:{type:Or.LoadParser,priority:To.Low},name:"loadJson",test:t=>Eo(t,"application/json")||yo(t,".json"),load:async t=>await(await Se.ADAPTER.fetch(t)).json()};Nr.add(Ao);const So={name:"loadTxt",extension:{type:Or.LoadParser,priority:To.Low},test:t=>Eo(t,"text/plain")||yo(t,".txt"),load:async t=>await(await Se.ADAPTER.fetch(t)).text()};Nr.add(So);const wo=["normal","bold","100","200","300","400","500","600","700","800","900"],Po=[".ttf",".otf",".woff",".woff2"],Ro=["font/ttf","font/otf","font/woff","font/woff2"],Mo=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i,Co=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/,Io={extension:{type:Or.LoadParser,priority:To.Low},name:"loadWebFont",test:t=>Eo(t,Ro)||yo(t,Po),async load(t,e){const r=Se.ADAPTER.getFontFaceSet();if(r){const s=[],n=e.data?.family??function(t){const e=Be.extname(t),r=Be.basename(t,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map((t=>t.charAt(0).toUpperCase()+t.slice(1)));let i=r.length>0;for(const t of r)if(!t.match(Mo)){i=!1;break}let s=r.join(" ");return i||(s=`"${s.replace(/[\\"]/g,"\\$&")}"`),s}(t),o=e.data?.weights?.filter((t=>wo.includes(t)))??["normal"],a=e.data??{};for(let e=0;e<o.length;e++){const h=o[e],l=new FontFace(n,`url(${i=t,Co.test(i)?i:encodeURI(i)})`,{...a,weight:h});await l.load(),r.add(l),s.push(l)}return 1===s.length?s[0]:s}var i;return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(t){(Array.isArray(t)?t:[t]).forEach((t=>Se.ADAPTER.getFontFaceSet().delete(t)))}};Nr.add(Io);let Do=null;class Oo{constructor(){Do||(Do=URL.createObjectURL(new Blob(['(function() {\n  "use strict";\n  const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";\n  async function checkImageBitmap() {\n    try {\n      if (typeof createImageBitmap != "function")\n        return !1;\n      const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob);\n      return imageBitmap.width === 1 && imageBitmap.height === 1;\n    } catch {\n      return !1;\n    }\n  }\n  checkImageBitmap().then((result) => {\n    self.postMessage(result);\n  });\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(Do)}}Oo.revokeObjectURL=function(){Do&&(URL.revokeObjectURL(Do),Do=null)};let Bo=null;class Lo{constructor(){Bo||(Bo=URL.createObjectURL(new Blob(['(function() {\n  "use strict";\n  async function loadImageBitmap(url) {\n    const response = await fetch(url);\n    if (!response.ok)\n      throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);\n    const imageBlob = await response.blob();\n    return await createImageBitmap(imageBlob);\n  }\n  self.onmessage = async (event) => {\n    try {\n      const imageBitmap = await loadImageBitmap(event.data.data[0]);\n      self.postMessage({\n        data: imageBitmap,\n        uuid: event.data.uuid,\n        id: event.data.id\n      }, [imageBitmap]);\n    } catch (e) {\n      self.postMessage({\n        error: e,\n        uuid: event.data.uuid,\n        id: event.data.id\n      });\n    }\n  };\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(Bo)}}Lo.revokeObjectURL=function(){Bo&&(URL.revokeObjectURL(Bo),Bo=null)};let No,Fo=0;const ko=new class{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return void 0!==this._isImageBitmapSupported||(this._isImageBitmapSupported=new Promise((t=>{const{worker:e}=new Oo;e.addEventListener("message",(r=>{e.terminate(),Oo.revokeObjectURL(),t(r.data)}))}))),this._isImageBitmapSupported}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){void 0===No&&(No=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers<No&&(this._createdWorkers++,t=(new Lo).worker,t.addEventListener("message",(t=>{this.complete(t.data),this.returnWorker(t.target),this.next()}))),t}returnWorker(t){this.workerPool.push(t)}complete(t){void 0!==t.error?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const r=new Promise(((r,i)=>{this.queue.push({id:t,arguments:e,resolve:r,reject:i})}));return this.next(),r}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),r=e.id;this.resolveHash[Fo]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:Fo++,id:r})}};function Uo(t,e,r){t.resource.internal=!0;const i=new cs(t),s=()=>{delete e.promiseCache[r],vo.has(r)&&vo.remove(r)};return i.baseTexture.once("destroyed",(()=>{r in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),s())})),i.once("destroyed",(()=>{t.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),s())})),i}const Go=[".jpeg",".jpg",".png",".webp",".avif"],Ho=["image/jpeg","image/png","image/webp","image/avif"],jo={name:"loadTextures",extension:{type:Or.LoadParser,priority:To.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test:t=>Eo(t,Ho)||yo(t,Go),async load(t,e,r){const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let s;s=i?this.config.preferWorkers&&await ko.isImageBitmapSupported()?await ko.loadImageBitmap(t):await async function(t){const e=await Se.ADAPTER.fetch(t);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${t}: ${e.status} ${e.statusText}`);const r=await e.blob();return await createImageBitmap(r)}(t):await new Promise(((e,r)=>{const i=new Image;i.crossOrigin=this.config.crossOrigin,i.src=t,i.complete?e(i):(i.onload=()=>e(i),i.onerror=t=>r(t))}));const n={...e.data};n.resolution??(n.resolution=Dr(t)),i&&void 0===n.resourceOptions?.ownsImageBitmap&&(n.resourceOptions={...n.resourceOptions},n.resourceOptions.ownsImageBitmap=!0);const o=new Yr(s,n);return o.resource.src=t,Uo(o,r,t)},unload(t){t.destroy(!0)}};Nr.add(jo);const Vo={extension:{type:Or.LoadParser,priority:To.High},name:"loadSVG",test:t=>Eo(t,"image/svg+xml")||yo(t,".svg"),testParse:async t=>In.test(t),async parse(t,e,r){const i=new In(t,e?.data?.resourceOptions);await i.load();const s=new Yr(i,{resolution:Dr(t),...e?.data});return s.resource.src=e.src,Uo(s,r,e.src)},load:async(t,e)=>(await Se.ADAPTER.fetch(t)).text(),unload:jo.unload};Nr.add(Vo);const $o=[".mp4",".m4v",".webm",".ogv"],Xo=["video/mp4","video/webm","video/ogg"],zo={name:"loadVideo",extension:{type:Or.LoadParser,priority:To.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test:t=>Eo(t,Xo)||yo(t,$o),async load(t,e,r){let i;const s=await(await Se.ADAPTER.fetch(t)).blob(),n=URL.createObjectURL(s);try{const s={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...e?.data?.resourceOptions,autoLoad:!0},o=new On(n,s);await o.load();const a=new Yr(o,{alphaMode:await Fe(),resolution:Dr(t),...e?.data});a.resource.src=t,i=Uo(a,r,t),i.baseTexture.once("destroyed",(()=>{URL.revokeObjectURL(n)}))}catch(t){throw URL.revokeObjectURL(n),t}return i},unload(t){t.destroy(!0)}};function Wo(t,e,r,i,s){const n=e[r];for(let o=0;o<n.length;o++){const a=n[o];r<e.length-1?Wo(t.replace(i[r],a),e,r+1,i,s):s.push(t.replace(i[r],a))}}function Yo(t){const e=t.match(/\{(.*?)\}/g),r=[];if(e){const i=[];e.forEach((t=>{const e=t.substring(1,t.length-1).split(",");i.push(e)})),Wo(t,i,0,e,r)}else r.push(t);return r}Nr.add(zo);class qo{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach((t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))})),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if("string"==typeof t)this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}}getAlias(t){const{alias:e,name:r,src:i,srcs:s}=t;return _o(e||r||i||s,(t=>"string"==typeof t?t:Array.isArray(t)?t.map((t=>t?.src??t?.srcs??t)):t?.src||t?.srcs?t.src??t.srcs:t),!0)}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach((t=>{this.addBundle(t.name,t.assets)}))}addBundle(t,e){const r=[];Array.isArray(e)?e.forEach((e=>{const i=e.src??e.srcs,s=e.alias??e.name;let n;if("string"==typeof s){const e=this._createBundleAssetId(t,s);r.push(e),n=[s,e]}else{const e=s.map((e=>this._createBundleAssetId(t,e)));r.push(...e),n=[...s,...e]}this.add({...e,alias:n,src:i})})):Object.keys(e).forEach((i=>{const s=[i,this._createBundleAssetId(t,i)];if("string"==typeof e[i])this.add({alias:s,src:e[i]});else if(Array.isArray(e[i]))this.add({alias:s,src:e[i]});else{const t=e[i],r=t.src??t.srcs;this.add({...t,alias:s,src:Array.isArray(r)?r:[r]})}r.push(...s)})),this._bundles[t]=r}add(t,e,r,i,s){const n=[];let o;"string"==typeof t||Array.isArray(t)&&"string"==typeof t[0]?(Ie("7.2.0","Assets.add now uses an object instead of individual parameters.\nPlease use Assets.add({ alias, src, data, format, loadParser }) instead."),n.push({alias:t,src:e,data:r,format:i,loadParser:s})):Array.isArray(t)?n.push(...t):n.push(t),o=t=>{this.hasKey(t)&&console.warn(`[Resolver] already has key: ${t} overwriting`)},_o(n).forEach((t=>{const{src:e,srcs:r}=t;let{data:i,format:s,loadParser:n}=t;const a=_o(e||r).map((t=>"string"==typeof t?Yo(t):Array.isArray(t)?t:[t])),h=this.getAlias(t);Array.isArray(h)?h.forEach(o):o(h);const l=[];a.forEach((t=>{t.forEach((t=>{let e={};if("object"!=typeof t){e.src=t;for(let r=0;r<this._parsers.length;r++){const i=this._parsers[r];if(i.test(t)){e=i.parse(t);break}}}else i=t.data??i,s=t.format??s,n=t.loadParser??n,e={...e,...t};if(!h)throw new Error(`[Resolver] alias is undefined for this asset: ${e.src}`);e=this.buildResolvedAsset(e,{aliases:h,data:i,format:s,loadParser:n}),l.push(e)}))})),h.forEach((t=>{this._assetMap[t]=l}))}))}resolveBundle(t){const e=xo(t);t=_o(t);const r={};return t.forEach((t=>{const e=this._bundles[t];if(e){const i=this.resolve(e),s={};for(const e in i){const r=i[e];s[this._extractAssetIdFromBundle(t,e)]=r}r[t]=s}})),e?r[t[0]]:r}resolveUrl(t){const e=this.resolve(t);if("string"!=typeof t){const t={};for(const r in e)t[r]=e[r].src;return t}return e.src}resolve(t){const e=xo(t);t=_o(t);const r={};return t.forEach((t=>{if(!this._resolverHash[t])if(this._assetMap[t]){let e=this._assetMap[t];const r=e[0],i=this._getPreferredOrder(e);i?.priority.forEach((t=>{i.params[t].forEach((r=>{const i=e.filter((e=>!!e[t]&&e[t]===r));i.length&&(e=i)}))})),this._resolverHash[t]=e[0]??r}else this._resolverHash[t]=this.buildResolvedAsset({alias:[t],src:t},{});r[t]=this._resolverHash[t]})),e?r[t[0]]:r}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const e=t[0],r=this._preferredOrder.find((t=>t.params.format.includes(e.format)));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){return this._defaultSearchParams?`${t}${/\?/.test(t)?"&":"?"}${this._defaultSearchParams}`:t}buildResolvedAsset(t,e){const{aliases:r,data:i,loadParser:s,format:n}=e;return(this._basePath||this._rootPath)&&(t.src=Be.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=r??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...i||{},...t.data},t.loadParser=s??t.loadParser,t.format=n??t.format??Be.extname(t.src).slice(1),t.srcs=t.src,t.name=t.alias,t}}const Ko=new class{constructor(){this._detections=[],this._initialized=!1,this.resolver=new qo,this.loader=new bo,this.cache=vo,this._backgroundLoader=new go(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized)return void console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let e=t.manifest;"string"==typeof e&&(e=await this.load(e)),this.resolver.addManifest(e)}const e=t.texturePreference?.resolution??1,r="number"==typeof e?[e]:e,i=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:i,resolution:r}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,r,i,s){this.resolver.add(t,e,r,i,s)}async load(t,e){this._initialized||await this.init();const r=xo(t),i=_o(t).map((t=>{if("string"!=typeof t){const e=this.resolver.getAlias(t);return e.some((t=>!this.resolver.hasKey(t)))&&this.add(t),Array.isArray(e)?e[0]:e}return this.resolver.hasKey(t)||this.add({alias:t,src:t}),t})),s=this.resolver.resolve(i),n=await this._mapLoadToResolve(s,e);return r?n[i[0]]:n}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let r=!1;"string"==typeof t&&(r=!0,t=[t]);const i=this.resolver.resolveBundle(t),s={},n=Object.keys(i);let o=0,a=0;const h=()=>{e?.(++o/a)},l=n.map((t=>{const e=i[t];return a+=Object.keys(e).length,this._mapLoadToResolve(e,h).then((e=>{s[t]=e}))}));return await Promise.all(l),r?s[t[0]]:s}async backgroundLoad(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach((t=>{this._backgroundLoader.add(Object.values(t))}))}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if("string"==typeof t)return vo.get(t);const e={};for(let r=0;r<t.length;r++)e[r]=vo.get(t[r]);return e}async _mapLoadToResolve(t,e){const r=Object.values(t),i=Object.keys(t);this._backgroundLoader.active=!1;const s=await this.loader.load(r,e);this._backgroundLoader.active=!0;const n={};return r.forEach(((t,e)=>{const r=s[t.src],o=[t.src];t.alias&&o.push(...t.alias),n[i[e]]=r,vo.set(o,r)})),n}async unload(t){this._initialized||await this.init();const e=_o(t).map((t=>"string"!=typeof t?t.src:t)),r=this.resolver.resolve(e);await this._unloadFromResolved(r)}async unloadBundle(t){this._initialized||await this.init(),t=_o(t);const e=this.resolver.resolveBundle(t),r=Object.keys(e).map((t=>this._unloadFromResolved(e[t])));await Promise.all(r)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach((t=>{vo.remove(t.src)})),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const r of t.detections)t.skipDetections||await r.test()?e=await r.add(e):t.skipDetections||(e=await r.remove(e));return e=e.filter(((t,r)=>e.indexOf(t)===r)),e}get detections(){return this._detections}get preferWorkers(){return jo.config.preferWorkers}set preferWorkers(t){Ie("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach((e=>{e.config&&Object.keys(e.config).filter((e=>e in t)).forEach((r=>{e.config[r]=t[r]}))}))}};Nr.handleByList(Or.LoadParser,Ko.loader.parsers).handleByList(Or.ResolveParser,Ko.resolver.parsers).handleByList(Or.CacheParser,Ko.cache.parsers).handleByList(Or.DetectionParser,Ko.detections);const Zo={extension:Or.CacheParser,test:t=>Array.isArray(t)&&t.every((t=>t instanceof cs)),getCacheableAssets:(t,e)=>{const r={};return t.forEach((t=>{e.forEach(((e,i)=>{r[t+(0===i?"":i+1)]=e}))})),r}};async function Qo(t){if("Image"in globalThis)return new Promise((e=>{const r=new Image;r.onload=()=>{e(!0)},r.onerror=()=>{e(!1)},r.src=t}));if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(t)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}Nr.add(Zo);const Jo={extension:{type:Or.DetectionParser,priority:1},test:async()=>Qo("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async t=>[...t,"avif"],remove:async t=>t.filter((t=>"avif"!==t))};Nr.add(Jo);const ta={extension:{type:Or.DetectionParser,priority:0},test:async()=>Qo("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async t=>[...t,"webp"],remove:async t=>t.filter((t=>"webp"!==t))};Nr.add(ta);const ea=["png","jpg","jpeg"],ra={extension:{type:Or.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async t=>[...t,...ea],remove:async t=>t.filter((t=>!ea.includes(t)))};Nr.add(ra);const ia="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function sa(t){return!ia&&""!==document.createElement("video").canPlayType(t)}const na={extension:{type:Or.DetectionParser,priority:0},test:async()=>sa("video/webm"),add:async t=>[...t,"webm"],remove:async t=>t.filter((t=>"webm"!==t))};Nr.add(na);const oa={extension:{type:Or.DetectionParser,priority:0},test:async()=>sa("video/mp4"),add:async t=>[...t,"mp4","m4v"],remove:async t=>t.filter((t=>"mp4"!==t&&"m4v"!==t))};Nr.add(oa);const aa={extension:{type:Or.DetectionParser,priority:0},test:async()=>sa("video/ogg"),add:async t=>[...t,"ogv"],remove:async t=>t.filter((t=>"ogv"!==t))};Nr.add(aa);const ha={extension:Or.ResolveParser,test:jo.test,parse:t=>({resolution:parseFloat(Se.RETINA_PREFIX.exec(t)?.[1]??"1"),format:Be.extname(t).slice(1),src:t})};Nr.add(ha);const la=(t,e)=>{const r=e.split("?")[1];return r&&(t+=`?${r}`),t};var ua=(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=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t))(ua||{});const ca={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let da,pa;function fa(){pa={bptc:da.getExtension("EXT_texture_compression_bptc"),astc:da.getExtension("WEBGL_compressed_texture_astc"),etc:da.getExtension("WEBGL_compressed_texture_etc"),s3tc:da.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:da.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:da.getExtension("WEBGL_compressed_texture_pvrtc")||da.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:da.getExtension("WEBGL_compressed_texture_etc1"),atc:da.getExtension("WEBGL_compressed_texture_atc")}}const ma={extension:{type:Or.DetectionParser,priority:2},test:async()=>{const t=Se.ADAPTER.createCanvas().getContext("webgl");return t?(da=t,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async t=>{pa||fa();const e=[];for(const t in pa)pa[t]&&e.push(t);return[...e,...t]},remove:async t=>(pa||fa(),t.filter((t=>!(t in pa))))};Nr.add(ma);class ga extends Xr{constructor(t,e={width:1,height:1,autoLoad:!0}){let r,i;"string"==typeof t?(r=t,i=new Uint8Array):(r=null,i=t),super(i,e),this.origin=r,this.buffer=i?new Fr(i):null,this._load=null,this.loaded=!1,null!==this.origin&&!1!==e.autoLoad&&this.load(),null===this.origin&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load||(this._load=fetch(this.origin).then((t=>t.blob())).then((t=>t.arrayBuffer())).then((t=>(this.data=new Uint32Array(t),this.buffer=new Fr(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)))),this._load}}class ya extends ga{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=ya._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||ya._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,r){const 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;i.pixelStorei(i.UNPACK_ALIGNMENT,4);for(let t=0,e=this.levels;t<e;t++){const{levelID:e,levelWidth:r,levelHeight:s,levelBuffer:n}=this._levelBuffers[t];i.compressedTexImage2D(i.TEXTURE_2D,e,this.format,r,s,0,n)}return!0}onBlobLoaded(){this._levelBuffers=ya._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=35916&&t<=35919)return"s3tc_sRGB";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(36196===t)return"etc1";if(35986===t||35987===t||34798===t)return"atc";if(t>=36492&&t<=36495)return"bptc";if(37808===t)return"astc";throw new Error(`Invalid (compressed) texture format given: ${t}`)}static _createLevelBuffers(t,e,r,i,s,n,o){const a=new Array(r);let h=t.byteOffset,l=n,u=o,c=l+i-1&~(i-1),d=u+s-1&~(s-1),p=c*d*ca[e];for(let n=0;n<r;n++)a[n]={levelID:n,levelWidth:r>1?l:c,levelHeight:r>1?u:d,levelBuffer:new Uint8Array(t.buffer,h,p)},h+=p,l=l>>1||1,u=u>>1||1,c=l+i-1&~(i-1),d=u+s-1&~(s-1),p=c*d*ca[e];return a}}const _a=827611204,va=861165636,xa=894720068,ba={[_a]:ua.COMPRESSED_RGBA_S3TC_DXT1_EXT,[va]:ua.COMPRESSED_RGBA_S3TC_DXT3_EXT,[xa]:ua.COMPRESSED_RGBA_S3TC_DXT5_EXT},Ta={70:ua.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:ua.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:ua.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:ua.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:ua.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:ua.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:ua.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:ua.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:ua.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:ua.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:ua.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:ua.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:ua.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT},Ea=[171,75,84,88,32,49,49,187,13,10,26,10],Aa={[de.UNSIGNED_BYTE]:1,[de.UNSIGNED_SHORT]:2,[de.INT]:4,[de.UNSIGNED_INT]:4,[de.FLOAT]:4,[de.HALF_FLOAT]:8},Sa={[ue.RGBA]:4,[ue.RGB]:3,[ue.RG]:2,[ue.RED]:1,[ue.LUMINANCE]:1,[ue.LUMINANCE_ALPHA]:2,[ue.ALPHA]:1},wa={[de.UNSIGNED_SHORT_4_4_4_4]:2,[de.UNSIGNED_SHORT_5_5_5_1]:2,[de.UNSIGNED_SHORT_5_6_5]:2};function Pa(t){switch(t){case ue.RGBA:return ue.RGBA_INTEGER;case ue.RGB:return ue.RGB_INTEGER;case ue.RG:return ue.RG_INTEGER;case ue.RED:return ue.RED_INTEGER;default:return t}}const Ra={extension:{type:Or.LoadParser,priority:To.High},name:"loadDDS",test:t=>yo(t,".dds"),async load(t,e,r){const i=function(t){const e=new Uint32Array(t);if(542327876!==e[0])throw new Error("Invalid DDS file magic word");const r=new Uint32Array(t,0,124/Uint32Array.BYTES_PER_ELEMENT),i=r[3],s=r[4],n=r[7],o=new Uint32Array(t,19*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),a=o[1];if(4&a){const r=o[2];if(808540228!==r){const e=ba[r],o=new Uint8Array(t,128);return[new ya(o,{format:e,width:s,height:i,levels:n})]}const a=128,h=new Uint32Array(e.buffer,a,20/Uint32Array.BYTES_PER_ELEMENT),l=h[0],u=h[1],c=h[2],d=h[3],p=Ta[l];if(void 0===p)throw new Error(`DDSParser cannot parse texture data with DXGI format ${l}`);if(4===c)throw new Error("DDSParser does not support cubemap textures");if(6===u)throw new Error("DDSParser does not supported 3D texture data");const f=new Array,m=148;if(1===d)f.push(new Uint8Array(t,m));else{const e=ca[p];let r=0,o=s,a=i;for(let t=0;t<n;t++)r+=Math.max(1,o+3&-4)*Math.max(1,a+3&-4)*e,o>>>=1,a>>>=1;let h=m;for(let e=0;e<d;e++)f.push(new Uint8Array(t,h,r)),h+=r}return f.map((t=>new ya(t,{format:p,width:s,height:i,levels:n})))}throw 64&a?new Error("DDSParser does not support uncompressed texture data."):512&a?new Error("DDSParser does not supported YUV uncompressed texture data."):131072&a?new Error("DDSParser does not support single-channel (lumninance) texture data!"):2&a?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}(await(await Se.ADAPTER.fetch(t)).arrayBuffer()).map((i=>Uo(new Yr(i,{mipmap:ge.OFF,alphaMode:ye.NO_PREMULTIPLIED_ALPHA,resolution:Dr(t),...e.data}),r,t)));return 1===i.length?i[0]:i},unload(t){Array.isArray(t)?t.forEach((t=>t.destroy(!0))):t.destroy(!0)}};Nr.add(Ra);const Ma={extension:{type:Or.LoadParser,priority:To.High},name:"loadKTX",test:t=>yo(t,".ktx"),async load(t,e,r){const i=await(await Se.ADAPTER.fetch(t)).arrayBuffer(),{compressed:s,uncompressed:n,kvData:o}=function(t,e,r=!1){const i=new DataView(e);if(!function(t,e){for(let r=0;r<Ea.length;r++)if(e.getUint8(r)!==Ea[r])return console.error(`${t} is not a valid *.ktx file!`),!1;return!0}(t,i))return null;const s=67305985===i.getUint32(12,!0),n=i.getUint32(16,s),o=i.getUint32(24,s),a=i.getUint32(28,s),h=i.getUint32(36,s),l=i.getUint32(40,s)||1,u=i.getUint32(44,s)||1,c=i.getUint32(48,s)||1,d=i.getUint32(52,s),p=i.getUint32(56,s),f=i.getUint32(60,s);if(0===l||1!==u)throw new Error("Only 2D textures are supported");if(1!==d)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==c)throw new Error("WebGL does not support array textures");const m=h+3&-4,g=l+3&-4,y=new Array(c);let _,v=h*l;if(0===n&&(v=m*g),_=0!==n?Aa[n]?Aa[n]*Sa[o]:wa[n]:ca[a],void 0===_)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const x=r?function(t,e,r){const i=new Map;let s=0;for(;s<e;){const n=t.getUint32(64+s,r),o=64+s+4,a=3-(n+3)%4;if(0===n||n>e-s){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h<n&&0!==t.getUint8(o+h);h++);if(-1===h){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const l=(new TextDecoder).decode(new Uint8Array(t.buffer,o,h)),u=new DataView(t.buffer,o+h+1,n-h-1);i.set(l,u),s+=4+n+a}return i}(i,f,s):null;let b=v*_,T=h,E=l,A=m,S=g,w=64+f;for(let t=0;t<p;t++){const r=i.getUint32(w,s);let o=w+4;for(let r=0;r<c;r++){let i=y[r];i||(i=y[r]=new Array(p)),i[t]={levelID:t,levelWidth:p>1||0!==n?T:A,levelHeight:p>1||0!==n?E:S,levelBuffer:new Uint8Array(e,o,b)},o+=b}w+=r+4,w=w%4!=0?w+4-w%4:w,T=T>>1||1,E=E>>1||1,A=T+4-1&-4,S=E+4-1&-4,b=A*S*_}return 0!==n?{uncompressed:y.map((t=>{let e=t[0].levelBuffer,r=!1;return n===de.FLOAT?e=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):n===de.UNSIGNED_INT?(r=!0,e=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):n===de.INT&&(r=!0,e=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new Xr(e,{width:t[0].levelWidth,height:t[0].levelHeight}),type:n,format:r?Pa(o):o}})),kvData:x}:{compressed:y.map((t=>new ya(null,{format:a,width:h,height:l,levels:p,levelBuffers:t}))),kvData:x}}(t,i),a=s??n,h={mipmap:ge.OFF,alphaMode:ye.NO_PREMULTIPLIED_ALPHA,resolution:Dr(t),...e.data},l=a.map((e=>{a===n&&Object.assign(h,{type:e.type,format:e.format});const i=e.resource??e,s=new Yr(i,h);return s.ktxKeyValueData=o,Uo(s,r,t)}));return 1===l.length?l[0]:l},unload(t){Array.isArray(t)?t.forEach((t=>t.destroy(!0))):t.destroy(!0)}};Nr.add(Ma);const Ca=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],Ia={extension:Or.ResolveParser,test:t=>{const e=Be.extname(t).slice(1);return["basis","ktx","dds"].includes(e)},parse:t=>{const e=t.split("."),r=e.pop();if(["ktx","dds"].includes(r)){const r=e.pop();if(Ca.includes(r))return{resolution:parseFloat(Se.RETINA_PREFIX.exec(t)?.[1]??"1"),format:r,src:t}}return{resolution:parseFloat(Se.RETINA_PREFIX.exec(t)?.[1]??"1"),format:r,src:t}}};Nr.add(Ia);const Da=new ci,Oa=class t{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){const t=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}async image(t,e,r,i){const s=new Image;return s.src=await this.base64(t,e,r,i),s}async base64(t,e,r,i){const s=this.canvas(t,i);if(void 0!==s.toBlob)return new Promise(((t,i)=>{s.toBlob((e=>{if(!e)return void i(new Error("ICanvas.toBlob failed!"));const r=new FileReader;r.onload=()=>t(r.result),r.onerror=i,r.readAsDataURL(e)}),e,r)}));if(void 0!==s.toDataURL)return s.toDataURL(e,r);if(void 0!==s.convertToBlob){const t=await s.convertToBlob({type:e,quality:r});return new Promise(((e,r)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=r,i.readAsDataURL(t)}))}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,r){const{pixels:i,width:s,height:n,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,r);o&&t._flipY(i,s,n),a&&t._unpremultiplyAlpha(i);const h=new Mr(s,n,1),l=new ImageData(new Uint8ClampedArray(i.buffer),s,n);return h.context.putImageData(l,0,0),h.canvas}pixels(e,r){const{pixels:i,width:s,height:n,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,r);return o&&t._flipY(i,s,n),a&&t._unpremultiplyAlpha(i),i}_rawPixels(t,e){const r=this.renderer;if(!r)throw new Error("The Extract has already been destroyed");let i,s,n=!1,o=!1,a=!1;t&&(t instanceof ds?s=t:(s=r.generateTexture(t,{region:e,resolution:r.resolution,multisample:r.multisample}),a=!0,e&&(Da.width=e.width,Da.height=e.height,e=Da)));const h=r.gl;if(s){if(i=s.baseTexture.resolution,e=e??s.frame,n=!1,o=s.baseTexture.alphaMode>0&&s.baseTexture.format===ue.RGBA,!a){r.renderTexture.bind(s);const t=s.framebuffer.glFramebuffers[r.CONTEXT_UID];t.blitFramebuffer&&r.framebuffer.bind(t.blitFramebuffer)}}else i=r.resolution,e||((e=Da).width=r.width/i,e.height=r.height/i),n=!0,o=this._rendererPremultipliedAlpha,r.renderTexture.bind();const l=Math.max(Math.round(e.width*i),1),u=Math.max(Math.round(e.height*i),1),c=new Uint8Array(4*l*u);return h.readPixels(Math.round(e.x*i),Math.round(e.y*i),l,u,h.RGBA,h.UNSIGNED_BYTE,c),a&&s?.destroy(!0),{pixels:c,width:l,height:u,flipY:n,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(t,e,r){const i=e<<2,s=r>>1,n=new Uint8Array(i);for(let e=0;e<s;e++){const s=e*i,o=(r-e-1)*i;n.set(t.subarray(s,s+i)),t.copyWithin(s,o,o+i),t.set(n,o)}}static _unpremultiplyAlpha(t){t instanceof Uint8ClampedArray&&(t=new Uint8Array(t.buffer));const e=t.length;for(let r=0;r<e;r+=4){const e=t[r+3];if(0!==e){const i=255.001/e;t[r]=t[r]*i+.5,t[r+1]=t[r+1]*i+.5,t[r+2]=t[r+2]*i+.5}}}};Oa.extension={name:"extract",type:Or.RendererSystem};let Ba=Oa;Nr.add(Ba);const La={build(t){const e=t.points;let r,i,s,n,o,a;if(t.type===hi.CIRC){const e=t.shape;r=e.x,i=e.y,o=a=e.radius,s=n=0}else if(t.type===hi.ELIP){const e=t.shape;r=e.x,i=e.y,o=e.width,a=e.height,s=n=0}else{const e=t.shape,h=e.width/2,l=e.height/2;r=e.x+h,i=e.y+l,o=a=Math.max(0,Math.min(e.radius,Math.min(h,l))),s=h-o,n=l-a}if(!(o>=0&&a>=0&&s>=0&&n>=0))return void(e.length=0);const h=Math.ceil(2.3*Math.sqrt(o+a)),l=8*h+(s?4:0)+(n?4:0);if(e.length=l,0===l)return;if(0===h)return e.length=8,e[0]=e[6]=r+s,e[1]=e[3]=i+n,e[2]=e[4]=r-s,void(e[5]=e[7]=i-n);let u=0,c=4*h+(s?2:0)+2,d=c,p=l;{const t=s+o,a=n,h=r+t,l=r-t,f=i+a;if(e[u++]=h,e[u++]=f,e[--c]=f,e[--c]=l,n){const t=i-a;e[d++]=l,e[d++]=t,e[--p]=t,e[--p]=h}}for(let t=1;t<h;t++){const l=Math.PI/2*(t/h),f=s+Math.cos(l)*o,m=n+Math.sin(l)*a,g=r+f,y=r-f,_=i+m,v=i-m;e[u++]=g,e[u++]=_,e[--c]=_,e[--c]=y,e[d++]=y,e[d++]=v,e[--p]=v,e[--p]=g}{const t=n+a,o=r+s,h=r-s,l=i+t,c=i-t;e[u++]=o,e[u++]=l,e[--p]=c,e[--p]=o,s&&(e[u++]=h,e[u++]=l,e[--p]=c,e[--p]=h)}},triangulate(t,e){const r=t.points,i=e.points,s=e.indices;if(0===r.length)return;let n=i.length/2;const o=n;let a,h;if(t.type!==hi.RREC){const e=t.shape;a=e.x,h=e.y}else{const e=t.shape;a=e.x+e.width/2,h=e.y+e.height/2}const l=t.matrix;i.push(t.matrix?l.a*a+l.c*h+l.tx:a,t.matrix?l.b*a+l.d*h+l.ty:h),n++,i.push(r[0],r[1]);for(let t=2;t<r.length;t+=2)i.push(r[t],r[t+1]),s.push(n++,o,n);s.push(o+1,o,n)}};function Na(t,e=!1){const r=t.length;if(r<6)return;let i=0;for(let e=0,s=t[r-2],n=t[r-1];e<r;e+=2){const r=t[e],o=t[e+1];i+=(r-s)*(o+n),s=r,n=o}if(!e&&i>0||e&&i<=0){const e=r/2;for(let i=e+e%2;i<r;i+=2){const e=r-i-2,s=r-i-1,n=i,o=i+1;[t[e],t[n]]=[t[n],t[e]],[t[s],t[o]]=[t[o],t[s]]}}}const Fa={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let r=t.points;const i=t.holes,s=e.points,n=e.indices;if(r.length>=6){Na(r,!1);const t=[];for(let e=0;e<i.length;e++){const s=i[e];Na(s.points,!0),t.push(r.length/2),r=r.concat(s.points)}const e=Me(r,t,2);if(!e)return;const o=s.length/2;for(let t=0;t<e.length;t+=3)n.push(e[t]+o),n.push(e[t+1]+o),n.push(e[t+2]+o);for(let t=0;t<r.length;t++)s.push(r[t])}}},ka={build(t){const e=t.shape,r=e.x,i=e.y,s=e.width,n=e.height,o=t.points;o.length=0,s>=0&&n>=0&&o.push(r,i,r+s,i,r+s,i+n,r,i+n)},triangulate(t,e){const r=t.points,i=e.points;if(0===r.length)return;const s=i.length/2;i.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(s,s+1,s+2,s+1,s+2,s+3)}},Ua={build(t){La.build(t)},triangulate(t,e){La.triangulate(t,e)}};var Ga=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(Ga||{}),Ha=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(Ha||{});const ja={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class Va{static curveTo(t,e,r,i,s,n){const o=n[n.length-2],a=n[n.length-1]-e,h=o-t,l=i-e,u=r-t,c=Math.abs(a*u-h*l);if(c<1e-8||0===s)return(n[n.length-2]!==t||n[n.length-1]!==e)&&n.push(t,e),null;const d=a*a+h*h,p=l*l+u*u,f=a*l+h*u,m=s*Math.sqrt(d)/c,g=s*Math.sqrt(p)/c,y=m*f/d,_=g*f/p,v=m*u+g*h,x=m*l+g*a,b=h*(g+y),T=a*(g+y),E=u*(m+_),A=l*(m+_);return{cx:v+t,cy:x+e,radius:s,startAngle:Math.atan2(T-x,b-v),endAngle:Math.atan2(A-x,E-v),anticlockwise:h*l>u*a}}static arc(t,e,r,i,s,n,o,a,h){const l=o-n,u=ja._segmentsCount(Math.abs(l)*s,40*Math.ceil(Math.abs(l)/ni)),c=l/(2*u),d=2*c,p=Math.cos(c),f=Math.sin(c),m=u-1,g=m%1/m;for(let t=0;t<=m;++t){const e=c+n+d*(t+g*t),o=Math.cos(e),a=-Math.sin(e);h.push((p*o+f*a)*s+r,(p*-a+f*o)*s+i)}}}class $a{static curveLength(t,e,r,i,s,n,o,a){let h=0,l=0,u=0,c=0,d=0,p=0,f=0,m=0,g=0,y=0,_=0,v=t,x=e;for(let b=1;b<=10;++b)l=b/10,u=l*l,c=u*l,d=1-l,p=d*d,f=p*d,m=f*t+3*p*l*r+3*d*u*s+c*o,g=f*e+3*p*l*i+3*d*u*n+c*a,y=v-m,_=x-g,v=m,x=g,h+=Math.sqrt(y*y+_*_);return h}static curveTo(t,e,r,i,s,n,o){const a=o[o.length-2],h=o[o.length-1];o.length-=2;const l=ja._segmentsCount($a.curveLength(a,h,t,e,r,i,s,n));let u=0,c=0,d=0,p=0,f=0;o.push(a,h);for(let m=1,g=0;m<=l;++m)g=m/l,u=1-g,c=u*u,d=c*u,p=g*g,f=p*g,o.push(d*a+3*c*g*t+3*u*p*r+f*s,d*h+3*c*g*e+3*u*p*i+f*n)}}function Xa(t,e,r,i,s,n,o,a){let h,l;o?(h=i,l=-r):(h=-i,l=r);const u=t-r*s+h,c=e-i*s+l,d=t+r*n+h,p=e+i*n+l;return a.push(u,c,d,p),2}function za(t,e,r,i,s,n,o,a){const h=r-t,l=i-e;let u=Math.atan2(h,l),c=Math.atan2(s-t,n-e);a&&u<c?u+=2*Math.PI:!a&&u>c&&(c+=2*Math.PI);let d=u;const p=c-u,f=Math.abs(p),m=Math.sqrt(h*h+l*l),g=1+(15*f*Math.sqrt(m)/Math.PI|0),y=p/g;if(d+=y,a){o.push(t,e,r,i);for(let r=1,i=d;r<g;r++,i+=y)o.push(t,e,t+Math.sin(i)*m,e+Math.cos(i)*m);o.push(t,e,s,n)}else{o.push(r,i,t,e);for(let r=1,i=d;r<g;r++,i+=y)o.push(t+Math.sin(i)*m,e+Math.cos(i)*m,t,e);o.push(s,n,t,e)}return 2*g}function Wa(t,e){t.lineStyle.native?function(t,e){let r=0;const i=t.shape,s=t.points||i.points,n=i.type!==hi.POLY||i.closeStroke;if(0===s.length)return;const o=e.points,a=e.indices,h=s.length/2,l=o.length/2;let u=l;for(o.push(s[0],s[1]),r=1;r<h;r++)o.push(s[2*r],s[2*r+1]),a.push(u,u+1),u++;n&&a.push(u,l)}(t,e):function(t,e){const r=t.shape;let i=t.points||r.points.slice();const s=e.closePointEps;if(0===i.length)return;const n=t.lineStyle,o=new li(i[0],i[1]),a=new li(i[i.length-2],i[i.length-1]),h=r.type!==hi.POLY||r.closeStroke,l=Math.abs(o.x-a.x)<s&&Math.abs(o.y-a.y)<s;if(h){i=i.slice(),l&&(i.pop(),i.pop(),a.set(i[i.length-2],i[i.length-1]));const t=.5*(o.x+a.x),e=.5*(a.y+o.y);i.unshift(t,e),i.push(t,e)}const u=e.points,c=i.length/2;let d=i.length;const p=u.length/2,f=n.width/2,m=f*f,g=n.miterLimit*n.miterLimit;let y=i[0],_=i[1],v=i[2],x=i[3],b=0,T=0,E=-(_-x),A=y-v,S=0,w=0,P=Math.sqrt(E*E+A*A);E/=P,A/=P,E*=f,A*=f;const R=n.alignment,M=2*(1-R),C=2*R;h||(n.cap===Ha.ROUND?d+=za(y-E*(M-C)*.5,_-A*(M-C)*.5,y-E*M,_-A*M,y+E*C,_+A*C,u,!0)+2:n.cap===Ha.SQUARE&&(d+=Xa(y,_,E,A,M,C,!0,u))),u.push(y-E*M,_-A*M,y+E*C,_+A*C);for(let t=1;t<c-1;++t){y=i[2*(t-1)],_=i[2*(t-1)+1],v=i[2*t],x=i[2*t+1],b=i[2*(t+1)],T=i[2*(t+1)+1],E=-(_-x),A=y-v,P=Math.sqrt(E*E+A*A),E/=P,A/=P,E*=f,A*=f,S=-(x-T),w=v-b,P=Math.sqrt(S*S+w*w),S/=P,w/=P,S*=f,w*=f;const e=v-y,r=_-x,s=v-b,o=T-x,a=e*s+r*o,h=r*s-o*e,l=h<0;if(Math.abs(h)<.001*Math.abs(a)){u.push(v-E*M,x-A*M,v+E*C,x+A*C),a>=0&&(n.join===Ga.ROUND?d+=za(v,x,v-E*M,x-A*M,v-S*M,x-w*M,u,!1)+4:d+=2,u.push(v-S*C,x-w*C,v+S*M,x+w*M));continue}const c=(-E+y)*(-A+x)-(-E+v)*(-A+_),p=(-S+b)*(-w+x)-(-S+v)*(-w+T),R=(e*p-s*c)/h,I=(o*c-r*p)/h,D=(R-v)*(R-v)+(I-x)*(I-x),O=v+(R-v)*M,B=x+(I-x)*M,L=v-(R-v)*C,N=x-(I-x)*C,F=l?M:C,k=D<=Math.min(e*e+r*r,s*s+o*o)+F*F*m;let U=n.join;if(U===Ga.MITER&&D/m>g&&(U=Ga.BEVEL),k)switch(U){case Ga.MITER:u.push(O,B,L,N);break;case Ga.BEVEL:l?u.push(O,B,v+E*C,x+A*C,O,B,v+S*C,x+w*C):u.push(v-E*M,x-A*M,L,N,v-S*M,x-w*M,L,N),d+=2;break;case Ga.ROUND:l?(u.push(O,B,v+E*C,x+A*C),d+=za(v,x,v+E*C,x+A*C,v+S*C,x+w*C,u,!0)+4,u.push(O,B,v+S*C,x+w*C)):(u.push(v-E*M,x-A*M,L,N),d+=za(v,x,v-E*M,x-A*M,v-S*M,x-w*M,u,!1)+4,u.push(v-S*M,x-w*M,L,N))}else{switch(u.push(v-E*M,x-A*M,v+E*C,x+A*C),U){case Ga.MITER:l?u.push(L,N,L,N):u.push(O,B,O,B),d+=2;break;case Ga.ROUND:d+=l?za(v,x,v+E*C,x+A*C,v+S*C,x+w*C,u,!0)+2:za(v,x,v-E*M,x-A*M,v-S*M,x-w*M,u,!1)+2}u.push(v-S*M,x-w*M,v+S*C,x+w*C),d+=2}}y=i[2*(c-2)],_=i[2*(c-2)+1],v=i[2*(c-1)],x=i[2*(c-1)+1],E=-(_-x),A=y-v,P=Math.sqrt(E*E+A*A),E/=P,A/=P,E*=f,A*=f,u.push(v-E*M,x-A*M,v+E*C,x+A*C),h||(n.cap===Ha.ROUND?d+=za(v-E*(M-C)*.5,x-A*(M-C)*.5,v-E*M,x-A*M,v+E*C,x+A*C,u,!1)+2:n.cap===Ha.SQUARE&&(d+=Xa(v,x,E,A,M,C,!1,u)));const I=e.indices,D=ja.epsilon*ja.epsilon;for(let t=p;t<d+p-2;++t)y=u[2*t],_=u[2*t+1],v=u[2*(t+1)],x=u[2*(t+1)+1],b=u[2*(t+2)],T=u[2*(t+2)+1],!(Math.abs(y*(x-T)+v*(T-_)+b*(_-x))<D)&&I.push(t,t+1,t+2)}(t,e)}class Ya{static curveLength(t,e,r,i,s,n){const o=t-2*r+s,a=e-2*i+n,h=2*r-2*t,l=2*i-2*e,u=4*(o*o+a*a),c=4*(o*h+a*l),d=h*h+l*l,p=2*Math.sqrt(u+c+d),f=Math.sqrt(u),m=2*u*f,g=2*Math.sqrt(d),y=c/f;return(m*p+f*c*(p-g)+(4*d*u-c*c)*Math.log((2*f+y+p)/(y+g)))/(4*m)}static curveTo(t,e,r,i,s){const n=s[s.length-2],o=s[s.length-1],a=ja._segmentsCount(Ya.curveLength(n,o,t,e,r,i));let h=0,l=0;for(let u=1;u<=a;++u){const c=u/a;h=n+(t-n)*c,l=o+(e-o)*c,s.push(h+(t+(r-t)*c-h)*c,l+(e+(i-e)*c-l)*c)}}}const qa={[hi.POLY]:Fa,[hi.CIRC]:La,[hi.ELIP]:La,[hi.RECT]:ka,[hi.RREC]:Ua},Ka=[],Za=[];class Qa{constructor(t,e=null,r=null,i=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=r,this.fillStyle=e,this.matrix=i,this.type=t.type}clone(){return new Qa(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}class Ja{constructor(){this.reset()}begin(t,e,r){this.reset(),this.style=t,this.start=e,this.attribStart=r}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}const th=new li,eh=class t extends si{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new Bn,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){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(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Za.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),Ka.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,r=null,i=null){const s=new Qa(t,e,r,i);return this.graphicsData.push(s),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const r=new Qa(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return r.lineStyle=i.lineStyle,i.holes.push(r),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].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}containsPoint(t){const e=this.graphicsData;for(let r=0;r<e.length;++r){const i=e[r];if(i.fillStyle.visible&&i.shape&&(i.matrix?i.matrix.applyInverse(t,th):th.copyFrom(t),i.shape.contains(th.x,th.y))){let t=!1;if(i.holes)for(let e=0;e<i.holes.length;e++)if(i.holes[e].shape.contains(th.x,th.y)){t=!0;break}if(!t)return!0}}return!1}updateBatches(){if(!this.graphicsData.length)return void(this.batchable=!0);if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let r=null,i=null;this.batches.length>0&&(r=this.batches[this.batches.length-1],i=r.style);for(let s=this.shapeIndex;s<e.length;s++){this.shapeIndex++;const n=e[s],o=n.fillStyle,a=n.lineStyle;qa[n.type].build(n),n.matrix&&this.transformPoints(n.points,n.matrix),(o.visible||a.visible)&&this.processHoles(n.holes);for(let e=0;e<2;e++){const s=0===e?o:a;if(!s.visible)continue;const h=s.texture.baseTexture,l=this.indices.length,u=this.points.length/2;h.wrapMode=me.REPEAT,0===e?this.processFill(n):this.processLine(n);const c=this.points.length/2-u;0!==c&&(r&&!this._compareStyles(i,s)&&(r.end(l,u),r=null),r||(r=Ka.pop()||new Ja,r.begin(s,l,u),this.batches.push(r),i=s),this.addUvs(this.points,t,s.texture,u,c,s.matrix))}}const s=this.indices.length,n=this.points.length/2;if(r&&r.end(s,n),0===this.batches.length)return void(this.batchable=!0);const o=n>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&o===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=o?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const e=this.graphicsData[t],r=e.fillStyle,i=e.lineStyle;if(r&&!r.texture.baseTexture.valid||i&&!i.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,r=t.length;e<r;e++){const r=t[e];for(let t=0;t<r.size;t++){const e=r.start+t;this.indicesUint16[e]=this.indicesUint16[e]-r.attribStart}}}isBatchable(){if(this.points.length>131070)return!1;const e=this.batches;for(let t=0;t<e.length;t++)if(e[t].style.native)return!1;return this.points.length<2*t.BATCHABLE_SIZE}buildDrawCalls(){let t=++Yr._globalBatch;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Za.push(this.drawCalls[t]);this.drawCalls.length=0;const e=this.colors,r=this.textureIds;let i=Za.pop();i||(i=new qr,i.texArray=new Yi),i.texArray.count=0,i.start=0,i.size=0,i.type=le.TRIANGLES;let s=0,n=null,o=0,a=!1,h=le.TRIANGLES,l=0;this.drawCalls.push(i);for(let u=0;u<this.batches.length;u++){const c=this.batches[u],d=8,p=c.style,f=p.texture.baseTexture;a!==!!p.native&&(a=!!p.native,h=a?le.LINES:le.TRIANGLES,n=null,s=d,t++),n!==f&&(n=f,f._batchEnabled!==t&&(s===d&&(t++,s=0,i.size>0&&(i=Za.pop(),i||(i=new qr,i.texArray=new Yi),this.drawCalls.push(i)),i.start=l,i.size=0,i.texArray.count=0,i.type=h),f.touched=1,f._batchEnabled=t,f._batchLocation=s,f.wrapMode=me.REPEAT,i.texArray.elements[i.texArray.count++]=f,s++)),i.size+=c.size,l+=c.size,o=f._batchLocation,this.addColors(e,p.color,p.alpha,c.attribSize,c.attribStart),this.addTextureIds(r,o,c.attribSize,c.attribStart)}Yr._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,r=this.colors,i=this.textureIds,s=new ArrayBuffer(3*t.length*4),n=new Float32Array(s),o=new Uint32Array(s);let a=0;for(let s=0;s<t.length/2;s++)n[a++]=t[2*s],n[a++]=t[2*s+1],n[a++]=e[2*s],n[a++]=e[2*s+1],o[a++]=r[s],n[a++]=i[s];this._buffer.update(s),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?Fa.triangulate(t,this):qa[t.type].triangulate(t,this)}processLine(t){Wa(t,this);for(let e=0;e<t.holes.length;e++)Wa(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const r=t[e];qa[r.type].build(r),r.matrix&&this.transformPoints(r.points,r.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let r=0;r<t.length/2;r++){const i=t[2*r],s=t[2*r+1];t[2*r]=e.a*i+e.c*s+e.tx,t[2*r+1]=e.b*i+e.d*s+e.ty}}addColors(t,e,r,i,s=0){const n=pr.shared.setValue(e).toLittleEndianNumber(),o=pr.shared.setValue(n).toPremultiplied(r);t.length=Math.max(t.length,s+i);for(let e=0;e<i;e++)t[s+e]=o}addTextureIds(t,e,r,i=0){t.length=Math.max(t.length,i+r);for(let s=0;s<r;s++)t[i+s]=e}addUvs(t,e,r,i,s,n=null){let o=0;const a=e.length,h=r.frame;for(;o<s;){let r=t[2*(i+o)],s=t[2*(i+o)+1];if(n){const t=n.a*r+n.c*s+n.tx;s=n.b*r+n.d*s+n.ty,r=t}o++,e.push(r/h.width,s/h.height)}const l=r.baseTexture;(h.width<l.width||h.height<l.height)&&this.adjustUvs(e,r,a,s)}adjustUvs(t,e,r,i){const s=e.baseTexture,n=1e-6,o=r+2*i,a=e.frame,h=a.width/s.width,l=a.height/s.height;let u=a.x/a.width,c=a.y/a.height,d=Math.floor(t[r]+n),p=Math.floor(t[r+1]+n);for(let e=r+2;e<o;e+=2)d=Math.min(d,Math.floor(t[e]+n)),p=Math.min(p,Math.floor(t[e+1]+n));u-=d,c-=p;for(let e=r;e<o;e+=2)t[e]=(t[e]+u)*h,t[e+1]=(t[e+1]+c)*l}};eh.BATCHABLE_SIZE=100;let rh=eh;class ih{constructor(){this.color=16777215,this.alpha=1,this.texture=cs.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new ih;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t}reset(){this.color=16777215,this.alpha=1,this.texture=cs.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class sh extends ih{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=Ha.BUTT,this.join=Ga.MITER,this.miterLimit=10}clone(){const t=new sh;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}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1,this.cap=Ha.BUTT,this.join=Ga.MITER,this.miterLimit=10}}const nh={},oh=class t extends Gn{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new ih,this._lineStyle=new sh,this._matrix=null,this._holeMode=!1,this.state=Gr.for2d(),this._geometry=t||new rh,this._geometry.refCount++,this._transformID=-1,this._tintColor=new pr(16777215),this.blendMode=he.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new t(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,r,i=.5,s=!1){return"number"==typeof t&&(t={width:t,color:e,alpha:r,alignment:i,native:s}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:cs.WHITE,color:t?.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:Ha.BUTT,join:Ga.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.width>0&&t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:r},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new fi,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new fi,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const r=this.currentPath.points,i=r[r.length-2],s=r[r.length-1];return(i!==t||s!==e)&&r.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,r,i){this._initCurve();const s=this.currentPath.points;return 0===s.length&&this.moveTo(0,0),Ya.curveTo(t,e,r,i,s),this}bezierCurveTo(t,e,r,i,s,n){return this._initCurve(),$a.curveTo(t,e,r,i,s,n,this.currentPath.points),this}arcTo(t,e,r,i,s){this._initCurve(t,e);const n=this.currentPath.points,o=Va.curveTo(t,e,r,i,s,n);if(o){const{cx:t,cy:e,radius:r,startAngle:i,endAngle:s,anticlockwise:n}=o;this.arc(t,e,r,i,s,n)}return this}arc(t,e,r,i,s,n=!1){if(i===s)return this;if(!n&&s<=i?s+=ni:n&&i<=s&&(i+=ni),s-i==0)return this;const o=t+Math.cos(i)*r,a=e+Math.sin(i)*r,h=this._geometry.closePointEps;let l=this.currentPath?this.currentPath.points:null;if(l){const t=Math.abs(l[l.length-2]-o),e=Math.abs(l[l.length-1]-a);t<h&&e<h||l.push(o,a)}else this.moveTo(o,a),l=this.currentPath.points;return Va.arc(o,a,t,e,r,i,s,n,l),this}beginFill(t=0,e){return this.beginTextureFill({texture:cs.WHITE,color:t,alpha:e})}normalizeColor(t){const e=pr.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:cs.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const r=t.alpha>0;return r?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:r},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,r,i){return this.drawShape(new ci(t,e,r,i))}drawRoundedRect(t,e,r,i,s){return this.drawShape(new mi(t,e,r,i,s))}drawCircle(t,e,r){return this.drawShape(new di(t,e,r))}drawEllipse(t,e,r,i){return this.drawShape(new pi(t,e,r,i))}drawPolygon(...t){let e,r=!0;const i=t[0];i.points?(r=i.closeStroke,e=i.points):e=Array.isArray(t[0])?t[0]:t;const s=new fi(e);return s.closeStroke=r,this.drawShape(s),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return!(1!==t.length||t[0].shape.type!==hi.RECT||t[0].matrix||t[0].holes.length||t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const 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(let i=0;i<r;i++){const r=t.batches[i],s=r.style.color,n=new Float32Array(this.vertexData.buffer,4*r.attribStart*2,2*r.attribSize),o=new Float32Array(t.uvsFloat32.buffer,4*r.attribStart*2,2*r.attribSize),a={vertexData:n,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*r.start,r.size),uvs:o,_batchRGB:pr.shared.setValue(s).toRgbArray(),_tintRGB:s,_texture:r.style.texture,alpha:r.style.alpha,worldAlpha:1};this.batches[i]=a}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,r=this.batches.length;e<r;e++){const r=this.batches[e];r.worldAlpha=this.worldAlpha*r.alpha,t.plugins[this.pluginName].render(r)}}}_renderDirect(t){const e=this._resolveDirectShader(t),r=this._geometry,i=this.worldAlpha,s=e.uniforms,n=r.drawCalls;s.translationMatrix=this.transform.worldTransform,pr.shared.setValue(this._tintColor).premultiply(i).toArray(s.tint),t.shader.bind(e),t.geometry.bind(r,e),t.state.set(this.state);for(let e=0,i=n.length;e<i;e++)this._renderDrawCallDirect(t,r.drawCalls[e])}_renderDrawCallDirect(t,e){const{texArray:r,type:i,size:s,start:n}=e,o=r.count;for(let e=0;e<o;e++)t.texture.bind(r.elements[e],e);t.geometry.draw(i,s,n)}_resolveDirectShader(t){let e=this.shader;const r=this.pluginName;if(!e){if(!nh[r]){const{maxTextures:e}=t.plugins[r],i=new Int32Array(e);for(let t=0;t<e;t++)i[t]=t;const s={tint:new Float32Array([1,1,1,1]),translationMatrix:new gi,default:Xi.from({uSamplers:i},!0)},n=t.plugins[r]._shader.program;nh[r]=new zi(n,s)}e=nh[r]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:r,maxX:i,maxY:s}=t.bounds;this._bounds.addFrame(this.transform,e,r,i,s)}containsPoint(e){return this.worldTransform.applyInverse(e,t._TEMP_POINT),this._geometry.containsPoint(t._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=pr.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,r=e.a,i=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,h=this._geometry.points,l=this.vertexData;let u=0;for(let t=0;t<h.length;t+=2){const e=h[t],c=h[t+1];l[u++]=r*e+s*c+o,l[u++]=n*c+i*e+a}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){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,super.destroy(t)}};oh.curves=ja,oh._TEMP_POINT=new li;let ah=oh;class hh{constructor(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(t){if(!t&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const 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++}}const lh=new li,uh=new fi,ch=class t extends Gn{constructor(t,e,r,i=le.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=r||Gr.for2d(),this.drawMode=i,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=Se.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(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)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(t){this.shader=t}get material(){return this.shader}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(t){this.shader.tint=t}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(t){this.shader.texture=t}_render(e){const r=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===le.TRIANGLES&&r.length<2*t.BATCHABLE_SIZE?this._renderToBatch(e):this._renderDefault(e)}_renderDefault(t){const 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)}_renderToBatch(t){const 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;const i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].render(this)}calculateVertices(){const t=this.geometry.buffers[0],e=t.data,r=t._updateID;if(r===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));const i=this.transform.worldTransform,s=i.a,n=i.b,o=i.c,a=i.d,h=i.tx,l=i.ty,u=this.vertexData;for(let t=0;t<u.length/2;t++){const r=e[2*t],i=e[2*t+1];u[2*t]=s*r+o*i+h,u[2*t+1]=n*r+a*i+l}if(this._roundPixels){const t=Se.RESOLUTION;for(let e=0;e<u.length;++e)u[e]=Math.round(u[e]*t)/t}this.vertexDirty=r}calculateUvs(){const t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new hh(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,lh);const e=this.geometry.getBuffer("aVertexPosition").data,r=uh.points,i=this.geometry.getIndex().data,s=i.length,n=4===this.drawMode?3:1;for(let t=0;t+2<s;t+=n){const s=2*i[t],n=2*i[t+1],o=2*i[t+2];if(r[0]=e[s],r[1]=e[s+1],r[2]=e[n],r[3]=e[n+1],r[4]=e[o],r[5]=e[o+1],uh.contains(lh.x,lh.y))return!0}return!1}destroy(t){super.destroy(t),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}};ch.BATCHABLE_SIZE=100;let dh=ch;class ph extends ii{constructor(t,e,r){super();const i=new Zr(t),s=new Zr(e,!0),n=new Zr(r,!0,!0);this.addAttribute("aVertexPosition",i,2,!1,de.FLOAT).addAttribute("aTextureCoord",s,2,!1,de.FLOAT).addIndex(n),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}class fh extends zi{constructor(t,e){const r={uSampler:t,alpha:1,uTextureMatrix:gi.IDENTITY,uColor:new Float32Array([1,1,1,1])};(e=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},e)).uniforms&&Object.assign(r,e.uniforms),super(e.program||Vi.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"),r),this._colorDirty=!1,this.uvMatrix=new ws(t),this.batchable=void 0===e.program,this.pluginName=e.pluginName,this._tintColor=new pr(e.tint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0,this.alpha=e.alpha}get texture(){return this.uniforms.uSampler}set texture(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)}set alpha(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(t){t!==this.tint&&(this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}get tintValue(){return this._tintColor.toNumber()}update(){if(this._colorDirty){this._colorDirty=!1;const t=this.texture.baseTexture.alphaMode;pr.shared.setValue(this._tintColor).premultiply(this._alpha,t).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}class mh{constructor(t,e,r){this.geometry=new ii,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(let r=0;r<t.length;++r){let i=t[r];i={attributeName:i.attributeName,size:i.size,uploadFunction:i.uploadFunction,type:i.type||de.FLOAT,offset:i.offset},e[r]?this.dynamicProperties.push(i):this.staticProperties.push(i)}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()}initBuffers(){const t=this.geometry;let e=0;this.indexBuffer=new Zr(function(t,e=null){const 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(let t=0,i=0;t<r;t+=6,i+=4)e[t+0]=i+0,e[t+1]=i+1,e[t+2]=i+2,e[t+3]=i+0,e[t+4]=i+2,e[t+5]=i+3;return e}(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(let t=0;t<this.dynamicProperties.length;++t){const r=this.dynamicProperties[t];r.offset=e,e+=r.size,this.dynamicStride+=r.size}const r=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(r),this.dynamicDataUint32=new Uint32Array(r),this.dynamicBuffer=new Zr(this.dynamicData,!1,!1);let i=0;this.staticStride=0;for(let t=0;t<this.staticProperties.length;++t){const e=this.staticProperties[t];e.offset=i,i+=e.size,this.staticStride+=e.size}const s=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(s),this.staticDataUint32=new Uint32Array(s),this.staticBuffer=new Zr(this.staticData,!0,!1);for(let e=0;e<this.dynamicProperties.length;++e){const r=this.dynamicProperties[e];t.addAttribute(r.attributeName,this.dynamicBuffer,0,r.type===de.UNSIGNED_BYTE,r.type,4*this.dynamicStride,4*r.offset)}for(let e=0;e<this.staticProperties.length;++e){const r=this.staticProperties[e];t.addAttribute(r.attributeName,this.staticBuffer,0,r.type===de.UNSIGNED_BYTE,r.type,4*this.staticStride,4*r.offset)}}uploadDynamic(t,e,r){for(let i=0;i<this.dynamicProperties.length;i++){const s=this.dynamicProperties[i];s.uploadFunction(t,e,r,s.type===de.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,s.offset)}this.dynamicBuffer._updateID++}uploadStatic(t,e,r){for(let i=0;i<this.staticProperties.length;i++){const s=this.staticProperties[i];s.uploadFunction(t,e,r,s.type===de.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,s.offset)}this.staticBuffer._updateID++}destroy(){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()}}class gh extends qi{constructor(t){super(t),this.shader=null,this.properties=null,this.tempMatrix=new gi,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:de.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=zi.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}",{}),this.state=Gr.for2d()}render(t){const e=t.children,r=t._maxSize,i=t._batchSize,s=this.renderer;let n=e.length;if(0===n)return;n>r&&!t.autoResize&&(n=r);let o=t._buffers;o||(o=t._buffers=this.generateBuffers(t));const a=e[0]._texture.baseTexture,h=a.alphaMode>0;this.state.blendMode=mr(t.blendMode,h),s.state.set(this.state);const l=s.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=pr.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,h).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=a,this.renderer.shader.bind(this.shader);let c=!1;for(let r=0,a=0;r<n;r+=i,a+=1){let h=n-r;h>i&&(h=i),a>=o.length&&o.push(this._generateOneMoreBuffer(t));const u=o[a];u.uploadDynamic(e,r,h);const d=t._bufferUpdateIDs[a]||0;c=c||u._updateID<d,c&&(u._updateID=t._updateID,u.uploadStatic(e,r,h)),s.geometry.bind(u.geometry),l.drawElements(l.TRIANGLES,6*h,l.UNSIGNED_SHORT,0)}}generateBuffers(t){const e=[],r=t._maxSize,i=t._batchSize,s=t._properties;for(let t=0;t<r;t+=i)e.push(new mh(this.properties,s,i));return e}_generateOneMoreBuffer(t){const e=t._batchSize,r=t._properties;return new mh(this.properties,r,e)}uploadVertices(t,e,r,i,s,n){let o=0,a=0,h=0,l=0;for(let u=0;u<r;++u){const r=t[e+u],c=r._texture,d=r.scale.x,p=r.scale.y,f=c.trim,m=c.orig;f?(a=f.x-r.anchor.x*m.width,o=a+f.width,l=f.y-r.anchor.y*m.height,h=l+f.height):(o=m.width*(1-r.anchor.x),a=m.width*-r.anchor.x,h=m.height*(1-r.anchor.y),l=m.height*-r.anchor.y),i[n]=a*d,i[n+1]=l*p,i[n+s]=o*d,i[n+s+1]=l*p,i[n+2*s]=o*d,i[n+2*s+1]=h*p,i[n+3*s]=a*d,i[n+3*s+1]=h*p,n+=4*s}}uploadPosition(t,e,r,i,s,n){for(let o=0;o<r;o++){const r=t[e+o].position;i[n]=r.x,i[n+1]=r.y,i[n+s]=r.x,i[n+s+1]=r.y,i[n+2*s]=r.x,i[n+2*s+1]=r.y,i[n+3*s]=r.x,i[n+3*s+1]=r.y,n+=4*s}}uploadRotation(t,e,r,i,s,n){for(let o=0;o<r;o++){const r=t[e+o].rotation;i[n]=r,i[n+s]=r,i[n+2*s]=r,i[n+3*s]=r,n+=4*s}}uploadUvs(t,e,r,i,s,n){for(let o=0;o<r;++o){const r=t[e+o]._texture._uvs;r?(i[n]=r.x0,i[n+1]=r.y0,i[n+s]=r.x1,i[n+s+1]=r.y1,i[n+2*s]=r.x2,i[n+2*s+1]=r.y2,i[n+3*s]=r.x3,i[n+3*s+1]=r.y3,n+=4*s):(i[n]=0,i[n+1]=0,i[n+s]=0,i[n+s+1]=0,i[n+2*s]=0,i[n+2*s+1]=0,i[n+3*s]=0,i[n+3*s+1]=0,n+=4*s)}}uploadTint(t,e,r,i,s,n){for(let o=0;o<r;++o){const r=t[e+o],a=pr.shared.setValue(r._tintRGB).toPremultiplied(r.alpha,r.texture.baseTexture.alphaMode>0);i[n]=a,i[n+s]=a,i[n+2*s]=a,i[n+3*s]=a,n+=4*s}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}gh.extension={name:"particle",type:Or.RendererPlugin},Nr.add(gh);var yh=(t=>(t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",t))(yh||{});const _h={willReadFrequently:!0},vh=class t{static get experimentalLetterSpacingSupported(){let e=t._experimentalLetterSpacingSupported;if(void 0!==e){const r=Se.ADAPTER.getCanvasRenderingContext2D().prototype;e=t._experimentalLetterSpacingSupported="letterSpacing"in r||"textLetterSpacing"in r}return e}constructor(t,e,r,i,s,n,o,a,h){this.text=t,this.style=e,this.width=r,this.height=i,this.lines=s,this.lineWidths=n,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=h}static measureText(e,r,i,s=t._canvas){i=i??r.wordWrap;const n=r.toFontString(),o=t.measureFont(n);0===o.fontSize&&(o.fontSize=r.fontSize,o.ascent=r.fontSize);const a=s.getContext("2d",_h);a.font=n;const h=(i?t.wordWrap(e,r,s):e).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let u=0;for(let e=0;e<h.length;e++){const i=t._measureText(h[e],r.letterSpacing,a);l[e]=i,u=Math.max(u,i)}let c=u+r.strokeThickness;r.dropShadow&&(c+=r.dropShadowDistance);const d=r.lineHeight||o.fontSize+r.strokeThickness;let p=Math.max(d,o.fontSize+2*r.strokeThickness)+r.leading+(h.length-1)*(d+r.leading);return r.dropShadow&&(p+=r.dropShadowDistance),new t(e,r,c,p,h,l,d+r.leading,u,o)}static _measureText(e,r,i){let s=!1;t.experimentalLetterSpacingSupported&&(t.experimentalLetterSpacing?(i.letterSpacing=`${r}px`,i.textLetterSpacing=`${r}px`,s=!0):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(e).width;return n>0&&(s?n-=r:n+=(t.graphemeSegmenter(e).length-1)*r),n}static wordWrap(e,r,i=t._canvas){const s=i.getContext("2d",_h);let n=0,o="",a="";const h=Object.create(null),{letterSpacing:l,whiteSpace:u}=r,c=t.collapseSpaces(u),d=t.collapseNewlines(u);let p=!c;const f=r.wordWrapWidth+l,m=t.tokenize(e);for(let e=0;e<m.length;e++){let i=m[e];if(t.isNewline(i)){if(!d){a+=t.addLine(o),p=!c,o="",n=0;continue}i=" "}if(c){const e=t.isBreakingSpace(i),r=t.isBreakingSpace(o[o.length-1]);if(e&&r)continue}const u=t.getFromCache(i,l,h,s);if(u>f)if(""!==o&&(a+=t.addLine(o),o="",n=0),t.canBreakWords(i,r.breakWords)){const e=t.wordWrapSplit(i);for(let u=0;u<e.length;u++){let c=e[u],d=c,m=1;for(;e[u+m];){const s=e[u+m];if(t.canBreakChars(d,s,i,u,r.breakWords))break;c+=s,d=s,m++}u+=m-1;const g=t.getFromCache(c,l,h,s);g+n>f&&(a+=t.addLine(o),p=!1,o="",n=0),o+=c,n+=g}}else{o.length>0&&(a+=t.addLine(o),o="",n=0);const r=e===m.length-1;a+=t.addLine(i,!r),p=!1,o="",n=0}else u+n>f&&(p=!1,a+=t.addLine(o),o="",n=0),(o.length>0||!t.isBreakingSpace(i)||p)&&(o+=i,n+=u)}return a+=t.addLine(o,!1),a}static addLine(e,r=!0){return e=t.trimRight(e),r?`${e}\n`:e}static getFromCache(e,r,i,s){let n=i[e];return"number"!=typeof n&&(n=t._measureText(e,r,s)+r,i[e]=n),n}static collapseSpaces(t){return"normal"===t||"pre-line"===t}static collapseNewlines(t){return"normal"===t}static trimRight(e){if("string"!=typeof e)return"";for(let r=e.length-1;r>=0;r--){const i=e[r];if(!t.isBreakingSpace(i))break;e=e.slice(0,-1)}return e}static isNewline(e){return"string"==typeof e&&t._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,r){return"string"==typeof e&&t._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const r=[];let i="";if("string"!=typeof e)return r;for(let s=0;s<e.length;s++){const n=e[s],o=e[s+1];t.isBreakingSpace(n,o)||t.isNewline(n)?(""!==i&&(r.push(i),i=""),r.push(n)):i+=n}return""!==i&&r.push(i),r}static canBreakWords(t,e){return e}static canBreakChars(t,e,r,i,s){return!0}static wordWrapSplit(e){return t.graphemeSegmenter(e)}static measureFont(e){if(t._fonts[e])return t._fonts[e];const r={ascent:0,descent:0,fontSize:0},i=t._canvas,s=t._context;s.font=e;const n=t.METRICS_STRING+t.BASELINE_SYMBOL,o=Math.ceil(s.measureText(n).width);let a=Math.ceil(s.measureText(t.BASELINE_SYMBOL).width);const h=Math.ceil(t.HEIGHT_MULTIPLIER*a);if(a=a*t.BASELINE_MULTIPLIER|0,0===o||0===h)return t._fonts[e]=r,r;i.width=o,i.height=h,s.fillStyle="#f00",s.fillRect(0,0,o,h),s.font=e,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(n,0,a);const l=s.getImageData(0,0,o,h).data,u=l.length,c=4*o;let d=0,p=0,f=!1;for(d=0;d<a;++d){for(let t=0;t<c;t+=4)if(255!==l[p+t]){f=!0;break}if(f)break;p+=c}for(r.ascent=a-d,p=u-c,f=!1,d=h;d>a;--d){for(let t=0;t<c;t+=4)if(255!==l[p+t]){f=!0;break}if(f)break;p-=c}return r.descent=d-a,r.fontSize=r.ascent+r.descent,t._fonts[e]=r,r}static clearMetrics(e=""){e?delete t._fonts[e]:t._fonts={}}static get _canvas(){if(!t.__canvas){let e;try{const r=new OffscreenCanvas(0,0);if(r.getContext("2d",_h)?.measureText)return t.__canvas=r,r;e=Se.ADAPTER.createCanvas()}catch{e=Se.ADAPTER.createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas}static get _context(){return t.__context||(t.__context=t._canvas.getContext("2d",_h)),t.__context}};vh.METRICS_STRING="|ÉqÅ",vh.BASELINE_SYMBOL="M",vh.BASELINE_MULTIPLIER=1.4,vh.HEIGHT_MULTIPLIER=2,vh.graphemeSegmenter=(()=>{if("function"==typeof Intl?.Segmenter){const t=new Intl.Segmenter;return e=>[...t.segment(e)].map((t=>t.segment))}return t=>[...t]})(),vh.experimentalLetterSpacing=!1,vh._fonts={},vh._newlines=[10,13],vh._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let xh=vh;const bh=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Th=class t{constructor(t){this.styleID=0,this.reset(),Sh(this,t,t)}clone(){const e={};return Sh(e,this,t.defaultStyle),new t(e)}reset(){Sh(this,t.defaultStyle,t.defaultStyle)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){const e=Ah(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){const e=Ah(t);this._fill!==e&&(this._fill=e,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.styleID++)}get stroke(){return this._stroke}set stroke(t){const e=Ah(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}toFontString(){const t="number"==typeof this.fontSize?`${this.fontSize}px`:this.fontSize;let e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(let t=e.length-1;t>=0;t--){let r=e[t].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!bh.includes(r)&&(r=`"${r}"`),e[t]=r}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};Th.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:yh.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let Eh=Th;function Ah(t){const e=pr.shared,r=t=>{const r=e.setValue(t);return 1===r.alpha?r.toHex():r.toRgbaString()};return Array.isArray(t)?t.map(r):r(t)}function Sh(t,e,r){for(const i in r)Array.isArray(e[i])?t[i]=e[i].slice():t[i]=e[i]}const wh={texture:!0,children:!1,baseTexture:!0},Ph=class t extends Vn{constructor(e,r,i){let s=!1;i||(i=Se.ADAPTER.createCanvas(),s=!0),i.width=3,i.height=3;const n=cs.from(i);n.orig=new ci,n.trim=new ci,super(n),this._ownCanvas=s,this.canvas=i,this.context=i.getContext("2d",{willReadFrequently:!0}),this._resolution=t.defaultResolution??Se.RESOLUTION,this._autoResolution=t.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=r,this.localStyleID=-1}static get experimentalLetterSpacing(){return xh.experimentalLetterSpacing}static set experimentalLetterSpacing(t){Ie("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),xh.experimentalLetterSpacing=t}updateText(t){const e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;this._font=this._style.toFontString();const r=this.context,i=xh.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),s=i.width,n=i.height,o=i.lines,a=i.lineHeight,h=i.lineWidths,l=i.maxLineWidth,u=i.fontProperties;let c,d;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,n)+2*e.padding)*this._resolution),r.scale(this._resolution,this._resolution),r.clearRect(0,0,this.canvas.width,this.canvas.height),r.font=this._font,r.lineWidth=e.strokeThickness,r.textBaseline=e.textBaseline,r.lineJoin=e.lineJoin,r.miterLimit=e.miterLimit;const p=e.dropShadow?2:1;for(let t=0;t<p;++t){const s=e.dropShadow&&0===t,p=s?Math.ceil(Math.max(1,n)+2*e.padding):0,f=p*this._resolution;if(s){r.fillStyle="black",r.strokeStyle="black";const t=e.dropShadowColor,i=e.dropShadowBlur*this._resolution,s=e.dropShadowDistance*this._resolution;r.shadowColor=pr.shared.setValue(t).setAlpha(e.dropShadowAlpha).toRgbaString(),r.shadowBlur=i,r.shadowOffsetX=Math.cos(e.dropShadowAngle)*s,r.shadowOffsetY=Math.sin(e.dropShadowAngle)*s+f}else r.fillStyle=this._generateFillStyle(e,o,i),r.strokeStyle=e.stroke,r.shadowColor="black",r.shadowBlur=0,r.shadowOffsetX=0,r.shadowOffsetY=0;let m=(a-u.fontSize)/2;a-u.fontSize<0&&(m=0);for(let t=0;t<o.length;t++)c=e.strokeThickness/2,d=e.strokeThickness/2+t*a+u.ascent+m,"right"===e.align?c+=l-h[t]:"center"===e.align&&(c+=(l-h[t])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(o[t],c+e.padding,d+e.padding-p,!0),e.fill&&this.drawLetterSpacing(o[t],c+e.padding,d+e.padding-p)}this.updateTexture()}drawLetterSpacing(t,e,r,i=!1){const s=this._style.letterSpacing;let n=!1;if(xh.experimentalLetterSpacingSupported&&(xh.experimentalLetterSpacing?(this.context.letterSpacing=`${s}px`,this.context.textLetterSpacing=`${s}px`,n=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),0===s||n)return void(i?this.context.strokeText(t,e,r):this.context.fillText(t,e,r));let o=e;const a=xh.graphemeSegmenter(t);let h=this.context.measureText(t).width,l=0;for(let t=0;t<a.length;++t){const e=a[t];i?this.context.strokeText(e,o,r):this.context.fillText(e,o,r);let n="";for(let e=t+1;e<a.length;++e)n+=a[e];l=this.context.measureText(n).width,o+=h-l+s,h=l}}updateTexture(){const t=this.canvas;if(this._style.trim){const e=function(t){const e=function(t){const{width:e,height:r}=t,i=t.getContext("2d",{willReadFrequently:!0});if(null===i)throw new TypeError("Failed to get canvas 2D context");const s=i.getImageData(0,0,e,r).data;let n=0,o=0,a=e-1,h=r-1;for(;o<r&&Cr(s,e,o);)++o;if(o===r)return Sr.EMPTY;for(;Cr(s,e,h);)--h;for(;Ir(s,e,n,o,h);)++n;for(;Ir(s,e,a,o,h);)--a;return++a,++h,new Sr(n,o,a,h)}(t),{width:r,height:i}=e;let s=null;if(!e.isEmpty()){const n=t.getContext("2d");if(null===n)throw new TypeError("Failed to get canvas 2D context");s=n.getImageData(e.left,e.top,r,i)}return{width:r,height:i,data:s}}(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}const e=this._texture,r=this._style,i=r.trim?0:r.padding,s=e.baseTexture;e.trim.width=e._frame.width=t.width/this._resolution,e.trim.height=e._frame.height=t.height/this._resolution,e.trim.x=-i,e.trim.y=-i,e.orig.width=e._frame.width-2*i,e.orig.height=e._frame.height-2*i,this._onTextureUpdate(),s.setRealSize(t.width,t.height,this._resolution),e.updateUvs(),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(t,e){return this.updateText(!0),-1===this._textureID&&(t=!1),super.getBounds(t,e)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds.call(this,t)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(t,e,r){const i=t.fill;if(!Array.isArray(i))return i;if(1===i.length)return i[0];let s;const n=t.dropShadow?t.dropShadowDistance:0,o=t.padding||0,a=this.canvas.width/this._resolution-n-2*o,h=this.canvas.height/this._resolution-n-2*o,l=i.slice(),u=t.fillGradientStops.slice();if(!u.length){const t=l.length+1;for(let e=1;e<t;++e)u.push(e/t)}if(l.unshift(i[0]),u.unshift(0),l.push(i[i.length-1]),u.push(1),t.fillGradientType===yh.LINEAR_VERTICAL){s=this.context.createLinearGradient(a/2,o,a/2,h+o);const i=r.fontProperties.fontSize+t.strokeThickness;for(let t=0;t<e.length;t++){const n=r.lineHeight*(t-1)+i,o=r.lineHeight*t;let a=o;t>0&&n>o&&(a=(o+n)/2);const c=o+i,d=r.lineHeight*(t+1);let p=c;t+1<e.length&&d<c&&(p=(c+d)/2);const f=(p-a)/h;for(let t=0;t<l.length;t++){let e=0;e="number"==typeof u[t]?u[t]:t/l.length;let r=Math.min(1,Math.max(0,a/h+e*f));r=Number(r.toFixed(5)),s.addColorStop(r,l[t])}}}else{s=this.context.createLinearGradient(o,h/2,a+o,h/2);const t=l.length+1;let e=1;for(let r=0;r<l.length;r++){let i;i="number"==typeof u[r]?u[r]:e/t,s.addColorStop(i,l[r]),e++}}return s}destroy(t){"boolean"==typeof t&&(t={children:t}),t=Object.assign({},wh,t),super.destroy(t),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this.updateText(!0);const e=br(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this.updateText(!0);const e=br(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get style(){return this._style}set style(t){t=t||{},this._style=t instanceof Eh?t:new Eh(t),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}};Ph.defaultAutoResolution=!0;let Rh=Ph;class Mh{constructor(t){this.maxItemsPerFrame=t,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function Ch(t,e){let r=!1;if(t?._textures?.length)for(let i=0;i<t._textures.length;i++)if(t._textures[i]instanceof cs){const s=t._textures[i].baseTexture;e.includes(s)||(e.push(s),r=!0)}return r}function Ih(t,e){if(t.baseTexture instanceof Yr){const r=t.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function Dh(t,e){if(t._texture&&t._texture instanceof cs){const r=t._texture.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function Oh(t,e){return e instanceof Rh&&(e.updateText(!0),!0)}function Bh(t,e){if(e instanceof Eh){const t=e.toFontString();return xh.measureFont(t),!0}return!1}function Lh(t,e){if(t instanceof Rh){e.includes(t.style)||e.push(t.style),e.includes(t)||e.push(t);const r=t._texture.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function Nh(t,e){return t instanceof Eh&&(e.includes(t)||e.push(t),!0)}const Fh=class t{constructor(e){this.limiter=new Mh(t.uploadsPerFrame),this.renderer=e,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{this.queue&&this.prepareItems()},this.registerFindHook(Lh),this.registerFindHook(Nh),this.registerFindHook(Ch),this.registerFindHook(Ih),this.registerFindHook(Dh),this.registerUploadHook(Oh),this.registerUploadHook(Bh)}upload(t){return new Promise((e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,gn.system.addOnce(this.tick,this,pn.UTILITY))):e()}))}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const t=this.queue[0];let e=!1;if(t&&!t._destroyed)for(let 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)gn.system.addOnce(this.tick,this,pn.UTILITY);else{this.ticking=!1;const t=this.completes.slice(0);this.completes.length=0;for(let e=0,r=t.length;e<r;e++)t[e]()}}registerFindHook(t){return t&&this.addHooks.push(t),this}registerUploadHook(t){return t&&this.uploadHooks.push(t),this}add(t){for(let e=0,r=this.addHooks.length;e<r&&!this.addHooks[e](t,this.queue);e++);if(t instanceof Gn)for(let e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&gn.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}};Fh.uploadsPerFrame=4;let kh=Fh;function Uh(t,e){return e instanceof Yr&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function Gh(t,e){if(!(e instanceof ah))return!1;const{geometry:r}=e;e.finishPoly(),r.updateBatches();const{batches:i}=r;for(let e=0;e<i.length;e++){const{texture:r}=i[e].style;r&&Uh(t,r.baseTexture)}return r.batchable||t.geometry.bind(r,e._resolveDirectShader(t)),!0}function Hh(t,e){return t instanceof ah&&(e.push(t),!0)}Object.defineProperties(Se,{UPLOADS_PER_FRAME:{get:()=>kh.uploadsPerFrame,set(t){Ie("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),kh.uploadsPerFrame=t}}});class jh extends kh{constructor(t){super(t),this.uploadHookHelper=this.renderer,this.registerFindHook(Hh),this.registerUploadHook(Uh),this.registerUploadHook(Gh)}}jh.extension={name:"prepare",type:Or.RendererSystem},Nr.add(jh),new li;var Vh="#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";const $h=new gi;class Xh extends qi{constructor(t){super(t),t.runners.contextChange.add(this),this.quad=new ms,this.state=Gr.for2d()}contextChange(){const t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=zi.from(Vh,"#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?zi.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):zi.from(Vh,"#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)}render(t){const e=this.renderer,r=this.quad;let 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);const s=t.uvRespectAnchor?t.anchor.x:0,n=t.uvRespectAnchor?t.anchor.y:0;i=r.uvs,i[0]=i[6]=-s,i[1]=i[3]=-n,i[2]=i[4]=1-s,i[5]=i[7]=1-n,r.invalidate();const o=t._texture,a=o.baseTexture,h=a.alphaMode>0,l=t.tileTransform.localTransform,u=t.uvMatrix;let c=a.isPowerOfTwo&&o.frame.width===a.width&&o.frame.height===a.height;c&&(a._glTextures[e.CONTEXT_UID]?c=a.wrapMode!==me.CLAMP:a.wrapMode===me.CLAMP&&(a.wrapMode=me.REPEAT));const d=c?this.simpleShader:this.shader,p=o.width,f=o.height,m=t._width,g=t._height;$h.set(l.a*p/m,l.b*p/g,l.c*f/m,l.d*f/g,l.tx/m,l.ty/g),$h.invert(),c?$h.prepend(u.mapCoord):(d.uniforms.uMapCoord=u.mapCoord.toArray(!0),d.uniforms.uClampFrame=u.uClampFrame,d.uniforms.uClampOffset=u.uClampOffset),d.uniforms.uTransform=$h.toArray(!0),d.uniforms.uColor=pr.shared.setValue(t.tint).premultiply(t.worldAlpha,h).toArray(d.uniforms.uColor),d.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),d.uniforms.uSampler=o,e.shader.bind(d),e.geometry.bind(r),this.state.blendMode=mr(t.blendMode,h),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}Xh.extension={name:"tilingSprite",type:Or.RendererPlugin},Nr.add(Xh);const zh=class t{constructor(t,e,r){this.linkedSheets=[],(t instanceof Yr||t instanceof cs)&&(t={texture:t,data:e,resolutionFilename:r});const{texture:i,data:s,resolutionFilename:n=null,cachePrefix:o=""}=t;this.cachePrefix=o,this._texture=i instanceof cs?i:null,this.baseTexture=i instanceof Yr?i:this._texture.baseTexture,this.textures={},this.animations={},this.data=s;const a=this.baseTexture.resource;this.resolution=this._updateResolution(n||(a?a.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(t=null){const{scale:e}=this.data.meta;let r=Dr(t,null);return null===r&&(r="number"==typeof e?e:parseFloat(e??"1")),1!==r&&this.baseTexture.setResolution(r),r}parse(){return new Promise((e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()}))}_processFrames(e){let r=e;const i=t.BATCH_SIZE;for(;r-e<i&&r<this._frameKeys.length;){const t=this._frameKeys[r],e=this._frames[t],i=e.frame;if(i){let r=null,s=null;const n=!1!==e.trimmed&&e.sourceSize?e.sourceSize:e.frame,o=new ci(0,0,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution);r=e.rotated?new ci(Math.floor(i.x)/this.resolution,Math.floor(i.y)/this.resolution,Math.floor(i.h)/this.resolution,Math.floor(i.w)/this.resolution):new ci(Math.floor(i.x)/this.resolution,Math.floor(i.y)/this.resolution,Math.floor(i.w)/this.resolution,Math.floor(i.h)/this.resolution),!1!==e.trimmed&&e.spriteSourceSize&&(s=new ci(Math.floor(e.spriteSourceSize.x)/this.resolution,Math.floor(e.spriteSourceSize.y)/this.resolution,Math.floor(i.w)/this.resolution,Math.floor(i.h)/this.resolution)),this.textures[t]=new cs(this.baseTexture,r,o,s,e.rotated?2:0,e.anchor,e.borders),cs.addToCache(this.textures[t],this.cachePrefix+t.toString())}r++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let r=0;r<t[e].length;r++){const i=t[e][r];this.animations[e].push(this.textures[i])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((()=>{this._batchIndex*t.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())}),0)}destroy(t=!1){for(const t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};zh.BATCH_SIZE=1e3;let Wh=zh;const Yh=["jpg","png","jpeg","avif","webp","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"];function qh(t,e,r){const i={};if(t.forEach((t=>{i[t]=e})),Object.keys(e.textures).forEach((t=>{i[`${e.cachePrefix}${t}`]=e.textures[t]})),!r){const r=Be.dirname(t[0]);e.linkedSheets.forEach(((t,s)=>{Object.assign(i,qh([`${r}/${e.data.meta.related_multi_packs[s]}`],t,!0))}))}return i}const Kh={extension:Or.Asset,cache:{test:t=>t instanceof Wh,getCacheableAssets:(t,e)=>qh(t,e,!1)},resolver:{test:t=>{const e=t.split("?")[0].split("."),r=e.pop(),i=e.pop();return"json"===r&&Yh.includes(i)},parse:t=>{const e=t.split(".");return{resolution:parseFloat(Se.RETINA_PREFIX.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",extension:{type:Or.LoadParser,priority:To.Normal},testParse:async(t,e)=>".json"===Be.extname(e.src).toLowerCase()&&!!t.frames,async parse(t,e,r){const{texture:i,imageFilename:s,cachePrefix:n}=e?.data??{};let o,a=Be.dirname(e.src);if(a&&a.lastIndexOf("/")!==a.length-1&&(a+="/"),i&&i.baseTexture)o=i;else{const i=la(a+(s??t.meta.image),e.src);o=(await r.load([i]))[i]}const h=new Wh({texture:o.baseTexture,data:t,resolutionFilename:e.src,cachePrefix:n});await h.parse();const l=t?.meta?.related_multi_packs;if(Array.isArray(l)){const t=[];for(const i of l){if("string"!=typeof i)continue;let s=a+i;e.data?.ignoreMultiPack||(s=la(s,e.src),t.push(r.load({src:s,data:{ignoreMultiPack:!0}})))}const i=await Promise.all(t);h.linkedSheets=i,i.forEach((t=>{t.linkedSheets=[h].concat(h.linkedSheets.filter((e=>e!==t)))}))}return h},unload(t){t.destroy(!0)}}};Nr.add(Kh);class Zh{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Qh{static test(t){return"string"==typeof t&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),r={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const t in e){const i=e[t].match(/^[a-z]+/gm)[0],s=e[t].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),n={};for(const t in s){const e=s[t].split("="),r=e[0],i=e[1].replace(/"/gm,""),o=parseFloat(i),a=isNaN(o)?i:o;n[r]=a}r[i].push(n)}const i=new Zh;return r.info.forEach((t=>i.info.push({face:t.face,size:parseInt(t.size,10)}))),r.common.forEach((t=>i.common.push({lineHeight:parseInt(t.lineHeight,10)}))),r.page.forEach((t=>i.page.push({id:parseInt(t.id,10),file:t.file}))),r.char.forEach((t=>i.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((t=>i.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)}))),r.distanceField.forEach((t=>i.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType}))),i}}class Jh{static test(t){const e=t;return"string"!=typeof t&&"getElementsByTagName"in t&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")}static parse(t){const e=new Zh,r=t.getElementsByTagName("info"),i=t.getElementsByTagName("common"),s=t.getElementsByTagName("page"),n=t.getElementsByTagName("char"),o=t.getElementsByTagName("kerning"),a=t.getElementsByTagName("distanceField");for(let t=0;t<r.length;t++)e.info.push({face:r[t].getAttribute("face"),size:parseInt(r[t].getAttribute("size"),10)});for(let t=0;t<i.length;t++)e.common.push({lineHeight:parseInt(i[t].getAttribute("lineHeight"),10)});for(let t=0;t<s.length;t++)e.page.push({id:parseInt(s[t].getAttribute("id"),10)||0,file:s[t].getAttribute("file")});for(let t=0;t<n.length;t++){const r=n[t];e.char.push({id:parseInt(r.getAttribute("id"),10),page:parseInt(r.getAttribute("page"),10)||0,x:parseInt(r.getAttribute("x"),10),y:parseInt(r.getAttribute("y"),10),width:parseInt(r.getAttribute("width"),10),height:parseInt(r.getAttribute("height"),10),xoffset:parseInt(r.getAttribute("xoffset"),10),yoffset:parseInt(r.getAttribute("yoffset"),10),xadvance:parseInt(r.getAttribute("xadvance"),10)})}for(let t=0;t<o.length;t++)e.kerning.push({first:parseInt(o[t].getAttribute("first"),10),second:parseInt(o[t].getAttribute("second"),10),amount:parseInt(o[t].getAttribute("amount"),10)});for(let t=0;t<a.length;t++)e.distanceField.push({fieldType:a[t].getAttribute("fieldType"),distanceRange:parseInt(a[t].getAttribute("distanceRange"),10)});return e}}class tl{static test(t){return!("string"!=typeof t||!t.includes("<font>"))&&Jh.test(Se.ADAPTER.parseXML(t))}static parse(t){return Jh.parse(Se.ADAPTER.parseXML(t))}}const el=[Qh,Jh,tl];function rl(t,e,r,i,s,n,o){const a=r.text,h=r.fontProperties;e.translate(i,s),e.scale(n,n);const l=o.strokeThickness/2,u=-o.strokeThickness/2;if(e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=function(t,e,r,i,s,n){const o=r.fill;if(!Array.isArray(o))return o;if(1===o.length)return o[0];let a;const h=r.dropShadow?r.dropShadowDistance:0,l=r.padding||0,u=t.width/i-h-2*l,c=t.height/i-h-2*l,d=o.slice(),p=r.fillGradientStops.slice();if(!p.length){const t=d.length+1;for(let e=1;e<t;++e)p.push(e/t)}if(d.unshift(o[0]),p.unshift(0),d.push(o[o.length-1]),p.push(1),r.fillGradientType===yh.LINEAR_VERTICAL){a=e.createLinearGradient(u/2,l,u/2,c+l);let t=0;const i=(n.fontProperties.fontSize+r.strokeThickness)/c;for(let e=0;e<s.length;e++){const r=n.lineHeight*e;for(let e=0;e<d.length;e++){let s=0;s="number"==typeof p[e]?p[e]:e/d.length;const n=r/c+s*i;let o=Math.max(t,n);o=Math.min(o,1),a.addColorStop(o,d[e]),t=o}}}else{a=e.createLinearGradient(l,c/2,u+l,c/2);const t=d.length+1;let r=1;for(let e=0;e<d.length;e++){let i;i="number"==typeof p[e]?p[e]:r/t,a.addColorStop(i,d[e]),r++}}return a}(t,e,o,n,[a],r),e.strokeStyle=o.stroke,o.dropShadow){const t=o.dropShadowColor,r=o.dropShadowBlur*n,i=o.dropShadowDistance*n;e.shadowColor=pr.shared.setValue(t).setAlpha(o.dropShadowAlpha).toRgbaString(),e.shadowBlur=r,e.shadowOffsetX=Math.cos(o.dropShadowAngle)*i,e.shadowOffsetY=Math.sin(o.dropShadowAngle)*i}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;o.stroke&&o.strokeThickness&&e.strokeText(a,l,u+r.lineHeight-h.descent),o.fill&&e.fillText(a,l,u+r.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function il(t){return Array.from?Array.from(t):t.split("")}function sl(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}const nl=class t{constructor(t,e,r){const[i]=t.info,[s]=t.common,[n]=t.page,[o]=t.distanceField,a=Dr(n.file),h={};this._ownsTextures=r,this.font=i.face,this.size=i.size,this.lineHeight=s.lineHeight/a,this.chars={},this.pageTextures=h;for(let r=0;r<t.page.length;r++){const{id:i,file:s}=t.page[r];h[i]=e instanceof Array?e[r]:e[s],o?.fieldType&&"none"!==o.fieldType&&(h[i].baseTexture.alphaMode=ye.NO_PREMULTIPLIED_ALPHA,h[i].baseTexture.mipmap=ge.OFF)}for(let e=0;e<t.char.length;e++){const{id:r,page:i}=t.char[e];let{x:s,y:n,width:o,height:l,xoffset:u,yoffset:c,xadvance:d}=t.char[e];s/=a,n/=a,o/=a,l/=a,u/=a,c/=a,d/=a;const p=new ci(s+h[i].frame.x/a,n+h[i].frame.y/a,o,l);this.chars[r]={xOffset:u,yOffset:c,xAdvance:d,kerning:{},texture:new cs(h[i].baseTexture,p),page:i}}for(let e=0;e<t.kerning.length;e++){let{first:r,second:i,amount:s}=t.kerning[e];r/=a,i/=a,s/=a,this.chars[i]&&(this.chars[i].kerning[r]=s)}this.distanceFieldRange=o?.distanceRange,this.distanceFieldType=o?.fieldType?.toLowerCase()??"none"}destroy(){for(const t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(const t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null}static install(e,r,i){let s;if(e instanceof Zh)s=e;else{const t=function(t){for(let e=0;e<el.length;e++)if(el[e].test(t))return el[e];return null}(e);if(!t)throw new Error("Unrecognized data format for font.");s=t.parse(e)}r instanceof cs&&(r=[r]);const n=new t(s,r,i);return t.available[n.font]=n,n}static uninstall(e){const r=t.available[e];if(!r)throw new Error(`No font found named '${e}'`);r.destroy(),delete t.available[e]}static from(e,r,i){if(!e)throw new Error("[BitmapFont] Property `name` is required.");const{chars:s,padding:n,resolution:o,textureWidth:a,textureHeight:h,...l}=Object.assign({},t.defaultOptions,i),u=function(t){"string"==typeof t&&(t=[t]);const e=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];if(Array.isArray(i)){if(2!==i.length)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);const t=i[0].charCodeAt(0),r=i[1].charCodeAt(0);if(r<t)throw new Error("[BitmapFont]: Invalid character range.");for(let i=t,s=r;i<=s;i++)e.push(String.fromCharCode(i))}else e.push(...il(i))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(s),c=r instanceof Eh?r:new Eh(r),d=a,p=new Zh;p.info[0]={face:c.fontFamily,size:c.fontSize},p.common[0]={lineHeight:c.fontSize};let f,m,g,y=0,_=0,v=0;const x=[],b=[];for(let t=0;t<u.length;t++){f||(f=Se.ADAPTER.createCanvas(),f.width=a,f.height=h,m=f.getContext("2d"),g=new Yr(f,{resolution:o,...l}),x.push(g),b.push(new cs(g)),p.page.push({id:b.length-1,file:""}));const e=u[t],r=xh.measureText(e,c,!1,f),i=r.width,s=Math.ceil(r.height),T=Math.ceil(("italic"===c.fontStyle?2:1)*i);if(_>=h-s*o){if(0===_)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${c.fontFamily}', fontSize: ${c.fontSize}px, char: '${e}')`);--t,f=null,m=null,g=null,_=0,y=0,v=0;continue}if(v=Math.max(s+r.fontProperties.descent,v),T*o+y>=d){if(0===y)throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${c.fontFamily}', fontSize: ${c.fontSize}px, char: '${e}')`);--t,_+=v*o,_=Math.ceil(_),y=0,v=0;continue}rl(f,m,r,y,_,o,c);const E=sl(r.text);p.char.push({id:E,page:b.length-1,x:y/o,y:_/o,width:T,height:s,xoffset:0,yoffset:0,xadvance:i-(c.dropShadow?c.dropShadowDistance:0)-(c.stroke?c.strokeThickness:0)}),y+=(T+2*n)*o,y=Math.ceil(y)}if(!i?.skipKerning)for(let t=0,e=u.length;t<e;t++){const r=u[t];for(let t=0;t<e;t++){const e=u[t],i=m.measureText(r).width,s=m.measureText(e).width,n=m.measureText(r+e).width-(i+s);n&&p.kerning.push({first:sl(r),second:sl(e),amount:n})}}const T=new t(p,b,!0);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=T,T}};nl.ALPHA=[["a","z"],["A","Z"]," "],nl.NUMERIC=[["0","9"]],nl.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],nl.ASCII=[[" ","~"]],nl.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:nl.ALPHANUMERIC},nl.available={};let ol=nl;const al=[],hl=[],ll=[];(class t extends Gn{constructor(e,r={}){super();const{align:i,tint:s,maxWidth:n,letterSpacing:o,fontName:a,fontSize:h}=Object.assign({},t.styleDefaults,r);if(!ol.available[a])throw new Error(`Missing BitmapFont "${a}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new pr(s),this._font=void 0,this._fontName=a,this._fontSize=h,this.text=e,this._maxWidth=n,this._maxLineHeight=0,this._letterSpacing=o,this._anchor=new Si((()=>{this.dirty=!0}),this,0,0),this._roundPixels=Se.ROUND_PIXELS,this.dirty=!0,this._resolution=Se.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){const t=ol.available[this._fontName],e=this.fontSize,r=e/t.size,i=new li,s=[],n=[],o=[],a=il(this._text.replace(/(?:\r\n|\r)/g,"\n")||" "),h=this._maxWidth*t.size/e,l="none"===t.distanceFieldType?al:hl;let u=null,c=0,d=0,p=0,f=-1,m=0,g=0,y=0,_=0;for(let e=0;e<a.length;e++){const r=a[e],l=sl(r);if(/(?:\s)/.test(r)&&(f=e,m=c,_++),"\r"===r||"\n"===r){n.push(c),o.push(-1),d=Math.max(d,c),++p,++g,i.x=0,i.y+=t.lineHeight,u=null,_=0;continue}const v=t.chars[l];if(!v)continue;u&&v.kerning[u]&&(i.x+=v.kerning[u]);const x=ll.pop()||{texture:cs.EMPTY,line:0,charCode:0,prevSpaces:0,position:new li};x.texture=v.texture,x.line=p,x.charCode=l,x.position.x=Math.round(i.x+v.xOffset+this._letterSpacing/2),x.position.y=Math.round(i.y+v.yOffset),x.prevSpaces=_,s.push(x),c=x.position.x+Math.max(v.xAdvance-v.xOffset,v.texture.orig.width),i.x+=v.xAdvance+this._letterSpacing,y=Math.max(y,v.yOffset+v.texture.height),u=l,-1!==f&&h>0&&i.x>h&&(++g,xr(s,1+f-g,1+e-f),e=f,f=-1,n.push(m),o.push(s.length>0?s[s.length-1].prevSpaces:0),d=Math.max(d,m),p++,i.x=0,i.y+=t.lineHeight,u=null,_=0)}const v=a[a.length-1];"\r"!==v&&"\n"!==v&&(/(?:\s)/.test(v)&&(c=m),n.push(c),d=Math.max(d,c),o.push(-1));const x=[];for(let t=0;t<=p;t++){let e=0;"right"===this._align?e=d-n[t]:"center"===this._align?e=(d-n[t])/2:"justify"===this._align&&(e=o[t]<0?0:(d-n[t])/o[t]),x.push(e)}const b=s.length,T={},E=[],A=this._activePagesMeshData;l.push(...A);for(let e=0;e<b;e++){const r=s[e].texture,i=r.baseTexture.uid;if(!T[i]){let e=l.pop();if(!e){const r=new ph;let i,s;"none"===t.distanceFieldType?(i=new fh(cs.EMPTY),s=he.NORMAL):(i=new fh(cs.EMPTY,{program:Vi.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  if (median < 0.01) {\r\n    alpha = 0.0;\r\n  } else if (median > 0.99) {\r\n    alpha = 1.0;\r\n  }\r\n\r\n  // Gamma correction for coverage-like alpha\r\n  float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r\n  float gamma = mix(1.0, 1.0 / 2.2, luma);\r\n  float coverage = pow(uColor.a * alpha, gamma);  \r\n\r\n  // NPM Textures, NPM outputs\r\n  gl_FragColor = vec4(uColor.rgb, coverage);\r\n}\r\n"),uniforms:{uFWidth:0}}),s=he.NORMAL_NPM);const n=new dh(r,i);n.blendMode=s,e={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:n,vertices:null,uvs:null,indices:null}}e.index=0,e.indexCount=0,e.vertexCount=0,e.uvsCount=0,e.total=0;const{_textureCache:s}=this;s[i]=s[i]||new cs(r.baseTexture),e.mesh.texture=s[i],e.mesh.tint=this._tintColor.value,E.push(e),T[i]=e}T[i].total++}for(let t=0;t<A.length;t++)E.includes(A[t])||this.removeChild(A[t].mesh);for(let t=0;t<E.length;t++)E[t].mesh.parent!==this&&this.addChild(E[t].mesh);this._activePagesMeshData=E;for(const t in T){const e=T[t],r=e.total;if(!(e.indices?.length>6*r)||e.vertices.length<2*dh.BATCHABLE_SIZE)e.vertices=new Float32Array(8*r),e.uvs=new Float32Array(8*r),e.indices=new Uint16Array(6*r);else{const t=e.total,r=e.vertices;for(let e=4*t*2;e<r.length;e++)r[e]=0}e.mesh.size=6*r}for(let t=0;t<b;t++){const e=s[t];let i=e.position.x+x[e.line]*("justify"===this._align?e.prevSpaces:1);this._roundPixels&&(i=Math.round(i));const n=i*r,o=e.position.y*r,a=e.texture,h=T[a.baseTexture.uid],l=a.frame,u=a._uvs,c=h.index++;h.indices[6*c+0]=0+4*c,h.indices[6*c+1]=1+4*c,h.indices[6*c+2]=2+4*c,h.indices[6*c+3]=0+4*c,h.indices[6*c+4]=2+4*c,h.indices[6*c+5]=3+4*c,h.vertices[8*c+0]=n,h.vertices[8*c+1]=o,h.vertices[8*c+2]=n+l.width*r,h.vertices[8*c+3]=o,h.vertices[8*c+4]=n+l.width*r,h.vertices[8*c+5]=o+l.height*r,h.vertices[8*c+6]=n,h.vertices[8*c+7]=o+l.height*r,h.uvs[8*c+0]=u.x0,h.uvs[8*c+1]=u.y0,h.uvs[8*c+2]=u.x1,h.uvs[8*c+3]=u.y1,h.uvs[8*c+4]=u.x2,h.uvs[8*c+5]=u.y2,h.uvs[8*c+6]=u.x3,h.uvs[8*c+7]=u.y3}this._textWidth=d*r,this._textHeight=(i.y+t.lineHeight)*r;for(const t in T){const e=T[t];if(0!==this.anchor.x||0!==this.anchor.y){let t=0;const r=this._textWidth*this.anchor.x,i=this._textHeight*this.anchor.y;for(let s=0;s<e.total;s++)e.vertices[t++]-=r,e.vertices[t++]-=i,e.vertices[t++]-=r,e.vertices[t++]-=i,e.vertices[t++]-=r,e.vertices[t++]-=i,e.vertices[t++]-=r,e.vertices[t++]-=i}this._maxLineHeight=y*r;const i=e.mesh.geometry.getBuffer("aVertexPosition"),s=e.mesh.geometry.getBuffer("aTextureCoord"),n=e.mesh.geometry.getIndex();i.data=e.vertices,s.data=e.uvs,n.data=e.indices,i.update(),s.update(),n.update()}for(let t=0;t<s.length;t++)ll.push(s[t]);this._font=t,this.dirty=!1}updateTransform(){this.validate(),this.containerUpdateTransform()}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0);const{distanceFieldRange:e,distanceFieldType:r,size:i}=ol.available[this._fontName];if("none"!==r){const{a:r,b:s,c:n,d:o}=this.worldTransform,a=Math.sqrt(r*r+s*s),h=Math.sqrt(n*n+o*o),l=(Math.abs(a)+Math.abs(h))/2,u=this.fontSize/i,c=t._view.resolution;for(const t of this._activePagesMeshData)t.mesh.shader.uniforms.uFWidth=l*e*u*c}super._render(t)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){const t=ol.available[this._fontName];if(!t)throw new Error(`Missing BitmapFont "${this._fontName}"`);this._font!==t&&(this.dirty=!0),this.dirty&&this.updateText()}get tint(){return this._tintColor.value}set tint(t){if(this.tint!==t){this._tintColor.setValue(t);for(let e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.dirty=!0)}get fontName(){return this._fontName}set fontName(t){if(!ol.available[t])throw new Error(`Missing BitmapFont "${t}"`);this._fontName!==t&&(this._fontName=t,this.dirty=!0)}get fontSize(){return this._fontSize??ol.available[this._fontName].size}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}get text(){return this._text}set text(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)}get maxLineHeight(){return this.validate(),this._maxLineHeight}get textWidth(){return this.validate(),this._textWidth}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)}get roundPixels(){return this._roundPixels}set roundPixels(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)}get textHeight(){return this.validate(),this._textHeight}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}destroy(t){const{_textureCache:e}=this,r="none"===ol.available[this._fontName].distanceFieldType?al:hl;r.push(...this._activePagesMeshData);for(const t of this._activePagesMeshData)this.removeChild(t.mesh);this._activePagesMeshData=[],r.filter((t=>e[t.mesh.texture.baseTexture.uid])).forEach((t=>{t.mesh.texture=cs.EMPTY}));for(const t in e)e[t].destroy(),delete e[t];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}}).styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const ul=[".xml",".fnt"],cl={extension:{type:Or.LoadParser,priority:To.Normal},name:"loadBitmapFont",test:t=>ul.includes(Be.extname(t).toLowerCase()),testParse:async t=>Qh.test(t)||tl.test(t),async parse(t,e,r){const i=Qh.test(t)?Qh.parse(t):tl.parse(t),{src:s}=e,{page:n}=i,o=[];for(let t=0;t<n.length;++t){const e=n[t].file;let r=Be.join(Be.dirname(s),e);r=la(r,s),o.push(r)}const a=await r.load(o),h=o.map((t=>a[t]));return ol.install(i,h,!0)},load:async(t,e)=>(await Se.ADAPTER.fetch(t)).text(),unload(t){t.destroy()}};Nr.add(cl);const dl=class t extends Eh{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new t(Object.keys(t.defaultOptions).reduce(((t,r)=>({...t,[r]:e[r]})),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach((e=>{URL.revokeObjectURL(e.src),e.refs--,0===e.refs&&(e.fontFace&&document.fonts.delete(e.fontFace),delete t.availableFonts[e.originalUrl])})),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,r={}){const{availableFonts:i}=t;if(i[e]){const t=i[e];return this._fonts.push(t),t.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return Se.ADAPTER.fetch(e).then((t=>t.blob())).then((async t=>new Promise(((e,r)=>{const i=URL.createObjectURL(t),s=new FileReader;s.onload=()=>e([i,s.result]),s.onerror=r,s.readAsDataURL(t)})))).then((async([t,s])=>{const n=Object.assign({family:Be.basename(e,Be.extname(e)),weight:"normal",style:"normal",display:"auto",src:t,dataSrc:s,refs:1,originalUrl:e,fontFace:null},r);i[e]=n,this._fonts.push(n),this.styleID++;const o=new FontFace(n.family,`url(${n.src})`,{weight:n.weight,style:n.style,display:n.display});n.fontFace=o,await o.load(),document.fonts.add(o),await document.fonts.ready,this.styleID++,this.fontsDirty=!0}))}addOverride(...t){const e=t.filter((t=>!this._overrides.includes(t)));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter((t=>this._overrides.includes(t)));e.length>0&&(this._overrides=this._overrides.filter((t=>!e.includes(t))),this.styleID++)}toCSS(t){return[`transform: scale(${t})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?["word-wrap: "+(this.breakWords?"break-all":"break-word"),`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce(((t,e)=>`${t}\n            @font-face {\n                font-family: "${e.family}";\n                src: url('${e.dataSrc}');\n                font-weight: ${e.weight};\n                font-style: ${e.style};\n                font-display: ${e.display};\n            }`),this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(r=t,Ie("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),t=pr.shared.setValue(r).toNumber()),"number"==typeof t?(e=t,Ie("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),pr.shared.setValue(e).toHex()):t;var e,r}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,r=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),i=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(255*e|0).toString(16).padStart(2,"0"));const s=`${r}px ${i}px`;return this.dropShadowBlur>0?`text-shadow: ${s} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${s} ${t}`}reset(){Object.assign(this,t.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise((t=>setTimeout(t,100))):Promise.resolve()}get isSafari(){const{userAgent:t}=Se.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};dl.availableFonts={},dl.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let pl=dl;const fl=class t extends Vn{constructor(e="",r={}){super(cs.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=cs.from(i,{scaleMode:Se.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new ci,s.trim=new ci,this.texture=s;const n="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(n,"svg"),h=document.createElementNS(n,"foreignObject"),l=document.createElementNS(o,"div"),u=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=t.defaultMaxWidth,this.maxHeight=t.defaultMaxHeight,this._domElement=l,this._styleElement=u,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(u),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=t.defaultAutoResolution,this._resolution=t.defaultResolution??Se.RESOLUTION,this.text=e,this.style=r}measureText(t){const{text:e,style:r,resolution:i}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:r.toCSS(i)}),this._styleElement.textContent=r.toGlobalCSS(),document.body.appendChild(this._svgRoot);const s=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:n,height:o}=s;(n>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const a=Math.min(this.maxWidth,Math.ceil(n)),h=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",a.toString()),this._svgRoot.setAttribute("height",h.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),r!==this._style&&(Object.assign(this._domElement,{style:this._style?.toCSS(i)}),this._styleElement.textContent=this._style?.toGlobalCSS()),{width:a+2*r.padding,height:h+2*r.padding}}async updateText(t=!0){const{style:e,_image:r,_loadImage:i}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:s,height:n}=this.measureText();r.width=i.width=Math.ceil(Math.max(1,s)),r.height=i.height=Math.ceil(Math.max(1,n)),this._updateID++;const o=this._updateID;await new Promise((t=>{i.onload=async()=>{o<this._updateID||(await e.onBeforeDraw(),r.src=i.src,i.onload=null,i.src="",this.updateTexture()),t()};const s=(new XMLSerializer).serializeToString(this._svgRoot);i.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(s)}`}))}get source(){return this._image}updateTexture(){const{style:t,texture:e,_image:r,resolution:i}=this,{padding:s}=t,{baseTexture:n}=e;e.trim.width=e._frame.width=r.width/i,e.trim.height=e._frame.height=r.height/i,e.trim.x=-s,e.trim.y=-s,e.orig.width=e._frame.width-2*s,e.orig.height=e._frame.height-2*s,this._onTextureUpdate(),n.setRealSize(r.width,r.height,i),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}_renderCanvas(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(t)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds(t)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},t.defaultDestroyOptions,e),super.destroy(e);const r=null;this.ownsStyle&&this._style?.cleanFonts(),this._style=r,this._svgRoot?.remove(),this._svgRoot=r,this._domElement?.remove(),this._domElement=r,this._foreignObject?.remove(),this._foreignObject=r,this._styleElement?.remove(),this._styleElement=r,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=r,this._image.src="",this._image=r}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(t){this.updateText(!0);const e=br(this.scale.x)||1;this.scale.x=e*t/this._image.width/this.resolution,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(t){this.updateText(!0);const e=br(this.scale.y)||1;this.scale.y=e*t/this._image.height/this.resolution,this._height=t}get style(){return this._style}set style(t){this._style!==t&&((t=t||{})instanceof pl?(this.ownsStyle=!1,this._style=t):t instanceof Eh?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=pl.from(t)):(this.ownsStyle=!0,this._style=new pl(t)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(t){t=String(""===t||null==t?" ":t),t=this.sanitiseText(t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}sanitiseText(t){return t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};fl.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},fl.defaultMaxWidth=2024,fl.defaultMaxHeight=2024,fl.defaultAutoResolution=!0;var ml=r(2602);const gl={PickMode:0,Lining:1,Orthogonal:!1,Snap:!1,BoundaryFormation:!1,PosText:!1,TextHeight:3.5,Overlap:!1,Image:void 0,UserInput:"",Selection:{GUID:0,Type:Yt.Unknown},Initialized:!1},yl=new class{constructor(){this._State=gl,this.watched=[],this._isNotifying=!1}get State(){return this._State}set State(t){throw new Error("Can't set state externally")}get LineWidth(){return.5+.3*(ie[ie[this._State.Lining%3]]-ie.MEDIUM)}get LineMode(){let t=0;return this._State.Lining>=3&&(t=1),se[se[t]]}get LineStyle(){return this.LineMode==se.DOTTED?[6.35,3.175]:[0]}unregister(t){const e=this.watched.indexOf(t);e>-1&&this.watched.splice(e,1)}register(t){return this.watched.push(t),this._State}publish(t,e=!0){this._State=Object.assign(this._State,t),e&&(this.watched.forEach((t=>{this._notifyAndGet(t,this._State)})),console.info("State Published: ",this._State))}_notifyAndGet(t,e){if(this._isNotifying)return;this._isNotifying=!0;const r=t.observed(e);r&&(this._State={...this._State,...r},this.watched.forEach((e=>{e!==t&&e.observed(this._State)}))),this._isNotifying=!1}};window.rsm=yl;class _l{setPickStyle(t){yl.publish({PickMode:t})}setLineStyle(t){yl.publish({Lining:t})}setOrthogonal(t){yl.publish({Orthogonal:t})}setSnap(t){yl.publish({Snap:t})}setBoundaryFormation(t){yl.publish({BoundaryFormation:t})}setPosText(t){yl.publish({PosText:t})}setTextHeight(t){yl.publish({TextHeight:t})}setUserInput(t){yl.publish({UserInput:t})}setImage(t){yl.publish({Image:t})}registerListener(t){return yl.register(t)}unregisterListener(t){yl.unregister(t)}setInitialized(){yl.publish({Initialized:!0})}}class vl extends Gn{constructor(){super(...arguments),this._autoUpdate=!0}addChild(...t){return super.addChild(...t),this._autoUpdate&&t.forEach((t=>t.update())),t[0]}get AutoUpdate(){return this._autoUpdate}set AutoUpdate(t){this._autoUpdate=t}getNextIndent(){let t=this.children.map((t=>t.GeometryData.Ind));return 0!=t.length?Math.max(...t)+1:0}}class xl extends vl{constructor(t){super(),this.globals=t;const{Pos:e,Scale:r,Rot:i}=this.Globals;this.setTransform(e[0],e[1],r[0],r[1],i[0])}get Print(){return this.parent}get Globals(){return this.globals}addChild(...t){return super.addChild(...t)}getRelatedChildren(t){return this.children.filter((e=>e.GeometryData.DGUIDPO===t.GeometryData.DGUIDPO||e.GeometryData.DGUID===t.GeometryData.DGUID))}}class bl extends xl{constructor(){super({Pos:[0,0,0],Scale:[1,1,1],Rot:[0,0,0],YMIN:0,YMAX:0,XMIN:0,XMAX:0,VCT:0,GCCOffsetIndex:0,GCCGuid:"",GCCDGuid:0,DimVars:{ArrowLength:2.5,ArrowThickness:2.5,DimScale:25,DistContour:0,DistHelp2MassLine:0,DistText2MassLine:0,LineWidth:.2,TextHeight:2.5,line_r:0,line_g:0,line_b:0,text_r:0,text_g:0,text_b:0}}),this.setTransform()}}class Tl extends Gn{get World(){return this.parent}get Scene(){return this.parent}get UserContainer(){return this._userContainer||(this._userContainer=new bl,this.addChild(this._userContainer)),this._userContainer}getRelevantGraphs(t){let e=this.children.filter((t=>1!=t.scale.x));return t||e.push(this.UserContainer),e}getGraphById(t){return this.getRelevantGraphs(!0).find((e=>e.Globals.GCCGuid===t))}getGeometry(t){for(const e of this.getRelevantGraphs())for(const r of e.children)if(!t||t(r))return r}getGeometries(t){let e=[];for(const r of this.getRelevantGraphs())for(const i of r.children)t&&!t(i)||e.push(i);return e}getGeometryAt(t,e,r,i,s){let n,o=Number.MAX_SAFE_INTEGER;for(const e of this.getRelevantGraphs())for(let a of e.children){if(i){if(!i(a))continue}else if(a.GeometryData.DGUID<=0||a.GeometryData.DGUIDPO<=0)continue;if(s&&a.GeometryData.Type!=s)continue;let e=a.getDistance(t);e<r&&e<o&&(o=e,n=a)}return n}getSnapPointAt(t,e,r){let i,s=e;for(let e of this.getRelevantGraphs())for(let n of e.children){if(r&&r(n))continue;if(n.GeometryData.DGUID<=0||n.GeometryData.DGUIDPO<=0)continue;let e=n.getSnapPoint(t);if(e){let r=e.getDistance(t);r<s&&(s=r,i=e)}}return i}}const El=new class{constructor(){this.inch=25.4,this.dpi=72,this.scaleOperationConfig={DGUID:1,DGUIDPO:1,BlockGuid:1,RedFlags:1,Ind:1,OffsetIndex:1,VCT:1,MMZS:1,Type:1,Circle:{Rad:1},Text:{Align:1,Angle:1,SAP:1,StyleBit:1,Wrap:1,Overlap:1,DY:6,Height:6,RowDist:6},Image:{RZ:1},Block:{BlockGuid:1,BlockType:1},Polygon:{Vertices:0}}}get PixelFactor(){return this.inch/this.dpi}get ScaleFactor(){return 1/this.PixelFactor}toPX(t){return t*(1/this.ScaleFactor)}toMM(t){return t*this.ScaleFactor}globalsToMM(t){return t.Pos=[this.toMM(t.Pos[0]),this.toMM(t.Pos[1]),this.toMM(t.Pos[2])],t}globalsToPixels(t){return t.Pos=[this.toPX(t.Pos[0]),this.toPX(t.Pos[1]),this.toPX(t.Pos[2])],t}arrayToMM(t){return t.length>0&&Array.isArray(t[0])?t.map((t=>this.arrayToMM(t))):t.map((t=>this.toMM(t)))}arrayToPX(t){return t.length>0&&Array.isArray(t[0])?t.map((t=>this.arrayToPX(t))):t.map((t=>this.toPX(t)))}convertShapeUnitsToPixels(t,e=this.getIgnoredKeys(t,8)){const r=JSON.parse(JSON.stringify(t));return Object.keys(t).filter((t=>!e.includes(t))).forEach((t=>{const e=r[t];Array.isArray(e)?r[t]=this.arrayToMM(r[t]):"number"==typeof e&&(r[t]=this.toMM(e))})),r}convertShapeUnitsToMillimeters(t,e=this.getIgnoredKeys(t,16)){const r=JSON.parse(JSON.stringify(t));return Object.keys(t).filter((t=>!e.includes(t))).forEach((t=>{const e=r[t];Array.isArray(e)?r[t]=this.arrayToPX(r[t]):"number"==typeof e&&(r[t]=this.toPX(e))})),r}translatedShape(t,e){const r=this.getIgnoredKeys(t,2),i=JSON.parse(JSON.stringify(t));return Object.keys(i).filter((t=>!r.includes(t))).forEach((t=>{const r=i[t];if(Array.isArray(r))i[t]=this.translateArray(r,e);else if("number"==typeof r){const s=this.getTranslationOffset(t);i[t]=-1===s?r*e.Scale[0]:r*e.Scale[s]+e.Pos[s]}})),i}inverseTranslatedShape(t,e,r=this.getIgnoredKeys(t,4)){const i=JSON.parse(JSON.stringify(t));return Object.keys(i).filter((t=>!r.includes(t))).forEach((t=>{let r=i[t];if(Array.isArray(r))i[t]=this.inverseTranslateArray(r,e);else if("number"==typeof r){const s=this.getTranslationOffset(t);-1===s?(r/=e.Scale[0],r=Math.round(r)):(r-=e.Pos[s],r/=e.Scale[s],r+=e.Pos[s]*e.Scale[s],r=Math.round(r),r-=e.Pos[s]*e.Scale[s]),i[t]=r}})),i}exportGeometryData(t,e){const r=this.inverseTranslatedShape(t,e);return this.convertShapeUnitsToMillimeters(r)}translateArray(t,e){if(t.length>0&&Array.isArray(t[0]))return t.map((t=>this.translateArray(t,e)));for(let r=0;r<t.length;r++)t[r]*=e.Scale[r],t[r]+=e.Pos[r];return t}inverseTranslateArray(t,e){if(t.length>0&&Array.isArray(t[0]))return t.map((t=>this.inverseTranslateArray(t,e)));for(let r=0;r<t.length;r++)t[r]-=e.Pos[r],t[r]/=e.Scale[r],t[r]+=e.Pos[r]*e.Scale[r],t[r]=Math.round(t[r]),t[r]-=e.Pos[r]*e.Scale[r];return t}getIgnoredKeys(t,e){const r=new Set,i=e=>{Object.entries(this.scaleOperationConfig).forEach((([i,s])=>{if("number"==typeof s)(s&e)===e&&r.add(i);else if(i===t.TypeS){const t=s;Object.entries(t).forEach((([t,i])=>{(i&e)===e&&r.add(t)}))}}))};return i(1),i(e),Array.from(r)}getTranslationOffset(t){const e=[["x"],["y","height"]].findIndex((e=>e.some((e=>t.toLowerCase().includes(e.toLowerCase())))));return e>-1&&(t.startsWith("D")||"Rad"===t)?-1:e}};class Al{constructor(t=0,e=0){this.x=t,this.y=e}static fromAngle(t){return t=-t,new Al(Math.cos(t),Math.sin(t))}static validate(t){return null==t?null:t instanceof Al?t:"x"in t&&"y"in t?new Al(t.x,t.y):null}static fromArray(t){return new Al(t[0],t[1])}static dotXY(t,e,r,i){return t*r+e*i}static dot(t,e){return Al.dotXY(t.x,t.y,e.x,e.y)}static getPointOnLine(t,e,r,i=!0){let s=e.getVector(t),n=this.dot(s,r.getVector(t))/this.dot(s,s);if(i){if(n<0)return t;if(n>1)return e}return t.add(s.multiplyBy(n))}static getPointOnCircle(t,e,r){let i=e.getVector(t).normalize();return t.clone().add(i.multiplyBy(r))}static getCentroid(t){let e=new Al(0,0);for(let r=0;r<t.length;r++)e.add(t[r]);return e.divideBy(t.length)}get(t){return this.toArray()[t]}rotate(t,e){let r=t*oi;return this.rotateRad(r,e)}rotateRad(t,e){e||(e=new Al);let r=this.clone().subtract(e),i=r.x*Math.cos(t)-r.y*Math.sin(t),s=r.x*Math.sin(t)+r.y*Math.cos(t);return new Al(i,s).add(e)}round(t){let e=t?1/t:1;return this.x=Math.round(this.x*e)/e,this.y=Math.round(this.y*e)/e,this}ratio(){return this.x/this.y}isZero(){return 0==this.x&&0==this.y}max(){return Math.max(this.x,this.y)}min(){return Math.min(this.x,this.y)}abs(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this}applyP(t){return this.applyXY(t.x,t.y)}apply(t){return this.applyXY(t.x,t.y),this}applyXY(t=0,e=0){return this.x=t,this.y=e,this}clone(){return new Al(this.x,this.y)}normalize(){return this.divideBy(this.getLength())}getLength(){return Math.sqrt(this.getLengthSquared())}getLengthSquared(){return this.x*this.x+this.y*this.y}mul(t){return this.mulXY(t.x,t.y)}mulXY(t,e){return this.x*=t,this.y*=e,this}multiplyBy(t){return this.mulXY(t,t)}invert(){return this.multiplyBy(-1)}swap(){return new Al(this.y,this.x)}divideBy(t){return this.divXY(t,t)}div(t){return this.divXY(t.x,t.y)}divXY(t,e){return this.x/=t,this.y/=e,this}add(t){return this.addXY(t.x,t.y)}addXY(t,e){return this.x+=t,this.y+=e,this}subtract(t){return this.subtractXY(t.x,t.y)}subtractXY(t,e){return this.x-=t,this.y-=e,this}scale(){return this.x=El.toMM(this.x),this.y=El.toMM(this.y),this}unscale(){return this.x=El.toPX(this.x),this.y=El.toPX(this.y),this}getDistance(t){return t?this.getDistanceXY(t.x,t.y):1/0}getDistanceXY(t,e){let r=this.x-t,i=this.y-e;return Math.sqrt(r*r+i*i)}getMiddle(t){return this.getMiddleXY(t.x,t.y)}getMiddleXY(t,e){return new Al((this.x+t)/2,(this.y+e)/2)}getAngle(t){return this.getAngleXY(t.x,t.y)}getAngleXY(t,e){return(Math.atan2(this.x,this.y)-Math.atan2(t,e))/oi}getOrthoVector(t){let e=this.getVector(t);return new Al(-e.y,e.x).normalize()}getVector(t){return this.getVectorXY(t.x,t.y)}getVectorXY(t,e){return new Al(this.x-t,this.y-e)}getSlopeToXY(t,e){let r=this.getVectorXY(t,e),i=r.y/r.x;return Number.isFinite(i)?i:0}getSlopeTo(t){return this.getSlopeToXY(t.x,t.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.x=this.x,t.y=this.y,t}set(t,e){return t&&(this.x=t),e&&(this.y=e),this}equals(t,e){if(null==t||!(t instanceof Al))return!1;if(e){let r=this.getVector(t).abs();return r.x<e&&r.y<e}return this.x==t.x&&this.y==t.y}toArray(){return[this.x,this.y]}toVec3Array(t=0){return[this.x,this.y,t]}toVec4Array(t=0,e=0){return[this.x,this.y,t,e]}}class Sl extends Gn{constructor(t){super(),this._geometryData=t,this._autoUpdate=!0,this._selected=!1,this._highlighted=!1,this._dashedLine=void 0,this._displayObject=this.createDisplayObject(),this.addChild(this._displayObject)}set AutoUpdate(t){this._autoUpdate=t}get GraphContainer(){return this.parent}get OriginParent(){return this.GraphContainer?.Print.getGraphById(this.GeometryData.ParentGCGuid)||this.GraphContainer}get GeometryData(){return this._geometryData}set GeometryData(t){this._geometryData=t,this._autoUpdate&&this.update()}get Selected(){return this._selected}set Selected(t){const e=this._selected!=t;this._selected=t,this._autoUpdate&&e&&this.update()}get Highlighted(){return this._highlighted}set Highlighted(t){const e=this._highlighted!=t;this._highlighted=t,this._autoUpdate&&e&&this.update()}destroy(t){super.destroy(t)}createDisplayObject(){return new ah}updateDepth(){const t=this.zIndex;this.zIndex=this.getDepth(),this.parent&&t!=this.zIndex&&this.parent.sortChildren()}update(t,e=!0){return t=t||this._displayObject,e&&t&&t.clear(),this.updateDepth(),this.applyGeometryStyle(t)}applyGeometryStyle(t){let e=this._selected?this.rgbToHex([0,0,255]):this.getStrokeColor();this._highlighted&&(e=this.rgbToHex([255,0,0]));let r=this.getLineWidthDefinition();return t.lineStyle({width:r.width,color:e,alignment:r.alignment,cap:this.GeometryData.BlockGuid>0?Ha.BUTT:Ha.SQUARE,native:r.native}),t}getDashLineGeometry(t){if(!this.getLineDash())return t;t=t||this._displayObject;const e=new ml.DashLine(t,Object.assign({dash:this.getLineDash()},t.line));return this.applyGeometryStyle(t),e}getParentScale(t=this.GraphContainer){return t&&t.Globals?.Scale[0]||1}getDepth(){return this._highlighted?1e3:this._selected?999:0}getLineDash(){if(this.GeometryData.Props.LSACAD&&"0"!=this.GeometryData.Props.LSACAD)return this.GeometryData.Props.LSACAD.split(",").map((t=>parseInt(t)/this.getParentScale()))}getLineWidthDefinition(t=this.getParentScale()){let e=this.GeometryData.Props.Width,r=e<=.2;return this.Highlighted&&(e*=1.25),{width:e,alignment:.5,native:r}}getLineWidth(t=this.getParentScale()){return this.getLineWidthDefinition(t).width}getStrokeColor(){return this.GeometryData.Props?.Stroke_RGB?this.rgbToHex(this.GeometryData.Props.Stroke_RGB):this.rgbToHex([0,0,0])}getFillColor(){return this.GeometryData.Props?.Fill?this.rgbToHex(this.GeometryData.Props.Fill):this.rgbToHex([0,0,0])}getRandomColor(){return this.rgbToHex([Math.floor(255*Math.random()),Math.floor(255*Math.random()),Math.floor(255*Math.random())])}rgbToHex(t){return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1).toUpperCase()}getSnapPoint(t){}getDistance(t){let e=Number.MAX_SAFE_INTEGER,r=this.getDistancePoints(t);return r&&r.length>0&&(e=Math.min(...r.map((e=>e.getDistance(t))))),e}getDistancePoints(t){const e=this.getSnapPoint(t||new Al(0,0));return e?[e]:[]}exportGeometryData(){const t=this.OriginParent.Globals;return El.exportGeometryData(this.GeometryData,t)}applyPropertiesFrom(t){}getLocalBounds(t){return new ci}get x(){return 0}}class wl extends Sl{get P1(){return this._p1||(this._p1=new Al),this._p1.applyXY(this.GeometryData.P1[0],this.GeometryData.P1[1])}set P1(t){this.GeometryData.P1[0]=t.x,this.GeometryData.P1[1]=t.y,this._p1.apply(t)}get P2(){return this._p2||(this._p2=new Al),this._p2.applyXY(this.GeometryData.P2[0],this.GeometryData.P2[1])}set P2(t){this.GeometryData.P2[0]=t.x,this.GeometryData.P2[1]=t.y,this._p2.apply(t)}constructor(t){super(t)}createDisplayObject(){const t=new ah;return this.update(t),t}update(t){const e=this.getDashLineGeometry(t=super.update(t));return e.moveTo(this.P1.x,this.P1.y),e.lineTo(this.P2.x,this.P2.y),t}getBounds(){if(this.parent){const t=this.toGlobal(this.P1,new Al),e=this.toGlobal(this.P2,new Al);let r=t.getVector(e),i=r.getLength(),s=this.getLineWidth(),n=.5*s*r.x/i,o=.5*s*r.y/i,a=Math.min(t.x,e.x)-Math.abs(o),h=Math.max(t.x,e.x)+Math.abs(o),l=Math.min(t.y,e.y)-Math.abs(n),u=Math.max(t.y,e.y)+Math.abs(n);return new ci(a,l,h-a,u-l)}return ci.EMPTY}getSnapPoint(t){if(this.parent)return Al.getPointOnLine(this.toGlobal(this.P1,new Al),this.toGlobal(this.P2,new Al),t)}get x(){return this.P1.x}}class Pl extends Sl{get PM(){return new Al(this.GeometryData.PM[0],this.GeometryData.PM[1])}get Rad(){return this.GeometryData.Rad}createDisplayObject(){const t=new ah;return this.update(t),t}update(t){const e=this.getDashLineGeometry(t=super.update(t)),{PM:r,Rad:i}=this;return e.drawCircle(r.x,r.y,i/this.getParentScale()),t}getSnapPoint(t){return Al.getPointOnCircle(this.toGlobal(this.PM).copyTo(new Al),t,this.Rad)}}const Rl=new class{constructor(){this.ncr_regex=/&#(x?)([0-9a-fA-F]+);/g}encodeNCR(t){return t.replace(this.ncr_regex,((t,e,r)=>{const i=parseInt(r,e?16:10);return String.fromCodePoint(i)}))}};window.NCR=Rl;const Ml=new class{constructor(){this.debugInteractionManager=!1}prefix(t){return`[${t}] »`}logInteractionManager(...t){this.debugInteractionManager&&console.log(this.prefix("InteractionManager"),...t)}};window.ds=Ml;var Cl={furnplanPrefix:"manufacturer/_global/_global/html/",Images:[{name:"Schwarz",imagePath:"redlining/assets/overlay/black.png"},{name:"Weiss",imagePath:"redlining/assets/overlay/white.png"},{name:"Test",imagePath:"redlining/assets/overlay/test.jpg"},{name:"Haken",imagePath:"redlining/assets/overlay/check.png",size:{dimension:{x:10,y:10},scalable:!1}}]},Il=(Object.getOwnPropertyDescriptor,(t,e)=>(r,i)=>e(r,i,t));let Dl=class{constructor(t,e){this.client=t,this.endpoint=e,this._textures=new Map,this.images="furnplan"===this.client?Cl.Images.map((t=>(t.imagePath=Cl.furnplanPrefix+t.imagePath,t))):Cl.Images}getImageTexture(t){if(t=this.endpoint+t,this._textures.has(t))return this._textures.get(t);const e=cs.from(t);return this._textures.set(t,e),e}getImages(){return this.images}registerImages(){}toExportPath(t){return t.includes(Cl.furnplanPrefix)?t:Cl.furnplanPrefix+t}toFurnplanPath(t){let e=t.replaceAll("\\","/").split("/"),r=e.filter((t=>t.startsWith("manufacturer")))[0],i=e.indexOf(r);return e.slice(i,e.length).join("\\")}toFurnviewPath(t){return t.split("/").pop()||""}toClientPath(t){return"furnplan"===this.client?this.toFurnplanPath(t):this.toFurnviewPath(t)}};Dl=((t,e)=>{for(var r,i=e,s=t.length-1;s>=0;s--)(r=t[s])&&(i=r(i)||i);return i})([w(),Il(0,S("Client")),Il(1,S("ImageServiceEndpointUrl"))],Dl);class Ol extends Sl{get Text(){return Rl.encodeNCR(this.GeometryData.Text.replaceAll("\n","~").replaceAll("\r",""))}get P(){return new Al(this.GeometryData.P[0],this.GeometryData.P[1])}get Height(){return this.GeometryData.Height}get RowDist(){return this.GeometryData.RowDist}createDisplayObject(){const t=new ah;return this.update(t),t}update(t){const e=1/this.getParentScale();for(t=super.update(t,!0);t.children.length>0;)t.removeChildAt(0).destroy({children:!0,texture:!0,baseTexture:!0});const r=this.Text;if(r.includes("~")){const i=r.split("~"),s=this.Height*e;let n=i.length*s;for(let e=0;e<i.length;e++){const r=i[e],s=this.buildBasicTextGraphics(r,t.line);s.y=n,t.addChild(s),n-=this.GeometryData.RowDist}}else t.addChild(this.buildBasicTextGraphics(r,t.line));return t.position.copyFrom(this.P),t.angle=this.GeometryData.Angle,t.scale.set(e,e),t}getDistancePoints(t){return[this.toGlobal(this.P).copyTo(new Al)]}getTextAlign(t){return{horizontal:--t%3,vertical:Math.floor(t/3)}}getScaleRange(t=El.toPX(this.Height),e=1,r=5,i=2.5,s=30){return r-(t-i)*(r-e)/(s-i)}exportGeometryData(){const t=super.exportGeometryData();return t.Text=this.Text,t}buildBasicTextGraphics(t,e){const r=this.getTextAlign(this.GeometryData.Align),i=new ah,s=new Eh;s.fontFamily=this.GeometryData.Font,s.fontSize=this.Height,s.align="left",s.leading=0,s.wordWrap=!1,s.fill=e.color;const n=new Rh(t,s);n.resolution=this.getScaleRange();const o=xh.measureText(n.text,s,!1,n.canvas),a=new Al(o.width/2,(n.height+(n.height-1-o.fontProperties.ascent))/2);a.mulXY(r.horizontal,r.vertical),n.position.set(0,a.y),n.scale.y=-1,i.addChild(n);const h=a.rotate(this.GeometryData.Angle);return i.position.set(-h.x,0),i}}class Bl extends Sl{get Vertices(){return this.GeometryData.Vertices.map((t=>new Al(t[0],t[1])))}createDisplayObject(){const t=new ah;return this.update(t),t}update(t){t=super.update(t);const e=this.Vertices.map((t=>new li(t.x,t.y)));return t.beginFill(t.line.color,t.line.alpha),t.drawPolygon(e),t.endFill(),t}getBounds(){if(this.parent){const t=this.Vertices.map((t=>this.toGlobal(t).copyTo(new Al)));let e=Math.min(...t.map((t=>t.x))),r=Math.min(...t.map((t=>t.y))),i=Math.max(...t.map((t=>t.x))),s=Math.max(...t.map((t=>t.y)));return new ci(e,r,i-e,s-r)}return ci.EMPTY}getDistancePoints(t){if(t){const e=this.getSnapPoint(t);if(e)return[e]}return[]}getSnapPoint(t){if(this.parent){const e=this.Vertices.map((t=>this.toGlobal(t).copyTo(new Al)));let r,i=Number.MAX_SAFE_INTEGER;for(let s=0;s<e.length;s++){let n=e[s],o=t.getDistance(n);o<i&&(i=o,r=n.clone())}return r}}setVertexData(t,e){this.GeometryData.Vertices[t][0]=e.x,this.GeometryData.Vertices[t][1]=e.y}}class Ll extends Sl{constructor(t){super(t),this._dirty=!0,this._linked=[],this._autoUpdate=!1}get Dirty(){return this._dirty}set Dirty(t){this._dirty=t}getLinkedShapes(t){if(t&&(0===this._linked.length||this._dirty)){if(this._linked=t.getLinkedGeometries(this.GeometryData),this._linked.length>0){const t=this._linked[0];this.GeometryData.DGUID=t.GeometryData.DGUID,this.GeometryData.DGUIDPO=t.GeometryData.DGUIDPO}this._dirty=!1}return this._linked}update(t,e=!0){return this._linked.forEach((t=>t.update())),super.update(t,e)}exportGeometryData(){let t=this._geometryData._shape;return"_shape"in t&&(t=t._shape),t}}const Nl=new class{constructor(){this.counter=0,this.CMinute=4004}randomGUID(){let t=new Date,e=1e6*(t.getSeconds()+60*t.getMinutes()+60*t.getHours()*60);return e+=1e9*t.getDay(),e+=1e12*(t.getFullYear()-100),e+=this.counter++,this.CMinute!=t.getMinutes()&&(this.counter=0,this.CMinute=t.getMinutes()),e}},Fl={Fill:[0,0,0],FillOpacity:1,LineCap:Ha.BUTT,LSACAD:"",LType:0,Stroke_RGB:[0,0,0],StrokeOpacity:1,Width:.5,ZOrder:0},kl={Props:Fl,DGUID:0,DGUIDPO:0,BlockGuid:0,RedFlags:0,Ind:0,OffsetIndex:0,VCT:0,MMZS:0,Custom:!1,ParentGCGuid:"",Type:Yt.Unknown,TypeS:"Unknown"},Ul=new class{createImageData(t){const e=t?.Position||new Al(0,0),r={Type:Yt.Image,PX:e.x,PY:e.y,DX:t?.Dimension?.x||0,DY:t?.Dimension?.y||0,RZ:t?.ZDepth||0,ImageFile:t.ImageFile||"",P:e.toVec3Array()};return this.createGeometryData(r,!0)}createTextData(t){const e={Type:Yt.Text,P:[t.P?.x||0,t.P?.y||0,0],Height:t?.Height||0,RowDist:t?.RowDist||1.1*(t?.Height||1)||1.1,SAP:t?.SAP||0,Overlap:t?.Overlap||0,Text:t?.Text||"",Align:t?.Align||0,Angle:t?.Angle||0,StyleBit:t?.StyleBit||0,Font:t?.Font||""};return this.createGeometryData(e,!0)}createBlockData(t,e=!1){const r={Type:Yt.Block,BlockType:t?.blockType||qt.Unknown,BlockGuid:t?.blockGuid||Nl.randomGUID()};return this.createGeometryData(r,e)}createPolygonData(t){const e={Type:Yt.Polygon,Vertices:t?.vertices?.map((t=>[t.x,t.y,0]))||[]};return this.createGeometryData(e,!0)}createLineData(t){const e={Type:Yt.Line,P1:[t?.p1?.x||0,t?.p1?.y||0,0],P2:[t?.p2?.x||0,t?.p2?.y||0,0]};return this.createGeometryData(e,!0)}createCircleData(t){const e={Type:Yt.Circle,PM:[t?.p?.x||0,t?.p?.y||0,0],Rad:t?.rad||0};return this.createGeometryData(e,!0)}createGeometryData(t,e){if(!t.Type)throw new Error("Unable to create geometry with no type!");return t.TypeS=Yt[t.Type].toString(),e&&(t=Object.assign({},this.getShapeDefaults(),t)),t}getShapeDefaults(){const t=kl;return t.Props.LSACAD&&"0"!=t.Props.LSACAD?t.Props.LType=842:t.Props.LType=375,t}applyFinishedProperties(t,e,r,i){return e.Ind=t,e.OffsetIndex=r.OffsetIndex,e.DGUID=r.DGUIDPO,e.DGUIDPO=r.DGUIDPO,e.VCT=r.VCT,e.MMZS=r.MMZS,e.OffsetIndex=r.OffsetIndex,e.ParentGCGuid=r.ParentGCGuid,e.RedFlags=0,i&&(e.MMZS=i.BoundaryFormation?1:0),e}};class Gl{constructor(t){this._shape=t,this._p1=new Al,this._p2=new Al}MergeGeomData(t,e){Kt(t)&&Kt(e)&&(t.P1=e.P1,t.P2=e.P2),Jt(t)&&Jt(e)&&(t.Vertices=e.Vertices)}getGeometries(){return this._getGeometries().map((t=>(t.BlockGuid=this._shape.BlockGuid,t)))}get P1(){return this._p1}set P1(t){t&&this._p1.apply(t)}get P2(){return this._p2}set P2(t){t&&this._p2.apply(t)}get Type(){return this._shape.Type}get TypeS(){return this._shape.TypeS}set TypeS(t){this._shape.TypeS="Block"}get BlockType(){return this._shape.BlockType}get BlockGuid(){return this._shape.BlockGuid}set BlockGuid(t){this._shape.BlockGuid=t}get Props(){return Fl}get DGUID(){return this._shape.DGUID}set DGUID(t){this._shape.DGUID=t}get DGUIDPO(){return this._shape.DGUIDPO}set DGUIDPO(t){this._shape.DGUIDPO=t}get RedFlags(){return this._shape.RedFlags}set RedFlags(t){this._shape.RedFlags=t}get Ind(){return this._shape.Ind}set Ind(t){this._shape.Ind=t}get OffsetIndex(){return this._shape.OffsetIndex}set OffsetIndex(t){this._shape.OffsetIndex=t}get VCT(){return this._shape.VCT}set VCT(t){this._shape.VCT=t}get MMZS(){return this._shape.MMZS}set MMZS(t){this._shape.MMZS=t}get ParentGCGuid(){return this._shape.ParentGCGuid}set ParentGCGuid(t){this._shape.ParentGCGuid=t}export(){return Ul.createGeometryData(this._shape,!1)}}class Hl extends Gl{constructor(){super(...arguments),this._arrowLength=El.toMM(2.5),this._arrowHeight=0}set ArrowLength(t){this._arrowLength=t}get ArrowLength(){return this._arrowLength}set ArrowHeight(t){this._arrowHeight=t}get ArrowHeight(){return this._arrowHeight||(this._arrowHeight=this._arrowLength/2),this._arrowHeight}createLine(t,e){return Ul.createLineData({p1:t,p2:e})}createPolygon(t,e,r){let i=e.getOrthoVector(t).multiplyBy(r/2),s=e.clone().add(i),n=e.clone().subtract(i);return Ul.createPolygonData({vertices:[t,s,n]})}}class jl extends Gl{constructor(t){super(t)}getNeededLines(){let t=new Al(this.P2.x,this.P1.y),e=new Al(this.P1.x,this.P2.y);return[[this.P1,t],[t,this.P2],[this.P2,e],[e,this.P1]]}_getGeometries(){return this.getNeededLines().map((t=>Ul.createLineData({p1:t[0],p2:t[1]})))}}class Vl extends Hl{_getGeometries(){return this.getNeededShapes()}getNeededShapes(){let t=this.getNeededLines().map((t=>Ul.createLineData({p1:t[0],p2:t[1]})));return[...t,...this.getPolygons(this.ArrowLength,this.ArrowHeight)]}getNeededLines(){return[[this.P1,this.P2]]}getPolygons(t=this.ArrowLength,e=this.ArrowHeight){let r=this.P1,i=this.P2,s=r.getVector(i).normalize(),n=r.clone().add(s.multiplyBy(-t));return[this.createPolygon(r,n,e)]}}class $l extends Hl{constructor(){super(...arguments),this._offset=2.5,this._minLength=2.5,this._maxLength=10,this._leftLength=5,this._rightLength=5}get Offset(){return this._offset}set Offset(t){this._offset=t}get MinLength(){return this._minLength}set MinLength(t){this._minLength=t}get MaxLength(){return this._maxLength}set MaxLength(t){this._maxLength=t}get LeftLength(){return this._leftLength}set LeftLength(t){this._leftLength=this.clampLength(t)}get RightLength(){return this._rightLength}set RightLength(t){this._rightLength=this.clampLength(t)}_getGeometries(){return this.getNeededShapes()}getNeededShapes(){let t=this.getNeededLines().map((t=>this.createLine(t[0],t[1])));return[...t,...this.getPolygons(this.ArrowLength,this.ArrowHeight)]}getNeededLines(){let t=this.P1,e=this.P2,r=[t,e],i=t.getOrthoVector(e),s=i.clone().multiplyBy(this.Offset),n=i.clone().multiplyBy(this.Offset+this.LeftLength),o=i.clone().multiplyBy(this.Offset+this.RightLength);return[r,[t.clone().subtract(s),t.clone().add(n)],[e.clone().subtract(s),e.clone().add(o)]]}getPolygons(t,e){let r=this.P1,i=this.P2,s=r.getVector(i).normalize(),n=r.clone().add(s.clone().multiplyBy(-t)),o=i.clone().add(s.clone().multiplyBy(t));return[this.createPolygon(r,n,e),this.createPolygon(i,o,e)]}clampLength(t){return(t-=this._offset+this.MinLength)<this.MinLength-this._offset?t=this.MinLength-this._offset:t>this.MaxLength&&(t=this.MaxLength-this._offset),t}}class Xl extends ci{get x1(){return this.x+this.width}get y1(){return this.y+this.height}static fromVector(t,e){let r=Math.min(t.x,e.x),i=Math.max(t.x,e.x),s=Math.min(t.y,e.y),n=Math.max(t.y,e.y);return new Xl(r,s,i-r,n-s)}isInside(t){let e=this.valueInRange(t.x,Math.min(this.x,this.x1),Math.max(this.x,this.x1)),r=this.valueInRange(t.y,Math.min(this.y,this.y1),Math.max(this.y,this.y1));return e&&r}getMinVector(){return new Al(Math.min(this.x,this.x1),Math.max(this.y,this.y1))}getMaxVector(){return new Al(Math.max(this.x,this.x1),Math.min(this.y,this.y1))}getDistance(t){let e=this.getMinVector(),r=this.getMaxVector(),i=this.getNeededRectLines(e,r),s=Number.MAX_SAFE_INTEGER;for(let e=0;e<i.length;e++){let r=i[e][0],n=i[e][1],o=Al.getPointOnLine(r,n,t,!0);if(o){let e=o.getDistance(t);e<s&&(s=e)}}return s}getNeededRectLines(t,e){let r=new Al(e.x,t.y),i=new Al(t.x,e.y);return[[t,r],[r,e],[e,i],[i,t]]}getMiddle(){let t=this.getMinVector(),e=this.getMaxVector();return t.add(e).divideBy(2)}shrink(t){return this.x+=t,this.width-=t/2,this.y-=t,this.height+=t/2,this}rotate(t,e){let r=new Al(this.x,this.y).rotate(t,e),i=new Al(this.x1,this.y1).rotate(t,e);return Xl.fromVector(r,i)}valueInRange(t,e,r){return t>e&&t<r}}class zl extends Sl{constructor(t,e){super(t),this.imageService=e,this.GeometryData.Props=Fl}get Position(){return new Al(this.GeometryData.PX,this.GeometryData.PY)}set Position(t){this.GeometryData.PX=t.x,this.GeometryData.PY=t.y,this.GeometryData=this.GeometryData}get Dimension(){return new Al(this.GeometryData.DX,this.GeometryData.DY)}set Dimension(t){this.GeometryData.DX=t.x,this.GeometryData.DY=t.y,this.GeometryData=this.GeometryData}get Texture(){return this.imageService.getImageTexture(this.ImageSRC)}get ImageSRC(){return this.imageService.toClientPath(this.GeometryData.ImageFile)}update(t,e=!0){(t=super.update(t,e)).removeChildren();const r=this.Dimension,i=new Vn(this.Texture);return i.scale.y=-1,i.alpha=this.Selected||this.Highlighted?.5:1,i.x=0,i.y=0,i.width=r.x,i.height=r.y,t.x=this.Position.x,t.y=this.Position.y,t.width=i.width,t.height=i.height,t.addChild(i),t}getBounds_(){const t=this.getParentScale();return Xl.fromVector(this.Position,this.Position.clone().add(this.Dimension.clone().mulXY(1,-1).multiplyBy(t)))}getDistance(t){return this.getBounds_().getDistance(this.toLocal(t).copyTo(new Al))}getImageDimensions(t,e,r){const i=new Al,s=new Al;if(r?.size?.dimension){const t=Al.validate(r.size.dimension)?.scale();t&&(s.apply(t),i.apply(e.clone().add(s.clone().divideBy(2))))}else if(t){let r=Math.max(t.x,e.x),n=Math.min(t.x,e.x),o=Math.max(t.y,e.y),a=Math.min(t.y,e.y),h=new Al(n,o),l=new Al(r,a).clone().subtract(h).mulXY(1,-1);i.apply(h),s.apply(l)}return{Pos:i,Dim:s}}exportGeometryData(){const t=super.exportGeometryData();return t.P=[t.PX,t.PY,0],t.ImageFile=this.imageService.toExportPath(t.ImageFile),t}}const Wl=new class{constructor(){this._currentExport=void 0}createReferenceData(t){this._currentExport=this.createSceneExport(t)}createSceneExport(t,e=!1){const r={sites:[]},i=t.World.AllContainers;for(let s=0;s<i.length;s++){const n=i[s].UserContainer.children;e||console.log(`Exporting ${n.length} geometries`);const o={poData:[]},a=[];for(let e=0;e<n.length;e++){const r=n[e];let i=o.poData.find((t=>t.parentPO===r.GeometryData.DGUIDPO.toFixed(0)));i||(i={parentPO:r.GeometryData.DGUIDPO.toFixed(0),gcData:[{parentVCT:r.GeometryData.VCT,parentOffsetIndex:r.GeometryData.OffsetIndex,data:[]}]},o.poData.push(i));let s=i.gcData.find((t=>t.parentVCT==r.GeometryData.VCT&&t.parentOffsetIndex==r.GeometryData.OffsetIndex));s||(s={parentVCT:r.GeometryData.VCT,parentOffsetIndex:r.GeometryData.OffsetIndex,data:[]},i.gcData.push(s));let h=r.OriginParent.getRelatedChildren(r),l=h.filter((t=>1===t.GeometryData.RedFlags)).length>0;const u=t.BlockRegistry.getGeometryBlock(r.GeometryData);let c=s.data.find((t=>t.parentGC));if(c||(c={parentGC:r.GeometryData.ParentGCGuid,exploded:!1,clearDataTable:!1,shapes:[]},s.data.push(c)),u){const t=this.convertShapeGuidsToString(u);t&&!a.includes(t.BlockGuid)&&(c.shapes.push(t),a.push(t.BlockGuid))}const d=this.convertShapeGuidsToString(r);d&&c.shapes.push(d),c.clearDataTable=h.length>0,c.exploded=l,s.data=s.data.sort(((t,e)=>t.clearDataTable&&!e.clearDataTable?-1:!t.clearDataTable&&e.clearDataTable?1:t.exploded&&!e.exploded?-1:!t.exploded&&e.exploded?1:0))}r.sites.push(o)}return console.log(r),r}convertShapeGuidsToString(t){const e=t.exportGeometryData();return Object.entries(e).forEach((([t,r])=>{"number"==typeof r&&t.toLowerCase().includes("guid")&&(e[t]=r.toFixed())})),e}removeIf(t,e){let r=t.length;for(;r--;)e(t[r],r,t)&&t.splice(r,1)}};Object.getOwnPropertyDescriptor;let Yl=class{constructor(t){this.imageService=t}async parseAsync(t,e){return new Promise(((r,i)=>{r(this.parse(t,e))}))}parse(t,e){e.World.clearChildren(),e.BlockRegistry.dispose();for(const r in t){const i=t[r],s=this.parsePrint(e,i);s.name=`print_${r}`,e.World.addChild(s)}return e.BlockRegistry.updateExistingBlocks(),Wl.createReferenceData(e),e.World.buildBVH(),t.length}parsePrint(t,e){const r=new Tl;for(const i of e.GraphController)i.Globals=El.globalsToMM(i.Globals),r.addChild(this.parseGraphController(t,i,r.UserContainer));return r}formatGuids(t){return t.DGUID=parseFloat(String(t.DGUID)),t.DGUIDPO=parseFloat(String(t.DGUIDPO)),t.BlockGuid=parseFloat(String(t.BlockGuid)),t}applyLineStyle(t){return 842===t.Props.LType&&(t.Props.LSACAD=[6.175,3.175].join(",")),t}parseGraphController(t,e,r){const i=new xl(e.Globals);for(let s of e.BaseList)if(s.BlockGuid<0&&(s=this.formatGuids(s)),s=this.applyLineStyle(s),ee(s)&&-1!=s.DGUID)t.BlockRegistry.createGeometryBlock(s);else if(s.ParentGCGuid=e.Globals.GCCGuid,s=El.convertShapeUnitsToPixels(s),1===s.RedFlags){s.Ind=r.getNextIndent();let t=El.translatedShape(s,e.Globals);r.addChild(this.createGeometry(t))}else i.addChild(this.createGeometry(s));return i}createGeometry(t){let e;if(Kt(t)&&(e=new wl(t)),Zt(t)&&(e=new Pl(t)),Qt(t)&&(e=new Ol(t)),Jt(t)&&(e=new Bl(t)),te(t)&&(e=new zl(t,this.imageService)),ee(t))switch(t.BlockType){case qt.Rectangle:e=new Ll(new jl(t));break;case qt.Scope:e=new Ll(new $l(t));break;case qt.Arrow:e=new Ll(new Vl(t))}return e||(e=new Sl(t)),e}};var ql;Yl=((t,e)=>{for(var r,i=e,s=t.length-1;s>=0;s--)(r=t[s])&&(i=r(i)||i);return i})([A(),(ql=S(Dl),(t,e)=>ql(t,e,0))],Yl);const Kl=new Yl;class Zl{constructor(t){this.scene=t,this._page=0,this._pages=-1}get Page(){return this._page}set Page(t){t<0&&(t=0),t>this._pages-1&&(t=this._pages-1),this._page=t,this.updateContainerVisibility()}updateContainerVisibility(){this.scene.World.children.forEach((t=>{if(t?.name?.startsWith("print")){const e=t.name.endsWith(`_${this.Page}`);t.visible=e,t.renderable=e,t.eventMode="none"}})),this.scene.World.buildBVH(),this.scene.InteractionHandler.Selection.clearSelection()}jumpPage(t){this.Page=t}jumpFirst(){this.jumpPage(0)}jumpLast(){this.jumpPage(this._pages)}jumpNext(){this.Page++}jumpPrev(){this.Page--}async uploadPrintData(t){Kl.parseAsync(t,this.scene).then((t=>{this._pages=t,this.Page=0}))}exportSceneData(){return Wl.createSceneExport(this.scene,!0)}}class Ql{constructor(t){this.scene=t,this._moveOffset=100,this._dragging=!1,this._dragOffset=new Al,this._scale=1,this._offset=new Al(600,900)}get Scale(){return this._scale}set Scale(t){t>50&&(t=50),t<.5&&(t=.5),this._scale=t}handleMove(t){this._dragging&&this._offset.applyXY(t.x-this._dragOffset.x,t.y-this._dragOffset.y)}get Dragging(){return this._dragging}handleDown(t){1==t.button&&(this._dragOffset.applyXY(t.x-this._offset.x,t.y-this._offset.y),this._dragging=!0)}handleZoom(t){if(this._dragging)return;const e=t.deltaY<0?1:-1;this.zoom(e,t.getLocalPosition(this.scene.World).copyTo(new Al)),t.preventDefault()}handleUp(t){this._dragging=!1}zoom(t,e){let r=Math.exp(.2*t),i=this.Scale;this.Scale=i*r;let s=this.Scale-i;this.Scale!=i&&this._offset.add(e.mulXY(-s,s))}handleLeave(t){this._dragging=!1}get Offset(){return this._offset}set Offset(t){this._offset.apply(t)}get Zoom(){return this._scale}set Zoom(t){this._scale=t}applyViewportOptions(t){this.bounds||(this.bounds=this.scene.World.getLocalBounds()),t.setTransform(this._offset.x,this._offset.y,this._scale,-this._scale,0,0,0,.5,.5)}centerViewport(){this.fitContentToWindow(50),this._offset.apply(this.scene.World.getCenterOffset(this.Scale))}zoomIn(){this.zoom(1,new Al)}zoomOut(){this.zoom(-1,new Al)}moveViewport(t,e){this._offset.addXY(t,e)}moveUp(){this.moveViewport(0,this._moveOffset)}moveDown(){this.moveViewport(0,-this._moveOffset)}moveRight(){this.moveViewport(this._moveOffset,0)}moveLeft(){this.moveViewport(-this._moveOffset,0)}fitContentToWindow(t){this.Scale=this.scene.World.getFitScale(this.Scale,50)}}class Jl{constructor(t){this.scene=t,this._ticker=new gn,this._initialized=!1,this._running=!1,this._rendererMap=new Map}get Current(){return this._currentRenderer}initialize(t){t=t||{},this.initRendererMap(t),this._currentRenderer=this._rendererMap.get("default"),this.disablePixiTicker(),this._ticker.add(this.onRenderTick,this),this._initialized=!0}disablePixiTicker(){const t=gn.shared;t.autoStart=!1,t.stop()}initRendererMap(t){this._initialized||this.addRenderer("default",Object.assign(t,{hello:!0,backgroundColor:12632256,antialias:!0,powerPreference:"high-performance",autoDensity:!0}))}addRenderer(t,e){const r=new Sn(e);return this._rendererMap.set(t,r),r}switchRenderer(t){this._rendererMap.has(t)&&this._currentRenderer!==this._rendererMap.get(t)&&(console.log(`Switching renderer to: ${t}`),this._currentRenderer=this._rendererMap.get(t),this.resize({width:window.innerWidth,height:window.innerHeight}))}start(){this._running||(this._running=!0,this._ticker.start())}stop(){this._running=!1,this._ticker.stop()}resize(t){this._rendererMap.forEach((e=>{e.resize(t.width,t.height)})),this.scene.resize(t)}onRenderTick(t){this._running&&this._currentRenderer.render(this.scene)}}class tu extends ah{constructor(t){super(),this.size=t;const{Size:e}=this;let r=new ah;r.lineStyle(1,0,1,.5,!0),r.moveTo(0,e/2).lineTo(e,e/2),r.moveTo(e/2,0).lineTo(e/2,e),r.position.set(-e/2,-e/2),this.addChild(r)}get Size(){return El.toMM(this.size)}}class eu extends ah{constructor(){super(),this.clear(),this.lineStyle({color:0,alpha:1,width:3,native:!0}),this.drawCircle(0,0,5)}}class ru{constructor(t,e){this.container=t,this.left=null,this.right=null,this.objects=[],this.objects=e,this.bounds=this.computeBounds()}computeBounds(){let t=1/0,e=1/0,r=-1/0,i=-1/0;for(const s of this.objects){if(!s.parent)continue;const n=s.getBounds(!0);n&&(t=Math.min(t,n.x),e=Math.min(e,n.y),r=Math.max(r,n.x+n.width),i=Math.max(i,n.y+n.height))}return{x:t,y:e,width:r-t,height:i-e}}}function iu(t,e){if(e.length<=2)return new ru(t,e);e.sort(((t,e)=>t.x-e.x));const r=Math.floor(e.length/2),i=e.slice(0,r),s=e.slice(r),n=new ru(t,e);return n.left=iu(t,i),n.right=iu(t,s),n}function su(t,e,r,i,s){if(!t)return;const{x:n,y:o,width:a,height:h}=t.bounds,l=Math.max(n-e.x,0,e.x-(n+a)),u=Math.max(o-e.y,0,e.y-(o+h));if(Math.sqrt(l*l+u*u)>r)return;let c,d=Number.MAX_SAFE_INTEGER;for(const n of t.objects){if(i&&!i(n))continue;if(s&&n.GeometryData.Type!==s)continue;const t=n.getDistance(e);t<r&&t<d&&(d=t,c=n)}return[c,su(t.left,e,r,i,s),su(t.right,e,r,i,s)].filter(Boolean).sort(((t,r)=>t.getDistance(e)-r.getDistance(e)))[0]}class nu{constructor(t=100){this.cellSize=t,this.grid=new Map,this.bvhMap=new Map,this.grid=new Map,this.bvhMap=new Map}clear(){this.grid.clear(),this.bvhMap.clear()}insert(t){const e=t.getBounds(!0),r=this.getHashKey(e.x,e.y),i=this.getHashKey(e.x+e.width,e.y+e.height);for(let e=parseInt(r.split("_")[0]);e<=parseInt(i.split("_")[0]);e++)for(let s=parseInt(r.split("_")[1]);s<=parseInt(i.split("_")[1]);s++){const r=`${e}_${s}`;this.grid.has(r)||this.grid.set(r,[]),this.grid.get(r).push(t)}}buildBVH(t){for(const[e,r]of this.grid.entries())this.bvhMap.set(e,iu(t,r))}getNearbyBVH(t,e,r){const i=new Set,s=this.getHashKey(t-r,e-r),n=this.getHashKey(t+r,e+r);for(let t=parseInt(s.split("_")[0]);t<=parseInt(n.split("_")[0]);t++)for(let e=parseInt(s.split("_")[1]);e<=parseInt(n.split("_")[1]);e++)i.add(`${t}_${e}`);let o=[];for(const t of i)this.bvhMap.has(t)&&o.push(this.bvhMap.get(t));return o}getHashKey(t,e){return`${Math.floor(t/this.cellSize)}_${Math.floor(e/this.cellSize)}`}}class ou extends ah{constructor(t){super(),t&&this.updateGeometries(t)}set Geometries(t){this.updateGeometries(t)}updateGeometries(t){this.clear(),this.lineStyle({native:!0,color:new pr("green").toNumber()}),t.forEach((t=>{const e=t.getLocalBounds();this.drawRect(e.x,e.y,e.width,e.height)}))}}class au extends Gn{constructor(t,e){super(),this.contoruing=new ou,this.backgroundRect=this.createWorldBackground(El.toMM(t),El.toMM(e),El.toMM(2)),this._spatialGrid=new nu(250),this.addChild(this.contoruing)}createWorldBackground(t,e,r=0){return this.backgroundRect=new ah,this.backgroundRect.name="WORLD_RECT",this.backgroundRect.beginFill(0),this.backgroundRect.drawRect(r,0-r,t,e-r),this.backgroundRect.endFill(),this.backgroundRect.beginFill(16777215),this.backgroundRect.drawRect(0,0,t,e),this.backgroundRect.endFill(),this.addChild(this.backgroundRect),this.backgroundRect}get ActivePrintContainer(){return this.children.find((t=>t.name?.startsWith("print")&&t.renderable&&t.visible))}get AllContainers(){return this.children?.filter((t=>t.name?.startsWith("print")))||[]}getFitScale(t,e=0){if(!this.parent?.hitArea)throw new Error("Unable to get fit scale without parent hitArea");const r=this.parent.hitArea,i=new Al(this.backgroundRect.width,this.backgroundRect.height).addXY(e,e).multiplyBy(t),s=new Al(r.width,r.height),n=i.ratio(),o=s.ratio();let a=new Al;return o>n?(a.x=i.x*(s.y/i.y),a.y=s.y):(a.x=s.x,a.y=i.y*(s.x/i.x)),a.div(i.divideBy(t)),a.abs().max()}getCenterOffset(t){if(!this.parent?.hitArea)throw new Error("Unable to get fit scale without parent hitArea");const e=this.parent.hitArea,r=new Al(this.backgroundRect.width,this.backgroundRect.height).multiplyBy(t);return new Al(e.width,e.height).divideBy(2).addXY(-r.x/2,r.y/2)}clearChildren(){for(const t of this.children)t&&"WORLD_RECT"!=t.name&&t!=this.contoruing&&t.destroy({children:!0,texture:!0,baseTexture:!0});this._spatialGrid.clear()}getSnapPointAt(t,e,r){const i=this.parent.toGlobal(t).copyTo(new Al),s=this._spatialGrid.getNearbyBVH(i.x,i.y,e);let n,o=Number.MAX_SAFE_INTEGER;for(let i of s){const s=su(i,t,e,r);if(s&&s.parent){if(r&&r(s))continue;if(s.GeometryData.DGUID<=0||s.GeometryData.DGUIDPO<=0)continue;let e=s.getSnapPoint(t);if(e){let r=e.getDistance(t);r<o&&(o=r,n=e)}}}return n}getGeometryAt(t,e,r,i){const s=this._spatialGrid.getNearbyBVH(t.x,t.y,e);let n,o=Number.MAX_SAFE_INTEGER;for(const a of s){const s=su(a,t,e,r,i);if(s){const e=s.getDistance(t);e<o&&(o=e,n=s)}}return n}buildBVH(){this._spatialGrid.clear(),this.ActivePrintContainer?.getRelevantGraphs().flatMap((t=>t.children)).filter((t=>!!t.getLocalBounds())).forEach((t=>{this._spatialGrid.insert(t)})),this._spatialGrid.buildBVH(this)}}class hu{constructor(t){this.scene=t,this._highlightedGeometries=[],this._selectedGeometries=[],this.observer=[]}get Highlighted(){return this._highlightedGeometry}get Selected(){return this._selectedRef}get SelectionGroup(){return this._selectedGeometries}isHighlightedOrSelected(t){return this._selectedGeometries.includes(t)}getClosestGeometry(t,e,r=500){return this.scene.World.getGeometryAt(t,r,(t=>!this.isValidForSelection(t)||!e||e(t)))}updateSelection(t,e){const r=this.getClosestGeometry(t,e);e&&r&&!e(r)?this.clearSelection():this.setSelection(this.getClosestGeometry(t,e))}updateHighlighted(t,e){this.setHighlight(this.getClosestGeometry(t,e))}setHighlight(t){t&&t!=this._highlightedGeometry&&(this._highlightedGeometry=t,this.updateHighlightedGeometries())}update(){this.updateSelectedGeometries(),this.updateHighlightedGeometries()}setSelection(t){this._selectedRef=t,this._selectedBlock=void 0,this.updateSelectedGeometries()}clearSelection(){this._selectedGeometries.forEach((t=>t.Selected=!1)),this._selectedRef=void 0,this._selectedGeometries=[],this.publish(this._selectedRef)}clearHighlight(){this._highlightedGeometries.forEach((t=>t.Highlighted=!1)),this._highlightedGeometry=void 0,this._highlightedGeometries=[]}register(t){this.observer.push(t)}publish(t){return this.observer.forEach((e=>{e.observed(t)})),yl.publish({Selection:{GUID:this._selectedRef?this._selectedRef.GeometryData.DGUID:0,Type:this._selectedRef?this._selectedRef.GeometryData.Type:Yt.Unknown},PickMode:this._selectedRef?yl.State.PickMode:re.PICK}),t}unregister(t){const e=this.observer.indexOf(t);e>-1&&this.observer.splice(e,1)}isValidForSelection(t){return t.GeometryData.DGUID>0&&(t.GeometryData.OffsetIndex>=0||t.GeometryData.RedFlags>0)}updateSelectedGeometries(){if(!this._selectedRef)return void this.clearSelection();const t=this.scene.World.ActivePrintContainer?.getGeometries(this.isValidForSelection)||[];for(const e of this._selectedGeometries)t.includes(e)&&this.shouldSelect(e)||(e.Selected=!1);this._selectedGeometries=t.filter((t=>{const e=this.shouldSelect(t);return t.Selected=e,e})),this.publish(this._selectedRef)}updateHighlightedGeometries(){if(!this._highlightedGeometry)return void this.clearHighlight();const t=this.scene.World.ActivePrintContainer?.getGeometries((t=>this.isValidForSelection(t)))||[];for(const e of this._highlightedGeometries)t.includes(e)&&this.shouldHighlight(e)||(e.Highlighted=!1);this._highlightedGeometries=t.filter((t=>{const e=this.shouldHighlight(t);return t.Highlighted=e,e}))}shouldHighlight(t){if(!this._highlightedGeometry)return!1;const e=this.scene.BlockRegistry.getGeometryBlock(this._highlightedGeometry.GeometryData);return t===this._highlightedGeometry||!!e&&t.GeometryData.BlockGuid===e.GeometryData.BlockGuid}shouldSelect(t,e=this._selectedRef){if(!e)return!1;const r=e.GeometryData,i=t.GeometryData,s=r.VCT===i.VCT,n=r.DGUID===i.DGUID,o=r.DGUIDPO===i.DGUIDPO;return s&&(n||o)}}class lu{constructor(t){this.scene=t,this._globalClickPosition=new Al,this._state=yl.register(this),this.ignoreSnapGeometry=t=>{const e=this.scene.InteractionHandler.Selection.Selected;if(!e)return!0;const r=this.scene.BlockRegistry.getGeometryBlock(e.GeometryData);return e===t||!!r&&r.getLinkedShapes(this.scene.BlockRegistry).includes(t)}}observed(t){}mouseMove(t){const e=t.global.copyTo(this._globalClickPosition),r=this.scene.SnapIndicator,i=t.shiftKey||this._state.Snap;if(r.renderable=i,this.scene.Cursor.renderable=!i,i){const t=this.scene.World.getSnapPointAt(e,1e3,this.ignoreSnapGeometry);t&&(this._globalClickPosition.apply(t),this.scene.SnapIndicator.position.copyFrom(t))}else this._globalClickPosition.apply(e);return this._globalClickPosition}get GlobalMousePosition(){return this._globalClickPosition}}class uu extends Gn{constructor(t){super(),this.interaction=t}get InteractionManager(){return this.interaction}mouseUp(t,e){return!0}mouseDown(t,e){return!0}mouseMove(t){}createWorldContainer(){return!1}get ShouldRestart(){return!0}get SelectionHandler(){return this.interaction.Selection}get Scene(){return this.interaction.Scene}returnPickMode(){return this.getPickMode()}}class cu extends uu{constructor(t,e){super(t),this._state=yl.register(this),this._geometry=e}destroy(){yl.unregister(this),super.destroy()}mouseDown(t,e){return this.update(),super.mouseDown(t,e)}mouseMove(t){super.mouseMove(t),this.update()}observed(t){this._state=t,this.update()}createWorldContainer(){return!0}cleanup(){this._geometry&&(this._geometry=void 0)}update(){this._geometry&&this._geometry.update()}}class du extends uu{getPickMode(){return re.EXPLODE}constructor(t){super(t),this.SelectionHandler.Selected&&this.respawnElement(this.SelectionHandler.Selected)}respawnElement(t){const e=this.Scene.World.ActivePrintContainer;if(e){const r=e.UserContainer;if(r){const i=this.Scene.BlockRegistry.getGeometryBlock(t.GeometryData);if(i)return void this.Scene.BlockRegistry.destroyGeometryBlock(i.GeometryData,!1);const s=e.getGeometries((e=>e.parent!==r&&t.parent==e.parent&&e.GeometryData.DGUIDPO===t.GeometryData.DGUIDPO))||[];for(const t of s){const e=El.translatedShape(t.GeometryData,t.OriginParent.Globals);e.RedFlags=1,e.ParentGCGuid=t.GeometryData.ParentGCGuid;const i=Kl.createGeometry(e);i&&(t.destroy(),r.addChild(i))}this.SelectionHandler.setSelection(void 0)}}}returnPickMode(){return re.PICK}}class pu extends uu{getPickMode(){return re.DELETION}mouseDown(t,e){if(0==e){const t=this.SelectionHandler.Highlighted;if(t&&t.parent==this.Scene.World.ActivePrintContainer?.UserContainer){const e=this.Scene.BlockRegistry.getGeometryBlock(t.GeometryData);e&&this.Scene.BlockRegistry.destroyGeometryBlock(e.GeometryData,!0),t.destroy()}}return!0}}class fu extends ah{constructor(t){super(),this._prevP=new Al,this.dragging=!1,this.hovered=!1,this._enabled=!0,this._radius=2,this._drag=new Al(0,0),this._linkRef=t}get PrevP(){return this._prevP}get P(){return this._linkRef.Handle&&this._linkRef.Vector.applyXY(this._linkRef.Handle[0],this._linkRef.Handle[1]),this._linkRef.Vector}set P(t){this._linkRef.Handle&&(this._linkRef.Handle[0]=t.x,this._linkRef.Handle[1]=t.y),this._linkRef.Vector.apply(t),this.position.copyFrom(t)}get enabled(){return this._enabled}set enabled(t){const e=this._enabled=t;this._enabled=t,e&&this.update()}mouseUp(t,e){return this.dragging=!1,this._prevP.apply(this.P),!1}mouseDown(t,e){return!(0!=e||!this.isMouseInRange(t)||!this.enabled||(this.dragging=!0,this._prevP.apply(this.P),this._drag.apply(t.subtract(this.P)),0))}mouseMove(t){this.dragging&&this.enabled&&(this._prevP.apply(this.P),this.P=t.subtract(this._drag))}update(){this.position.copyFrom(this.P),this.clear(),this.enabled&&(this.lineStyle(1,0,1,0,!0),this.drawCircle(0,0,this._radius))}isMouseInRange(t){return this.P.getDistance(t)<=this._radius}}class mu extends cu{constructor(t,e){super(t),this.children=[],this._geometry=e}mouseDown(t,e){if(2===e)return!1;let r=!1;for(const i of this.children)!r&&i.mouseDown(t,e)&&(r=!0);return r}mouseUp(t,e){let r=this.children.some((r=>r.mouseUp(t,e)));return this.updateGrabPoints(r),r}mouseMove(t){this.children.forEach((e=>{e.mouseMove(t)})),this.updateGrabPoints(),super.mouseMove(t)}registerGrabPoints(t){t.forEach((t=>{const e=new fu(t);this.addChild(e),e.update()}))}updateGrabPoints(t=!1){return t}getChildAt(t){return super.getChildAt(t)}getHandle(t){return this.children.find((e=>e.P===t))}cleanup(){this.removeChildren()}getPickMode(){return re.MANIPULATION}}class gu extends mu{constructor(t,e){super(t,e),this._lineLength=0,this._direction=new Al,this._middle=new Al,this._geometry.getLinkedShapes(this.Scene.BlockRegistry)}update(){super.update()}getLinkedGeometries(){return this._geometry.getLinkedShapes()}buildRef(t,e){return{Vector:t,Handle:e}}recalculatePolygon(t,e,r,i){const{ArrowLength:s,ArrowHeight:n}=i;let o=e.clone().subtract(r.clone().multiplyBy(s)),a=e.getOrthoVector(o).multiplyBy(n/2);t.setVertexData(0,e),t.setVertexData(1,o.clone().subtract(a)),t.setVertexData(2,o.clone().add(a))}handleMidPointDragging(t,e,r){if(t.dragging){const t=this._direction.clone().multiplyBy(this._lineLength/2);e.P=this._middle.clone().add(t),r.P=this._middle.clone().subtract(t)}else this._direction.apply(e.P.getVector(r.P).normalize()),t.P=e.P.getMiddle(r.P),this._lineLength=e.P.getDistance(r.P)}}class yu extends mu{constructor(t,e){super(t,e),this.synchronize=!1,this.length=0,this.length=e.P1.getDistance(e.P2),this.direction=e.P1.getVector(e.P2).normalize(),this.registerGrabPoints([{Vector:e.P1,Handle:e.GeometryData.P1},{Vector:e.P2,Handle:e.GeometryData.P2},{Vector:this.middle=e.P1.getMiddle(e.P2)}])}updateGrabPoints(t){let e=this.getHandle(this.middle),r=this.getHandle(this._geometry.P1),i=this.getHandle(this._geometry.P2);if(!r||!i)return t;if(this.synchronize){if(e&&e.dragging){let s=r.P.getOrthoVector(i.P),n=e.P.clone().add(s),o=Al.getPointOnLine(e.P.clone(),n,this.middle,!1);this.middle.apply(o),t=!0}let s=(e,r)=>{if(e&&r&&r.dragging){let i=this.direction.swap().normalize(),s=e.P.clone().subtract(i),n=e.P.clone().add(i);e.P=Al.getPointOnLine(s,n,r.P,!1),t=!0}};s(r,i),s(i,r);let n=(t,e)=>{let r=t.P.getVector(e.P).abs();if(t&&e&&e.dragging){let t=30;r.x>t&&(e.P=e.P.set(e.PrevP.x,e.P.y)),r.y>t&&(e.P=e.P.set(e.P.x,e.PrevP.y))}};n(r,i),n(i,r)}if(e)if(e.dragging){this.length=this._geometry.P1.getDistance(this._geometry.P2);let e=this.direction.clone().multiplyBy(this.length/2);r.P=this.middle.clone().add(e),i.P=this.middle.clone().subtract(e),t=!0}else e.P=this._geometry.P1.getMiddle(this._geometry.P2),this.synchronize||(this.direction=this._geometry.P1.getVector(this._geometry.P2).normalize()),this.length=this._geometry.P1.getDistance(this._geometry.P2);return t}}class _u extends mu{constructor(t,e){super(t,e);let r=e.getParentScale();this.radiusPoint=new Al(this._geometry.PM.x+this._geometry.Rad*r,this._geometry.PM.y),this.lastDirection=this.radiusPoint.getVector(this._geometry.PM).normalize(),this.registerGrabPoints([{Vector:this.radiusPoint},{Vector:this._geometry.PM,Handle:this._geometry.GeometryData.PM}])}updateGrabPoints(t){let e=this._geometry.getParentScale(),r=this.getHandle(this.radiusPoint);return r&&(r.dragging?(this._geometry.GeometryData.Rad=this.radiusPoint.getDistance(this._geometry.PM)/e,this.lastDirection=this.radiusPoint.getVector(this._geometry.PM).normalize(),t=!0):this.radiusPoint.apply(this._geometry.PM.clone().add(this.lastDirection.clone().multiplyBy(this._geometry.Rad*e)))),t}}class vu extends mu{constructor(t,e){super(t,e),yl.publish({UserInput:this._geometry.GeometryData.Text}),this.registerGrabPoints([{Vector:this._geometry.P,Handle:this._geometry.GeometryData.P}])}observed(t){this._state&&this._state.TextHeight==t.TextHeight||(this._geometry.GeometryData.Height=El.toMM(t.TextHeight)),this._state&&this._state.UserInput==t.UserInput||(this._geometry.GeometryData.Text=t.UserInput),super.observed(t)}}class xu{constructor(t){this.parent=t,this._allowNegativeDimension=!0,this._aspectMode=0,this._aspectRatio=0,this._minWidth=0,this._maxWidth=0,this._minHeight=0,this._maxHeight=0,this._p=new Al,this._width=0,this._height=0,this._resizable=!0,this.createHandles()}get P(){return this._p}set P(t){this._p.copyFrom(t)}set width(t){this._width=t}get width(){return 0!=this._minWidth&&this._width<this._minWidth&&(this._width=this._minWidth),0!=this._maxWidth&&this._width>this._maxWidth&&(this._width=this._maxWidth),!this._allowNegativeDimension&&this._width<0&&(this._width=0),2==this._aspectMode?this._height*this._aspectRatio:this._width}set height(t){this._height=t}get height(){return 0!=this._minHeight&&this._height<this._minHeight&&(this._height=this._minHeight),0!=this._maxHeight&&this._height>this._maxHeight&&(this._height=this._maxHeight),!this._allowNegativeDimension&&this._height<0&&(this._height=0),1==this._aspectMode?this._width*this._aspectRatio:this._height}get resizable(){return this._resizable}set resizable(t){this._resizable=t,this.parent.children.forEach((e=>{e.enabled=t})),this.parent.getChildAt(8).enabled=!0}mouseUp(t,e){this.updateHandles()}mouseDown(t,e){this.updateHandles()}mouseMove(t){for(let t=0;t<9;t++){let e=this.parent.getChildAt(t);e&&e.dragging&&this.handleDragInput(t,e)}this.updateHandles()}getMinMaxVector(){let t=Math.min(this.P.x,this.P.x+this.width),e=Math.max(this.P.x,this.P.x+this.width),r=Math.min(this.P.y,this.P.y+this.height),i=Math.max(this.P.y,this.P.y+this.height);return{min:new Al(t,r),max:new Al(e,i)}}getNeededRectLinesAuto(){let t=this.getMinMaxVector();return this.getNeededRectLines(t.min,t.max)}getNeededRectLines(t,e){let r=new Al(e.x,t.y),i=new Al(t.x,e.y);return[[t,r],[r,e],[e,i],[i,t]]}createHandles(){let t=[];for(let e=0;e<3;e++)for(let r=0;r<3;r++){let i=this.P.x+e*this._width/3,s=this.P.y+r*this._height/3;t.push({Vector:new Al(i,s)})}this.parent.registerGrabPoints(t),this.updateHandles()}updateHandles(){this.parent.children.forEach(((t,e)=>{t.P=this.getPositionByIndex(e)}))}handleDragInput(t,e){if(e.dragging){const r=this.P;let i=e.P.clone().subtract(e.PrevP);switch(t){case 0:this._width-=i.x,this._height-=i.y,r.x+=i.x,r.y+=i.y;break;case 1:r.x+=i.x,this._width-=i.x;break;case 2:r.x+=i.x,this._width-=i.x,this._height+=i.y,r.y=e.P.y-this.height;break;case 3:this._height+=i.y,r.y=e.P.y-this.height;break;case 4:this._width+=i.x,this._height+=i.y,r.y=e.P.y-this.height;break;case 5:this._width+=i.x;break;case 6:this._width+=i.x,r.y+=i.y,this._height-=i.y;break;case 7:r.y+=i.y,this._height-=i.y;break;case 8:r.x+=i.x,r.y+=i.y}if(t%2==1)for(let r=1;r<t;r+=2){const t=e.P;r%2==0?t.x=e.PrevP.x:t.y=e.PrevP.y,e.P=t}this.P=r}}getPositionByIndex(t){const{x:e,y:r}=this.P;let i=new Al(0,0);switch(t){case 0:i.applyXY(e,r);break;case 1:i.applyXY(e,r+this.height/2);break;case 2:i.applyXY(e,r+this.height);break;case 3:i.applyXY(e+this.width/2,r+this.height);break;case 4:i.applyXY(e+this.width,r+this.height);break;case 5:i.applyXY(e+this.width,r+this.height/2);break;case 6:i.applyXY(e+this.width,r);break;case 7:i.applyXY(e+this.width/2,r);break;case 8:i.applyXY(e+this.width/2,r+this.height/2)}return i}}class bu extends mu{constructor(t,e){super(t,e),this.resizeRect=new xu(this),this.updateRectangleDimension()}mouseDown(t,e){const r=super.mouseDown(t,e);return this.resizeRect.mouseDown(t,e),r}mouseUp(t,e){return this.resizeRect.mouseUp(t,e),super.mouseUp(t,e)}mouseMove(t){super.mouseMove(t),this.resizeRect.mouseMove(t),this.update()}updateRectangleDimension(){const t=this._geometry.Dimension.clone(),e=this._state.Image;this.resizeRect.P=this._geometry.Position.subtractXY(0,t.y),this.resizeRect.width=t.x,this.resizeRect.height=t.y;let r=e?.size?.scalable,i=Al.validate(e?.size?.dimension)?.scale()||this._geometry.Dimension.clone();r||(r=!0),this.resizeRect.resizable=r,r||(this.resizeRect.width=i.x,this.resizeRect.height=i.y),this.resizeRect.updateHandles()}update(){const t=this.resizeRect.getMinMaxVector(),e=this._geometry.getImageDimensions(t.min,t.max,this._state.Image);this._geometry.GeometryData={...this._geometry.GeometryData,PX:e.Pos.x,PY:e.Pos.y,DX:e.Dim.x,DY:e.Dim.y},super.update()}}class Tu extends gu{constructor(t,e){super(t,e),this.resizeRect=new xu(this),this.updateRectangleDimension()}mouseDown(t,e){const r=super.mouseDown(t,e);return this.resizeRect.mouseDown(t,e),r}mouseUp(t,e){return this.resizeRect.mouseUp(t,e),super.mouseUp(t,e)}mouseMove(t){super.mouseMove(t),this.resizeRect.mouseMove(t),this.update()}updateRectangleDimension(){const t=this.getLinkedGeometries(),e=t.map((t=>t.GeometryData.P1)).concat(t.map((t=>t.GeometryData.P2)));let r=e.map((t=>t[0])),i=e.map((t=>t[1])),s=new Al(Math.min(...r),Math.min(...i)),n=new Al(Math.max(...r),Math.max(...i)).subtract(s);this.resizeRect.P=s,this.resizeRect.width=n.x,this.resizeRect.height=n.y,this.resizeRect.updateHandles()}update(){const t=this.getLinkedGeometries();let e=this.resizeRect.getNeededRectLinesAuto();for(let r=0;r<e.length;r++){const i=e[r][0],s=e[r][1];t[r].GeometryData.P1=[i.x,i.y,0],t[r].GeometryData.P2=[s.x,s.y,0]}super.update()}}class Eu{constructor(t){this.geometry=t}get Ready(){return!(this.connectionLine&&this.leftLine&&this.rightLine&&this.leftPolygon&&this.rightPolygon)}analyze(){let t=this.geometry.getLinkedShapes().sort(((t,e)=>t.GeometryData.Ind-e.GeometryData.Ind)),e=t.filter((t=>Kt(t.GeometryData))),r=t.filter((t=>Jt(t.GeometryData))),i=[];for(let t of e){let e=t.P1.getVector(t.P2).normalize(),r=1,s=i.filter((t=>t.vector.normalize().equals(e.normalize(),r)))[0];s?s.geometries.push(t):i.push({vector:e,geometries:[t]})}const s=this.connectionLine=i.filter((t=>1==t.geometries.length))[0].geometries[0];if(s){let t=i.filter((t=>2==t.geometries.length))[0].geometries.sort(((t,e)=>{let r=t.P1.getDistance(e.getSnapPoint(s.P1));return e.P1.getDistance(e.getSnapPoint(s.P1))-r}));return this.leftLine=t[0],this.rightLine=t[1],this.leftPolygon=r[0],this.rightPolygon=r[1],!0}return!1}}class Au extends gu{constructor(t,e){super(t,e),this._analyzer=new Eu(this._geometry),this._analyzer.analyze(),this.registerGrabPoints(this.getHandleReferences()),this.updateGrabPoints(!1)}mouseMove(t){super.mouseMove(t),this.update()}getScopeGeometries(){return{connectionLine:this._analyzer.connectionLine,leftLine:this._analyzer.leftLine,rightLine:this._analyzer.rightLine,leftPoly:this._analyzer.leftPolygon,rightPoly:this._analyzer.rightPolygon}}updateGrabPoints(t){const{connectionLine:e,leftLine:r,rightLine:i,leftPoly:s,rightPoly:n}=this.getScopeGeometries(),o=this.getHandle(e.P1),a=this.getHandle(e.P2),h=this.getHandle(r.P2),l=this.getHandle(i.P2),u=this.getHandle(this._middle),c=o.P.getOrthoVector(a.P).invert();return o.dragging||a.dragging||(this._geometry.GeometryData.LeftLength=r.P1.getDistance(r.P2),this._geometry.GeometryData.RightLength=i.P1.getDistance(i.P2)),this.handleMidPointDragging(u,o,a),h.dragging?this.limitManipulationHandle(o,h,c):this.recalculateLine(r,o,h,c,this._geometry.GeometryData.LeftLength),l.dragging?this.limitManipulationHandle(a,l,c):this.recalculateLine(i,a,l,c,this._geometry.GeometryData.RightLength),(u.dragging||o.dragging||a.dragging)&&(this.recalculateLine(r,o,h,c,this._geometry.GeometryData.LeftLength),this.recalculateLine(i,a,l,c,this._geometry.GeometryData.RightLength)),this.recalculatePolygon(s,o.P,this._direction,this._geometry.GeometryData),this.recalculatePolygon(n,a.P,this._direction.clone().multiplyBy(-1),this._geometry.GeometryData),t=o.dragging||a.dragging||h.dragging||l.dragging||u.dragging,super.updateGrabPoints(t)}limitManipulationHandle(t,e,r){const i=this._geometry.GeometryData.MaxLength-this._geometry.GeometryData.MinLength,s=r.clone().multiplyBy(-this._geometry.GeometryData.Offset-this._geometry.GeometryData.MinLength),n=r.clone().multiplyBy(this._geometry.GeometryData.Offset+i),o=t.P.clone().add(s),a=t.P.clone().subtract(n);e.P=Al.getPointOnLine(o,a,e.P)}recalculateLine(t,e,r,i,s){const n=i.clone().multiplyBy(this._geometry.GeometryData.Offset),o=i.clone().multiplyBy(this._geometry.GeometryData.Offset+s),a=e.P.clone().add(n),h=e.P.clone().subtract(o);t.P1=a,t.P2=h,r.P=h}getHandleReferences(){const{connectionLine:t,leftLine:e,rightLine:r}=this.getScopeGeometries();return this._lineLength=t.P1.getDistance(t.P2),this._direction=t.P1.getVector(t.P2).normalize(),this._middle=t.P1.getMiddle(t.P2),[this.buildRef(t.P1,t.GeometryData.P1),this.buildRef(t.P2,t.GeometryData.P2),this.buildRef(e.P2,e.GeometryData.P2),this.buildRef(r.P2,r.GeometryData.P2),this.buildRef(this._middle)]}}class Su extends gu{constructor(t,e){super(t,e),this.registerGrabPoints(this.getHandleReferences())}getArrowGeometries(){const t=this.getLinkedGeometries();return{connectionLine:t.find((t=>Kt(t.GeometryData))),arrowPoly:t.find((t=>Jt(t.GeometryData)))}}getHandleReferences(){const t=this.getArrowGeometries().connectionLine;return this._lineLength=t.P1.getDistance(t.P2),this._direction=t.P1.getVector(t.P2).normalize(),this._middle=t.P1.getMiddle(t.P2),[this.buildRef(t.P1,t.GeometryData.P1),this.buildRef(t.P2,t.GeometryData.P2),this.buildRef(this._middle)]}updateGrabPoints(t=!1){const e=this.getArrowGeometries(),r=e.connectionLine,i=e.arrowPoly,s=this.getHandle(r.P1),n=this.getHandle(r.P2),o=this.getHandle(this._middle);return this.handleMidPointDragging(o,s,n),this.recalculatePolygon(i,s.P,this._direction,this._geometry.GeometryData),super.updateGrabPoints(t)}}class wu extends uu{constructor(t){super(t),this.InteractionManager.Selection.register(this),this.updateManipulator()}mouseUp(t,e){return!0===this._geometryManipulator?.mouseUp(t,e)}mouseDown(t,e){return!0===this._geometryManipulator?.mouseDown(t,e)}mouseMove(t){this._geometryManipulator?.mouseMove(t),super.mouseMove(t)}updateManipulator(t=this.InteractionManager.Selection.Selected){if(this._geometryManipulator&&this._geometryManipulator.cleanup(),t&&!this.isManipulationAllowed(t)&&(t=void 0),t){const e=this.Scene.BlockRegistry.getGeometryBlock(t.GeometryData);e&&(t=e)}console.log("Manipulation on: ",t);let e=this.getGeometryManipulator(t);e!=this._geometryManipulator&&(this._geometryManipulator&&this._geometryManipulator.destroy(),console.log("Manipulator: ",e),this._geometryManipulator=e,this._geometryManipulator&&this.addChild(this._geometryManipulator))}isManipulationAllowed(t){return t.GraphContainer instanceof bl}getGeometryManipulator(t){if(t){if(Kt(t.GeometryData))return new yu(this.InteractionManager,t);if(Zt(t.GeometryData))return new _u(this.InteractionManager,t);if(Qt(t.GeometryData))return new vu(this.InteractionManager,t);if(te(t.GeometryData))return new bu(this.InteractionManager,t);if(ee(t.GeometryData))switch(t.GeometryData.BlockType){case qt.Rectangle:return new Tu(this.InteractionManager,t);case qt.Scope:return new Au(this.InteractionManager,t);case qt.Arrow:return new Su(this.InteractionManager,t)}}}createWorldContainer(){return!0}observed(t){this.updateManipulator(t)}destroy(t){this.InteractionManager.Selection.unregister(this),super.destroy(t)}getPickMode(){return re.MANIPULATION}}class Pu extends vl{constructor(t,e){super(),this._scene=t,this._blockGeomData=e,this._selected=!1,this._highlighted=!1}get GraphContainer(){return this.parent}get OriginParent(){return this.GraphContainer?.Print.getGraphById(this.GeometryData.ParentGCGuid)||this.GraphContainer}applyPropertiesFrom(t){}get GeometryData(){return this._blockGeomData}set GeometryData(t){this._blockGeomData=t,this.update()}get Selected(){return this._selected}set Selected(t){const e=this._selected!=t;this._selected=t,e&&this.update()}get Highlighted(){return this._highlighted}set Highlighted(t){const e=this._highlighted!=t;this._highlighted=t,e&&this.update()}update(){this.GeometryData.getGeometries().forEach(((t,e)=>{let r;if(e<=this.children.length-1)r=this.getChildAt(e),r.GeometryData=t;else{const e=Kl.createGeometry(t);e&&(r=this.addChild(e))}r&&(r.Highlighted=this.Highlighted,r.Selected=this.Selected)}))}getSnapPoint(t){}getDistance(t){return Number.MAX_SAFE_INTEGER}getLinkedShapes(){return this._scene.BlockRegistry.getLinkedGeometries(this.GeometryData)}exportGeometryData(){return this.GeometryData}getGeometryBounds(){}}class Ru extends cu{constructor(t){super(t),this._origin=new Al(0,0),this._coordinates=[],this._geometry=this.createGeometry(),this._geometry.GeometryData.Props.Width=yl.LineWidth,this._geometry.GeometryData.Props.LSACAD=yl.LineStyle.join(","),this._geometry.parent!=this&&this.addChild(this._geometry),this._geometry instanceof Pu&&this.InteractionManager.Scene.BlockRegistry.createGeometryBlock(this._geometry.GeometryData)}get Finished(){return 2==this._coordinates.length}get Drawing(){return this._coordinates.length>0}getClickPositions(){let t,e=this._origin;return this._coordinates.length>=1&&(t=this._coordinates[0]),this._coordinates.length>=2&&(e=this._coordinates[1]),{p1:t,p2:e}}mouseDown(t,e){return this._origin.apply(t),0==e?this._coordinates.push(this._origin.clone()):2==e&&this._coordinates.length>0&&this.abort(),this._updateGeometryInternal(),!0}mouseMove(t){this._origin.apply(t),this._updateGeometryInternal()}abort(){this._coordinates=[]}destroy(){this._geometry&&this.Scene.BlockRegistry.getGeometryBlock(this._geometry.GeometryData),this.cleanup(),this.abort(),super.destroy(),yl.unregister(this)}_updateGeometryInternal(){if(this.Finished&&this.Drawing)return this.InteractionManager.onGeometryFinished(this.getGeometryData(),this.Scene.BlockRegistry.getGeometryBlock(this._geometry.GeometryData)),void this.destroy();const t=this._geometry;t&&(t.renderable=this.Drawing,t.visible=this.Drawing),this.update()}}class Mu extends Ru{getGeometryData(){const{p1:t,p2:e}=this.getClickPositions();let r={};if(t&&e){if(this._state?.Orthogonal){let r=t.getVector(e).abs();r.x>r.y?e.y=t.y:e.x=t.x}const i=this._geometry.getParentScale();r={p:t,rad:t.getDistance(e)/i}}return[Ul.createCircleData(r)]}createGeometry(){return Kl.createGeometry(this.getGeometryData()[0])}update(){this._geometry.GeometryData=this.getGeometryData()[0],super.update()}getPickMode(){return re.CIRCLE}}class Cu extends Ru{getGeometryData(){const{p1:t,p2:e}=this.getClickPositions();let r={};if(t&&e){if(this._state?.Orthogonal){let r=t.getVector(e).abs();r.x>r.y?e.y=t.y:e.x=t.x}r={p1:t,p2:e}}return[Ul.createLineData(r)]}createGeometry(){return Kl.createGeometry(this.getGeometryData()[0])}update(){this._geometry.GeometryData=this.getGeometryData()[0],super.update()}getPickMode(){return re.LINE}}class Iu extends Ru{createGeometry(){const t=Ul.createBlockData({blockType:qt.Rectangle});return new Pu(this.Scene,new jl(t))}getGeometryData(){return this._geometry?.GeometryData.getGeometries()||[]}update(){const{p1:t,p2:e}=this.getClickPositions();this._geometry.GeometryData.P1=t,this._geometry.GeometryData.P2=e,super.update()}getPickMode(){return re.RECTANGLE}}class Du extends Ru{createGeometry(){const t=Ul.createBlockData({blockType:qt.Arrow});return new Pu(this.Scene,new Vl(t))}getGeometryData(){return this._geometry?.GeometryData.getGeometries()||[]}update(){const{p1:t,p2:e}=this.getClickPositions();this._geometry.GeometryData.P1=t,this._geometry.GeometryData.P2=e,super.update()}getPickMode(){return re.ARROW}}class Ou extends Ru{createGeometry(){const t=Ul.createBlockData({blockType:qt.Scope});return new Pu(this.Scene,new $l(t))}getGeometryData(){return this._geometry?.GeometryData.getGeometries()}update(){const{p1:t,p2:e}=this.getClickPositions();this._geometry.GeometryData.P1=t,this._geometry.GeometryData.P2=e,super.update()}getPickMode(){return re.SCOPE}}class Bu extends Ru{get ShouldRestart(){return!1}get Drawing(){return!0}get Finished(){return 1===this._coordinates.length}getGeometryData(){const t=this.getClickPositions().p2,e={Text:this._state.UserInput||"Text",Overlap:this._state.Overlap,Height:El.toMM(this._state.TextHeight),SAP:this._state.PosText,P:t,Align:7};return[Ul.createTextData(e)]}observed(t){let e=super.observed(t);return this.update(),e}createGeometry(){return Kl.createGeometry(this.getGeometryData()[0])}update(){this._geometry.GeometryData=this.getGeometryData()[0],super.update()}getPickMode(){return re.TEXT}}class Lu extends Ru{get Drawing(){return void 0!==this._state.Image?.size?.dimension||super.Drawing}get Finished(){return void 0!==this._state.Image?.size?.dimension?1==this._coordinates.length:super.Finished}getGeometryData(){const{p1:t,p2:e}=this.getClickPositions();let r={};if(this._geometry){const i=this._geometry.getImageDimensions(t,e,this._state.Image);r.Position=i.Pos,r.Dimension=i.Dim}return r.ImageFile=this._state.Image?.imagePath,[Ul.createImageData(r)]}update(){this._geometry.GeometryData=this.getGeometryData()[0],super.update()}createGeometry(){return Kl.createGeometry(this.getGeometryData()[0])}getPickMode(){return re.IMAGE}}class Nu{constructor(t){this.scene=t,this.filterGeometriesByAction=t=>!(this._actionHandler instanceof wu)||t.GraphContainer instanceof bl,this._selectionHandler=new hu(t),this._snapHandler=new lu(t),yl.register(this)}get Selection(){return this._selectionHandler}get Scene(){return this.scene}observed(t){return t.PickMode=this.updateActionHandler(t.PickMode),this._state=t,this._state}mouseUp(t){const e=this.scene.World.toLocal(this._snapHandler.GlobalMousePosition).copyTo(new Al);this._actionHandler?.mouseUp(e,t.button)||this.Scene.World.buildBVH()}updateActionHandler(t){let e=re.PICK;this._selectionHandler.Selected||t==re.MANIPULATION||(t=re.PICK,Ml.logInteractionManager(`No Geometry selected, returning to PickMode ${re[t].toString()}`,this._actionHandler)),this._actionHandler&&(e=this._actionHandler.getPickMode(),e!=t&&this.finishAction());let r=this._actionHandler?.getPickMode()===t?this._actionHandler:this.getActionHandler(t);return r&&t!==r.returnPickMode()&&(r=this.getActionHandler(r.returnPickMode())),r&&this._actionHandler!=r&&(Ml.logInteractionManager("New ActionHandler:",r),this._actionHandler=r,this._actionHandler.createWorldContainer()&&this.scene.World.addChild(this._actionHandler)),t}getActionHandler(t){switch(t){case re.MANIPULATION:return new wu(this);case re.EXPLODE:return new du(this);case re.DELETION:return new pu(this);case re.LINE:return new Cu(this);case re.CIRCLE:return new Mu(this);case re.RECTANGLE:return new Iu(this);case re.SCOPE:return new Ou(this);case re.ARROW:return new Du(this);case re.TEXT:return new Bu(this);case re.IMAGE:return new Lu(this)}}mouseDown(t){const e=this.scene.World.toLocal(this._snapHandler.GlobalMousePosition).copyTo(new Al);2===t.button&&this.preventRestart()||this._actionHandler?.mouseDown(e,t.button)||(0==t.button?this._selectionHandler.updateSelection(this._snapHandler.GlobalMousePosition,this.filterGeometriesByAction):2==t.button&&this._selectionHandler.clearSelection())}finishAction(){this.Scene.World.buildBVH(),this.preventRestart(),this._actionHandler&&(Ml.logInteractionManager("Cleared ActionHandler",this._actionHandler),this._actionHandler.destroy(),this._actionHandler=void 0)}mouseMove(t){this._snapHandler.mouseMove(t);const e=this.scene.World.toLocal(this._snapHandler.GlobalMousePosition).copyTo(new Al);this._actionHandler?.mouseMove(e),this._selectionHandler.updateHighlighted(this._snapHandler.GlobalMousePosition,this.filterGeometriesByAction)}onGeometryFinished(t,e){const r=this._selectionHandler.Selected,i=this.scene.World.ActivePrintContainer?.UserContainer;if(r&&i){let s=i.getNextIndent();const n=r.GeometryData;this.Scene.BlockRegistry.updateGeometryBlock(s,n,e?.GeometryData);for(const e of t){const t=Kl.createGeometry(Ul.applyFinishedProperties(s,e,n));t&&(i.addChild(t),t.update(),s++)}this._selectionHandler.update(),Ml.logInteractionManager(`Created ${t.length} new Geometries`)}const s=this._actionHandler;if(s){const t=s.getPickMode();this.finishAction(),s.ShouldRestart&&this.updateActionHandler(t)}}preventRestart(){return!(!this._actionHandler||this._actionHandler.ShouldRestart||(yl.publish({PickMode:re.PICK}),0))}}class Fu{constructor(t){this.scene=t,this._blockMap=new Map}dispose(){this._blockMap.clear()}getGeometryBlock(t){const e=t.BlockGuid;if(e>0)return this._blockMap.get(e)}updateGeometryBlock(t,e,r){if(r&&r.BlockGuid>0&&this._blockMap.has(r.BlockGuid)){let i=this.getGeometryBlock(r);i&&(i.GeometryData=Ul.applyFinishedProperties(t,i.GeometryData,e),this._blockMap.set(r.BlockGuid,i))}}createGeometryBlock(t){if(!this._blockMap.has(t.BlockGuid)){const e=Kl.createGeometry(t);return this._blockMap.set(t.BlockGuid,e),e}}destroyGeometryBlock(t,e=!0){const r=t.BlockGuid;return r>0&&(this.getLinkedGeometries(t).forEach((t=>{t.GeometryData.BlockGuid=0,e?t.destroy():t.update()})),this.scene.InteractionHandler.Selection.update(),this._blockMap.delete(r))}getLinkedGeometries(t){return this.scene.World.ActivePrintContainer?.getGeometries((e=>!ee(e.GeometryData)&&e.GeometryData.BlockGuid===t.BlockGuid))||[]}updateExistingBlocks(){Array.from(this._blockMap.values()).forEach((t=>{t.Dirty=!0,t.getLinkedShapes(this)}))}}class ku extends Gn{constructor(){super(),this._worldContainer=new au(287,200),this._cursor=new tu(15),this._snapIndicator=new eu,this._viewportController=new Ql(this),this._sceneController=new Zl(this),this._interactionManager=new Nu(this),this._blockRegistry=new Fu(this),this.setupEvents(),this.addChild(this._worldContainer),this.addChild(this._cursor),this.addChild(this._snapIndicator)}setupEvents(){this.eventMode="static",this.interactiveChildren=!1,this.addEventListener("wheel",(t=>{this._viewportController.handleZoom(t)})),this.addEventListener("mouseleave",(t=>{this._viewportController.handleLeave(t)})),this.addEventListener("pointerdown",(t=>{this._viewportController.handleDown(t),this._viewportController.Dragging||this._interactionManager.mouseDown(t)})),this.addEventListener("pointerup",(t=>{this._viewportController.handleUp(t),this._viewportController.Dragging||this._interactionManager.mouseUp(t)})),this.addEventListener("pointermove",(t=>{this._cursor.position.copyFrom(t.global),this._viewportController.handleMove(t),this._viewportController.Dragging||this._interactionManager.mouseMove(t)}))}render(t){this._viewportController.applyViewportOptions(this.World),super.render(t)}resize(t){this.hitArea=new ci(0,0,t.width,t.height),this._viewportController.centerViewport()}get Cursor(){return this._cursor}get SnapIndicator(){return this._snapIndicator}get World(){return this._worldContainer}get Controller(){return this._sceneController}get ViewportController(){return this._viewportController}get InteractionHandler(){return this._interactionManager}get BlockRegistry(){return this._blockRegistry}}class Uu{constructor(t,e){this.scene=t,this.renderer=e,this.stateController=new _l}get viewportController(){return this.scene.ViewportController}get sceneController(){return this.scene.Controller}resize(t){this.renderer.resize(t)}start(){this.stateController.setInitialized(),this.renderer.start(),this.scene.World.buildBVH()}stop(){this.renderer.stop()}}let Gu=class{get State(){return this._state}constructor(t){this.socket=t,this.preventZoom()}observed(t){this._state=t}publishStateUpdate(){window.rsm.publish(this._state)}waitForDOM(){return new Promise((t=>requestAnimationFrame((()=>requestAnimationFrame((()=>t("")))))))}async canvasInit(t){this._state=window.rsm.register(this),this._redlining=function(t){const e=new ku,r=new Jl(e);r.initialize(t);const i=new Uu(e,r);return i.start(),i}({view:t,hello:!0,antialias:!0,powerPreference:"high-performance"});const e=await this.socket.getCanvasData();await this._redlining.sceneController.uploadPrintData(e.CanvasData)}canvasResized(t,e){this._redlining.resize({width:t,height:e})}jumpToNextPage(){this._redlining.sceneController.jumpNext()}jumpToFirstPage(){this._redlining.sceneController.jumpFirst()}jumpToLastPage(){this._redlining.sceneController.jumpLast()}jumpToPreviousPage(){this._redlining.sceneController.jumpPrev()}centerViewport(){this._redlining.viewportController.centerViewport()}moveViewport(t,e){this._redlining.viewportController.moveViewport(t,e)}preventZoom(){document.addEventListener("keydown",(function(t){!t.ctrlKey||61!=t.which&&107!=t.which&&173!=t.which&&109!=t.which&&187!=t.which&&189!=t.which||t.preventDefault()}))}get RedliningController(){return this._redlining}};Gu=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([w(),function(t,e){return function(r,i){e(r,i,t)}}(0,S("RedliningSocketServiceInterface")),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Gu);var Hu=r(8388);function ju(t){return class extends t{constructor(...t){super(...t),window.rsm.register(this)}observed(t){return this.requestUpdate(),t}}}var Vu=function(t,e){return function(r,i){e(r,i,t)}};let $u=class extends Vt{static{this.styles=Hu.A}constructor(t,e){super(),this.printService=t,this.socket=e}render(){return St`
+            <button id="save_and_exit" @click="${this.saveAndExit}">Zurück & speichern</button>
+            <button id="exit" @click="${this.exit}">Zurück & Änderungen verwerfen</button>
+        `}async saveAndExit(){const t=this.printService?.RedliningController.sceneController.exportSceneData();await this.socket.sendData(t),this.exit()}exit(){document.title="Abbrechen #close#",window.parent.postMessage({id:"redlining:close",data:{}})}};$u=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([B("exit-component"),ju,A(),Vu(0,S(Gu)),Vu(1,S("RedliningSocketServiceInterface")),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Gu,Object])],$u);var Xu=r(2242);const{I:zu}=Ht;class Wu{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const Yu=(t,e)=>{const r=t._$AN;if(void 0===r)return!1;for(const t of r)t._$AO?.(e,!1),Yu(t,e);return!0},qu=t=>{let e,r;do{if(void 0===(e=t._$AM))break;r=e._$AN,r.delete(t),t=e}while(0===r?.size)},Ku=t=>{for(let e;e=t._$AM;t=e){let r=e._$AN;if(void 0===r)e._$AN=r=new Set;else if(r.has(t))break;r.add(t),Ju(e)}};function Zu(t){void 0!==this._$AN?(qu(this),this._$AM=t,Ku(this)):this._$AM=t}function Qu(t,e=!1,r=0){const i=this._$AH,s=this._$AN;if(void 0!==s&&0!==s.size)if(e)if(Array.isArray(i))for(let t=r;t<i.length;t++)Yu(i[t],!1),qu(i[t]);else null!=i&&(Yu(i,!1),qu(i));else Yu(this,t)}const Ju=t=>{2==t.type&&(t._$AP??=Qu,t._$AQ??=Zu)};class tc extends Wu{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),Ku(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Yu(this,t),qu(this))}setValue(t){if((()=>void 0===this._$Ct.strings)())this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}let ec=class extends tc{constructor(t,e){super(t),this.socket=e}async render(t){let e=(await(this.socket?.getLanguageText(t,t))).result||"";return e=Rl.encodeNCR(e),e?this.setValue(e):this.setValue(t),""}};ec=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([A(),function(t,e){return function(r,i){e(r,i,t)}}(1,S("RedliningSocketServiceInterface")),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Object])],ec);const rc=(ic=ec,(...t)=>({_$litDirective$:ic,values:t}));var ic;let sc=class extends Vt{static{this.styles=Xu.A}render(){return St`
+            <div class="row" style="height: 50%">
+                <image-button data-tooltip="${rc("redlining.control.pick")}" selected="PickMode:0" image-url='images/uibuttons/rl_om.gif'></image-button>
+            </div>
+            <div class="row" style="height: 50%">
+                <image-button data-tooltip="${rc("redlining.control.print")}" image-url='images/uibuttons/rl_dr.gif'></image-button>
+            </div>
+
+        `}};sc=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([B("common-control")],sc);var nc=r(2095),oc=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o},ac=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let hc=class extends Vt{static{this.styles=nc.A}constructor(t){super(),this.printService=t,this.resizeObserver=new ResizeObserver((()=>this.reportCanvasResized())),this.reportCanvasResized=()=>{this.canvas.width=this.clientWidth,this.canvas.height=this.clientHeight,this.printService.canvasResized(this.clientWidth,this.clientHeight)},this.setupCanvasEvents=()=>{this.canvas.addEventListener("wheel",(t=>{t.ctrlKey&&t.preventDefault()}),{passive:!0}),this.canvas.addEventListener("contextmenu",(t=>{t.preventDefault(),t.stopPropagation()}))}}render(){return St`
+            <canvas id="canvas" #canvas></canvas>
+        `}async firstUpdated(){this.canvas.width=this.clientWidth,this.canvas.height=this.clientHeight,this.setupCanvasEvents(),await(this.printService?.canvasInit(this.canvas)),this.reportCanvasResized(),this.resizeObserver.observe(this)}async disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this)}};oc([it("canvas"),ac("design:type",HTMLCanvasElement)],hc.prototype,"canvas",void 0),hc=oc([B("canvas-wrapper"),A(),function(t,e){return function(r,i){e(r,i,t)}}(0,S(Gu)),ac("design:paramtypes",[Gu])],hc);const lc={mode:"development",socketRoute:"/redlining",baseAssetPath:"./assets/"};var uc=r(3882);let cc=class extends Vt{static{this.styles=uc.A}get displayedImageName(){return this.isSelected()&&this.imageName?this.imageName+"_md":this._displayedImageName}isSelected(){if(this.hasAttribute("selected")){let t=this.getAttribute("selected").split(":");return(this.printService.State?.[t[0]]||0)==t[1]}if(this.hasAttribute("toggle")){let t=this.getAttribute("toggle");return this.printService.State?.[t]||!1}return!1}Select(){let t=this.hasAttribute("selected")||this.hasAttribute("toggle");if(this.hasAttribute("selected")){let t=this.getAttribute("selected").split(":");this.printService.State[t[0]]=parseInt(t[1])}if(this.hasAttribute("toggle")){let t=this.getAttribute("toggle");this.printService.State[t]=!this.isSelected()}t&&this.printService.publishStateUpdate()}constructor(t){super(),this.printService=t}render(){return this.displayedImageName?St`<img src="${this.getFinalImageSrc()}">`:Pt}connectedCallback(){super.connectedCallback(),this.baseUrl=this.getAttribute("image-url");let t=this.baseUrl.split("/");this.baseUrl=t.slice(0,-1).join("/");let e=t[t.length-1];this.imageName=e.split(".")[0],this._displayedImageName=this.imageName,this.imageExtension=e.split(".")[1]||"",this.addEventListener("mousemove",this.mousemove),this.addEventListener("mousedown",this.mousedown),this.addEventListener("mouseout",this.mouseout),this.addEventListener("mouseup",this.mouseup)}mousemove(t){this._displayedImageName=this.imageName+"_mo"}mousedown(t){this.Select(),this._displayedImageName=this.imageName+"_md"}mouseout(t){this._displayedImageName=this.imageName}mouseup(t){this.mousemove(t)}getFinalImageSrc(){return lc.baseAssetPath+this.baseUrl+"/"+this.displayedImageName+"."+this.imageExtension}};cc=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([B("image-button"),ju,A(),function(t,e){return function(r,i){e(r,i,t)}}(0,S(Gu)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Gu])],cc);var dc=r(7586),pc=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o},fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mc=function(t,e){return function(r,i){e(r,i,t)}};let gc=class extends Vt{static{this.styles=dc.A}constructor(t,e){super(),this.printService=t,this.imageService=e}render(){return St`
+            <rl-divider-2></rl-divider-2>
+            <div id="actions" class="control-container">
+                <ul>
+                    <li>
+                        <image-button data-tooltip="${rc("redlining.tools.manipulation")}" selected="PickMode:1" image-url='images/drawstyles/rl_ma.gif'></image-button>
+                    </li>
+                    <li>
+                        <image-button data-tooltip="${rc("redlining.tools.delete")}" selected="PickMode:2" image-url='images/drawstyles/rl_lo.gif'></image-button>
+                    </li>
+                    <li>
+                        <image-button data-tooltip="${rc("redlining.tools.explode")}" selected="PickMode:3" image-url='images/drawstyles/ac_explode.gif'></image-button>
+                    </li>
+                </ul>
+            </div>
+            <rl-divider></rl-divider>
+            <div id="settings" class="control-container">
+                <ul>
+                    <li>
+                        <image-button data-tooltip="${rc("redlining.mode.ortho")}" toggle="Orthogonal" image-url='images/drawstyles/rl_ot.gif'></image-button>
+                    </li>
+                    <li>
+                        <image-button data-tooltip="${rc("redlining.mode.snap")}" toggle="Snap" image-url='images/drawstyles/rl_sn.gif'></image-button>
+                    </li>
+                    <li>
+                        <image-button data-tooltip="${rc("redlining.mode.boundaryformation")}" toggle="BoundaryFormation" image-url='images/drawstyles/rl_gb.gif'></image-button>
+                    </li>
+                </ul>
+            </div>
+            <rl-divider></rl-divider>
+            <div id="line-mode" class="control-container flexbox">
+                <div id="solid">
+                    <ul>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.line.solid.thin")}" selected="Lining:0" image-url='images/drawstyles/rl_c1.gif'></image-button>
+                        </li>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.line.solid.medium")}" selected="Lining:1" image-url='images/drawstyles/rl_c2.gif'></image-button>
+                        </li>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.line.solid.thick")}" selected="Lining:2" image-url='images/drawstyles/rl_c3.gif'></image-button>
+                        </li>
+                    </ul>
+                </div>
+                <div id="dashed">
+                    <ul>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.line.dashed.thin")}" selected="Lining:3" image-url='images/drawstyles/rl_h1.gif'></image-button>
+                        </li>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.line.dashed.medium")}" selected="Lining:4" image-url='images/drawstyles/rl_h2.gif'></image-button>
+                        </li>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.line.dashed.thick")}" selected="Lining:5" image-url='images/drawstyles/rl_h3.gif'></image-button>
+                        </li>
+                    </ul>
+                </div>
+            </div>
+            <rl-divider></rl-divider>
+            <div id="shapes" class="control-container flexbox">
+                <div>
+                    <ul>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.tools.line")}" selected="PickMode:4" image-url='images/drawstyles/rl_li.gif'></image-button>
+                        </li>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.tools.circle")}" selected="PickMode:5" image-url='images/drawstyles/rl_kr.gif'></image-button>
+                        </li>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.tools.rectangle")}" selected="PickMode:6" image-url='images/drawstyles/rl_re.gif'></image-button>
+                        </li>
+                    </ul>
+                </div>
+                <div>
+                    <ul>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.tools.scope")}" selected="PickMode:7" image-url='images/drawstyles/rl_be.gif'></image-button>
+                        </li>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.tools.arrow")}" selected="PickMode:8" image-url='images/drawstyles/rl_pf.gif'></image-button>
+                        </li>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.tools.image")}" selected="PickMode:10" image-url='images/drawstyles/rl_pi.gif'></image-button>
+                        </li>
+                    </ul>
+                </div>
+            </div>
+            <div id="text" class="control-container flexbox">
+                <div style="padding-right: 5px;">
+                    <ul>
+                        <li>
+                            <image-button data-tooltip="${rc("redlining.tools.text")}" selected="PickMode:9" image-url='images/drawstyles/rl_te.gif'></image-button>
+                            <image-button data-tooltip="${rc("redlining.mode.postext")}" toggle="PosText" image-url='images/drawstyles/rl_pt.gif'></image-button>
+                        </li>
+                        <li>
+                            <select id="TextHeights">
+                                <option value="2.5">2.5mm</option>
+                                <option value="3.5" selected>3.5mm</option>
+                                <option value="5.0">5mm</option>
+                                <option value="7.0">7mm</option>
+                                <option value="10.0">10mm</option>
+                                <option value="20.0">20mm</option>
+                                <option value="30.0">30mm</option>
+                            </select>
+                        </li>
+                        <li>
+                            ${this.shouldShowImageSection()?St`
+                                        <div  class="select-offset">
+                                            <select @change="${this.imageSelectionChanged}" id="img-selector">
+                                                ${this.imageService.getImages().map((t=>St`
+                                                    <option value="${t.name}">${t.name}</option>
+                                                `))}
+                                            </select>
+                                        </div>
+                                    `:Pt}
+                        </li>
+                    </ul>
+                </div>
+                <textarea class="small-box" cols="27" id="TextArea" onresize="return false;" rows="5" style="padding-right: 5px;">${this.printService.State?.UserInput}</textarea>
+                <div class="spacer-2"></div>
+                <select id="defaultText" class="small-box" size="5" cols="27">
+                    <option value="1. Änderung">1. Änderung</option>
+                    <option value="2. Änderung">2. Änderung</option>
+                    <option value="3. Änderung">3. Änderung</option>
+                    <option value="X">Reklamation</option>
+                    <option value="ACHTUNG:~Alle Maß- und Typenangaben wurden nach uns vorliegenden Unterlagen erarbeitet und sind bei Auftragserteilung nochmals zu kontrollieren.~Vergleichen Sie bitte stets die aktuellen Typenlisten mit den zugesandten Skizzen.">Angebot</option>
+                    <option value="Wange beidseitig ohne Prägelochbohrungen">WoB</option>
+                    <option value="Wange beidseitig mit Prägelochbohrungen">WmB</option>
+                    <option value="Bitte geben Sie bei Bestellung dieser Planung die unten aufgeführte Projektnummer an.">Projektnummer (DE)</option>
+                    <option value="Merci de bien vouloir nous communiquer le numéro du projet mentionnée ci-dessous en cas d'une commande.">Projektnummer (FR)</option>
+                    <option value="Please indicate the project number when ordering this planing.">Projektnummer (EN)</option>
+                    <option value="Gelieve bij deze bestelling het onderstaand projectnummer vermelden.">Projektnummer (NL)</option>
+                </select>
+            </div>
+        `}setHeight(t){this.printService.State.TextHeight=parseFloat(t),this.printService.publishStateUpdate()}setText(t,e=!1){this.printService.State.UserInput=t,this.printService.publishStateUpdate()}onOptionsLoaded(){this.printService.State.Image=this.imageService.getImages()[0],this.printService.publishStateUpdate()}async firstUpdated(){this.setupTextarea(),this.setupTextSizeDropdown(),this.onOptionsLoaded()}shouldShowImageSection(){return!0}imageSelectionChanged(t){let e=t.target.selectedIndex||0;-1!=e&&(this.printService.State.Image=this.imageService.getImages()[e],this.printService.publishStateUpdate())}overlapStateChanged(t){this.printService.State.Overlap=t.checked,this.printService.publishStateUpdate()}restoreTextSizeIndex(t,e){let r=-1;for(let i=0;i<t.options.length;i++)if(t.options[i].value==e){r=i;break}-1!=r&&(t.selectedIndex=r)}setupTextSizeDropdown(){this.restoreTextSizeIndex(this.TextHeights,this.printService.State.TextHeight.toString()),this.setHeight(this.TextHeights.selectedOptions[0].value),this.TextHeights.oninput=()=>{this.setHeight(this.TextHeights.selectedOptions[0].value)}}setupTextarea(){this.setText(this.textArea.value),this.textArea.oninput=t=>{this.setText(this.textArea.value,!0)},this.defaultText.oninput=t=>{let e=this.defaultText.options[this.defaultText.selectedIndex];this.textArea.value=e.value,this.setText(this.textArea.value,!0)},this.restoreTextSelection(this.defaultText,this.textArea.value)}restoreTextSelection(t,e){let r=-1;for(let i=0;i<t.options.length;i++)if(t.options[i].value==e){r=i;break}-1!=r&&(t.selectedIndex=r)}};pc([it("#TextHeights"),fc("design:type",HTMLSelectElement)],gc.prototype,"TextHeights",void 0),pc([it("#TextArea"),fc("design:type",HTMLTextAreaElement)],gc.prototype,"textArea",void 0),pc([it("#defaultText"),fc("design:type",HTMLSelectElement)],gc.prototype,"defaultText",void 0),gc=pc([B("interaction-control"),ju,A(),mc(0,S(Gu)),mc(1,S(Dl)),fc("design:paramtypes",[Gu,Dl])],gc);var yc=r(2648);let _c=class extends Vt{static{this.styles=yc.A}constructor(t){super(),this.printService=t}render(){return St`
+            <div id="navigation">
+                <page-navigation></page-navigation>
+                <rl-divider></rl-divider>
+                <zoom-control></zoom-control>
+                <rl-divider></rl-divider>
+                <common-control></common-control>
+                ${this.showInteractionSettings()?St`<interaction-control></interaction-control>`:Pt}
+            </div>
+            <exit-component></exit-component>
+        `}showInteractionSettings(){return this.printService?.State?.Selection.GUID>0||!1}};_c=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([B("navigation-wrapper"),ju,A(),function(t,e){return function(r,i){e(r,i,t)}}(0,S(Gu)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Gu])],_c);var vc=r(8162);let xc=class extends Vt{static{this.styles=vc.A}constructor(t){super(),this.printService=t,this.moveOffset=100}render(){return St`
+            <div class="row" style="height: 33%">
+                <image-button data-tooltip="${rc("redlining.viewport.zoomout")}" @click=${this.zoomOut} image-url='images/uibuttons/rl_zm.gif'></image-button>
+                <image-button data-tooltip="${rc("redlining.viewport.zoomin")}" @click=${this.zoomIn} image-url='images/uibuttons/rl_zp.gif'></image-button>
+                <image-button data-tooltip="${rc("redlining.viewport.zoomfit")}" @click=${this.centerViewport} image-url='images/uibuttons/rl_zg.gif'></image-button>
+            </div>
+            <div class="row" style="height: 33%">
+                <image-button data-tooltip="${rc("redlining.viewport.move.left")}" @click=${this.moveLeft} image-url="images/uibuttons/rl_pl.gif"></image-button>
+                <image-button data-tooltip="${rc("redlining.viewport.move.right")}" @click=${this.moveRight} image-url="images/uibuttons/rl_pr.gif"></image-button>
+            </div>
+            <div class="row" style="height: 33%">
+                <image-button data-tooltip="${rc("redlining.viewport.move.down")}" @click=${this.moveDown} image-url="images/uibuttons/rl_po.gif"></image-button>
+                <image-button data-tooltip="${rc("redlining.viewport.move.up")}" @click=${this.moveUp} image-url="images/uibuttons/rl_pu.gif"></image-button>
+            </div>
+        `}centerViewport(){this.printService?.centerViewport()}zoomIn(){this.printService?.RedliningController.viewportController.zoomIn()}zoomOut(){this.printService?.RedliningController.viewportController.zoomOut()}moveUp(){this.printService?.moveViewport(0,this.moveOffset)}moveDown(){this.printService?.moveViewport(0,-this.moveOffset)}moveRight(){this.printService?.moveViewport(this.moveOffset,0)}moveLeft(){this.printService?.moveViewport(-this.moveOffset,0)}};xc=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([B("zoom-control"),A(),function(t,e){return function(r,i){e(r,i,t)}}(0,S(Gu)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Gu])],xc);var bc=r(7460);let Tc=class extends Vt{static{this.styles=bc.A}render(){return Pt}};Tc=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([B("rl-divider")],Tc);var Ec=r(596);let Ac=class extends Vt{static{this.styles=Ec.A}render(){return Pt}};Ac=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([B("rl-divider-2")],Ac);var Sc=r(6362);let wc=class extends Vt{static{this.styles=Sc.A}constructor(t){super(),this.printService=t,document.addEventListener("keydown",(t=>{37==t.keyCode?this.previousPage():39==t.keyCode&&this.nextPage()}))}render(){return St`
+            <div class="row" style="height: 50%">
+                <image-button data-tooltip="${rc("redlining.page.previous")}" @click="${this.previousPage}" image-url="images/uibuttons/rl_sz.gif"></image-button>
+                <image-button data-tooltip="${rc("redlining.page.next")}" @click="${this.nextPage}" image-url="images/uibuttons/rl_sv.gif"></image-button>
+            </div>
+            <div class="row" style="height: 50%">
+                <image-button data-tooltip="${rc("redlining.page.first")}" @click="${this.firstPage}" image-url="images/uibuttons/rl_se.gif"></image-button>
+                <image-button data-tooltip="${rc("redlining.page.last")}" @click="${this.lastPage}" image-url="images/uibuttons/rl_sl.gif"></image-button>
+            </div>
+        `}previousPage(){this.printService?.jumpToPreviousPage()}nextPage(){this.printService?.jumpToNextPage()}firstPage(){this.printService?.jumpToFirstPage()}lastPage(){this.printService?.jumpToLastPage()}};wc=function(t,e,r,i){var s,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}([B("page-navigation"),A(),function(t,e){return function(r,i){e(r,i,t)}}(0,S(Gu)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Gu])],wc);var Pc=r(6230),Rc=r.n(Pc),Mc=r(9519),Cc=r.n(Mc),Ic=r(7397),Dc=r.n(Ic),Oc=r(9494),Bc=r.n(Oc),Lc=r(7250),Nc=r.n(Lc),Fc=r(1159),kc=r.n(Fc),Uc=r(7500),Gc={};Gc.styleTagTransform=kc(),Gc.setAttributes=Bc(),Gc.insert=Dc().bind(null,"head"),Gc.domAPI=Cc(),Gc.insertStyleElement=Nc(),Rc()(Uc.A,Gc),Uc.A&&Uc.A.locals&&Uc.A.locals,window.environment=lc})()})();
\ No newline at end of file

--
Gitblit v1.9.3