"use strict";exports.id=697,exports.ids=[697],exports.modules={2433:(a,b,c)=>{c.d(b,{l:()=>m});var d=c(48419),e=c(91546),f=c(69043),g=c(7363),h=c(1342),i=c(93141),j=c(61487),k=c(43463),l=c(3645);class m{constructor(a){this.rootViewPort=new e.M,this.viewport=new e.M,this.onRenderTargetChange=new g.C("onRenderTargetChange"),this.projectionMatrix=new d.u,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=a,a.renderableGC.addManagedHash(this,"_gpuRenderTargetHash")}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:a,clear:b,clearColor:c,frame:d}){let e;this._renderTargetStack.length=0,this.push(a,b,c,d),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=(e=this.rootRenderTarget.colorTexture.source.resource,globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)),this.adaptor.prerender?.(this.rootRenderTarget)}postrender(){this.adaptor.postrender?.(this.rootRenderTarget)}bind(a,b=!0,c,d){var e,f,g;let h,i=this.getRenderTarget(a),k=this.renderTarget!==i;this.renderTarget=i,this.renderSurface=a;let l=this.getGpuRenderTarget(i);(i.pixelWidth!==l.width||i.pixelHeight!==l.height)&&(this.adaptor.resizeGpuRenderTarget(i),l.width=i.pixelWidth,l.height=i.pixelHeight);let m=i.colorTexture,n=this.viewport,o=m.pixelWidth,p=m.pixelHeight;if(!d&&a instanceof j.g&&(d=a.frame),d){let a=m._resolution;n.x=d.x*a+.5|0,n.y=d.y*a+.5|0,n.width=d.width*a+.5|0,n.height=d.height*a+.5|0}else n.x=0,n.y=0,n.width=o,n.height=p;return e=this.projectionMatrix,f=n.width/m.resolution,g=n.height/m.resolution,h=i.isRoot?-1:1,e.identity(),e.a=1/f*2,e.d=1/g*2*h,e.tx=-1-0*e.a,e.ty=-h-0*e.d,this.adaptor.startRenderPass(i,b,c,n),k&&this.onRenderTargetChange.emit(i),i}clear(a,b=f.u.ALL,c){b&&(a&&(a=this.getRenderTarget(a)),this.adaptor.clear(a||this.renderTarget,b,c,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(a,b=f.u.ALL,c,d){let e=this.bind(a,b,c,d);return this._renderTargetStack.push({renderTarget:e,frame:d}),e}pop(){this._renderTargetStack.pop();let a=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(a.renderTarget,!1,null,a.frame)}getRenderTarget(a){return a.isTexture&&(a=a.source),this._renderSurfaceToRenderTargetHash.get(a)??this._initRenderTarget(a)}copyToTexture(a,b,c,d,e){c.x<0&&(d.width+=c.x,e.x-=c.x,c.x=0),c.y<0&&(d.height+=c.y,e.y-=c.y,c.y=0);let{pixelWidth:f,pixelHeight:g}=a;return d.width=Math.min(d.width,f-c.x),d.height=Math.min(d.height,g-c.y),this.adaptor.copyToTexture(a,b,c,d,e)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((a,b)=>{a!==b&&a.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(a){let b=null;return h.q.test(a)&&(a=(0,k.c)(a).source),a instanceof l.O?b=a:a instanceof i.v&&(b=new l.O({colorTextures:[a]}),a.source instanceof h.q&&(b.isRoot=!0),a.once("destroy",()=>{b.destroy(),this._renderSurfaceToRenderTargetHash.delete(a);let c=this._gpuRenderTargetHash[b.uid];c&&(this._gpuRenderTargetHash[b.uid]=null,this.adaptor.destroyGpuRenderTarget(c))})),this._renderSurfaceToRenderTargetHash.set(a,b),b}getGpuRenderTarget(a){return this._gpuRenderTargetHash[a.uid]||(this._gpuRenderTargetHash[a.uid]=this.adaptor.initGpuRenderTarget(a))}resetState(){this.renderTarget=null,this.renderSurface=null}}},2574:(a,b,c)=>{c.d(b,{V:()=>d});function d(a,b,c){let d=(a>>24&255)/255;b[c++]=(255&a)/255*d,b[c++]=(a>>8&255)/255*d,b[c++]=(a>>16&255)/255*d,b[c++]=d}},3009:(a,b,c)=>{c.d(b,{E:()=>e});var d=c(93492);function e(a,b,c,e){let f=[`
        var v = null;
        var v2 = null;
        var t = 0;
        var index = 0;
        var name = null;
        var arrayOffset = null;
    `],g=0;for(let h=0;h<a.length;h++){let i=a[h],j=i.data.name,k=!1,l=0;for(let a=0;a<d.$.length;a++)if(d.$[a].test(i.data)){l=i.offset/4,f.push(`name = "${j}";`,`offset += ${l-g};`,d.$[a][b]||d.$[a].ubo),k=!0;break}if(!k)if(i.data.size>1)l=i.offset/4,f.push(c(i,l-g));else{let a=e[i.data.type];l=i.offset/4,f.push(`
                    v = uv.${j};
                    offset += ${l-g};
                    ${a};
                `)}g=l}return Function("uv","data","dataInt32","offset",f.join("\n"))}},3645:(a,b,c)=>{c.d(b,{O:()=>h});var d=c(42115),e=c(93141),f=c(61487);let g=class a{constructor(b={}){if(this.uid=(0,d.L)("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,b={...a.defaultOptions,...b},this.stencil=b.stencil,this.depth=b.depth,this.isRoot=b.isRoot,"number"==typeof b.colorTextures){this._managedColorTextures=!0;for(let a=0;a<b.colorTextures;a++)this.colorTextures.push(new e.v({width:b.width,height:b.height,resolution:b.resolution,antialias:b.antialias}))}else{this.colorTextures=[...b.colorTextures.map(a=>a.source)];const a=this.colorTexture.source;this.resize(a.width,a.height,a._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(b.depthStencilTexture||this.stencil)&&(b.depthStencilTexture instanceof f.g||b.depthStencilTexture instanceof e.v?this.depthStencilTexture=b.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){let a=this._size;return a[0]=this.pixelWidth,a[1]=this.pixelHeight,a}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(a){this.resize(a.width,a.height,a._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new e.v({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(a,b,c=this.resolution,d=!1){this.dirtyId++,this.colorTextures.forEach((e,f)=>{d&&0===f||e.source.resize(a,b,c)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(a,b,c)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(a=>{a.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};g.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let h=g},9563:(a,b,c)=>{c.d(b,{f:()=>aA,i:()=>az});var d=c(45753);class e{constructor(a){this._renderer=a}updateRenderable(){}destroyRenderable(){}validateRenderable(){return!1}addRenderable(a,b){this._renderer.renderPipes.batch.break(b),b.add(a)}execute(a){a.isRenderable&&a.render(this._renderer)}destroy(){this._renderer=null}}e.extension={type:[d.Ag.WebGLPipes,d.Ag.WebGPUPipes,d.Ag.CanvasPipes],name:"customRender"};var f=c(48419),g=c(6672),h=c(22724);function i(a,b){let c=a.instructionSet,d=c.instructions;for(let a=0;a<c.instructionSize;a++){let c=d[a];b[c.renderPipeId].execute(c)}}let j=new f.u;class k{constructor(a){this._renderer=a}addRenderGroup(a,b){a.isCachedAsTexture?this._addRenderableCacheAsTexture(a,b):this._addRenderableDirect(a,b)}execute(a){a.isRenderable&&(a.isCachedAsTexture?this._executeCacheAsTexture(a):this._executeDirect(a))}destroy(){this._renderer=null}_addRenderableDirect(a,b){this._renderer.renderPipes.batch.break(b),a._batchableRenderGroup&&(g.Z.return(a._batchableRenderGroup),a._batchableRenderGroup=null),b.add(a)}_addRenderableCacheAsTexture(a,b){let c=a._batchableRenderGroup??(a._batchableRenderGroup=g.Z.get(h.K));c.renderable=a.root,c.transform=a.root.relativeGroupTransform,c.texture=a.texture,c.bounds=a._textureBounds,b.add(a),this._renderer.renderPipes.blendMode.pushBlendMode(a,a.root.groupBlendMode,b),this._renderer.renderPipes.batch.addToBatch(c,b),this._renderer.renderPipes.blendMode.popBlendMode(b)}_executeCacheAsTexture(a){if(a.textureNeedsUpdate){a.textureNeedsUpdate=!1;let b=j.identity().translate(-a._textureBounds.x,-a._textureBounds.y);this._renderer.renderTarget.push(a.texture,!0,null,a.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:b,worldColor:0xffffffff,offset:{x:0,y:0}}),i(a,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop()}a._batchableRenderGroup._batcher.updateElement(a._batchableRenderGroup),a._batchableRenderGroup._batcher.geometry.buffers[0].update()}_executeDirect(a){this._renderer.globalUniforms.push({worldTransformMatrix:a.inverseParentTextureTransform,worldColor:a.worldColorAlpha}),i(a,this._renderer.renderPipes),this._renderer.globalUniforms.pop()}}k.extension={type:[d.Ag.WebGLPipes,d.Ag.WebGPUPipes,d.Ag.CanvasPipes],name:"renderGroup"};var l=c(29695),m=c(80424),n=c(87790);function o(a,b){b||(b=0);for(let c=b;c<a.length;c++)if(a[c])a[c]=null;else break}var p=c(64974),q=c(28383);let r=new p.mc,s=p.fR|p.ig|p.u;function t(a,b,c){if(c&p.ig){a.groupColor=(0,q.j)(a.localColor,b.groupColor);let c=a.localAlpha*b.groupAlpha;a.groupAlpha=c=c<0?0:c>1?1:c,a.groupColorAlpha=a.groupColor+(255*c<<24)}c&p.u&&(a.groupBlendMode="inherit"===a.localBlendMode?b.groupBlendMode:a.localBlendMode),c&p.fR&&(a.globalDisplayStatus=a.localDisplayStatus&b.globalDisplayStatus),a._updateFlags=0}let u=new f.u;class v{constructor(a){this._renderer=a}render({container:a,transform:b}){let c=a.parent,d=a.renderGroup.renderGroupParent;a.parent=null,a.renderGroup.renderGroupParent=null;let e=this._renderer;b&&(u.copyFrom(a.renderGroup.localTransform),a.renderGroup.localTransform.copyFrom(b));let f=e.renderPipes;this._updateCachedRenderGroups(a.renderGroup,null),this._updateRenderGroups(a.renderGroup),e.globalUniforms.start({worldTransformMatrix:b?a.renderGroup.localTransform:a.renderGroup.worldTransform,worldColor:a.renderGroup.worldColorAlpha}),i(a.renderGroup,f),f.uniformBatch&&f.uniformBatch.renderEnd(),b&&a.renderGroup.localTransform.copyFrom(u),a.parent=c,a.renderGroup.renderGroupParent=d}destroy(){this._renderer=null}_updateCachedRenderGroups(a,b){if(a._parentCacheAsTextureRenderGroup=b,a.isCachedAsTexture){if(!a.textureNeedsUpdate)return;b=a}for(let c=a.renderGroupChildren.length-1;c>=0;c--)this._updateCachedRenderGroups(a.renderGroupChildren[c],b);if(a.invalidateMatrices(),a.isCachedAsTexture){if(a.textureNeedsUpdate){let b=a.root.getLocalBounds();b.ceil();let c=a.texture;a.texture&&l.W.returnTexture(a.texture,!0);let d=this._renderer,e=a.textureOptions.resolution||d.view.resolution,f=a.textureOptions.antialias??d.view.antialias,g=a.textureOptions.scaleMode??"linear",h=l.W.getOptimalTexture(b.width,b.height,e,f);h._source.style=new m.n({scaleMode:g}),a.texture=h,a._textureBounds||(a._textureBounds=new n.c),a._textureBounds.copyFrom(b),c!==a.texture&&a.renderGroupParent&&(a.renderGroupParent.structureDidChange=!0)}}else a.texture&&(l.W.returnTexture(a.texture,!0),a.texture=null)}_updateRenderGroups(a){let b=this._renderer,c=b.renderPipes;if(a.runOnRender(b),a.instructionSet.renderPipes=c,a.structureDidChange?o(a.childrenRenderablesToUpdate.list,0):!function(a,b){let{list:c}=a.childrenRenderablesToUpdate,d=!1;for(let e=0;e<a.childrenRenderablesToUpdate.index;e++){let a=c[e];if(d=b[a.renderPipeId].validateRenderable(a))break}a.structureDidChange=d}(a,c),!function a(b,c=!1){var d=b;let e,f=d.root;if(d.renderGroupParent){let a=d.renderGroupParent;d.worldTransform.appendFrom(f.relativeGroupTransform,a.worldTransform),d.worldColor=(0,q.j)(f.groupColor,a.worldColor),e=f.groupAlpha*a.worldAlpha}else d.worldTransform.copyFrom(f.localTransform),d.worldColor=f.localColor,e=f.localAlpha;d.worldAlpha=e=e<0?0:e>1?1:e,d.worldColorAlpha=d.worldColor+(255*e<<24);let g=b.childrenToUpdate,h=b.updateTick++;for(let a in g){let c=Number(a),d=g[a],e=d.list,f=d.index;for(let a=0;a<f;a++){let d=e[a];d.parentRenderGroup===b&&d.relativeRenderGroupDepth===c&&function a(b,c,d){if(c===b.updateTick)return;b.updateTick=c,b.didChange=!1;let e=b.localTransform;b.updateLocalTransform();let f=b.parent;if(f&&!f.renderGroup?(d|=b._updateFlags,b.relativeGroupTransform.appendFrom(e,f.relativeGroupTransform),d&s&&t(b,f,d)):(d=b._updateFlags,b.relativeGroupTransform.copyFrom(e),d&s&&t(b,r,d)),!b.renderGroup){let e=b.children,f=e.length;for(let b=0;b<f;b++)a(e[b],c,d);let g=b.parentRenderGroup;b.renderPipeId&&!g.structureDidChange&&g.updateRenderable(b)}}(d,h,0)}o(e,f),d.index=0}if(c)for(let d=0;d<b.renderGroupChildren.length;d++)a(b.renderGroupChildren[d],c)}(a),a.structureDidChange?(a.structureDidChange=!1,this._buildInstructions(a,b)):this._updateRenderables(a),a.childrenRenderablesToUpdate.index=0,b.renderPipes.batch.upload(a.instructionSet),!a.isCachedAsTexture||a.textureNeedsUpdate)for(let b=0;b<a.renderGroupChildren.length;b++)this._updateRenderGroups(a.renderGroupChildren[b])}_updateRenderables(a){let{list:b,index:c}=a.childrenRenderablesToUpdate;for(let d=0;d<c;d++){let c=b[d];c.didViewUpdate&&a.updateRenderable(c)}o(b,c)}_buildInstructions(a,b){let c=a.root,d=a.instructionSet;d.reset();let e=b.renderPipes?b:b.batch.renderer,f=e.renderPipes;f.batch.buildStart(d),f.blendMode.buildStart(),f.colorMask.buildStart(),c.sortableChildren&&c.sortChildren(),c.collectRenderablesWithEffects(d,e,null),f.batch.buildEnd(d),f.blendMode.buildEnd(d)}}v.extension={type:[d.Ag.WebGLSystem,d.Ag.WebGPUSystem,d.Ag.CanvasSystem],name:"renderGroup"};class w{constructor(a){this._renderer=a}addRenderable(a,b){let c=this._getGpuSprite(a);a.didViewUpdate&&this._updateBatchableSprite(a,c),this._renderer.renderPipes.batch.addToBatch(c,b)}updateRenderable(a){let b=this._getGpuSprite(a);a.didViewUpdate&&this._updateBatchableSprite(a,b),b._batcher.updateElement(b)}validateRenderable(a){let b=this._getGpuSprite(a);return!b._batcher.checkAndUpdateTexture(b,a._texture)}_updateBatchableSprite(a,b){b.bounds=a.visualBounds,b.texture=a._texture}_getGpuSprite(a){return a._gpuData[this._renderer.uid]||this._initGPUSprite(a)}_initGPUSprite(a){let b=new h.K;return b.renderable=a,b.transform=a.groupTransform,b.texture=a._texture,b.bounds=a.visualBounds,b.roundPixels=this._renderer._roundPixels|a._roundPixels,a._gpuData[this._renderer.uid]=b,b}destroy(){this._renderer=null}}w.extension={type:[d.Ag.WebGLPipes,d.Ag.WebGPUPipes,d.Ag.CanvasPipes],name:"sprite"};var x=c(30231),y=c(83305),z=c(36519);let A=class a{constructor(a,b){this.state=y.U.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=a,this._adaptor=b,this._adaptor.init?.(this)}static getBatcher(a){return new this._availableBatchers[a]}buildStart(a){let b=this._batchersByInstructionSet[a.uid];for(let c in!b&&((b=this._batchersByInstructionSet[a.uid]=Object.create(null)).default||(b.default=new z.J({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=b,this._activeBatch=this._activeBatches.default,this._activeBatches)this._activeBatches[c].begin()}addToBatch(b,c){if(this._activeBatch.name!==b.batcherName){this._activeBatch.break(c);let d=this._activeBatches[b.batcherName];d||(d=this._activeBatches[b.batcherName]=a.getBatcher(b.batcherName)).begin(),this._activeBatch=d}this._activeBatch.add(b)}break(a){this._activeBatch.break(a)}buildEnd(a){this._activeBatch.break(a);let b=this._activeBatches;for(let a in b){let c=b[a],d=c.geometry;d.indexBuffer.setDataWithSize(c.indexBuffer,c.indexSize,!0),d.buffers[0].setDataWithSize(c.attributeBuffer.float32View,c.attributeSize,!1)}}upload(a){let b=this._batchersByInstructionSet[a.uid];for(let a in b){let c=b[a],d=c.geometry;c.dirty&&(c.dirty=!1,d.buffers[0].update(4*c.attributeSize))}}execute(a){if("startBatch"===a.action){let b=a.batcher,c=b.geometry,d=b.shader;this._adaptor.start(this,c,d)}this._adaptor.execute(this,a)}destroy(){for(let a in this.state=null,this.renderer=null,this._adaptor=null,this._activeBatches)this._activeBatches[a].destroy();this._activeBatches=null}};A.extension={type:[d.Ag.WebGLPipes,d.Ag.WebGPUPipes,d.Ag.CanvasPipes],name:"batch"},A._availableBatchers=Object.create(null),d.XO.handleByMap(d.Ag.Batcher,A._availableBatchers),d.XO.add(z.J);var B=c(65151),C=c(15104),D=c(5086),E=c(87796),F=c(84434),G=c(43984),H="struct GlobalFilterUniforms {\n  uInputSize:vec4<f32>,\n  uInputPixel:vec4<f32>,\n  uInputClamp:vec4<f32>,\n  uOutputFrame:vec4<f32>,\n  uGlobalFrame:vec4<f32>,\n  uOutputTexture:vec4<f32>,\n};\n\nstruct MaskUniforms {\n  uFilterMatrix:mat3x3<f32>,\n  uMaskClamp:vec4<f32>,\n  uAlpha:f32,\n  uInverse:f32,\n};\n\n@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;\n@group(0) @binding(1) var uTexture: texture_2d<f32>;\n@group(0) @binding(2) var uSampler : sampler;\n\n@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;\n@group(1) @binding(1) var uMaskTexture: texture_2d<f32>;\n\nstruct VSOutput {\n    @builtin(position) position: vec4<f32>,\n    @location(0) uv : vec2<f32>,\n    @location(1) filterUv : vec2<f32>,\n};\n\nfn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>\n{\n    var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;\n\n    position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;\n    position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;\n\n    return vec4(position, 0.0, 1.0);\n}\n\nfn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n    return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);\n}\n\nfn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>\n{\n  return  (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);\n}\n\nfn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>\n{\n  return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0)  ).xy;\n}\n\nfn getSize() -> vec2<f32>\n{\n  return gfu.uGlobalFrame.zw;\n}\n\n@vertex\nfn mainVertex(\n  @location(0) aPosition : vec2<f32>,\n) -> VSOutput {\n  return VSOutput(\n   filterVertexPosition(aPosition),\n   filterTextureCoord(aPosition),\n   getFilterCoord(aPosition)\n  );\n}\n\n@fragment\nfn mainFragment(\n  @location(0) uv: vec2<f32>,\n  @location(1) filterUv: vec2<f32>,\n  @builtin(position) position: vec4<f32>\n) -> @location(0) vec4<f32> {\n\n    var maskClamp = filterUniforms.uMaskClamp;\n    var uAlpha = filterUniforms.uAlpha;\n\n    var clip = step(3.5,\n      step(maskClamp.x, filterUv.x) +\n      step(maskClamp.y, filterUv.y) +\n      step(filterUv.x, maskClamp.z) +\n      step(filterUv.y, maskClamp.w));\n\n    var mask = textureSample(uMaskTexture, uSampler, filterUv);\n    var source = textureSample(uTexture, uSampler, uv);\n    var alphaMul = 1.0 - uAlpha * (1.0 - mask.a);\n\n    var a: f32 = alphaMul * mask.r * uAlpha * clip;\n\n    if (filterUniforms.uInverse == 1.0) {\n        a = 1.0 - a;\n    }\n\n    return source * a;\n}\n";class I extends G.d{constructor(a){const{sprite:b,...c}=a,d=new F.N(b.texture),e=new E.k({uFilterMatrix:{value:new f.u,type:"mat3x3<f32>"},uMaskClamp:{value:d.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:+!!a.inverse,type:"f32"}});super({...c,gpuProgram:D.B.from({vertex:{source:H,entryPoint:"mainVertex"},fragment:{source:H,entryPoint:"mainFragment"}}),glProgram:C.M.from({vertex:"in vec2 aPosition;\n\nout vec2 vTextureCoord;\nout vec2 vMaskCoord;\n\n\nuniform vec4 uInputSize;\nuniform vec4 uOutputFrame;\nuniform vec4 uOutputTexture;\nuniform mat3 uFilterMatrix;\n\nvec4 filterVertexPosition(  vec2 aPosition )\n{\n    vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;\n       \n    position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;\n    position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;\n\n    return vec4(position, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord(  vec2 aPosition )\n{\n    return aPosition * (uOutputFrame.zw * uInputSize.zw);\n}\n\nvec2 getFilterCoord( vec2 aPosition )\n{\n    return  ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0)  ).xy;\n}   \n\nvoid main(void)\n{\n    gl_Position = filterVertexPosition(aPosition);\n    vTextureCoord = filterTextureCoord(aPosition);\n    vMaskCoord = getFilterCoord(aPosition);\n}\n",fragment:"in vec2 vMaskCoord;\nin vec2 vTextureCoord;\n\nuniform sampler2D uTexture;\nuniform sampler2D uMaskTexture;\n\nuniform float uAlpha;\nuniform vec4 uMaskClamp;\nuniform float uInverse;\n\nout vec4 finalColor;\n\nvoid main(void)\n{\n    float clip = step(3.5,\n        step(uMaskClamp.x, vMaskCoord.x) +\n        step(uMaskClamp.y, vMaskCoord.y) +\n        step(vMaskCoord.x, uMaskClamp.z) +\n        step(vMaskCoord.y, uMaskClamp.w));\n\n    // TODO look into why this is needed\n    float npmAlpha = uAlpha;\n    vec4 original = texture(uTexture, vTextureCoord);\n    vec4 masky = texture(uMaskTexture, vMaskCoord);\n    float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n    float a = alphaMul * masky.r * npmAlpha * clip;\n\n    if (uInverse == 1.0) {\n        a = 1.0 - a;\n    }\n\n    finalColor = original * a;\n}\n",name:"mask-filter"}),clipToViewport:!1,resources:{filterUniforms:e,uMaskTexture:b.texture.source}}),this.sprite=b,this._textureMatrix=d}set inverse(a){this.resources.filterUniforms.uniforms.uInverse=+!!a}get inverse(){return 1===this.resources.filterUniforms.uniforms.uInverse}apply(a,b,c,d){this._textureMatrix.texture=this.sprite.texture,a.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,a.applyFilter(this,b,c,d)}}var J=c(33349),K=c(30006),L=c(61487),M=c(11489);let N=new n.c;class O extends B.a{constructor(){super(),this.filters=[new I({sprite:new K.k(L.g.EMPTY),inverse:!1,resolution:"inherit",antialias:"inherit"})]}get sprite(){return this.filters[0].sprite}set sprite(a){this.filters[0].sprite=a}get inverse(){return this.filters[0].inverse}set inverse(a){this.filters[0].inverse=a}}class P{constructor(a){this._activeMaskStage=[],this._renderer=a}push(a,b,c){let d=this._renderer;if(d.renderPipes.batch.break(c),c.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:a,inverse:b._maskOptions.inverse,canBundle:!1,maskedContainer:b}),a.inverse=b._maskOptions.inverse,a.renderMaskToTexture){let b=a.mask;b.includeInBuild=!0,b.collectRenderables(c,d,null),b.includeInBuild=!1}d.renderPipes.batch.break(c),c.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:a,maskedContainer:b,inverse:b._maskOptions.inverse,canBundle:!1})}pop(a,b,c){this._renderer.renderPipes.batch.break(c),c.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:a,inverse:b._maskOptions.inverse,canBundle:!1})}execute(a){let b=this._renderer,c=a.mask.renderMaskToTexture;if("pushMaskBegin"===a.action){let d=g.Z.get(O);if(d.inverse=a.inverse,c){a.mask.mask.measurable=!0;let c=(0,J.f)(a.mask.mask,!0,N);a.mask.mask.measurable=!1,c.ceil();let e=b.renderTarget.renderTarget.colorTexture.source,f=l.W.getOptimalTexture(c.width,c.height,e._resolution,e.antialias);b.renderTarget.push(f,!0),b.globalUniforms.push({offset:c,worldColor:0xffffffff});let g=d.sprite;g.texture=f,g.worldTransform.tx=c.minX,g.worldTransform.ty=c.minY,this._activeMaskStage.push({filterEffect:d,maskedContainer:a.maskedContainer,filterTexture:f})}else d.sprite=a.mask.mask,this._activeMaskStage.push({filterEffect:d,maskedContainer:a.maskedContainer})}else if("pushMaskEnd"===a.action){let a=this._activeMaskStage[this._activeMaskStage.length-1];c&&(b.type===M.W.WEBGL&&b.renderTarget.finishRenderPass(),b.renderTarget.pop(),b.globalUniforms.pop()),b.filter.push({renderPipeId:"filter",action:"pushFilter",container:a.maskedContainer,filterEffect:a.filterEffect,canBundle:!1})}else if("popMaskEnd"===a.action){b.filter.pop();let a=this._activeMaskStage.pop();c&&l.W.returnTexture(a.filterTexture),g.Z.return(a.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}}P.extension={type:[d.Ag.WebGLPipes,d.Ag.WebGPUPipes,d.Ag.CanvasPipes],name:"alphaMask"};class Q{constructor(a){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=a}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(a,b,c){this._renderer.renderPipes.batch.break(c);let d=this._colorStack;d[this._colorStackIndex]=d[this._colorStackIndex-1]&a.mask;let e=this._colorStack[this._colorStackIndex];e!==this._currentColor&&(this._currentColor=e,c.add({renderPipeId:"colorMask",colorMask:e,canBundle:!1})),this._colorStackIndex++}pop(a,b,c){this._renderer.renderPipes.batch.break(c);let d=this._colorStack;this._colorStackIndex--;let e=d[this._colorStackIndex-1];e!==this._currentColor&&(this._currentColor=e,c.add({renderPipeId:"colorMask",colorMask:e,canBundle:!1}))}execute(a){this._renderer.colorMask.setMask(a.colorMask)}destroy(){this._renderer=null,this._colorStack=null}}Q.extension={type:[d.Ag.WebGLPipes,d.Ag.WebGPUPipes,d.Ag.CanvasPipes],name:"colorMask"};var R=c(69043),S=c(21507);class T{constructor(a){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=a}push(a,b,c){var d;let e=this._renderer;e.renderPipes.batch.break(c),e.renderPipes.blendMode.setBlendMode(a.mask,"none",c),c.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:a,inverse:b._maskOptions.inverse,canBundle:!1});let f=a.mask;f.includeInBuild=!0,this._maskHash.has(a)||this._maskHash.set(a,{instructionsStart:0,instructionsLength:0});let g=this._maskHash.get(a);g.instructionsStart=c.instructionSize,f.collectRenderables(c,e,null),f.includeInBuild=!1,e.renderPipes.batch.break(c),c.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:a,inverse:b._maskOptions.inverse,canBundle:!1});let h=c.instructionSize-g.instructionsStart-1;g.instructionsLength=h;let i=e.renderTarget.renderTarget.uid;(d=this._maskStackHash)[i]??(d[i]=0)}pop(a,b,c){let d=this._renderer;d.renderPipes.batch.break(c),d.renderPipes.blendMode.setBlendMode(a.mask,"none",c),c.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:b._maskOptions.inverse,canBundle:!1});let e=this._maskHash.get(a);for(let a=0;a<e.instructionsLength;a++)c.instructions[c.instructionSize++]=c.instructions[e.instructionsStart++];c.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(a){var b;let c=this._renderer,d=c.renderTarget.renderTarget.uid,e=(b=this._maskStackHash)[d]??(b[d]=0);"pushMaskBegin"===a.action?(c.renderTarget.ensureDepthStencil(),c.stencil.setStencilMode(S.K.RENDERING_MASK_ADD,e),e++,c.colorMask.setMask(0)):"pushMaskEnd"===a.action?(a.inverse?c.stencil.setStencilMode(S.K.INVERSE_MASK_ACTIVE,e):c.stencil.setStencilMode(S.K.MASK_ACTIVE,e),c.colorMask.setMask(15)):"popMaskBegin"===a.action?(c.colorMask.setMask(0),0!==e?c.stencil.setStencilMode(S.K.RENDERING_MASK_REMOVE,e):(c.renderTarget.clear(null,R.u.STENCIL),c.stencil.setStencilMode(S.K.DISABLED,e)),e--):"popMaskEnd"===a.action&&(a.inverse?c.stencil.setStencilMode(S.K.INVERSE_MASK_ACTIVE,e):c.stencil.setStencilMode(S.K.MASK_ACTIVE,e),c.colorMask.setMask(15)),this._maskStackHash[d]=e}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}}T.extension={type:[d.Ag.WebGLPipes,d.Ag.WebGPUPipes,d.Ag.CanvasPipes],name:"stencilMask"};var U=c(66242),V=c(87818);let W=class a{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new U.Q(0),this.color=this._backgroundColor,this.alpha=1}init(b){b={...a.defaultOptions,...b},this.clearBeforeRender=b.clearBeforeRender,this.color=b.background||b.backgroundColor||this._backgroundColor,this.alpha=b.backgroundAlpha,this._backgroundColor.setAlpha(b.backgroundAlpha)}get color(){return this._backgroundColor}set color(a){U.Q.shared.setValue(a).alpha<1&&1===this._backgroundColor.alpha&&(0,V.R)("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."),this._backgroundColor.setValue(a)}get alpha(){return this._backgroundColor.alpha}set alpha(a){this._backgroundColor.setAlpha(a)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};W.extension={type:[d.Ag.WebGLSystem,d.Ag.WebGPUSystem,d.Ag.CanvasSystem],name:"background",priority:0},W.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};var X=c(92602);let Y={};d.XO.handle(d.Ag.BlendMode,a=>{if(!a.name)throw Error("BlendMode extension must have a name property");Y[a.name]=a.ref},a=>{delete Y[a.name]});class Z{constructor(a){this._blendModeStack=[],this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=a,this._renderer.runners.prerender.add(this)}prerender(){this._activeBlendMode="normal",this._isAdvanced=!1}pushBlendMode(a,b,c){this._blendModeStack.push(b),this.setBlendMode(a,b,c)}popBlendMode(a){this._blendModeStack.pop();let b=this._blendModeStack[this._activeBlendMode.length-1]??"normal";this.setBlendMode(null,b,a)}setBlendMode(a,b,c){let d=a instanceof X.m;if(this._activeBlendMode===b){this._isAdvanced&&a&&!d&&this._renderableList?.push(a);return}this._isAdvanced&&this._endAdvancedBlendMode(c),this._activeBlendMode=b,a&&(this._isAdvanced=!!Y[b],this._isAdvanced&&this._beginAdvancedBlendMode(a,c))}_beginAdvancedBlendMode(a,b){this._renderer.renderPipes.batch.break(b);let c=this._activeBlendMode;if(!Y[c])return void(0,V.R)(`Unable to assign BlendMode: '${c}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);let d=this._ensureFilterEffect(c),e=a instanceof X.m,f={renderPipeId:"filter",action:"pushFilter",filterEffect:d,renderables:e?null:[a],container:e?a.root:null,canBundle:!1};this._renderableList=f.renderables,b.add(f)}_ensureFilterEffect(a){let b=this._filterHash[a];return b||((b=this._filterHash[a]=new B.a).filters=[new Y[a]]),b}_endAdvancedBlendMode(a){this._isAdvanced=!1,this._renderableList=null,this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(a){this._isAdvanced&&this._endAdvancedBlendMode(a)}destroy(){for(let a in this._renderer=null,this._renderableList=null,this._filterHash)this._filterHash[a].destroy();this._filterHash=null}}Z.extension={type:[d.Ag.WebGLPipes,d.Ag.WebGPUPipes,d.Ag.CanvasPipes],name:"blendMode"};var $=c(43274);let _={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},aa=class a{constructor(a){this._renderer=a}_normalizeOptions(a,b={}){return a instanceof p.mc||a instanceof L.g?{target:a,...b}:{...b,...a}}async image(a){let b=$.e.get().createImage();return b.src=await this.base64(a),b}async base64(b){let{format:c,quality:d}=b=this._normalizeOptions(b,a.defaultImageOptions),e=this.canvas(b);if(void 0!==e.toBlob)return new Promise((a,b)=>{e.toBlob(c=>{if(!c)return void b(Error("ICanvas.toBlob failed!"));let d=new FileReader;d.onload=()=>a(d.result),d.onerror=b,d.readAsDataURL(c)},_[c],d)});if(void 0!==e.toDataURL)return e.toDataURL(_[c],d);if(void 0!==e.convertToBlob){let a=await e.convertToBlob({type:_[c],quality:d});return new Promise((b,c)=>{let d=new FileReader;d.onload=()=>b(d.result),d.onerror=c,d.readAsDataURL(a)})}throw Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(a){let b=(a=this._normalizeOptions(a)).target,c=this._renderer;if(b instanceof L.g)return c.texture.generateCanvas(b);let d=c.textureGenerator.generateTexture(a),e=c.texture.generateCanvas(d);return d.destroy(!0),e}pixels(a){let b=(a=this._normalizeOptions(a)).target,c=this._renderer,d=b instanceof L.g?b:c.textureGenerator.generateTexture(a),e=c.texture.getPixels(d);return b instanceof p.mc&&d.destroy(!0),e}texture(a){return(a=this._normalizeOptions(a)).target instanceof L.g?a.target:this._renderer.textureGenerator.generateTexture(a)}download(a){a=this._normalizeOptions(a);let b=this.canvas(a),c=document.createElement("a");c.download=a.filename??"image.png",c.href=b.toDataURL("image/png"),document.body.appendChild(c),c.click(),document.body.removeChild(c)}log(a){let b=a.width??200;a=this._normalizeOptions(a);let c=this.canvas(a),d=c.toDataURL();console.log(`[Pixi Texture] ${c.width}px ${c.height}px`),console.log("%c ",`font-size: 1px; padding: ${b}px 300px; background: url(${d}) no-repeat; background-size: contain;`)}destroy(){this._renderer=null}};aa.extension={type:[d.Ag.WebGLSystem,d.Ag.WebGPUSystem],name:"extract"},aa.defaultImageOptions={format:"png",quality:1};var ab=c(91546),ac=c(50139),ad=c(96609);let ae=new ab.M,af=new n.c,ag=[0,0,0,0];class ah{constructor(a){this._renderer=a}generateTexture(a){a instanceof p.mc&&(a={target:a,frame:void 0,textureSourceOptions:{},resolution:void 0});let b=a.resolution||this._renderer.resolution,c=a.antialias||this._renderer.view.antialias,d=a.target,e=a.clearColor;e=e?Array.isArray(e)&&4===e.length?e:U.Q.shared.setValue(e).toArray():ag;let g=a.frame?.copyTo(ae)||(0,ac.n)(d,af).rectangle;g.width=0|Math.max(g.width,1/b),g.height=0|Math.max(g.height,1/b);let h=ad.Y.create({...a.textureSourceOptions,width:g.width,height:g.height,resolution:b,antialias:c}),i=f.u.shared.translate(-g.x,-g.y);return this._renderer.render({container:d,transform:i,target:h,clearColor:e}),h.source.updateMipmaps(),h}destroy(){this._renderer=null}}ah.extension={type:[d.Ag.WebGLSystem,d.Ag.WebGPUSystem],name:"textureGenerator"};var ai=c(21783),aj=c(2574),ak=c(19979);class al{constructor(a){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=a}reset(){this._stackIndex=0;for(let a=0;a<this._activeUniforms.length;a++)this._uniformsPool.push(this._activeUniforms[a]);for(let a=0;a<this._activeBindGroups.length;a++)this._bindGroupPool.push(this._activeBindGroups[a]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(a){this.reset(),this.push(a)}bind({size:a,projectionMatrix:b,worldTransformMatrix:c,worldColor:d,offset:e}){let g,h=this._renderer.renderTarget.renderTarget,i=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:h,worldTransformMatrix:new f.u,worldColor:0xffffffff,offset:new ai.b},j={projectionMatrix:b||this._renderer.renderTarget.projectionMatrix,resolution:a||h.size,worldTransformMatrix:c||i.worldTransformMatrix,worldColor:d||i.worldColor,offset:e||i.offset,bindGroup:null},k=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(k);let l=k.uniforms;l.uProjectionMatrix=j.projectionMatrix,l.uResolution=j.resolution,l.uWorldTransformMatrix.copyFrom(j.worldTransformMatrix),l.uWorldTransformMatrix.tx-=j.offset.x,l.uWorldTransformMatrix.ty-=j.offset.y,(0,aj.V)(j.worldColor,l.uWorldColorAlpha,0),k.update(),this._renderer.renderPipes.uniformBatch?g=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(k,!1):(g=this._bindGroupPool.pop()||new ak.T,this._activeBindGroups.push(g),g.setResource(k,0)),j.bindGroup=g,this._currentGlobalUniformData=j}push(a){this.bind(a),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===M.W.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new E.k({uProjectionMatrix:{value:new f.u,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new f.u,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null,this._globalUniformDataStack.length=0,this._uniformsPool.length=0,this._activeUniforms.length=0,this._bindGroupPool.length=0,this._activeBindGroups.length=0,this._currentGlobalUniformData=null}}al.extension={type:[d.Ag.WebGLSystem,d.Ag.WebGPUSystem,d.Ag.CanvasSystem],name:"globalUniforms"};var am=c(26632);let an=1;class ao{constructor(){this._tasks=[],this._offset=0}init(){am.R.system.add(this._update,this)}repeat(a,b,c=!0){let d=an++,e=0;return c&&(this._offset+=1e3,e=this._offset),this._tasks.push({func:a,duration:b,start:performance.now(),offset:e,last:performance.now(),repeat:!0,id:d}),d}cancel(a){for(let b=0;b<this._tasks.length;b++)if(this._tasks[b].id===a)return void this._tasks.splice(b,1)}_update(){let a=performance.now();for(let b=0;b<this._tasks.length;b++){let c=this._tasks[b];if(a-c.offset-c.last>=c.duration){let b=a-c.start;c.func(b),c.last=a}}}destroy(){am.R.system.remove(this._update,this),this._tasks.length=0}}ao.extension={type:[d.Ag.WebGLSystem,d.Ag.WebGPUSystem,d.Ag.CanvasSystem],name:"scheduler",priority:0};var ap=c(74885);let aq=!1;class ar{constructor(a){this._renderer=a}init(a){if(a.hello){let a=this._renderer.name;this._renderer.type===M.W.WEBGL&&(a+=` ${this._renderer.context.webGLVersion}`);var b=a;if(!aq){if($.e.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){let a=[`%c  %c  %c  %c  %c PixiJS %c v${ap.xv} (${b}) http://www.pixijs.com/

`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...a)}else globalThis.console&&globalThis.console.log(`PixiJS ${ap.xv} - ${b} - http://www.pixijs.com/`);aq=!0}}}}ar.extension={type:[d.Ag.WebGLSystem,d.Ag.WebGPUSystem,d.Ag.CanvasSystem],name:"hello",priority:-2},ar.defaultOptions={hello:!1};let as=0,at=class a{constructor(a){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=a}init(b){b={...a.defaultOptions,...b},this.maxUnusedTime=b.renderableGCMaxUnusedTime,this._frequency=b.renderableGCFrequency,this.enabled=b.renderableGCActive}get enabled(){return!!this._handler}set enabled(a){this.enabled!==a&&(a?(this._handler=this._renderer.scheduler.repeat(()=>this.run(),this._frequency,!1),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(let a of this._managedHashes)a.context[a.hash]=function(a){let b=!1;for(let c in a)if(void 0==a[c]){b=!0;break}if(!b)return a;let c=Object.create(null);for(let b in a){let d=a[b];d&&(c[b]=d)}return c}(a.context[a.hash])},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(let a of this._managedArrays)!function(a){let b=0;for(let c=0;c<a.length;c++)void 0==a[c]?b++:a[c-b]=a[c];a.length-=b}(a.context[a.hash])},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)))}addManagedHash(a,b){this._managedHashes.push({context:a,hash:b})}addManagedArray(a,b){this._managedArrays.push({context:a,hash:b})}prerender({container:a}){this._now=performance.now(),a.renderGroup.gcTick=as++,this._updateInstructionGCTick(a.renderGroup,a.renderGroup.gcTick)}addRenderable(a){this.enabled&&(-1===a._lastUsed&&(this._managedRenderables.push(a),a.once("destroyed",this._removeRenderable,this)),a._lastUsed=this._now)}run(){let a=this._now,b=this._managedRenderables,c=this._renderer.renderPipes,d=0;for(let e=0;e<b.length;e++){let f=b[e];if(null===f){d++;continue}let g=f.renderGroup??f.parentRenderGroup,h=g?.instructionSet?.gcTick??-1;(g?.gcTick??0)===h&&(f._lastUsed=a),a-f._lastUsed>this.maxUnusedTime?(f.destroyed||(g&&(g.structureDidChange=!0),c[f.renderPipeId].destroyRenderable(f)),f._lastUsed=-1,d++,f.off("destroyed",this._removeRenderable,this)):b[e-d]=f}b.length-=d}destroy(){this.enabled=!1,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0}_removeRenderable(a){let b=this._managedRenderables.indexOf(a);b>=0&&(a.off("destroyed",this._removeRenderable,this),this._managedRenderables[b]=null)}_updateInstructionGCTick(a,b){for(let c of(a.instructionSet.gcTick=b,a.renderGroupChildren))this._updateInstructionGCTick(c,b)}};at.extension={type:[d.Ag.WebGLSystem,d.Ag.WebGPUSystem],name:"renderableGC",priority:0},at.defaultOptions={renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};let au=class a{constructor(a){this._renderer=a,this.count=0,this.checkCount=0}init(b){b={...a.defaultOptions,...b},this.checkCountMax=b.textureGCCheckCountMax,this.maxIdle=b.textureGCAMaxIdle??b.textureGCMaxIdle,this.active=b.textureGCActive}postrender(){!this._renderer.renderingToScreen||(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){let a=this._renderer.texture.managedTextures;for(let b=0;b<a.length;b++){let c=a[b];c.autoGarbageCollect&&c.resource&&c._touched>-1&&this.count-c._touched>this.maxIdle&&(c._touched=-1,c.unload())}}destroy(){this._renderer=null}};au.extension={type:[d.Ag.WebGLSystem,d.Ag.WebGPUSystem],name:"textureGC"},au.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};var av=c(71568),aw=c(3645),ax=c(43463);let ay=class a{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(a){this.texture.source.autoDensity=a}get resolution(){return this.texture.source._resolution}set resolution(a){this.texture.source.resize(this.texture.source.width,this.texture.source.height,a)}init(b){(b={...a.defaultOptions,...b}).view&&((0,av.t6)(av.lj,"ViewSystem.view has been renamed to ViewSystem.canvas"),b.canvas=b.view),this.screen=new ab.M(0,0,b.width,b.height),this.canvas=b.canvas||$.e.get().createCanvas(),this.antialias=!!b.antialias,this.texture=(0,ax.c)(this.canvas,b),this.renderTarget=new aw.O({colorTextures:[this.texture],depth:!!b.depth,isRoot:!0}),this.texture.source.transparent=b.backgroundAlpha<1,this.resolution=b.resolution}resize(a,b,c){this.texture.source.resize(a,b,c),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height}destroy(a=!1){("boolean"==typeof a?a:!!a?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.texture.destroy()}};ay.extension={type:[d.Ag.WebGLSystem,d.Ag.WebGPUSystem,d.Ag.CanvasSystem],name:"view",priority:0},ay.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let az=[W,al,ar,ay,v,au,ah,aa,x.d,at,ao],aA=[Z,A,w,k,P,T,Q,e]},14333:(a,b,c)=>{c.d(b,{Ls:()=>d,_Q:()=>e,mA:()=>f});let d={name:"local-uniform-bit",vertex:{header:`

            struct LocalUniforms {
                uTransformMatrix:mat3x3<f32>,
                uColor:vec4<f32>,
                uRound:f32,
            }

            @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
        `,main:`
            vColor *= localUniforms.uColor;
            modelMatrix *= localUniforms.uTransformMatrix;
        `,end:`
            if(localUniforms.uRound == 1)
            {
                vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
            }
        `}},e={...d,vertex:{...d.vertex,header:d.vertex.header.replace("group(1)","group(2)")}},f={name:"local-uniform-bit",vertex:{header:`

            uniform mat3 uTransformMatrix;
            uniform vec4 uColor;
            uniform float uRound;
        `,main:`
            vColor *= uColor;
            modelMatrix = uTransformMatrix;
        `,end:`
            if(uRound == 1.)
            {
                gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
            }
        `}}},22724:(a,b,c)=>{c.d(b,{K:()=>d});class d{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){}}},43463:(a,b,c)=>{c.d(b,{c:()=>h});var d=c(83401),e=c(1342),f=c(61487);let g=new Map;function h(a,b){if(!g.has(a)){let c=new f.g({source:new e.q({resource:a,...b})}),d=()=>{g.get(a)===c&&g.delete(a)};c.once("destroy",d),c.source.once("destroy",d),g.set(a,c)}return g.get(a)}d.L.register(g)},47745:(a,b,c)=>{c.d(b,{W:()=>g});var d=c(92431),e=c(16183),f=c(43362);class g{constructor(a){this._syncFunctionHash=Object.create(null),this._adaptor=a,this._systemCheck()}_systemCheck(){if(!(0,d.f)())throw Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(a){let b=this.getUniformGroupData(a);a.buffer||(a.buffer=new e.h({data:new Float32Array(b.layout.size/4),usage:f.S.UNIFORM|f.S.COPY_DST}))}getUniformGroupData(a){return this._syncFunctionHash[a._signature]||this._initUniformGroup(a)}_initUniformGroup(a){let b=a._signature,c=this._syncFunctionHash[b];if(!c){let d=Object.keys(a.uniformStructures).map(b=>a.uniformStructures[b]),e=this._adaptor.createUboElements(d),f=this._generateUboSync(e.uboElements);c=this._syncFunctionHash[b]={layout:e,syncFunction:f}}return this._syncFunctionHash[b]}_generateUboSync(a){return this._adaptor.generateUboSync(a)}syncUniformGroup(a,b,c){let d=this.getUniformGroupData(a);a.buffer||(a.buffer=new e.h({data:new Float32Array(d.layout.size/4),usage:f.S.UNIFORM|f.S.COPY_DST}));let g=null;return b||(b=a.buffer.data,g=a.buffer.dataInt32),c||(c=0),d.syncFunction(a.uniforms,b,g,c),!0}updateUniformGroup(a){if(a.isStatic&&!a._dirtyId)return!1;a._dirtyId=0;let b=this.syncUniformGroup(a);return a.buffer.update(),b}destroy(){this._syncFunctionHash=null}}},68689:(a,b,c)=>{c.d(b,{R:()=>d,m:()=>e});let d={name:"texture-bit",vertex:{header:`

        struct TextureUniforms {
            uTextureMatrix:mat3x3<f32>,
        }

        @group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;
        `,main:`
            uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;
        `},fragment:{header:`
            @group(2) @binding(0) var uTexture: texture_2d<f32>;
            @group(2) @binding(1) var uSampler: sampler;


        `,main:`
            outColor = textureSample(uTexture, uSampler, vUV);
        `}},e={name:"texture-bit",vertex:{header:`
            uniform mat3 uTextureMatrix;
        `,main:`
            uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
        `},fragment:{header:`
        uniform sampler2D uTexture;


        `,main:`
            outColor = texture(uTexture, vUV);
        `}}},77894:(a,b,c)=>{c.d(b,{g:()=>e});var d=c(21507);let e=[];e[d.K.NONE]=void 0,e[d.K.DISABLED]={stencilWriteMask:0,stencilReadMask:0},e[d.K.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}},e[d.K.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}},e[d.K.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}},e[d.K.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}}},80326:(a,b,c)=>{c.d(b,{q:()=>f});var d=c(87818),e=c(96156);function f(a,b){for(let c in a.attributes){let e=a.attributes[c],f=b[c];f?(e.format??(e.format=f.format),e.offset??(e.offset=f.offset),e.instance??(e.instance=f.instance)):(0,d.R)(`Attribute ${c} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}!function(a){let{buffers:b,attributes:c}=a,d={},f={};for(let a in b){let c=b[a];d[c.uid]=0,f[c.uid]=0}for(let a in c){let b=c[a];d[b.buffer.uid]+=(0,e.m)(b.format).stride}for(let a in c){let b=c[a];b.stride??(b.stride=d[b.buffer.uid]),b.start??(b.start=f[b.buffer.uid]),f[b.buffer.uid]+=(0,e.m)(b.format).stride}}(a)}},85612:(a,b,c)=>{function d(a,b){return`
        for (let i = 0; i < ${a*b}; i++) {
            data[offset + (((i / ${a})|0) * 4) + (i % ${a})] = v[i];
        }
    `}c.d(b,{_:()=>f,g:()=>e});let e={f32:`
        data[offset] = v;`,i32:`
        dataInt32[offset] = v;`,"vec2<f32>":`
        data[offset] = v[0];
        data[offset + 1] = v[1];`,"vec3<f32>":`
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 2] = v[2];`,"vec4<f32>":`
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 2] = v[2];
        data[offset + 3] = v[3];`,"vec2<i32>":`
        dataInt32[offset] = v[0];
        dataInt32[offset + 1] = v[1];`,"vec3<i32>":`
        dataInt32[offset] = v[0];
        dataInt32[offset + 1] = v[1];
        dataInt32[offset + 2] = v[2];`,"vec4<i32>":`
        dataInt32[offset] = v[0];
        dataInt32[offset + 1] = v[1];
        dataInt32[offset + 2] = v[2];
        dataInt32[offset + 3] = v[3];`,"mat2x2<f32>":`
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 4] = v[2];
        data[offset + 5] = v[3];`,"mat3x3<f32>":`
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 2] = v[2];
        data[offset + 4] = v[3];
        data[offset + 5] = v[4];
        data[offset + 6] = v[5];
        data[offset + 8] = v[6];
        data[offset + 9] = v[7];
        data[offset + 10] = v[8];`,"mat4x4<f32>":`
        for (let i = 0; i < 16; i++) {
            data[offset + i] = v[i];
        }`,"mat3x2<f32>":d(3,2),"mat4x2<f32>":d(4,2),"mat2x3<f32>":d(2,3),"mat4x3<f32>":d(4,3),"mat2x4<f32>":d(2,4),"mat3x4<f32>":d(3,4)},f={...e,"mat2x2<f32>":`
        data[offset] = v[0];
        data[offset + 1] = v[1];
        data[offset + 2] = v[2];
        data[offset + 3] = v[3];
    `}},86128:(a,b,c)=>{c.d(b,{d:()=>f});var d=c(57680),e=c(42115);class f extends d.A{constructor({buffer:a,offset:b,size:c}){super(),this.uid=(0,e.L)("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=(0,e.L)("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=a,this.offset=0|b,this.size=c,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=(0,e.L)("resource"),this.emit("change",this)}destroy(a=!1){this.destroyed=!0,a&&this.buffer.destroy(),this.emit("change",this),this.buffer=null,this.removeAllListeners()}}},93492:(a,b,c)=>{c.d(b,{$:()=>d});let d=[{type:"mat3x3<f32>",test:a=>void 0!==a.value.a,ubo:`
            var matrix = uv[name].toArray(true);
            data[offset] = matrix[0];
            data[offset + 1] = matrix[1];
            data[offset + 2] = matrix[2];
            data[offset + 4] = matrix[3];
            data[offset + 5] = matrix[4];
            data[offset + 6] = matrix[5];
            data[offset + 8] = matrix[6];
            data[offset + 9] = matrix[7];
            data[offset + 10] = matrix[8];
        `,uniform:`
            gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
        `},{type:"vec4<f32>",test:a=>"vec4<f32>"===a.type&&1===a.size&&void 0!==a.value.width,ubo:`
            v = uv[name];
            data[offset] = v.x;
            data[offset + 1] = v.y;
            data[offset + 2] = v.width;
            data[offset + 3] = v.height;
        `,uniform:`
            cv = ud[name].value;
            v = uv[name];
            if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {
                cv[0] = v.x;
                cv[1] = v.y;
                cv[2] = v.width;
                cv[3] = v.height;
                gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);
            }
        `},{type:"vec2<f32>",test:a=>"vec2<f32>"===a.type&&1===a.size&&void 0!==a.value.x,ubo:`
            v = uv[name];
            data[offset] = v.x;
            data[offset + 1] = v.y;
        `,uniform:`
            cv = ud[name].value;
            v = uv[name];
            if (cv[0] !== v.x || cv[1] !== v.y) {
                cv[0] = v.x;
                cv[1] = v.y;
                gl.uniform2f(ud[name].location, v.x, v.y);
            }
        `},{type:"vec4<f32>",test:a=>"vec4<f32>"===a.type&&1===a.size&&void 0!==a.value.red,ubo:`
            v = uv[name];
            data[offset] = v.red;
            data[offset + 1] = v.green;
            data[offset + 2] = v.blue;
            data[offset + 3] = v.alpha;
        `,uniform:`
            cv = ud[name].value;
            v = uv[name];
            if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {
                cv[0] = v.red;
                cv[1] = v.green;
                cv[2] = v.blue;
                cv[3] = v.alpha;
                gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);
            }
        `},{type:"vec3<f32>",test:a=>"vec3<f32>"===a.type&&1===a.size&&void 0!==a.value.red,ubo:`
            v = uv[name];
            data[offset] = v.red;
            data[offset + 1] = v.green;
            data[offset + 2] = v.blue;
        `,uniform:`
            cv = ud[name].value;
            v = uv[name];
            if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {
                cv[0] = v.red;
                cv[1] = v.green;
                cv[2] = v.blue;
                gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
            }
        `}]}};