@drincs/pixi-vn 1.2.14 → 1.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/index.cjs +1 -1
- package/dist/canvas/index.mjs +1 -1
- package/dist/canvas/tickers/index.cjs +1 -1
- package/dist/canvas/tickers/index.mjs +1 -1
- package/dist/character/index.cjs +1 -1
- package/dist/character/index.mjs +1 -1
- package/dist/classes/index.cjs +1 -1
- package/dist/classes/index.d.cts +2 -2
- package/dist/classes/index.d.ts +2 -2
- package/dist/classes/index.mjs +1 -1
- package/dist/history/index.cjs +1 -1
- package/dist/history/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/narration/index.cjs +1 -1
- package/dist/narration/index.mjs +1 -1
- package/dist/storage/index.cjs +1 -1
- package/dist/storage/index.mjs +1 -1
- package/package.json +1 -1
package/dist/canvas/index.cjs
CHANGED
|
@@ -3307,4 +3307,4 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3307
3307
|
u32v[offset + stride] = c;
|
|
3308
3308
|
u32v[offset + (stride * 2)] = c;
|
|
3309
3309
|
u32v[offset + (stride * 3)] = c;
|
|
3310
|
-
`,dynamic:false}};});var SF,cR,hR,dR=f(()=>{vt();Hr();eE();SF=new ge(0,0,0,0),cR=class tE extends qe{constructor(e={}){e={...tE.defaultOptions,...e,dynamicProperties:{...tE.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in _d){let l=_d[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return SF}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){let i=this.particleChildren.splice(e,t);return this.onViewUpdate(),i}removeParticleAt(e){let t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};cR.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};hR=cR;});var fR,rE,G_,mR=f(()=>{ss();he();_e();Hr();zm();fR=class pR extends qe{constructor(e){e instanceof C&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??Kr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Kr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Kr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Kr.defaultOptions.bottomHeight,this._width=t??l.width??Kr.defaultOptions.width,this._height=i??l.height??Kr.defaultOptions.height,this.allowChildren=false,this.texture=l??pR.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new Be({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=C.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};fR.defaultOptions={texture:C.EMPTY};rE=fR,G_=class extends rE{constructor(...e){let t=e[0];t instanceof C&&(D(V,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),t={texture:t,leftWidth:e[1],topHeight:e[2],rightWidth:e[3],bottomHeight:e[4]}),D(V,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function gR(r,e){return e instanceof et||e instanceof qr?e:r==="html"?new qr(e):new et(e)}var xR=f(()=>{Wc();Hi();});async function _R(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var bR=f(()=>{});function iE(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=EF[AF++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Ee&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];iE(a,e,{...t});}}function sE(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];sE(o,e,{...t,index:n});}}var EF,AF,yR=f(()=>{gs();EF=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],AF=0;});var vR={};Nd(vR,{AbstractBitmapFont:()=>Ls,AbstractRenderer:()=>mi,AbstractText:()=>Ti,AccessibilitySystem:()=>Af,AlphaFilter:()=>G3,AlphaMask:()=>Dn,AlphaMaskPipe:()=>yo,AnimatedSprite:()=>yl,Application:()=>Ih,ApplicationInitHook:()=>_o,Assets:()=>tt,AssetsClass:()=>Nh,BLEND_TO_NPM:()=>qf,BUFFER_TYPE:()=>Wo,BackgroundLoader:()=>$u,BackgroundSystem:()=>cg,Batch:()=>gc,BatchGeometry:()=>Ga,BatchTextureArray:()=>Oa,BatchableGraphics:()=>Ni,BatchableMesh:()=>di,BatchableSprite:()=>Br,Batcher:()=>Zf,BatcherPipe:()=>bh,BigPool:()=>Z,BindGroup:()=>nt,BindGroupSystem:()=>wo,BitmapFont:()=>ta,BitmapFontManager:()=>zi,BitmapText:()=>Sl,BitmapTextPipe:()=>eo,BlendModeFilter:()=>re,BlendModePipe:()=>So,BlurFilter:()=>ld,BlurFilterPass:()=>bl,Bounds:()=>ge,BrowserAdapter:()=>If,Buffer:()=>ke,BufferImageSource:()=>ki,BufferResource:()=>_i,BufferUsage:()=>te,CLEAR:()=>ot,Cache:()=>fe,CanvasPool:()=>It,CanvasPoolClass:()=>Ic,CanvasSource:()=>lt,CanvasTextMetrics:()=>Qt,CanvasTextPipe:()=>qn,CanvasTextSystem:()=>Jn,Circle:()=>ru,Color:()=>K,ColorBlend:()=>qc,ColorBurnBlend:()=>Kc,ColorDodgeBlend:()=>Zc,ColorMask:()=>In,ColorMaskPipe:()=>vo,ColorMatrixFilter:()=>__,CompressedSource:()=>Dr,Container:()=>ie,Culler:()=>Jx,CullerPlugin:()=>jh,CustomRenderPipe:()=>ho,D3D10_RESOURCE_DIMENSION:()=>Xx,D3DFMT:()=>Wt,DATA_URI:()=>TP,DDS:()=>J,DEG_TO_RAD:()=>$d,DEPRECATED_SCALE_MODES:()=>xd,DEPRECATED_WRAP_MODES:()=>gd,DOMAdapter:()=>W,DOMContainer:()=>Df,DOMPipe:()=>Rn,DRAW_MODES:()=>mB,DXGI_FORMAT:()=>Wx,DXGI_TO_TEXTURE_FORMAT:()=>Ot,DarkenBlend:()=>Qc,DefaultBatcher:()=>Un,DefaultShader:()=>Va,DifferenceBlend:()=>Jc,DisplacementFilter:()=>v_,DivideBlend:()=>eh,DynamicBitmapFont:()=>Vc,Ellipse:()=>iu,EventBoundary:()=>wa,EventEmitter:()=>le,EventSystem:()=>Ba,EventsTicker:()=>br,ExclusionBlend:()=>th,ExtensionType:()=>x,ExtractSystem:()=>hg,FOURCC_TO_TEXTURE_FORMAT:()=>Xh,FederatedContainer:()=>Mf,FederatedEvent:()=>li,FederatedMouseEvent:()=>Nr,FederatedPointerEvent:()=>Tt,FederatedWheelEvent:()=>yr,FillGradient:()=>Dt,FillPattern:()=>Yr,Filter:()=>gt,FilterEffect:()=>Gr,FilterPipe:()=>no,FilterSystem:()=>oo,FontStylePromiseCache:()=>mu,GAUSSIAN_VALUES:()=>_l,GL_FORMATS:()=>Uu,GL_INTERNAL_FORMAT:()=>ZS,GL_TARGETS:()=>Ch,GL_TYPES:()=>pe,GL_WRAP_MODES:()=>PT,GenerateTextureSystem:()=>Eo,Geometry:()=>Rt,GlBackBufferSystem:()=>Vg,GlBatchAdaptor:()=>zo,GlBuffer:()=>Gu,GlBufferSystem:()=>Xo,GlColorMaskSystem:()=>$o,GlContextSystem:()=>Lg,GlEncoderSystem:()=>jo,GlGeometrySystem:()=>Yo,GlGraphicsAdaptor:()=>Ho,GlMeshAdaptor:()=>Vo,GlParticleContainerAdaptor:()=>Za,GlParticleContainerPipe:()=>Yn,GlProgram:()=>Fe,GlProgramData:()=>Hu,GlRenderTarget:()=>Lu,GlRenderTargetAdaptor:()=>Nu,GlRenderTargetSystem:()=>Zo,GlShaderSystem:()=>Qo,GlStateSystem:()=>lx,GlStencilSystem:()=>qo,GlTexture:()=>zu,GlTextureSystem:()=>ea,GlUboSystem:()=>Ko,GlUniformGroupSystem:()=>Jo,GlobalUniformSystem:()=>Ao,GpuBatchAdaptor:()=>co,GpuBlendModesToPixi:()=>At,GpuBufferSystem:()=>Bo,GpuColorMaskSystem:()=>Ro,GpuDeviceSystem:()=>qs,GpuEncoderSystem:()=>Mo,GpuGraphicsAdaptor:()=>uo,GpuGraphicsContext:()=>Pc,GpuMeshAdapter:()=>lo,GpuMipmapGenerator:()=>Ou,GpuParticleContainerAdaptor:()=>eu,GpuParticleContainerPipe:()=>$n,GpuProgram:()=>Oe,GpuReadBuffer:()=>dB,GpuRenderTarget:()=>Iu,GpuRenderTargetAdaptor:()=>ku,GpuRenderTargetSystem:()=>Go,GpuShaderSystem:()=>Uo,GpuStateSystem:()=>Lo,GpuStencilModesToPixi:()=>Mr,GpuStencilSystem:()=>Do,GpuTextureSystem:()=>No,GpuUboSystem:()=>ko,GpuUniformBatchPipe:()=>Fo,Graphics:()=>Us,GraphicsContext:()=>Je,GraphicsContextRenderData:()=>wc,GraphicsContextSystem:()=>Ds,GraphicsPath:()=>Rr,GraphicsPipe:()=>Wn,HTMLText:()=>El,HTMLTextPipe:()=>to,HTMLTextRenderData:()=>Ns,HTMLTextStyle:()=>qr,HTMLTextSystem:()=>Hs,HardLightBlend:()=>rh,HardMixBlend:()=>ih,HelloSystem:()=>js,IGLUniformData:()=>jg,ImageSource:()=>Bt,InstructionSet:()=>us,KTX:()=>Xe,LightenBlend:()=>sh,LinearBurnBlend:()=>nh,LinearDodgeBlend:()=>oh,LinearLightBlend:()=>ah,Loader:()=>qu,LoaderParserPriority:()=>Me,LuminosityBlend:()=>uh,MSAA_QUALITY:()=>$1,MaskEffectManager:()=>ya,MaskEffectManagerClass:()=>Ql,MaskFilter:()=>Su,Matrix:()=>M,Mesh:()=>ir,MeshGeometry:()=>kt,MeshPipe:()=>Xn,MeshPlane:()=>k_,MeshRope:()=>rR,MeshSimple:()=>O_,NOOP:()=>rc,NegationBlend:()=>lh,NineSliceGeometry:()=>Kr,NineSlicePlane:()=>G_,NineSliceSprite:()=>rE,NineSliceSpritePipe:()=>so,NoiseFilter:()=>Y3,ObservablePoint:()=>Be,OverlayBlend:()=>ch,PI_2:()=>Xd,Particle:()=>uR,ParticleBuffer:()=>Qa,ParticleContainer:()=>hR,ParticleContainerPipe:()=>Is,ParticleShader:()=>Ja,PerspectiveMesh:()=>qB,PerspectivePlaneGeometry:()=>Cl,PinLightBlend:()=>hh,PipelineSystem:()=>Oo,PlaneGeometry:()=>zs,Point:()=>se,Polygon:()=>Fs,Pool:()=>Di,PoolGroupClass:()=>Kl,PrepareBase:()=>E_,PrepareQueue:()=>Tl,PrepareSystem:()=>md,PrepareUpload:()=>Al,QuadGeometry:()=>_u,RAD_TO_DEG:()=>Yd,Rectangle:()=>Q,RenderContainer:()=>R_,RenderGroup:()=>Aa,RenderGroupPipe:()=>po,RenderGroupSystem:()=>go,RenderLayer:()=>VB,RenderLayerClass:()=>j1,RenderTarget:()=>Po,RenderTargetSystem:()=>Qs,RenderTexture:()=>Eu,RenderableGCSystem:()=>mg,RendererInitHook:()=>bo,RendererType:()=>Ge,ResizePlugin:()=>Pn,Resolver:()=>Et,RopeGeometry:()=>F_,RoundedRectangle:()=>su,SCALE_MODES:()=>yB,STENCIL_MODES:()=>Re,SVGParser:()=>cm,SaturationBlend:()=>dh,SchedulerSystem:()=>Co,ScissorMask:()=>w_,SdfShader:()=>du,Shader:()=>ze,ShaderStage:()=>As,ShapePath:()=>uu,SharedRenderPipes:()=>wu,SharedSystems:()=>Pu,SoftLightBlend:()=>fh,Sprite:()=>Ee,SpritePipe:()=>xo,Spritesheet:()=>hc,State:()=>Le,StencilMask:()=>kn,StencilMaskPipe:()=>To,SubtractBlend:()=>ph,SystemRunner:()=>Ys,TEXTURE_FORMAT_BLOCK_SIZE:()=>Yx,Text:()=>Ir,TextStyle:()=>et,Texture:()=>C,TextureGCSystem:()=>gg,TextureMatrix:()=>cs,TexturePool:()=>ye,TexturePoolClass:()=>ic,TextureSource:()=>ce,TextureStyle:()=>Ea,TextureUvs:()=>B_,Ticker:()=>ve,TickerListener:()=>ds,TickerPlugin:()=>Bn,TilingSprite:()=>C_,TilingSpritePipe:()=>io,TilingSpriteShader:()=>xu,Transform:()=>vl,Triangle:()=>S_,UNIFORM_TO_ARRAY_SETTERS:()=>ox,UNIFORM_TO_SINGLE_SETTERS:()=>nx,UNIFORM_TYPES_MAP:()=>bp,UNIFORM_TYPES_VALUES:()=>Tc,UPDATE_BLEND:()=>Ca,UPDATE_COLOR:()=>Cn,UPDATE_PRIORITY:()=>zt,UPDATE_TRANSFORM:()=>aA,UPDATE_VISIBLE:()=>hs,UboBatch:()=>Mu,UboSystem:()=>Ks,UniformGroup:()=>ae,VERSION:()=>$s,VideoSource:()=>bs,ViewContainer:()=>qe,ViewSystem:()=>bg,ViewableBuffer:()=>vr,VividLightBlend:()=>mh,WGSL_ALIGN_SIZE_DATA:()=>Io,WGSL_TO_STD40_SIZE:()=>Ph,WRAP_MODES:()=>bB,WebGLRenderer:()=>Dh,WebGPURenderer:()=>Ah,WebWorkerAdapter:()=>I3,WorkerManager:()=>Lh,_getGlobalBounds:()=>of,accessibilityTarget:()=>Cf,addBits:()=>_c,addMaskBounds:()=>xs,addMaskLocalBounds:()=>_s,addProgramDefines:()=>tp,alphaFrag:()=>c_,alphaWgsl:()=>ud,applyMatrix:()=>Nm,applyProjectiveTransformationToPlane:()=>M_,applyStyleParams:()=>Mh,assignWithIgnore:()=>An,autoDetectEnvironment:()=>xP,autoDetectRenderer:()=>bx,autoDetectSource:()=>IA,basisTranscoderUrls:()=>nl,bgr2rgb:()=>Ii,bitmapFontCachePlugin:()=>yx,bitmapFontTextParser:()=>Yu,bitmapFontXMLParser:()=>kh,bitmapFontXMLStringParser:()=>Fh,blendTemplateFrag:()=>Xm,blendTemplateVert:()=>Ym,blendTemplateWgsl:()=>$m,blockDataMap:()=>Eh,blurTemplateWgsl:()=>m_,boundsPool:()=>Vt,browserExt:()=>e2,buildAdaptiveBezier:()=>ou,buildAdaptiveQuadratic:()=>em,buildArc:()=>au,buildArcTo:()=>rm,buildArcToSvg:()=>im,buildCircle:()=>Pr,buildContextBatches:()=>Vp,buildEllipse:()=>Ap,buildGeometryFromPath:()=>UB,buildLine:()=>Mp,buildPixelLine:()=>Dp,buildPolygon:()=>$a,buildRectangle:()=>ja,buildRoundedRectangle:()=>Cp,buildSimpleUvs:()=>Wa,buildTriangle:()=>qa,buildUvs:()=>za,cacheAsTextureMixin:()=>Zd,cacheTextureArray:()=>Tx,calculateProjection:()=>Dg,checkChildrenDidChange:()=>ec,checkDataUrl:()=>Jt,checkExtension:()=>We,checkMaxIfStatementsInShader:()=>Yf,childrenHelperMixin:()=>Jd,cleanArray:()=>pg,cleanHash:()=>fg,clearList:()=>mo,closePointEps:()=>wp,collectAllRenderables:()=>RB,collectRenderablesMixin:()=>ef,color32BitToUniform:()=>wr,colorBit:()=>Ps,colorBitGl:()=>ws,colorMatrixFilterFrag:()=>x_,colorMatrixFilterWgsl:()=>cd,colorToUniform:()=>hC,compareModeToGlCompare:()=>mx,compileHighShader:()=>hp,compileHighShaderGl:()=>dp,compileHighShaderGlProgram:()=>Sr,compileHighShaderGpuProgram:()=>Tr,compileHooks:()=>bc,compileInputs:()=>yc,compileOutputs:()=>cp,compileShader:()=>wh,compute2DProjection:()=>I_,convertFormatIfRequired:()=>Cw,convertToList:()=>St,copySearchParams:()=>Mn,createIdFromString:()=>Xr,createIndicesForQuads:()=>Mc,createLevelBuffers:()=>dw,createLevelBuffersFromKTX:()=>ww,createStringVariations:()=>kf,createTexture:()=>Ft,createUboElementsSTD40:()=>zg,createUboElementsWGSL:()=>Tg,createUboSyncFunction:()=>Bu,createUboSyncFunctionSTD40:()=>Yg,createUboSyncFunctionWGSL:()=>Bg,crossOrigin:()=>LS,cullingMixin:()=>Wd,curveEps:()=>Bp,defaultFilterVert:()=>nn,defaultValue:()=>Vu,definedProps:()=>pt,deprecation:()=>D,detectAvif:()=>Ex,detectBasis:()=>nw,detectCompressed:()=>Fw,detectDefaults:()=>Ax,detectMp4:()=>Cx,detectOgv:()=>Px,detectVideoAlphaMode:()=>Da,detectWebm:()=>wx,detectWebp:()=>Bx,determineCrossOrigin:()=>HS,displacementFrag:()=>b_,displacementVert:()=>y_,displacementWgsl:()=>hd,earcut:()=>TR.default,effectsMixin:()=>tf,ensureAttributes:()=>Du,ensureIsBuffer:()=>xc,ensurePrecision:()=>rp,ensureTextOptions:()=>on,ensureTextStyle:()=>gR,executeInstructions:()=>fo,extensions:()=>G,extractAttributesFromGlProgram:()=>Jg,extractAttributesFromGpuProgram:()=>op,extractFontFamilies:()=>Bm,extractStructAndGroups:()=>La,extractSvgUrlId:()=>Uc,fastCopy:()=>Gn,findHooksRx:()=>$y,findMixin:()=>rf,fontStringFromTextStyle:()=>Vi,formatShader:()=>nB,fragmentGPUTemplate:()=>pp,fragmentGlTemplate:()=>gp,generateArraySyncSTD40:()=>Xg,generateArraySyncWGSL:()=>wg,generateBlurFragSource:()=>d_,generateBlurGlProgram:()=>p_,generateBlurProgram:()=>g_,generateBlurVertSource:()=>f_,generateGPULayout:()=>tB,generateGpuLayoutGroups:()=>ap,generateLayout:()=>iB,generateLayoutHash:()=>up,generateParticleUpdateFunction:()=>zp,generateProgram:()=>ix,generateShaderSyncCode:()=>$g,generateTextStyleKey:()=>lu,generateTextureBatchBit:()=>Bs,generateTextureBatchBitGl:()=>Rs,generateTextureMatrix:()=>Hp,generateUID:()=>SB,generateUniformsSync:()=>ax,getAdjustedBlendModeBlend:()=>zr,getAttributeInfoFromFormat:()=>Mt,getBatchSamplersUniformGroup:()=>Ms,getBitmapTextLayout:()=>pu,getCanvasBoundingBox:()=>jp,getCanvasFillStyle:()=>Gs,getCanvasTexture:()=>Cu,getDefaultUniformValue:()=>yp,getFastGlobalBounds:()=>PB,getFastGlobalBoundsMixin:()=>nf,getFontCss:()=>Mm,getFontFamilyName:()=>DS,getGeometryBounds:()=>Qf,getGlTypeFromFormat:()=>Hg,getGlobalBounds:()=>ui,getGlobalMixin:()=>lf,getGlobalRenderableBounds:()=>Wm,getLocalBounds:()=>as,getMatrixRelativeToParent:()=>Lf,getMaxFragmentPrecision:()=>ep,getMaxTexturesPerBatch:()=>Kt,getOrientationOfPoints:()=>Rp,getParent:()=>Mb,getPo2TextureFromSource:()=>hu,getResolutionOfUrl:()=>tn,getSVGUrl:()=>Dm,getSupportedCompressedTextureFormats:()=>rl,getSupportedGPUCompressedTextureFormats:()=>Vh,getSupportedGlCompressedTextureFormats:()=>Hh,getSupportedTextureFormats:()=>bi,getTemporaryCanvasFromImage:()=>Im,getTestContext:()=>Ia,getTextureBatchBindGroup:()=>vs,getTextureDefaultMatrix:()=>nR,getTextureFormatFromKTXTexture:()=>Rw,getUboData:()=>ex,getUniformData:()=>tx,getUrlExtension:()=>uy,glFormatToGPUFormat:()=>Kx,glUploadBufferImageResource:()=>cx,glUploadCompressedTextureResource:()=>hx,glUploadImageResource:()=>Wu,glUploadVideoResource:()=>fx,globalUniformsBit:()=>xp,globalUniformsBitGl:()=>_p,globalUniformsUBOBitGl:()=>YA,gpuFormatToBasisTranscoderFormat:()=>pw,gpuFormatToKTXBasisTranscoderFormat:()=>Dw,gpuUploadBufferImageResource:()=>Fg,gpuUploadCompressedTextureResource:()=>Og,gpuUploadImageResource:()=>Fu,gpuUploadVideoResource:()=>Ug,groupD8:()=>ue,hasCachedCanvasTexture:()=>MP,hslWgsl:()=>j3,hslgl:()=>Ws,hslgpu:()=>Xs,injectBits:()=>vc,insertVersion:()=>ip,isMobile:()=>Sf,isPow2:()=>tc,isRenderingToScreen:()=>Ig,isSafari:()=>Em,isSingleItem:()=>Oi,isWebGLSupported:()=>gi,isWebGPUSupported:()=>xi,ktxTranscoderUrls:()=>al,loadBasis:()=>cw,loadBasisOnWorker:()=>zx,loadBitmapFont:()=>vx,loadDDS:()=>gw,loadEnvironmentExtensions:()=>gh,loadFontAsBase64:()=>Rm,loadFontCSS:()=>Xc,loadImageBitmap:()=>US,loadJson:()=>Rx,loadKTX:()=>_w,loadKTX2:()=>Sw,loadKTX2onWorker:()=>qx,loadSVGImage:()=>km,loadSvg:()=>Ix,loadTextures:()=>Ju,loadTxt:()=>Mx,loadVideoTextures:()=>Fx,loadWebFont:()=>Dx,localUniformBit:()=>Xi,localUniformBitGl:()=>Vs,localUniformBitGroup2:()=>Om,localUniformMSDFBit:()=>gm,localUniformMSDFBitGl:()=>xm,log2:()=>JE,logDebugTexture:()=>_R,logProgramError:()=>rx,logRenderGroupScene:()=>sE,logScene:()=>iE,mSDFBit:()=>_m,mSDFBitGl:()=>bm,mapFormatToGlFormat:()=>gx,mapFormatToGlInternalFormat:()=>xx,mapFormatToGlType:()=>_x,mapGlToVertexFormat:()=>Zg,mapSize:()=>cB,mapType:()=>Bh,mapWebGLBlendModesToPixi:()=>ux,maskFrag:()=>ug,maskVert:()=>lg,maskWgsl:()=>yh,matrixPool:()=>je,measureHtmlText:()=>gu,measureMixin:()=>hf,migrateFragmentFromV7toV8:()=>uB,mipmapScaleModeToGlFilter:()=>px,mixHexColors:()=>DB,multiplyColors:()=>os,multiplyHexColors:()=>Ta,nextPow2:()=>Ur,noiseFrag:()=>T_,noiseWgsl:()=>dd,nonCompressedFormats:()=>YS,normalizeExtensionPriority:()=>xa,nssvg:()=>Am,nsxhtml:()=>Cm,onRenderMixin:()=>df,parseAttribute:()=>lm,parseDDS:()=>$x,parseFunctionBody:()=>AB,parseKTX:()=>jx,parseSVGDefinitions:()=>am,parseSVGFloatAttribute:()=>Ue,parseSVGPath:()=>qp,parseSVGStyle:()=>Lc,particleData:()=>_d,particlesFrag:()=>Wp,particlesVert:()=>Xp,particlesWgsl:()=>Dc,path:()=>De,pointInTriangle:()=>fd,preloadVideo:()=>NS,removeItems:()=>ba,removeStructAndGroupDuplicates:()=>lp,resetUids:()=>$E,resolveCharacters:()=>fu,resolveCompressedTextureUrl:()=>kw,resolveJsonUrl:()=>Gx,resolveTextureUrl:()=>el,resourceToTexture:()=>_y,roundPixelsBit:()=>Er,roundPixelsBitGl:()=>Ar,roundedShapeArc:()=>sm,roundedShapeQuadraticCurve:()=>nm,sayHello:()=>dg,scaleModeToGlFilter:()=>Rh,setBasisTranscoderPath:()=>uw,setKTXTranscoderPath:()=>vw,setPositions:()=>Lm,setProgramName:()=>sp,setUvs:()=>Hm,shapeBuilders:()=>Ka,sortMixin:()=>ff,spritesheetAsset:()=>Of,squaredDistanceToLineSegment:()=>ks,stripVersion:()=>np,styleAttributes:()=>um,testImageFormat:()=>ju,testVideoFormat:()=>Js,textStyleToCSS:()=>wm,textureBit:()=>Qm,textureBitGl:()=>Jm,textureFrom:()=>by,tilingBit:()=>Gm,tilingBitGl:()=>Um,toFillStyle:()=>$r,toLocalGlobalMixin:()=>pf,toStrokeStyle:()=>Os,transformVertices:()=>Ln,triangulateWithHoles:()=>Ya,uboSyncFunctionsSTD40:()=>Th,uboSyncFunctionsWGSL:()=>Cg,uid:()=>oe,uniformParsers:()=>Zr,unpremultiplyAlpha:()=>zP,unsafeEvalSupported:()=>bu,updateLocalTransform:()=>kB,updateQuadBounds:()=>Ma,updateRenderGroupTransform:()=>f2,updateRenderGroupTransforms:()=>_h,updateTextBounds:()=>jn,updateTransformAndChildren:()=>sg,updateTransformBackwards:()=>va,updateWorldTransform:()=>OB,v8_0_0:()=>V,v8_3_4:()=>qd,validFormats:()=>ul,validateRenderables:()=>ng,vertexGPUTemplate:()=>fp,vertexGlTemplate:()=>mp,viewportFromFrame:()=>xB,vkFormatToGPUFormat:()=>Zx,warn:()=>k,webworkerExt:()=>t2,wrapModeToGlAddress:()=>Xu});var TR,Pe=f(()=>{XC();$C();E();E();zf();Gf();jb();qb();KC();ZC();QC();JC();eP();tP();rP();iP();sP();nP();oP();aP();uP();lP();cP();hP();dP();fP();pP();mP();gP();ZP();Kb();Qb();sw();vS();ci();TS();SS();ES();AS();CS();PS();wS();Sx();Oh();BS();ur();RS();MS();IS();kS();kx();VS();Yi();GS();zS();Ox();ms();en();dr();Ra();Ff();ay();lc();st();ow();hw();fw();mw();$S();jS();qS();xw();KS();bw();JS();QS();Ew();Pw();Bw();Mw();i1();Iw();e1();s1();t1();Ow();n1();a1();Gw();vb();CA();ny();Ae();a2();oy();k3();ty();Rf();Pf();sc();sy();oc();wf();Bf();i2();s2();n2();q3();S1();E1();w1();M1();D1();ad();I1();k1();F1();O1();G1();y2();v2();T2();$e();$c();jc();U3();H3();R1();h_();A1();P1();C1();B1();V3();z3();$3();pi();Zl();Kv();Qv();S2();_f();de();jd();Sa();Kp();ss();Ht();U1();j0();q0();K0();Ze();Z0();K3();L1();z1();eB();Y1();vT();vy();ys();rB();sB();pc();c2();Ay();b2();wy();Sy();vp();o0();Ui();Jy();Yy();jy();qy();Ky();oB();Zy();e0();Na();Ha();t0();ro();Li();eg();hy();A2();dy();C2();Cb();aB();fy();P2();dc();fc();pS();TT();ST();ET();ao();CT();BT();wT();MT();DT();IT();UT();kT();GT();LT();NT();HT();Sc();Zt();VT();KT();JT();lB();zT();qg();Rg();XT();qT();Ry();Xf();YT();$T();jT();hB();Qg();My();Dy();Iy();ky();Fy();Wg();OT();FT();QT();ZT();rS();eS();Ng();iS();dS();sS();nS();dx();oS();uS();WS();lS();cS();hS();aS();WP();fS();$2();j2();fB();rT();q2();K2();Z2();Q2();tT();iT();sT();nT();aT();uT();lT();Gi();lr();cT();Sg();eT();Ly();Ny();J2();Vy();zy();Wy();hT();dT();Mg();xT();fT();pT();Gg();mT();XS();gT();_T();B2();R2();hi();Sh();Wr();jf();I2();F2();gB();Ss();Tp();Cy();Es();Py();Sp();mf();O2();oT();xg();kg();_B();G2();Hy();Cr();s0();vg();Qe();Ag();n0();Pg();Eg();L2();Ts();Fa();hr();yu();yg();qm();Kn();vB();V2();k2();bf();Fn();tl();On();mt();Vf();he();W2();yf();Lr();gf();TB();EB();_g();Hx();il();yy();Ua();CB();Y2();cr();O0();G0();U0();vt();wB();yn();Jl();Zv();ns();Sb();Eb();Ab();Pb();wb();Bb();cf();Ib();kb();Fb();Ob();qt();h2();BB();Lb();d2();g2();vf();Db();ig();MB();ls();rg();IB();uf();af();FB();p2();GB();m2();bT();zn();u2();Ep();Jp();tv();tm();rv();nv();Pp();u0();l0();Up();Lp();Np();JA();Vn();kc();mm();Qn();Bc();w0();Gc();ov();av();uv();om();$0();cv();hv();lv();_0();LB();hm();x0();a0();Gp();zB();KB();Z1();q1();K1();ZB();Yc();iR();sR();Q1();yT();l2();Rc();oR();ia();Wi();R0();D0();H0();N0();V0();lR();F0();dR();Yp();eE();L0();I0();k0();N1();zm();mR();jv();Uv();Hv();V1();Yv();Wv();Vv();zv();Xv();tu();gs();x2();ym();xS();_S();bS();yS();gS();zc();W1();Ev();Tv();Tm();vm();X1();Cv();Pm();Wc();Ov();Bv();Dv();Iv();kv();Rv();Mv();Fv();Fm();wv();pd();Hc();W0();mv();Nc();pm();vv();xv();_v();P_();Hi();xR();dm();fm();$p();Hr();ly();cy();wn();fs();Zb();Nf();Yb();Pv();vu();Tu();jm();X0();og();Pt();N2();Qd();ft();Uf();$f();ag();_e();bR();yR();xe();Ub();H1();Gh();ps();Kd();wt();U2();TR=ga(p0());G.add(e2,t2);});var DR=Fr((j_,MR)=>{(function(r,e){typeof j_=="object"?MR.exports=j_=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(j_,function(){var r=r||function(e,t){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof db=="function")try{i=db("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function g(){}return function(y){var T;return g.prototype=y,T=new g,g.prototype=null,T}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(g){var y=n(this);return g&&y.mixIn(g),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var y in g)g.hasOwnProperty(y)&&(this[y]=g[y]);g.hasOwnProperty("toString")&&(this.toString=g.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(g,y){g=this.words=g||[],y!=t?this.sigBytes=y:this.sigBytes=g.length*4;},toString:function(g){return (g||h).stringify(this)},concat:function(g){var y=this.words,T=g.words,S=this.sigBytes,R=g.sigBytes;if(this.clamp(),S%4)for(var A=0;A<R;A++){var P=T[A>>>2]>>>24-A%4*8&255;y[S+A>>>2]|=P<<24-(S+A)%4*8;}else for(var F=0;F<R;F+=4)y[S+F>>>2]=T[F>>>2];return this.sigBytes+=R,this},clamp:function(){var g=this.words,y=this.sigBytes;g[y>>>2]&=4294967295<<32-y%4*8,g.length=e.ceil(y/4);},clone:function(){var g=u.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var y=[],T=0;T<g;T+=4)y.push(s());return new l.init(y,g)}}),c=o.enc={},h=c.Hex={stringify:function(g){for(var y=g.words,T=g.sigBytes,S=[],R=0;R<T;R++){var A=y[R>>>2]>>>24-R%4*8&255;S.push((A>>>4).toString(16)),S.push((A&15).toString(16));}return S.join("")},parse:function(g){for(var y=g.length,T=[],S=0;S<y;S+=2)T[S>>>3]|=parseInt(g.substr(S,2),16)<<24-S%8*4;return new l.init(T,y/2)}},d=c.Latin1={stringify:function(g){for(var y=g.words,T=g.sigBytes,S=[],R=0;R<T;R++){var A=y[R>>>2]>>>24-R%4*8&255;S.push(String.fromCharCode(A));}return S.join("")},parse:function(g){for(var y=g.length,T=[],S=0;S<y;S++)T[S>>>2]|=(g.charCodeAt(S)&255)<<24-S%4*8;return new l.init(T,y)}},p=c.Utf8={stringify:function(g){try{return decodeURIComponent(escape(d.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return d.parse(unescape(encodeURIComponent(g)))}},m=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(g){typeof g=="string"&&(g=p.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes;},_process:function(g){var y,T=this._data,S=T.words,R=T.sigBytes,A=this.blockSize,P=A*4,F=R/P;g?F=e.ceil(F):F=e.max((F|0)-this._minBufferSize,0);var O=F*A,L=e.min(O*4,R);if(O){for(var I=0;I<O;I+=A)this._doProcessBlock(S,I);y=S.splice(0,O),T.sigBytes-=L;}return new l.init(y,L)},clone:function(){var g=u.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});a.Hasher=m.extend({cfg:u.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset();},reset:function(){m.reset.call(this),this._doReset();},update:function(g){return this._append(g),this._process(),this},finalize:function(g){g&&this._append(g);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(g){return function(y,T){return new g.init(T).finalize(y)}},_createHmacHelper:function(g){return function(y,T){return new _.HMAC.init(g,T).finalize(y)}}});var _=o.algo={};return o}(Math);return r});});var kR=Fr((q_,IR)=>{(function(r,e){typeof q_=="object"?IR.exports=q_=e(DR()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(q_,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],d=c[1],p=c[2],m=c[3],b=c[4],_=0;_<80;_++){if(_<16)o[_]=u[l+_]|0;else {var g=o[_-3]^o[_-8]^o[_-14]^o[_-16];o[_]=g<<1|g>>>31;}var y=(h<<5|h>>>27)+b+o[_];_<20?y+=(d&p|~d&m)+1518500249:_<40?y+=(d^p^m)+1859775393:_<60?y+=(d&p|d&m|p&m)-1894007588:y+=(d^p^m)-899497514,b=m,m=p,p=d<<30|d>>>2,d=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+p|0,c[3]=c[3]+m|0,c[4]=c[4]+b|0;},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,h=u.sigBytes*8;return l[h>>>5]|=128<<24-h%32,l[(h+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(h+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});Pe();var Si={};Nd(Si,{DistortionFilter:()=>U_,EqualizerFilter:()=>kr,Filter:()=>ct,MonoFilter:()=>L_,ReverbFilter:()=>N_,StereoFilter:()=>H_,StreamFilter:()=>V_,TelephoneFilter:()=>z_});var SR;function ER(r){return SR=r,r}function Te(){return SR}var ct=class{constructor(e,t){this.init(e,t);}init(e,t){this.destination=e,this.source=t||e;}connect(e){this.source?.connect(e);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var U_=class extends ct{constructor(e=0){let t;if(!Te().useLegacy){let{audioContext:i}=Te().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Te().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var at=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Te().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Se=class extends ct{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Se.F32,type:"lowshelf",gain:r},{f:Se.F64,type:"peaking",gain:e},{f:Se.F125,type:"peaking",gain:t},{f:Se.F250,type:"peaking",gain:i},{f:Se.F500,type:"peaking",gain:s},{f:Se.F1K,type:"peaking",gain:n},{f:Se.F2K,type:"peaking",gain:o},{f:Se.F4K,type:"peaking",gain:a},{f:Se.F8K,type:"peaking",gain:u},{f:Se.F16K,type:"highshelf",gain:l}];Te().useLegacy||(c=h.map(d=>{let p=Te().context.audioContext.createBiquadFilter();return p.type=d.type,at.setParamValue(p.Q,1),p.frequency.value=d.f,at.setParamValue(p.gain,d.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let p=this.bands[d];d>0&&this.bands[d-1].connect(p),this.bandsMap[p.frequency.value]=p;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);at.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(Se.F32,r);}get f32(){return this.getGain(Se.F32)}set f64(r){this.setGain(Se.F64,r);}get f64(){return this.getGain(Se.F64)}set f125(r){this.setGain(Se.F125,r);}get f125(){return this.getGain(Se.F125)}set f250(r){this.setGain(Se.F250,r);}get f250(){return this.getGain(Se.F250)}set f500(r){this.setGain(Se.F500,r);}get f500(){return this.getGain(Se.F500)}set f1k(r){this.setGain(Se.F1K,r);}get f1k(){return this.getGain(Se.F1K)}set f2k(r){this.setGain(Se.F2K,r);}get f2k(){return this.getGain(Se.F2K)}set f4k(r){this.setGain(Se.F4K,r);}get f4k(){return this.getGain(Se.F4K)}set f8k(r){this.setGain(Se.F8K,r);}get f8k(){return this.getGain(Se.F8K)}set f16k(r){this.setGain(Se.F16K,r);}get f16k(){return this.getGain(Se.F16K)}reset(){this.bands.forEach(r=>{at.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},kr=Se;kr.F32=32;kr.F64=64;kr.F125=125;kr.F250=250;kr.F500=500;kr.F1K=1e3;kr.F2K=2e3;kr.F4K=4e3;kr.F8K=8e3;kr.F16K=16e3;var L_=class extends ct{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().context;t=i.createChannelSplitter(),e=i.createChannelMerger(),e.connect(t);}super(e,t),this._merger=e;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var N_=class extends ct{constructor(e=3,t=2,i=false){super(null),this._seconds=this._clamp(e,1,50),this._decay=this._clamp(t,0,100),this._reverse=i,this._rebuild();}_clamp(e,t,i){return Math.min(i,Math.max(t,e))}get seconds(){return this._seconds}set seconds(e){this._seconds=this._clamp(e,1,50),this._rebuild();}get decay(){return this._decay}set decay(e){this._decay=this._clamp(e,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(e){this._reverse=e,this._rebuild();}_rebuild(){if(Te().useLegacy)return;let{audioContext:e}=Te().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var H_=class extends ct{constructor(e=0){let t,i,s;if(!Te().useLegacy){let{audioContext:n}=Te().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?at.setParamValue(this._stereo.pan,e):this._panner&&this._panner.setPosition(e,0,1-Math.abs(e));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var V_=class extends ct{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().context;e=i.createMediaStreamDestination(),t=i.createMediaStreamSource(e.stream);}super(e,t),this._stream=e?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var z_=class extends ct{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",at.setParamValue(s.frequency,2e3),n.type="lowpass",at.setParamValue(n.frequency,2e3),o.type="highpass",at.setParamValue(o.frequency,500),a.type="highpass",at.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};Pe();var bd=class extends le{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};Pe();var CF=0,nE=class extends le{constructor(r){super(),this.id=CF++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-nE.PADDING),this._end=Math.min(this._end+nE.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),ve.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){ve.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){ve.shared.remove(this._onUpdate,this),this.removeAllListeners();let r=this._source;r&&(r.onended=null,r.onplay=null,r.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},W_=nE;W_.PADDING=.1;Pe();var yd=class extends le{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new W_(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};Pe();var vd=class{constructor(e,t){this.parent=e,Object.assign(this,t),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(e){return this.parent.play({complete:e,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var sa=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],oE=["audio/mpeg","audio/ogg"],na={};function AR(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;sa.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(na,i);}AR();Pe();Pe();var wF=0,Td=class extends le{constructor(e){super(),this.id=wF++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);at.setParamValue(this._gain.gain,n*s*i),at.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){ve.shared.remove(this._updateListener,this),e&&ve.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var oa=class{constructor(e,t){this._output=t,this._input=e;}get destination(){return this._input}get filters(){return this._filters}set filters(e){if(this._filters&&(this._filters.forEach(t=>{t&&t.disconnect();}),this._filters=null,this._input.connect(this._output)),e&&e.length){this._filters=e.slice(0),this._input.disconnect();let t=null;e.forEach(i=>{t===null?this._input.connect(i.destination):t.connect(i.destination),t=i;}),t.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var CR=class extends oa{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(CR.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let r=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=r.buffer,at.setParamValue(e.playbackRate,r.playbackRate.value),e.loop=r.loop;let t=this.context.audioContext.createGain();return e.connect(t),t.connect(this.destination),{source:e,gain:t}}get bufferSize(){return this.script.bufferSize}},X_=CR;X_.BUFFER_SIZE=0;var aa=class{init(e){this.parent=e,this._nodes=new X_(this.context),this._source=this._nodes.bufferSource,this.source=e.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null,this.source=null;}create(){return new Td(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await W.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var Pl=class{static from(r){let e={};typeof r=="string"?e.url=r:r instanceof ArrayBuffer||r instanceof AudioBuffer||r instanceof HTMLAudioElement?e.source=r:Array.isArray(r)?e.url=r:e=r,e={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...e},Object.freeze(e);let t=Te().useLegacy?new yd:new aa;return new Pl(t,e)}constructor(r,e){this.media=r,this.options=e,this._instances=[],this._sprites={},this.media.init(this);let t=e.complete;this._autoPlayOptions=t?{complete:t}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=Array.isArray(e.url)?this.preferUrl(e.url):e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded);}preferUrl(r){let[e]=r.map(t=>({url:t,ext:De.extname(t).slice(1)})).filter(({ext:t})=>na[t]).sort((t,i)=>sa.indexOf(t.ext)-sa.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Te().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new vd(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(Pl._pool.length>0){let r=Pl._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Pl._pool.indexOf(r)<0&&Pl._pool.push(r);}},an=Pl;an._pool=[];Pe();var wl=class r extends oa{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new le,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var Y_=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new wl),this._htmlAudioContext=new bd,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(e){this.useLegacy||(this._context.filters=e);}get supported(){return wl.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof an)return this._sounds[e]=t,t;let i=this._getOptions(t),s=an.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};Pe();Pe();var PR=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=De.basename(e,De.extname(e))),t},wR={extension:x.Asset,detection:{test:async()=>true,add:async r=>[...r,...sa.filter(e=>na[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[x.LoadParser],priority:Me.High},test(r){let e=De.extname(r).slice(1);return !!na[e]||oE.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>an.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Te().add(PR(e),t),t},async unload(r,e){Te().remove(PR(e));}}};G.add(wR);ER(new Y_);var Sd="repeat";({DistortionFilter:Si.DistortionFilter,EqualizerFilter:Si.EqualizerFilter,MonoFilter:Si.MonoFilter,ReverbFilter:Si.ReverbFilter,StereoFilter:Si.StereoFilter,StreamFilter:Si.StreamFilter,TelephoneFilter:Si.TelephoneFilter});var BR=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],Jr="__game_layer__",Bl="Container",$_="ImageContainer",aE="Image",Rl="Sprite",Ml="Text",uE="Video";var H;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(H||(H={}));function Ut(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw H.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function RR(r){var e;let t={importPixi:false,...r};t.app&&(t.renderer=t.app.renderer,t.stage=t.app.stage),t.importPixi&&!t.pixi&&(t.pixi=await Promise.resolve().then(()=>(Pe(),vR))),window.__PIXI_DEVTOOLS__={...window.__PIXI_DEVTOOLS__||{},app:t.app,stage:t.stage,renderer:t.renderer,extensions:[...((e=window.__PIXI_DEVTOOLS__)==null?void 0:e.extensions)||[],...t.extensions||[]],plugins:{}};}var OR=ga(kR());Pe();var MF={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof we||r instanceof Xt||r instanceof Ne},testProp(r){switch(r){case "xAlign":case "yAlign":case "xPercentagePosition":case "yPercentagePosition":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof we||r instanceof Xt||r instanceof Ne)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "xPercentagePosition":r.xPercentagePosition=t/100;break;case "yPercentagePosition":r.yPercentagePosition=t/100;break}},getProperties(r){return [{value:r.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:r.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:r.xPercentagePosition*100,prop:"xPercentagePosition",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yPercentagePosition*100,prop:"yPercentagePosition",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},FR=MF;function DF(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var X=class X{constructor(){}static get app(){if(!X._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return X._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(Jr);return e||(e=new ie,e.label=Jr,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return X.canvasWidth=t,X.canvasHeight=i,X._app=new Ih,X.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=X.app,extensions:a=[],...u}=n||{};RR({app:o,extensions:[FR,...a],...u}),X._isInitialized=true,X.addCanvasIntoHTMLElement(e),window.addEventListener("resize",X.resize),X.resize(),X.gameLayer;})}static addCanvasIntoHTMLElement(e){X._isInitialized?e.appendChild(X.app.canvas):H.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return X.htmlLayers.push(s),X.resize(),n}static removeHtmlLayer(e){let t=X.htmlLayers.find(i=>i.id===e);t&&(t.remove(),X.htmlLayers=X.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return X.htmlLayers.find(t=>t.id===e)}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/X.canvasWidth,t/X.canvasHeight)}static get screenWidth(){return Math.floor(X.screenScale*X.canvasWidth)}static get screenHeight(){return Math.floor(X.screenScale*X.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-X.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-X.screenHeight)/2}static async resize(){await DF(async()=>{if(X._isInitialized){let i=X.app.canvas.style;i.width=`${X.screenWidth}px`,i.height=`${X.screenHeight}px`,i.marginLeft=`${X.horizontalMargin}px`,i.marginRight=`${X.horizontalMargin}px`,i.marginTop=`${X.verticalMargin}px`,i.marginBottom=`${X.verticalMargin}px`;}let t=X.htmlLayers.map(i=>{i.style.width=`${X.screenWidth}px`,i.style.height=`${X.screenHeight}px`,i.style.marginLeft=`${X.horizontalMargin}px`,i.style.marginRight=`${X.horizontalMargin}px`,i.style.marginTop=`${X.verticalMargin}px`,i.style.marginBottom=`${X.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return X.gameLayer.children.filter(e=>e.label).sort((e,t)=>X.gameLayer.getChildIndex(e)-X.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(X._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static generateTickerId(e){try{return (0,OR.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),X._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),X._currentTickersTimeouts[e]&&delete X._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),X.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(X._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&X.removeTickerTimeout(i);}else X._currentTickersTimeouts[i].aliases=n;});}};N(X,"_app"),N(X,"htmlLayers",[]),N(X,"canvasWidth",300),N(X,"canvasHeight",300),N(X,"_isInitialized",false),N(X,"_currentTickers",{}),N(X,"_currentTickersSequence",{}),N(X,"_currentTickersTimeouts",{}),N(X,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),N(X,"_tickersOnPause",{});var B=X;Pe();var Dl=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,NR=new Set,lE=typeof process=="object"&&process?process:{},HR=(r,e,t,i)=>{typeof lE.emitWarning=="function"?lE.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},Q_=globalThis.AbortController,GR=globalThis.AbortSignal;if(typeof Q_>"u"){GR=class{constructor(){N(this,"onabort");N(this,"_onabort",[]);N(this,"reason");N(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Q_=class{constructor(){N(this,"signal",new GR);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=lE.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,HR("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var IF=r=>!NR.has(r),un=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),VR=r=>un(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Il:null:null,Il=class extends Array{constructor(e){super(e),this.fill(0);}},kl,ua=class ua{constructor(e,t){N(this,"heap");N(this,"length");if(!v(ua,kl))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=VR(e);if(!t)return [];q(ua,kl,true);let i=new ua(e,t);return q(ua,kl,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};kl=new WeakMap,me(ua,kl,false);var cE=ua,UR,LR,ei,fr,ti,la,ri,Fl,Ol,ht,ii,ut,Ve,ne,Yt,pr,Lt,bt,si,yt,ni,oi,mr,ai,dn,$t,Gl,U,hE,ca,Ki,Ad,gr,zR,ha,Ul,Cd,ln,cn,dE,K_,Z_,He,fE,Ed,hn,pE,mE=class mE{constructor(e){me(this,U);me(this,ei);me(this,fr);me(this,ti);me(this,la);me(this,ri);me(this,Fl);me(this,Ol);N(this,"ttl");N(this,"ttlResolution");N(this,"ttlAutopurge");N(this,"updateAgeOnGet");N(this,"updateAgeOnHas");N(this,"allowStale");N(this,"noDisposeOnSet");N(this,"noUpdateTTL");N(this,"maxEntrySize");N(this,"sizeCalculation");N(this,"noDeleteOnFetchRejection");N(this,"noDeleteOnStaleGet");N(this,"allowStaleOnFetchAbort");N(this,"allowStaleOnFetchRejection");N(this,"ignoreFetchAbort");me(this,ht);me(this,ii);me(this,ut);me(this,Ve);me(this,ne);me(this,Yt);me(this,pr);me(this,Lt);me(this,bt);me(this,si);me(this,yt);me(this,ni);me(this,oi);me(this,mr);me(this,ai);me(this,dn);me(this,$t);me(this,Gl);me(this,ca,()=>{});me(this,Ki,()=>{});me(this,Ad,()=>{});me(this,gr,()=>false);me(this,ha,e=>{});me(this,Ul,(e,t,i)=>{});me(this,Cd,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});N(this,UR,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:p,maxSize:m=0,maxEntrySize:b=0,sizeCalculation:_,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:A,ignoreFetchAbort:P}=e;if(t!==0&&!un(t))throw new TypeError("max option must be a nonnegative integer");let F=t?VR(t):Array;if(!F)throw new Error("invalid max value: "+t);if(q(this,ei,t),q(this,fr,m),this.maxEntrySize=b||v(this,fr),this.sizeCalculation=_,this.sizeCalculation){if(!v(this,fr)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(q(this,Ol,y),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(q(this,Fl,g),q(this,dn,!!g),q(this,ut,new Map),q(this,Ve,new Array(t).fill(void 0)),q(this,ne,new Array(t).fill(void 0)),q(this,Yt,new F(t)),q(this,pr,new F(t)),q(this,Lt,0),q(this,bt,0),q(this,si,cE.create(t)),q(this,ht,0),q(this,ii,0),typeof l=="function"&&q(this,ti,l),typeof c=="function"&&q(this,la,c),typeof h=="function"?(q(this,ri,h),q(this,yt,[])):(q(this,ri,void 0),q(this,yt,void 0)),q(this,ai,!!v(this,ti)),q(this,Gl,!!v(this,la)),q(this,$t,!!v(this,ri)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(v(this,fr)!==0&&!un(v(this,fr)))throw new TypeError("maxSize must be a positive integer if specified");if(!un(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Y(this,U,zR).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=un(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!un(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Y(this,U,hE).call(this);}if(v(this,ei)===0&&this.ttl===0&&v(this,fr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!v(this,ei)&&!v(this,fr)){let O="LRU_CACHE_UNBOUNDED";IF(O)&&(NR.add(O),HR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,mE));}}static unsafeExposeInternals(e){return {starts:v(e,oi),ttls:v(e,mr),sizes:v(e,ni),keyMap:v(e,ut),keyList:v(e,Ve),valList:v(e,ne),next:v(e,Yt),prev:v(e,pr),get head(){return v(e,Lt)},get tail(){return v(e,bt)},free:v(e,si),isBackgroundFetch:t=>{var i;return Y(i=e,U,He).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return Y(o=e,U,Z_).call(o,t,i,s,n)},moveToTail:t=>{var i;return Y(i=e,U,Ed).call(i,t)},indexes:t=>{var i;return Y(i=e,U,ln).call(i,t)},rindexes:t=>{var i;return Y(i=e,U,cn).call(i,t)},isStale:t=>{var i;return v(i=e,gr).call(i,t)}}}get max(){return v(this,ei)}get maxSize(){return v(this,fr)}get calculatedSize(){return v(this,ii)}get size(){return v(this,ht)}get fetchMethod(){return v(this,Fl)}get memoMethod(){return v(this,Ol)}get dispose(){return v(this,ti)}get onInsert(){return v(this,la)}get disposeAfter(){return v(this,ri)}getRemainingTTL(e){return v(this,ut).has(e)?1/0:0}*entries(){for(let e of Y(this,U,ln).call(this))v(this,ne)[e]!==void 0&&v(this,Ve)[e]!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield [v(this,Ve)[e],v(this,ne)[e]]);}*rentries(){for(let e of Y(this,U,cn).call(this))v(this,ne)[e]!==void 0&&v(this,Ve)[e]!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield [v(this,Ve)[e],v(this,ne)[e]]);}*keys(){for(let e of Y(this,U,ln).call(this)){let t=v(this,Ve)[e];t!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield t);}}*rkeys(){for(let e of Y(this,U,cn).call(this)){let t=v(this,Ve)[e];t!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield t);}}*values(){for(let e of Y(this,U,ln).call(this))v(this,ne)[e]!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield v(this,ne)[e]);}*rvalues(){for(let e of Y(this,U,cn).call(this))v(this,ne)[e]!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield v(this,ne)[e]);}[(LR=Symbol.iterator,UR=Symbol.toStringTag,LR)](){return this.entries()}find(e,t={}){for(let i of Y(this,U,ln).call(this)){let s=v(this,ne)[i],n=Y(this,U,He).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,v(this,Ve)[i],this))return this.get(v(this,Ve)[i],t)}}forEach(e,t=this){for(let i of Y(this,U,ln).call(this)){let s=v(this,ne)[i],n=Y(this,U,He).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,Ve)[i],this);}}rforEach(e,t=this){for(let i of Y(this,U,cn).call(this)){let s=v(this,ne)[i],n=Y(this,U,He).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,Ve)[i],this);}}purgeStale(){let e=false;for(let t of Y(this,U,cn).call(this,{allowStale:true}))v(this,gr).call(this,t)&&(Y(this,U,hn).call(this,v(this,Ve)[t],"expire"),e=true);return e}info(e){let t=v(this,ut).get(e);if(t===void 0)return;let i=v(this,ne)[t],s=Y(this,U,He).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(v(this,mr)&&v(this,oi)){let o=v(this,mr)[t],a=v(this,oi)[t];if(o&&a){let u=o-(Dl.now()-a);n.ttl=u,n.start=Date.now();}}return v(this,ni)&&(n.size=v(this,ni)[t]),n}dump(){let e=[];for(let t of Y(this,U,ln).call(this,{allowStale:true})){let i=v(this,Ve)[t],s=v(this,ne)[t],n=Y(this,U,He).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(v(this,mr)&&v(this,oi)){o.ttl=v(this,mr)[t];let a=Dl.now()-v(this,oi)[t];o.start=Math.floor(Date.now()-a);}v(this,ni)&&(o.size=v(this,ni)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=Dl.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,p,m,b;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=v(this,Cd).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),Y(this,U,hn).call(this,e,"set"),this;let h=v(this,ht)===0?void 0:v(this,ut).get(e);if(h===void 0)h=v(this,ht)===0?v(this,bt):v(this,si).length!==0?v(this,si).pop():v(this,ht)===v(this,ei)?Y(this,U,K_).call(this,false):v(this,ht),v(this,Ve)[h]=e,v(this,ne)[h]=t,v(this,ut).set(e,h),v(this,Yt)[v(this,bt)]=h,v(this,pr)[h]=v(this,bt),q(this,bt,h),Hd(this,ht)._++,v(this,Ul).call(this,h,c,u),u&&(u.set="add"),l=false,v(this,Gl)&&((d=v(this,la))==null||d.call(this,t,e,"add"));else {Y(this,U,Ed).call(this,h);let _=v(this,ne)[h];if(t!==_){if(v(this,dn)&&Y(this,U,He).call(this,_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=_;g!==void 0&&!o&&(v(this,ai)&&((p=v(this,ti))==null||p.call(this,g,e,"set")),v(this,$t)&&v(this,yt)?.push([g,e,"set"]));}else o||(v(this,ai)&&((m=v(this,ti))==null||m.call(this,_,e,"set")),v(this,$t)&&v(this,yt)?.push([_,e,"set"]));if(v(this,ha).call(this,h),v(this,Ul).call(this,h,c,u),v(this,ne)[h]=t,u){u.set="replace";let g=_&&Y(this,U,He).call(this,_)?_.__staleWhileFetching:_;g!==void 0&&(u.oldValue=g);}}else u&&(u.set="update");v(this,Gl)&&this.onInsert?.(t,e,t===_?"update":"replace");}if(s!==0&&!v(this,mr)&&Y(this,U,hE).call(this),v(this,mr)&&(l||v(this,Ad).call(this,h,s,n),u&&v(this,Ki).call(this,u,h)),!o&&v(this,$t)&&v(this,yt)){let _=v(this,yt),g;for(;g=_?.shift();)(b=v(this,ri))==null||b.call(this,...g);}return this}pop(){var e;try{for(;v(this,ht);){let t=v(this,ne)[v(this,Lt)];if(Y(this,U,K_).call(this,!0),Y(this,U,He).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(v(this,$t)&&v(this,yt)){let t=v(this,yt),i;for(;i=t?.shift();)(e=v(this,ri))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=v(this,ut).get(e);if(n!==void 0){let o=v(this,ne)[n];if(Y(this,U,He).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(v(this,gr).call(this,n))s&&(s.has="stale",v(this,Ki).call(this,s,n));else return i&&v(this,ca).call(this,n),s&&(s.has="hit",v(this,Ki).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=v(this,ut).get(e);if(s===void 0||!i&&v(this,gr).call(this,s))return;let n=v(this,ne)[s];return Y(this,U,He).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:b,forceRefresh:_=false,status:g,signal:y}=t;if(!v(this,dn))return g&&(g.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});let T={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:p,status:g,signal:y},S=v(this,ut).get(e);if(S===void 0){g&&(g.fetch="miss");let R=Y(this,U,Z_).call(this,e,S,T,b);return R.__returned=R}else {let R=v(this,ne)[S];if(Y(this,U,He).call(this,R)){let L=i&&R.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",L&&(g.returnedStale=true)),L?R.__staleWhileFetching:R.__returned=R}let A=v(this,gr).call(this,S);if(!_&&!A)return g&&(g.fetch="hit"),Y(this,U,Ed).call(this,S),s&&v(this,ca).call(this,S),g&&v(this,Ki).call(this,g,S),R;let P=Y(this,U,Z_).call(this,e,S,T,b),O=P.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=A?"stale":"refresh",O&&A&&(g.returnedStale=true)),O?P.__staleWhileFetching:P.__returned=P}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=v(this,Ol);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=v(this,ut).get(e);if(a!==void 0){let u=v(this,ne)[a],l=Y(this,U,He).call(this,u);return o&&v(this,Ki).call(this,o,a),v(this,gr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||Y(this,U,hn).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(Y(this,U,Ed).call(this,a),s&&v(this,ca).call(this,a),u))}else o&&(o.get="miss");}delete(e){return Y(this,U,hn).call(this,e,"delete")}clear(){return Y(this,U,pE).call(this,"delete")}};ei=new WeakMap,fr=new WeakMap,ti=new WeakMap,la=new WeakMap,ri=new WeakMap,Fl=new WeakMap,Ol=new WeakMap,ht=new WeakMap,ii=new WeakMap,ut=new WeakMap,Ve=new WeakMap,ne=new WeakMap,Yt=new WeakMap,pr=new WeakMap,Lt=new WeakMap,bt=new WeakMap,si=new WeakMap,yt=new WeakMap,ni=new WeakMap,oi=new WeakMap,mr=new WeakMap,ai=new WeakMap,dn=new WeakMap,$t=new WeakMap,Gl=new WeakMap,U=new WeakSet,hE=function(){let e=new Il(v(this,ei)),t=new Il(v(this,ei));q(this,mr,e),q(this,oi,t),q(this,Ad,(n,o,a=Dl.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{v(this,gr).call(this,n)&&Y(this,U,hn).call(this,v(this,Ve)[n],"expire");},o+1);u.unref&&u.unref();}}),q(this,ca,n=>{t[n]=e[n]!==0?Dl.now():0;}),q(this,Ki,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=Dl.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=v(this,ut).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},q(this,gr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},ca=new WeakMap,Ki=new WeakMap,Ad=new WeakMap,gr=new WeakMap,zR=function(){let e=new Il(v(this,ei));q(this,ii,0),q(this,ni,e),q(this,ha,t=>{q(this,ii,v(this,ii)-e[t]),e[t]=0;}),q(this,Cd,(t,i,s,n)=>{if(Y(this,U,He).call(this,i))return 0;if(!un(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!un(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),q(this,Ul,(t,i,s)=>{if(e[t]=i,v(this,fr)){let n=v(this,fr)-e[t];for(;v(this,ii)>n;)Y(this,U,K_).call(this,true);}q(this,ii,v(this,ii)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=v(this,ii));});},ha=new WeakMap,Ul=new WeakMap,Cd=new WeakMap,ln=function*({allowStale:e=this.allowStale}={}){if(v(this,ht))for(let t=v(this,bt);!(!Y(this,U,dE).call(this,t)||((e||!v(this,gr).call(this,t))&&(yield t),t===v(this,Lt)));)t=v(this,pr)[t];},cn=function*({allowStale:e=this.allowStale}={}){if(v(this,ht))for(let t=v(this,Lt);!(!Y(this,U,dE).call(this,t)||((e||!v(this,gr).call(this,t))&&(yield t),t===v(this,bt)));)t=v(this,Yt)[t];},dE=function(e){return e!==void 0&&v(this,ut).get(v(this,Ve)[e])===e},K_=function(e){var n;let t=v(this,Lt),i=v(this,Ve)[t],s=v(this,ne)[t];return v(this,dn)&&Y(this,U,He).call(this,s)?s.__abortController.abort(new Error("evicted")):(v(this,ai)||v(this,$t))&&(v(this,ai)&&((n=v(this,ti))==null||n.call(this,s,i,"evict")),v(this,$t)&&v(this,yt)?.push([s,i,"evict"])),v(this,ha).call(this,t),e&&(v(this,Ve)[t]=void 0,v(this,ne)[t]=void 0,v(this,si).push(t)),v(this,ht)===1?(q(this,Lt,q(this,bt,0)),v(this,si).length=0):q(this,Lt,v(this,Yt)[t]),v(this,ut).delete(i),Hd(this,ht)._--,t},Z_=function(e,t,i,s){let n=t===void 0?void 0:v(this,ne)[t];if(Y(this,U,He).call(this,n))return n;let o=new Q_,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(b,_=false)=>{let{aborted:g}=o.signal,y=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(g&&!_?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),g&&!y&&!_)return h(o.signal.reason);let T=p;return v(this,ne)[t]===p&&(b===void 0?T.__staleWhileFetching?v(this,ne)[t]=T.__staleWhileFetching:Y(this,U,hn).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,b,u.options))),b},c=b=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=b),h(b)),h=b=>{let{aborted:_}=o.signal,g=_&&i.allowStaleOnFetchAbort,y=g||i.allowStaleOnFetchRejection,T=y||i.noDeleteOnFetchRejection,S=p;if(v(this,ne)[t]===p&&(!T||S.__staleWhileFetching===void 0?Y(this,U,hn).call(this,e,"fetch"):g||(v(this,ne)[t]=S.__staleWhileFetching)),y)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw b},d=(b,_)=>{var y;let g=(y=v(this,Fl))==null?void 0:y.call(this,e,n,u);g&&g instanceof Promise&&g.then(T=>b(T===void 0?void 0:T),_),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=T=>l(T,true)));});};i.status&&(i.status.fetchDispatched=true);let p=new Promise(d).then(l,c),m=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,m,{...u.options,status:void 0}),t=v(this,ut).get(e)):v(this,ne)[t]=m,m},He=function(e){if(!v(this,dn))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Q_},fE=function(e,t){v(this,pr)[t]=e,v(this,Yt)[e]=t;},Ed=function(e){e!==v(this,bt)&&(e===v(this,Lt)?q(this,Lt,v(this,Yt)[e]):Y(this,U,fE).call(this,v(this,pr)[e],v(this,Yt)[e]),Y(this,U,fE).call(this,v(this,bt),e),q(this,bt,e));},hn=function(e,t){var s,n;let i=false;if(v(this,ht)!==0){let o=v(this,ut).get(e);if(o!==void 0)if(i=true,v(this,ht)===1)Y(this,U,pE).call(this,t);else {v(this,ha).call(this,o);let a=v(this,ne)[o];if(Y(this,U,He).call(this,a)?a.__abortController.abort(new Error("deleted")):(v(this,ai)||v(this,$t))&&(v(this,ai)&&((s=v(this,ti))==null||s.call(this,a,e,t)),v(this,$t)&&v(this,yt)?.push([a,e,t])),v(this,ut).delete(e),v(this,Ve)[o]=void 0,v(this,ne)[o]=void 0,o===v(this,bt))q(this,bt,v(this,pr)[o]);else if(o===v(this,Lt))q(this,Lt,v(this,Yt)[o]);else {let u=v(this,pr)[o];v(this,Yt)[u]=v(this,Yt)[o];let l=v(this,Yt)[o];v(this,pr)[l]=v(this,pr)[o];}Hd(this,ht)._--,v(this,si).push(o);}}if(v(this,$t)&&v(this,yt)?.length){let o=v(this,yt),a;for(;a=o?.shift();)(n=v(this,ri))==null||n.call(this,...a);}return i},pE=function(e){var t,i;for(let s of Y(this,U,cn).call(this,{allowStale:true})){let n=v(this,ne)[s];if(Y(this,U,He).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=v(this,Ve)[s];v(this,ai)&&((t=v(this,ti))==null||t.call(this,n,o,e)),v(this,$t)&&v(this,yt)?.push([n,o,e]);}}if(v(this,ut).clear(),v(this,ne).fill(void 0),v(this,Ve).fill(void 0),v(this,mr)&&v(this,oi)&&(v(this,mr).fill(0),v(this,oi).fill(0)),v(this,ni)&&v(this,ni).fill(0),q(this,Lt,0),q(this,bt,0),v(this,si).length=0,q(this,ii,0),q(this,ht,0),v(this,$t)&&v(this,yt)){let s=v(this,yt),n;for(;n=s?.shift();)(i=v(this,ri))==null||i.call(this,...n);}};var J_=mE;var Ei=class{constructor(e){N(this,"cache");N(this,"map",new Map);this.cache=new J_({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}get entries(){return this.map.entries}keys(){return this.map.keys()}get values(){return this.map.values}};var Pd=new Ei({cacheSize:5});function kF(r){return function(e){eb.add(e,r);}}var eb;(s=>{function r(n,o){o||(o=n.name),Pd.get(o)&&H.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Pd.set(o,n);}s.add=r;function e(n){try{let o=Pd.get(n);if(!o){H.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){H.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Pd.values())}s.values=t;function i(n){return Pd.has(n)}s.has=i;})(eb||(eb={}));var jt=eb;var Ll=new Ei({cacheSize:5});function FF(r){return function(e){tb.add(e,r);}}var tb;(n=>{function r(o,a){a||(a=o.name),Ll.get(a)&&H.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,Ll.set(a,o);}n.add=r;function e(o){try{let a=Ll.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=Ll.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(Ll.values())}n.values=i;function s(o){return Ll.has(o)}n.has=s;})(tb||(tb={}));var Zi=tb;async function rb(r){let e=OF(r.pixivnId);if(e)await e.setMemory(r);else throw new Error("[Pixi\u2019VN] The element "+r.pixivnId+" could not be created");return e}function OF(r){try{let e=jt.get(r);return e?new e:void 0}catch(e){H.error(`Error while getting CanvasElement ${r}`,e);return}}Pe();function gE(r){return "memory"in r?r.memory:r instanceof Ir?xE(r):r instanceof Ee?wd(r):da(r)}function GF(r){return {width:r.width,height:r.height,isRenderGroup:r.isRenderGroup,blendMode:r.blendMode,tint:r.tint,alpha:r.alpha,angle:r.angle,renderable:r.renderable,rotation:r.rotation,scale:{x:r.scale.x,y:r.scale.y},pivot:{x:r.pivot.x,y:r.pivot.y},position:{x:r.position.x,y:r.position.y},skew:{x:r.skew.x,y:r.skew.y},visible:r.visible,x:r.x,y:r.y,boundsArea:r.boundsArea,cursor:r.cursor,eventMode:r.eventMode,interactive:r.interactive,interactiveChildren:r.interactiveChildren,hitArea:r.hitArea}}function WR(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function da(r,e){let t=UF(r,Bl),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>gE(n)):[];return {pixivnId:t,elements:s,...GF(r)}}function wd(r){let e=da(r),t=e.pixivnId??Rl,i=YR(r),s="textureAlias"in r?WR(r.texture,r.textureAlias):WR(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function xE(r){let e=da(r),t=e.pixivnId??Ml,i=YR(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:LF(r.style),roundPixels:r.roundPixels,onEvents:i}}function UF(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function YR(r){return "onEvents"in r?r.onEvents:{}}function XR(r,e){if(typeof r!="object"||r===null)return r;H.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function LF(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:XR(r.stroke,"fill"),fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontVariant:r.fontVariant,fontWeight:r.fontWeight,leading:r.leading,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,padding:r.padding,stroke:XR(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var fa=class extends ie{constructor(t){super(t);N(this,"pixivnId",Bl);N(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Bl;}get memory(){return da(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await Ai(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await rb(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Zi.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};jt.add(fa,Bl);async function Ai(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}Pe();var Bd=class Bd{static init(e){Bd._getScreen=e.getScreen;}static get screen(){return Bd._getScreen()}};N(Bd,"_getScreen");var sr=Bd;function Qi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(sr.screen.width-t)+i+n*t+(s?t:0):e*(sr.screen.height-t)+i+n*t+(s?t:0)}function Ci(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(sr.screen.width-t):(e-i-n*t-(s?t:0))/(sr.screen.height-t)}function Ji(r,e){return r==="width"?e*sr.screen.width:e*sr.screen.height}function Pi(r,e){return r==="width"?e/sr.screen.width:e/sr.screen.height}function it(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i-r.y*s,y:r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*s-r.x*i,y:r.y*i-r.x*s}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i+r.y*s,y:-r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*s-r.x*i,y:-r.y*i-r.x*s}}return {x:0,y:0}}function _E(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function wi(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?e:i===90||i===270?t:Math.abs(e*Math.cos(i*Math.PI/180))+Math.abs(t*Math.sin(i*Math.PI/180))}function Bi(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?t:i===90||i===270?e:Math.abs(t*Math.cos(i*Math.PI/180))+Math.abs(e*Math.sin(i*Math.PI/180))}Pe();var NF=new RegExp(`(${BR.join("|")})$`);function Rd(r){let e=tt.cache.has(r)?tt.get(r):null;return e instanceof C&&(r=e.source?.label||r),NF.test(r)}function pa(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===void 0?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===void 0?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.xPercentagePosition},delete r.xPercentagePosition):(r.percentagePosition.x=r.xPercentagePosition,delete r.xPercentagePosition)),r.yPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.yPercentagePosition},delete r.yPercentagePosition):(r.percentagePosition.y=r.yPercentagePosition,delete r.yPercentagePosition))),r)}Pe();Pe();async function Ri(r){if(r!=="EMPTY"){if(!r){H.error("Texture not found",r);return}if(tt.cache.has(r)){let e=tt.get(r);if(e)return e}return tt.load(r).then(e=>{if(!e){H.error("Texture not found",r);return}if(!(e instanceof C)){H.error("File not is a file",r);return}return e}).catch(e=>{H.error("Error loading file",e);})}}Pe();var es=class r extends Ee{constructor(t){super(t);N(this,"pixivnId",Rl);N(this,"_textureAlias");N(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Rl;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return wd(this)}set memory(t){}async setMemory(t){return this.memory=t,await Md(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Zi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}};jt.add(es,Rl);async function Md(r,e,t){let i=t?.ignoreTexture||false;if(await Ai(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await Ri(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&tt.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await Ri(n);o&&(r.texture=o);}}let s=t?.half;if(s&&await s(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=Zi.get(o);a&&r.onEvent(n,a);}}var we=class r extends es{constructor(t,i){t=pa(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);N(this,"pixivnId",aE);N(this,"_loadIsStarted",false);N(this,"_align");N(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...wd(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Dd(this,t),this.reloadPosition();}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Ri(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,H.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return {x:Ci("width",this.x,wi(this),t.x,i.x<0,this.anchor.x),y:Ci("height",this.y,Bi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return Ci("width",this.x,wi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return Ci("height",this.y,Bi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Pi("width",this.x),y:Pi("height",this.y)}}get xPercentagePosition(){return Pi("width",this.x)}set xPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get yPercentagePosition(){return Pi("height",this.y)}set yPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);this._align.x!==void 0&&(super.x=Qi("width",this._align.x,wi(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=Qi("height",this._align.y,Bi(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Ji("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Ji("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};jt.add(we,aE);async function Dd(r,e,t){let i=t?.ignoreTexture||false;return e=pa(e),await Md(r,e,{half:async()=>{"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();},ignoreTexture:t?.ignoreTexture})}Pe();var Xt=class r extends we{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);N(this,"pixivnId",uE);N(this,"_looop",false);N(this,"_paused",false);N(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await bE(this,t)}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};jt.add(Xt,uE);async function bE(r,e,t){await Dd(r,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(r.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(r.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(r.paused=e.paused);}var Ne=class extends fa{constructor(t,i=[]){t=pa(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);N(this,"pixivnId",$_);N(this,"_loadIsStarted",false);N(this,"_anchor");N(this,"_align");N(this,"_percentagePosition");t=pa(t),i&&i.forEach(a=>{let u;Rd(a)?u=new Xt(void 0,a):u=new we(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:$_,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await yE(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,H.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new C}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return {x:Ci("width",this.x,wi(this),t.x,i.x<0,this.anchor.x),y:Ci("height",this.y,Bi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return Ci("width",this.x,wi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return Ci("height",this.y,Bi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Pi("width",this.x),y:Pi("height",this.y)}}set xPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get xPercentagePosition(){return Pi("width",this.x)}set yPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get yPercentagePosition(){return Pi("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);this._align.x!==void 0&&(super.x=Qi("width",this._align.x,wi(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=Qi("height",this._align.y,Bi(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Ji("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Ji("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};jt.add(Ne,$_);async function yE(r,e,t){e=pa(e),Ai(r,e,{...t,end:async()=>{"anchor"in e&&e.anchor!==void 0&&(r.anchor=e.anchor),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}Pe();var ma=class extends Ir{constructor(t){super(t);N(this,"pixivnId",Ml);N(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Ml;}get memory(){return xE(this)}set memory(t){}async setMemory(t){return this.memory=t,await vE(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Zi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};jt.add(ma,Ml);async function vE(r,e){if(await Ai(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=Zi.get(i);s&&r.onEvent(t,s);}}var nr=class{constructor(e,t,i){N(this,"id","ticker_id_not_set");N(this,"args");N(this,"duration");N(this,"priority");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}fn(e,t,i,s){throw new Error("[Pixi\u2019VN] The method TickerBase.fn() must be overridden")}onEndOfTicker(e,t,i){let s="aliasToRemoveAfter"in i&&i.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in i&&i.tickerAliasToResume||[];typeof n=="string"&&(n=[n]),w.onEndOfTicker(t,{aliasToRemoveAfter:s,tickerAliasToResume:n});}};var Nl=new Ei({cacheSize:5});function HF(r){return function(e){ib.add(e,r);}}var ib;(n=>{function r(o,a){a||(a=o.name),Nl.get(a)&&H.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,Nl.set(a,o);}n.add=r;function e(o){try{let a=Nl.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=Nl.get(o);if(!c){H.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){H.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(Nl.values())}n.values=i;function s(o){return Nl.has(o)}n.has=s;})(ib||(ib={}));var or=ib;var Hl="aliasToRemoveAfter";var Id=class{get app(){return B.app}get gameLayer(){return B.gameLayer}get isInitialized(){return B._isInitialized}get htmlLayout(){return B.htmlLayers[0]}set htmlLayout(e){this.addHtmlLayer("ui",e);}get canvasWidth(){return B.canvasWidth}get canvasHeight(){return B.canvasHeight}set canvasWidth(e){B.canvasWidth=e;}set canvasHeight(e){B.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await B.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await B.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){this.addHtmlLayer("ui",e);}get children(){return B.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {H.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {H.error(`Canvas element ${e} not found`);return}}e instanceof ie&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof Xt?await bE(t,e,{ignoreTexture:true}):t instanceof we?await Dd(t,e,{ignoreTexture:true}):t instanceof es?await Md(t,e,{ignoreTexture:true}):t instanceof ma?await vE(t,e):t instanceof Ne?await yE(t,e):t instanceof ie&&await Ai(t,e);}transferTickers(e,t,i="move"){B._currentTickersSequence[e]&&(i==="move"?B._currentTickersSequence[t]=Ut(B._currentTickersSequence[e]):i==="duplicate"&&(B._currentTickersSequence[t]=Ut(B._currentTickersSequence[e]))),Object.entries(B._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.canvasElementAliases.includes(e)&&(i==="move"?n.canvasElementAliases=n.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&n.canvasElementAliases.find(o=>o===e)&&n.canvasElementAliases.push(t),n.args.hasOwnProperty(Hl))){let o=n.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?n.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(n.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(B._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),B._currentTickersSequence[t]&&Object.keys(B._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&B._currentTickersSequence[e]&&Object.keys(B._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===Jr){H.error(`The alias ${Jr} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?H.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===Jr){H.error(`The alias ${Jr} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}find(e){if(e===Jr)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren(),this.removeAllTickers();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return B._currentTickers}get currentTickersSteps(){return B._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!or.getInstance(i,t.args,t.duration,t.priority)){H.error(`Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:Ut(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=B.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{B.removeTickerTimeoutInfo(o),B._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:Hl in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);B.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){B._currentTickers[e]=t,t.fn=s=>{let n=B._currentTickers[e];if(n){let o=n.canvasElementAliases;if(t.createdByTicketSteps){if(this.isTickerPaused(t.createdByTicketSteps.canvasElementAlias,t.createdByTicketSteps.id))return}else o=o.filter(a=>!this.isTickerPaused(a,e));i?.fn(s,n.args,o,e);}},this.app.ticker.add(t.fn,void 0,t.priority);}pushEndOfTicker(e,t,i){t.onEndOfTicker=()=>{i.onEndOfTicker(t.canvasElementAliases,e,t.args);};}addTickersSequence(e,t,i=0){if(t.length==0){H.warn("The steps of the tickers is empty");return}e in B._currentTickersSequence||(B._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Sd||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:Ut(o.args),duration:o.duration})},n=B.generateTickerId(s);return B._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!B._currentTickersSequence[e]||!B._currentTickersSequence[e][t])return;let i=B._currentTickersSequence[e][t].steps[B._currentTickersSequence[e][t].currentStepNumber];if(i===Sd&&(i=B._currentTickersSequence[e][t].steps[0],B._currentTickersSequence[e][t].currentStepNumber=0,i===Sd)){H.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=B._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),B.removeTickerTimeoutInfo(u);},i.duration*1e3);B.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=or.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){H.error(`Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:Ut(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=B.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=B._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Hl in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),B.removeTickerTimeoutInfo(u);},s.duration*1e3);B.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(B._currentTickersSequence[e]&&B._currentTickersSequence[e][t]){let i=B._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,B._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&B._currentTickersSequence[e]&&B._currentTickersSequence[e][t]&&(delete B._currentTickersSequence[e][t],Object.entries(B._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=B._currentTickers[e],s=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!s&&i.duration==null&&i.createdByTicketSteps&&this.nextTickerStep(i.createdByTicketSteps.canvasElementAlias,i.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(B._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),B._currentTickersSequence[s]&&delete B._currentTickersSequence[s],B.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof nr?i=t.id:i=t.prototype.id,e.forEach(s=>{B._currentTickersSequence[s]&&Object.entries(B._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete B._currentTickersSequence[s][n];});}),Object.entries(B._currentTickers).forEach(([s,n])=>{n.id===i&&(B._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(B._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(B._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(B._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Hl in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(B._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete B._currentTickersSequence[e];}),Object.entries(B._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&B.removeTickerTimeout(e);});}removeAllTickers(){B._currentTickersSequence={},Object.keys(B._currentTickers).forEach(e=>{this.removeTicker(e);}),B._currentTickers={};for(let e in B._currentTickersTimeouts)B.removeTickerTimeout(e);B._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},B._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=B._currentTickers[t];if(i){if(i.args.hasOwnProperty(Hl)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete B._currentTickers[t];}});}pauseTicker(e,t={}){let i=B._tickersOnPause[e];if(!i){B._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?B._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:B._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?B._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:B._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete B._tickersOnPause[t];});}isTickerPaused(e,t){let i=B._tickersOnPause[e];if(i){if(t){if("tickerIdsIncluded"in i&&i.tickerIdsIncluded)return i.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in i&&i.tickerIdsExcluded)return !i.tickerIdsExcluded.includes(t)}return true}return false}completeTickerOnStepEnd(e){e.alias?B._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):B._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=B._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Sd)?H.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(s=>{if(typeof s=="object"&&"ticker"in s){let n=or.getInstance(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=B._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===Jr){H.error(`The alias ${Jr} is reserved`);return}return t.label=e,B.app.stage.addChild(t)}getLayer(e){return B.app.stage.getChildByLabel(e)}removeLayer(e){B.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return B.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return B.removeHtmlLayer(e)}getHtmlLayer(e){return B.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=gE(t));}),{tickers:Ut(B.currentTickersWithoutCreatedBySteps),tickersSteps:Ut(B._currentTickersSequence),elements:Ut(e),stage:Ut(da(this.gameLayer)),elementAliasesOrder:Ut(B.childrenAliasesOrder),tickersOnPause:Ut(B._tickersOnPause),tickersToCompleteOnStepEnd:Ut(B._tickersToCompleteOnStepEnd)}}async restore(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,s=e.elementAliasesOrder,n=s.filter(a=>i[a]).map(a=>rb(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),B.childrenAliasesOrder.push(l);});}else {H.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Ai(this.gameLayer,e.stage,{ignoreScale:!0}):H.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([s,n])=>{let o=n.canvasElementAliases,a=or.getInstance(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else H.error(`Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{B._currentTickersSequence[s]=n,Object.keys(n).forEach(o=>{this.runTickersSequence(s,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(s=>{let n=i[s];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(i[s].tickerIdsExcluded=n.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(i[s].tickerIdsIncluded=n.tickerIdsIncluded.map(o=>t[o]||o));}),B._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds.map(o=>({id:t[o.id]||o.id})),n=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));B._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){H.error("Error importing data",t);}}};var sb=class{constructor(){N(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var nb=class{constructor(){N(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};Pe();Pe();function fn(r){return (r instanceof we||r instanceof Ne)&&r.haveEmptyTexture?false:!(r instanceof Ee&&r.texture?.label=="EMPTY")}function pn(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=TE(r[e],t):t.type==="exponential"&&(r[e]=SE(r[e],t)):r[e]!==void 0&&typeof r[e]=="object"&&r[e].haveOwnProperty("x")&&r[e].haveOwnProperty("y")&&typeof r[e].x=="number"&&typeof r[e].y=="number"&&(t.type==="linear"?(r[e].x=TE(r[e].x,t),r[e].y=TE(r[e].y,t)):t.type==="exponential"&&(r[e].x=SE(r[e].x,t),r[e].y=SE(r[e].y,t))));}function TE(r,e){let{limit:t,amt:i}=e;if(t!==void 0){if(r>t&&i>0)return t;if(r<t&&i<0)return t}return r+i}function SE(r,e){let{limit:t}=e;if(t!==void 0){if(r>t&&e.percentage>0)return t;if(r<t&&e.percentage<0)return t}return r+r*e.percentage}var VF=5,ts=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=VF:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=w.find(c);return !(!h||o&&!fn(h))}).forEach(c=>{let h=w.find(c);if(h&&h instanceof ie){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.onEndOfTicker(c,s,t);return}else if(n==="hide"&&h.alpha<=l){this.onEndOfTicker(c,s,t);return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){H.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,s,t,{editAlpha:false});return}}}),a&&pn(t,"speed",a);}onEndOfTicker(e,t,i,s={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=w.find(n);if(o&&s.editAlpha){let a=this.getLimit(i);o.alpha=a;}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}};or.add(ts);Pe();var zF=10;function WF(r,e){let t=Ut(r.destination);if(t.type==="align"){let i,s;e instanceof Ee&&(i=e.anchor.x,s=e.anchor.y);let n=it(e.pivot,e.angle),o=it(e.scale,e.angle);t.x=Qi("width",t.x,wi(e),n.x,o.x<0,i),t.y=Qi("height",t.y,Bi(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=Ji("width",t.x),t.y=Ji("height",t.y)),t}var xr=class extends nr{fn(e,t,i,s){t.speed===void 0&&(t.speed=zF);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=w.find(u);return !(!l||o&&!fn(l))}).forEach(u=>{let l=w.find(u);if(l&&l instanceof ie){let c=WF(t,l),h=c.x-l.x,d=c.y-l.y,p=h>0?1:-1,m=d>0?1:-1,b,_;if(typeof n=="number"){let g=this.speedConvert(n);h===0||d===0?b=_=g:(b=Math.abs(h/(h+d))*g,_=Math.abs(d/(h+d))*g);}else b=this.speedConvert(n.x),_=this.speedConvert(n.y);if(b>0){l.x+=p*b*e.deltaTime;let g=c.x-l.x;(p<0&&g>0||p>0&&g<0)&&(l.x=c.x);}if(_>0){l.y+=m*_*e.deltaTime;let g=c.y-l.y;(m<0&&g>0||m>0&&g<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.onEndOfTicker(u,s,t);return}else if(b<1e-5&&_<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){H.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,s,t,{editPosition:false});return}}}),a&&pn(t,"speed",a);}onEndOfTicker(e,t,i,s={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=w.find(n);if(o){let a=i.destination;s.editPosition&&(o instanceof we||o instanceof Ne?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};or.add(xr);Pe();var XF=1,kd=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=XF);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=w.find(l);return !(!c||t.startOnlyIfHaveTexture&&!fn(c))}).forEach(l=>{let c=w.find(l);if(c&&c instanceof ie&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.onEndOfTicker(l,s,t)):!n&&c.angle<=a&&(c.angle=a,this.onEndOfTicker(l,s,t))),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){H.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,s,t,{editRotation:false});return}}),o&&pn(t,"speed",o);}onEndOfTicker(e,t,i,s={editRotation:true}){let{limit:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=w.find(o);a&&s.editRotation&&n!==void 0&&(a.angle=n);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};or.add(kd);Pe();var YF=10,mn=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=YF);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(d=>{let p=w.find(d);return !(!p||a&&!fn(p))}).forEach(d=>{let p=w.find(d);if(p&&p instanceof ie){if(o==="zoom"&&(p.scale.x<h.x||p.scale.y<h.y)?(p.scale.x+=l*e.deltaTime,p.scale.y+=c*e.deltaTime):o==="unzoom"&&(p.scale.x>h.x||p.scale.y>h.y)&&(p.scale.x-=l*e.deltaTime,p.scale.y-=c*e.deltaTime),o==="zoom"){if(p.scale.x>h.x&&(p.scale.x=h.x),p.scale.y>h.y&&(p.scale.y=h.y),p.scale.x>=h.x&&p.scale.y>=h.y){this.onEndOfTicker(d,s,t);return}}else if(o==="unzoom"&&(p.scale.x<h.x&&(p.scale.x=h.x),p.scale.y<h.y&&(p.scale.y=h.y),p.scale.x<=h.x&&p.scale.y<=h.y)){this.onEndOfTicker(d,s,t);return}if((l<1e-5&&c<1e-5||l<1e-5&&p.scale.y==h.y||c<1e-5&&p.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){H.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(d,s,t,{editScale:false});return}}}),u&&pn(t,"speed",u);}speedConvert(e){return e/600}onEndOfTicker(e,t,i,s={editScale:true}){let{isZoomInOut:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=w.find(o);if(a){if(s.editScale){let u=this.getLimit(i);a.scale.x=u.x,a.scale.y=u.y;}if(n){let{pivot:u,position:l}=n;a.pivot=u.x,a.position=l;}}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}};or.add(mn);async function $F(r,e={},t){let i=w.find(r);if(!i){H.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},n=e.speed||20,o=e.speedProgression||void 0,a=e.startOnlyIfHaveTexture||false,u=e.type||"horizontal",l=e.maximumShockSize||10,c=(e.shocksNumber||10)-1;if(c<2){H.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),d=Math.ceil(c/2),p=[];for(let _=0;_<h;_++){let g={x:s.x,y:s.y},y=l*(_+1)/h;u==="horizontal"?_%2!==0?g.x=s.x+y:g.x=s.x-y:_%2!==0?g.y=s.y+y:g.y=s.y-y,p.push(new xr({destination:g,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let m=h%2===0;for(let _=d;_>0;_--){let g={x:s.x,y:s.y},y=l*(_+1)/(d-1);u==="horizontal"?_%2===0&&!m||_%2!==0&&m?g.x=s.x-y:g.x=s.x+y:_%2===0&&!m||_%2!==0&&m?g.y=s.y-y:g.y=s.y+y,p.push(new xr({destination:g,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}p.push(new xr({destination:s,speed:n,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let b=w.addTickersSequence(r,p);b&&(w.completeTickerOnStepEnd({id:b,alias:r}),w.pauseTicker(r,{tickerIdsExcluded:[b]}));}function ob(r,e,t){let i=new Ne(t,e);return w.add(r,i),i}async function jF(r,e,t){let i=new Ne(t,e);return await i.load(),w.add(r,i),i}Pe();function ab(r,e,t){if(!e)if(tt.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new we(t,e);return w.add(r,i),i}async function qF(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Ri(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function KF(r,e,t){if(!e)if(tt.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new we(t,e);return await i.load(),w.add(r,i),i}Pe();function ub(r,e,t){if(!e)if(tt.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Xt(t,e);return w.add(r,i),i}async function ZF(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Ri(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function QF(r,e,t){if(!e)if(tt.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Xt(t,e);return await i.load(),w.add(r,i),i}function Fd(r,e){if(typeof e=="string")return Rd(e)?ub(r,e):ab(r,e);if(Array.isArray(e))return ob(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Rd(e.value)?ub(r,e.value,e.options):ab(r,e.value,e.options);if(Array.isArray(e.value))return ob(r,e.value,e.options)}return w.add(r,e),e}async function $R(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(w.find(r)&&(a=r+"_temp_disolve",w.editAlias(r,a)),e=Fd(r,e),a&&w.copyCanvasElementProperty(a,r),a&&w.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=lb(a,t,i);c&&(o.push(...c),w.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new ts({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},void 0,i),l=w.addTicker(r,u);if(l&&(s&&w.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof we||e instanceof Ne)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function lb(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:s=[]}=e;typeof r=="string"&&(r=[r]),typeof s=="string"&&(s=[s]),s.push(...r);let n=new ts({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},void 0,t),o=w.addTicker(r,n);if(o)return i&&w.completeTickerOnStepEnd({id:o}),[o]}async function JF(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!w.find(r))return $R(r,e,t,i);let a=r+"_temp_fade";w.editAlias(r,a),n.push(a),e=Fd(r,e),a&&w.copyCanvasElementProperty(a,r),a&&w.transferTickers(a,r,"duplicate"),e.alpha=0;let u=lb(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new ts({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,i),c=w.addTicker(r,l);if(c&&(s&&w.completeTickerOnStepEnd({id:c}),o.push(c),w.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof we||e instanceof Ne)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function eO(r,e={},t){return lb(r,e,t)}async function tO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;w.find(r)&&(c=r+"_temp_movein",w.editAlias(r,c)),e=Fd(r,e),c&&w.copyCanvasElementProperty(c,r),c&&w.transferTickers(c,r,"move");let h;e instanceof we||e instanceof Ne?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d;switch(c&&(u?(d=EE(c,t,i),d&&(l.push(...d),o.push(c))):a.push(c)),(e instanceof we||e instanceof Ne)&&e.haveEmptyTexture&&await e.load(),c&&w.pauseTicker(c,{tickerIdsIncluded:d}),s){case "up":e.y=w.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=w.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new xr({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),m=w.addTicker(r,p);if(m&&(w.pauseTicker(r,{tickerIdsExcluded:[m]}),n&&w.completeTickerOnStepEnd({id:m}),l.push(m)),l.length>0)return l}function EE(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=w.find(r);if(!o){H.warn("The canvas component is not found.");return}let a={x:o.x,y:o.y};switch(i){case "up":a.y=-o.height;break;case "down":a.y=w.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=w.canvasWidth+o.width;break}let u=new xr({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,t),l=w.addTicker(r,u);if(l)return w.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&w.completeTickerOnStepEnd({id:l}),[l]}async function rO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=w.find(r);c&&(l=r+"_temp_zoom",w.editAlias(r,l)),e=Fd(r,e),l&&w.copyCanvasElementProperty(l,r),l&&w.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=w.canvasHeight-e.y,e.pivot.x=w.canvasWidth/2-e.x,e.y=w.canvasHeight,e.x=w.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=w.canvasWidth/2-e.x,e.y=0,e.x=w.canvasWidth/2):s=="left"?(e.pivot.x=w.canvasWidth-e.x,e.pivot.y=w.canvasHeight/2-e.y,e.x=w.canvasWidth,e.y=w.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=w.canvasHeight/2-e.y,e.x=0,e.y=w.canvasHeight/2),e.pivot=_E(e.pivot,e.angle),e.scale.set(0);let h=c?{pivot:{x:c.pivot.x,y:c.pivot.y},position:{x:c.x,y:c.y}}:void 0;if(l){if(t.removeOldComponentWithZoomOut){let m=jR(l,t,i);m&&(u.push(...m),o.push(l));}else a.push(l);w.pauseTicker(l);}o.push(r);let d=new mn({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),p=w.addTicker(r,d);if(p&&(w.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&w.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof we||e instanceof Ne)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function jR(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=w.find(r);if(!o){H.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=w.canvasHeight-o.y,o.pivot.x=w.canvasWidth/2-o.x,o.y=w.canvasHeight,o.x=w.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=w.canvasWidth/2-o.x,o.y=0,o.x=w.canvasWidth/2):i=="left"?(o.pivot.x=w.canvasWidth-o.x,o.pivot.y=w.canvasHeight/2-o.y,o.x=w.canvasWidth,o.y=w.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=w.canvasHeight/2-o.y,o.x=0,o.y=w.canvasHeight/2),o.pivot=_E(o.pivot,o.angle),o.scale.set(1);let a=new mn({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},void 0,t),u=w.addTicker(r,a);if(u)return w.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&w.completeTickerOnStepEnd({id:u}),[u]}async function iO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;w.find(r)&&(u=r+"_temp_push",w.editAlias(r,u)),e=Fd(r,e),u&&w.copyCanvasElementProperty(u,r),u&&w.transferTickers(u,r,"move");let l;if((e instanceof we||e instanceof Ne)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-w.canvasHeight+e.y:s=="down"?e.y=w.canvasHeight+e.y:s=="left"?e.x=-w.canvasWidth+e.x:s=="right"&&(e.x=w.canvasWidth+e.x),u){let d=qR(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);d&&a.push(...d);}o.push(r);let c=new xr({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=w.addTicker(r,c);if(h&&(w.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&w.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof we||e instanceof Ne)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function qR(r,e={direction:"right"},t){return EE(r,e,t)}var w=new Id;sr.init({getScreen:()=>w.screen});exports.CanvasBaseItem=nb;exports.CanvasEvent=sb;exports.CanvasManagerStatic=B;exports.Container=fa;exports.FadeAlphaTicker=ts;exports.ImageContainer=Ne;exports.ImageSprite=we;exports.MoveTicker=xr;exports.RegisteredCanvasComponents=jt;exports.RegisteredEvents=Zi;exports.RegisteredTickers=or;exports.RotateTicker=kd;exports.Sprite=es;exports.Text=ma;exports.TickerBase=nr;exports.VideoSprite=Xt;exports.ZoomTicker=mn;exports.addImage=ab;exports.addImageCointainer=ob;exports.addVideo=ub;exports.canvas=w;exports.canvasComponentDecorator=kF;exports.eventDecorator=FF;exports.getTexture=Ri;exports.loadImage=qF;exports.loadVideo=ZF;exports.moveIn=tO;exports.moveOut=EE;exports.pushIn=iO;exports.pushOut=qR;exports.removeWithDissolve=lb;exports.removeWithFade=eO;exports.shakeEffect=$F;exports.showImage=KF;exports.showImageContainer=jF;exports.showVideo=QF;exports.showWithDissolve=$R;exports.showWithFade=JF;exports.tickerDecorator=HF;exports.zoomIn=rO;exports.zoomOut=jR;
|
|
3310
|
+
`,dynamic:false}};});var SF,cR,hR,dR=f(()=>{vt();Hr();eE();SF=new ge(0,0,0,0),cR=class tE extends qe{constructor(e={}){e={...tE.defaultOptions,...e,dynamicProperties:{...tE.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in _d){let l=_d[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return SF}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){let i=this.particleChildren.splice(e,t);return this.onViewUpdate(),i}removeParticleAt(e){let t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};cR.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};hR=cR;});var fR,rE,G_,mR=f(()=>{ss();he();_e();Hr();zm();fR=class pR extends qe{constructor(e){e instanceof C&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??Kr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Kr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Kr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Kr.defaultOptions.bottomHeight,this._width=t??l.width??Kr.defaultOptions.width,this._height=i??l.height??Kr.defaultOptions.height,this.allowChildren=false,this.texture=l??pR.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new Be({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=C.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};fR.defaultOptions={texture:C.EMPTY};rE=fR,G_=class extends rE{constructor(...e){let t=e[0];t instanceof C&&(D(V,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),t={texture:t,leftWidth:e[1],topHeight:e[2],rightWidth:e[3],bottomHeight:e[4]}),D(V,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function gR(r,e){return e instanceof et||e instanceof qr?e:r==="html"?new qr(e):new et(e)}var xR=f(()=>{Wc();Hi();});async function _R(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var bR=f(()=>{});function iE(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=EF[AF++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Ee&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];iE(a,e,{...t});}}function sE(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];sE(o,e,{...t,index:n});}}var EF,AF,yR=f(()=>{gs();EF=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],AF=0;});var vR={};Nd(vR,{AbstractBitmapFont:()=>Ls,AbstractRenderer:()=>mi,AbstractText:()=>Ti,AccessibilitySystem:()=>Af,AlphaFilter:()=>G3,AlphaMask:()=>Dn,AlphaMaskPipe:()=>yo,AnimatedSprite:()=>yl,Application:()=>Ih,ApplicationInitHook:()=>_o,Assets:()=>tt,AssetsClass:()=>Nh,BLEND_TO_NPM:()=>qf,BUFFER_TYPE:()=>Wo,BackgroundLoader:()=>$u,BackgroundSystem:()=>cg,Batch:()=>gc,BatchGeometry:()=>Ga,BatchTextureArray:()=>Oa,BatchableGraphics:()=>Ni,BatchableMesh:()=>di,BatchableSprite:()=>Br,Batcher:()=>Zf,BatcherPipe:()=>bh,BigPool:()=>Z,BindGroup:()=>nt,BindGroupSystem:()=>wo,BitmapFont:()=>ta,BitmapFontManager:()=>zi,BitmapText:()=>Sl,BitmapTextPipe:()=>eo,BlendModeFilter:()=>re,BlendModePipe:()=>So,BlurFilter:()=>ld,BlurFilterPass:()=>bl,Bounds:()=>ge,BrowserAdapter:()=>If,Buffer:()=>ke,BufferImageSource:()=>ki,BufferResource:()=>_i,BufferUsage:()=>te,CLEAR:()=>ot,Cache:()=>fe,CanvasPool:()=>It,CanvasPoolClass:()=>Ic,CanvasSource:()=>lt,CanvasTextMetrics:()=>Qt,CanvasTextPipe:()=>qn,CanvasTextSystem:()=>Jn,Circle:()=>ru,Color:()=>K,ColorBlend:()=>qc,ColorBurnBlend:()=>Kc,ColorDodgeBlend:()=>Zc,ColorMask:()=>In,ColorMaskPipe:()=>vo,ColorMatrixFilter:()=>__,CompressedSource:()=>Dr,Container:()=>ie,Culler:()=>Jx,CullerPlugin:()=>jh,CustomRenderPipe:()=>ho,D3D10_RESOURCE_DIMENSION:()=>Xx,D3DFMT:()=>Wt,DATA_URI:()=>TP,DDS:()=>J,DEG_TO_RAD:()=>$d,DEPRECATED_SCALE_MODES:()=>xd,DEPRECATED_WRAP_MODES:()=>gd,DOMAdapter:()=>W,DOMContainer:()=>Df,DOMPipe:()=>Rn,DRAW_MODES:()=>mB,DXGI_FORMAT:()=>Wx,DXGI_TO_TEXTURE_FORMAT:()=>Ot,DarkenBlend:()=>Qc,DefaultBatcher:()=>Un,DefaultShader:()=>Va,DifferenceBlend:()=>Jc,DisplacementFilter:()=>v_,DivideBlend:()=>eh,DynamicBitmapFont:()=>Vc,Ellipse:()=>iu,EventBoundary:()=>wa,EventEmitter:()=>le,EventSystem:()=>Ba,EventsTicker:()=>br,ExclusionBlend:()=>th,ExtensionType:()=>x,ExtractSystem:()=>hg,FOURCC_TO_TEXTURE_FORMAT:()=>Xh,FederatedContainer:()=>Mf,FederatedEvent:()=>li,FederatedMouseEvent:()=>Nr,FederatedPointerEvent:()=>Tt,FederatedWheelEvent:()=>yr,FillGradient:()=>Dt,FillPattern:()=>Yr,Filter:()=>gt,FilterEffect:()=>Gr,FilterPipe:()=>no,FilterSystem:()=>oo,FontStylePromiseCache:()=>mu,GAUSSIAN_VALUES:()=>_l,GL_FORMATS:()=>Uu,GL_INTERNAL_FORMAT:()=>ZS,GL_TARGETS:()=>Ch,GL_TYPES:()=>pe,GL_WRAP_MODES:()=>PT,GenerateTextureSystem:()=>Eo,Geometry:()=>Rt,GlBackBufferSystem:()=>Vg,GlBatchAdaptor:()=>zo,GlBuffer:()=>Gu,GlBufferSystem:()=>Xo,GlColorMaskSystem:()=>$o,GlContextSystem:()=>Lg,GlEncoderSystem:()=>jo,GlGeometrySystem:()=>Yo,GlGraphicsAdaptor:()=>Ho,GlMeshAdaptor:()=>Vo,GlParticleContainerAdaptor:()=>Za,GlParticleContainerPipe:()=>Yn,GlProgram:()=>Fe,GlProgramData:()=>Hu,GlRenderTarget:()=>Lu,GlRenderTargetAdaptor:()=>Nu,GlRenderTargetSystem:()=>Zo,GlShaderSystem:()=>Qo,GlStateSystem:()=>lx,GlStencilSystem:()=>qo,GlTexture:()=>zu,GlTextureSystem:()=>ea,GlUboSystem:()=>Ko,GlUniformGroupSystem:()=>Jo,GlobalUniformSystem:()=>Ao,GpuBatchAdaptor:()=>co,GpuBlendModesToPixi:()=>At,GpuBufferSystem:()=>Bo,GpuColorMaskSystem:()=>Ro,GpuDeviceSystem:()=>qs,GpuEncoderSystem:()=>Mo,GpuGraphicsAdaptor:()=>uo,GpuGraphicsContext:()=>Pc,GpuMeshAdapter:()=>lo,GpuMipmapGenerator:()=>Ou,GpuParticleContainerAdaptor:()=>eu,GpuParticleContainerPipe:()=>$n,GpuProgram:()=>Oe,GpuReadBuffer:()=>dB,GpuRenderTarget:()=>Iu,GpuRenderTargetAdaptor:()=>ku,GpuRenderTargetSystem:()=>Go,GpuShaderSystem:()=>Uo,GpuStateSystem:()=>Lo,GpuStencilModesToPixi:()=>Mr,GpuStencilSystem:()=>Do,GpuTextureSystem:()=>No,GpuUboSystem:()=>ko,GpuUniformBatchPipe:()=>Fo,Graphics:()=>Us,GraphicsContext:()=>Je,GraphicsContextRenderData:()=>wc,GraphicsContextSystem:()=>Ds,GraphicsPath:()=>Rr,GraphicsPipe:()=>Wn,HTMLText:()=>El,HTMLTextPipe:()=>to,HTMLTextRenderData:()=>Ns,HTMLTextStyle:()=>qr,HTMLTextSystem:()=>Hs,HardLightBlend:()=>rh,HardMixBlend:()=>ih,HelloSystem:()=>js,IGLUniformData:()=>jg,ImageSource:()=>Bt,InstructionSet:()=>us,KTX:()=>Xe,LightenBlend:()=>sh,LinearBurnBlend:()=>nh,LinearDodgeBlend:()=>oh,LinearLightBlend:()=>ah,Loader:()=>qu,LoaderParserPriority:()=>Me,LuminosityBlend:()=>uh,MSAA_QUALITY:()=>$1,MaskEffectManager:()=>ya,MaskEffectManagerClass:()=>Ql,MaskFilter:()=>Su,Matrix:()=>M,Mesh:()=>ir,MeshGeometry:()=>kt,MeshPipe:()=>Xn,MeshPlane:()=>k_,MeshRope:()=>rR,MeshSimple:()=>O_,NOOP:()=>rc,NegationBlend:()=>lh,NineSliceGeometry:()=>Kr,NineSlicePlane:()=>G_,NineSliceSprite:()=>rE,NineSliceSpritePipe:()=>so,NoiseFilter:()=>Y3,ObservablePoint:()=>Be,OverlayBlend:()=>ch,PI_2:()=>Xd,Particle:()=>uR,ParticleBuffer:()=>Qa,ParticleContainer:()=>hR,ParticleContainerPipe:()=>Is,ParticleShader:()=>Ja,PerspectiveMesh:()=>qB,PerspectivePlaneGeometry:()=>Cl,PinLightBlend:()=>hh,PipelineSystem:()=>Oo,PlaneGeometry:()=>zs,Point:()=>se,Polygon:()=>Fs,Pool:()=>Di,PoolGroupClass:()=>Kl,PrepareBase:()=>E_,PrepareQueue:()=>Tl,PrepareSystem:()=>md,PrepareUpload:()=>Al,QuadGeometry:()=>_u,RAD_TO_DEG:()=>Yd,Rectangle:()=>Q,RenderContainer:()=>R_,RenderGroup:()=>Aa,RenderGroupPipe:()=>po,RenderGroupSystem:()=>go,RenderLayer:()=>VB,RenderLayerClass:()=>j1,RenderTarget:()=>Po,RenderTargetSystem:()=>Qs,RenderTexture:()=>Eu,RenderableGCSystem:()=>mg,RendererInitHook:()=>bo,RendererType:()=>Ge,ResizePlugin:()=>Pn,Resolver:()=>Et,RopeGeometry:()=>F_,RoundedRectangle:()=>su,SCALE_MODES:()=>yB,STENCIL_MODES:()=>Re,SVGParser:()=>cm,SaturationBlend:()=>dh,SchedulerSystem:()=>Co,ScissorMask:()=>w_,SdfShader:()=>du,Shader:()=>ze,ShaderStage:()=>As,ShapePath:()=>uu,SharedRenderPipes:()=>wu,SharedSystems:()=>Pu,SoftLightBlend:()=>fh,Sprite:()=>Ee,SpritePipe:()=>xo,Spritesheet:()=>hc,State:()=>Le,StencilMask:()=>kn,StencilMaskPipe:()=>To,SubtractBlend:()=>ph,SystemRunner:()=>Ys,TEXTURE_FORMAT_BLOCK_SIZE:()=>Yx,Text:()=>Ir,TextStyle:()=>et,Texture:()=>C,TextureGCSystem:()=>gg,TextureMatrix:()=>cs,TexturePool:()=>ye,TexturePoolClass:()=>ic,TextureSource:()=>ce,TextureStyle:()=>Ea,TextureUvs:()=>B_,Ticker:()=>ve,TickerListener:()=>ds,TickerPlugin:()=>Bn,TilingSprite:()=>C_,TilingSpritePipe:()=>io,TilingSpriteShader:()=>xu,Transform:()=>vl,Triangle:()=>S_,UNIFORM_TO_ARRAY_SETTERS:()=>ox,UNIFORM_TO_SINGLE_SETTERS:()=>nx,UNIFORM_TYPES_MAP:()=>bp,UNIFORM_TYPES_VALUES:()=>Tc,UPDATE_BLEND:()=>Ca,UPDATE_COLOR:()=>Cn,UPDATE_PRIORITY:()=>zt,UPDATE_TRANSFORM:()=>aA,UPDATE_VISIBLE:()=>hs,UboBatch:()=>Mu,UboSystem:()=>Ks,UniformGroup:()=>ae,VERSION:()=>$s,VideoSource:()=>bs,ViewContainer:()=>qe,ViewSystem:()=>bg,ViewableBuffer:()=>vr,VividLightBlend:()=>mh,WGSL_ALIGN_SIZE_DATA:()=>Io,WGSL_TO_STD40_SIZE:()=>Ph,WRAP_MODES:()=>bB,WebGLRenderer:()=>Dh,WebGPURenderer:()=>Ah,WebWorkerAdapter:()=>I3,WorkerManager:()=>Lh,_getGlobalBounds:()=>of,accessibilityTarget:()=>Cf,addBits:()=>_c,addMaskBounds:()=>xs,addMaskLocalBounds:()=>_s,addProgramDefines:()=>tp,alphaFrag:()=>c_,alphaWgsl:()=>ud,applyMatrix:()=>Nm,applyProjectiveTransformationToPlane:()=>M_,applyStyleParams:()=>Mh,assignWithIgnore:()=>An,autoDetectEnvironment:()=>xP,autoDetectRenderer:()=>bx,autoDetectSource:()=>IA,basisTranscoderUrls:()=>nl,bgr2rgb:()=>Ii,bitmapFontCachePlugin:()=>yx,bitmapFontTextParser:()=>Yu,bitmapFontXMLParser:()=>kh,bitmapFontXMLStringParser:()=>Fh,blendTemplateFrag:()=>Xm,blendTemplateVert:()=>Ym,blendTemplateWgsl:()=>$m,blockDataMap:()=>Eh,blurTemplateWgsl:()=>m_,boundsPool:()=>Vt,browserExt:()=>e2,buildAdaptiveBezier:()=>ou,buildAdaptiveQuadratic:()=>em,buildArc:()=>au,buildArcTo:()=>rm,buildArcToSvg:()=>im,buildCircle:()=>Pr,buildContextBatches:()=>Vp,buildEllipse:()=>Ap,buildGeometryFromPath:()=>UB,buildLine:()=>Mp,buildPixelLine:()=>Dp,buildPolygon:()=>$a,buildRectangle:()=>ja,buildRoundedRectangle:()=>Cp,buildSimpleUvs:()=>Wa,buildTriangle:()=>qa,buildUvs:()=>za,cacheAsTextureMixin:()=>Zd,cacheTextureArray:()=>Tx,calculateProjection:()=>Dg,checkChildrenDidChange:()=>ec,checkDataUrl:()=>Jt,checkExtension:()=>We,checkMaxIfStatementsInShader:()=>Yf,childrenHelperMixin:()=>Jd,cleanArray:()=>pg,cleanHash:()=>fg,clearList:()=>mo,closePointEps:()=>wp,collectAllRenderables:()=>RB,collectRenderablesMixin:()=>ef,color32BitToUniform:()=>wr,colorBit:()=>Ps,colorBitGl:()=>ws,colorMatrixFilterFrag:()=>x_,colorMatrixFilterWgsl:()=>cd,colorToUniform:()=>hC,compareModeToGlCompare:()=>mx,compileHighShader:()=>hp,compileHighShaderGl:()=>dp,compileHighShaderGlProgram:()=>Sr,compileHighShaderGpuProgram:()=>Tr,compileHooks:()=>bc,compileInputs:()=>yc,compileOutputs:()=>cp,compileShader:()=>wh,compute2DProjection:()=>I_,convertFormatIfRequired:()=>Cw,convertToList:()=>St,copySearchParams:()=>Mn,createIdFromString:()=>Xr,createIndicesForQuads:()=>Mc,createLevelBuffers:()=>dw,createLevelBuffersFromKTX:()=>ww,createStringVariations:()=>kf,createTexture:()=>Ft,createUboElementsSTD40:()=>zg,createUboElementsWGSL:()=>Tg,createUboSyncFunction:()=>Bu,createUboSyncFunctionSTD40:()=>Yg,createUboSyncFunctionWGSL:()=>Bg,crossOrigin:()=>LS,cullingMixin:()=>Wd,curveEps:()=>Bp,defaultFilterVert:()=>nn,defaultValue:()=>Vu,definedProps:()=>pt,deprecation:()=>D,detectAvif:()=>Ex,detectBasis:()=>nw,detectCompressed:()=>Fw,detectDefaults:()=>Ax,detectMp4:()=>Cx,detectOgv:()=>Px,detectVideoAlphaMode:()=>Da,detectWebm:()=>wx,detectWebp:()=>Bx,determineCrossOrigin:()=>HS,displacementFrag:()=>b_,displacementVert:()=>y_,displacementWgsl:()=>hd,earcut:()=>TR.default,effectsMixin:()=>tf,ensureAttributes:()=>Du,ensureIsBuffer:()=>xc,ensurePrecision:()=>rp,ensureTextOptions:()=>on,ensureTextStyle:()=>gR,executeInstructions:()=>fo,extensions:()=>G,extractAttributesFromGlProgram:()=>Jg,extractAttributesFromGpuProgram:()=>op,extractFontFamilies:()=>Bm,extractStructAndGroups:()=>La,extractSvgUrlId:()=>Uc,fastCopy:()=>Gn,findHooksRx:()=>$y,findMixin:()=>rf,fontStringFromTextStyle:()=>Vi,formatShader:()=>nB,fragmentGPUTemplate:()=>pp,fragmentGlTemplate:()=>gp,generateArraySyncSTD40:()=>Xg,generateArraySyncWGSL:()=>wg,generateBlurFragSource:()=>d_,generateBlurGlProgram:()=>p_,generateBlurProgram:()=>g_,generateBlurVertSource:()=>f_,generateGPULayout:()=>tB,generateGpuLayoutGroups:()=>ap,generateLayout:()=>iB,generateLayoutHash:()=>up,generateParticleUpdateFunction:()=>zp,generateProgram:()=>ix,generateShaderSyncCode:()=>$g,generateTextStyleKey:()=>lu,generateTextureBatchBit:()=>Bs,generateTextureBatchBitGl:()=>Rs,generateTextureMatrix:()=>Hp,generateUID:()=>SB,generateUniformsSync:()=>ax,getAdjustedBlendModeBlend:()=>zr,getAttributeInfoFromFormat:()=>Mt,getBatchSamplersUniformGroup:()=>Ms,getBitmapTextLayout:()=>pu,getCanvasBoundingBox:()=>jp,getCanvasFillStyle:()=>Gs,getCanvasTexture:()=>Cu,getDefaultUniformValue:()=>yp,getFastGlobalBounds:()=>PB,getFastGlobalBoundsMixin:()=>nf,getFontCss:()=>Mm,getFontFamilyName:()=>DS,getGeometryBounds:()=>Qf,getGlTypeFromFormat:()=>Hg,getGlobalBounds:()=>ui,getGlobalMixin:()=>lf,getGlobalRenderableBounds:()=>Wm,getLocalBounds:()=>as,getMatrixRelativeToParent:()=>Lf,getMaxFragmentPrecision:()=>ep,getMaxTexturesPerBatch:()=>Kt,getOrientationOfPoints:()=>Rp,getParent:()=>Mb,getPo2TextureFromSource:()=>hu,getResolutionOfUrl:()=>tn,getSVGUrl:()=>Dm,getSupportedCompressedTextureFormats:()=>rl,getSupportedGPUCompressedTextureFormats:()=>Vh,getSupportedGlCompressedTextureFormats:()=>Hh,getSupportedTextureFormats:()=>bi,getTemporaryCanvasFromImage:()=>Im,getTestContext:()=>Ia,getTextureBatchBindGroup:()=>vs,getTextureDefaultMatrix:()=>nR,getTextureFormatFromKTXTexture:()=>Rw,getUboData:()=>ex,getUniformData:()=>tx,getUrlExtension:()=>uy,glFormatToGPUFormat:()=>Kx,glUploadBufferImageResource:()=>cx,glUploadCompressedTextureResource:()=>hx,glUploadImageResource:()=>Wu,glUploadVideoResource:()=>fx,globalUniformsBit:()=>xp,globalUniformsBitGl:()=>_p,globalUniformsUBOBitGl:()=>YA,gpuFormatToBasisTranscoderFormat:()=>pw,gpuFormatToKTXBasisTranscoderFormat:()=>Dw,gpuUploadBufferImageResource:()=>Fg,gpuUploadCompressedTextureResource:()=>Og,gpuUploadImageResource:()=>Fu,gpuUploadVideoResource:()=>Ug,groupD8:()=>ue,hasCachedCanvasTexture:()=>MP,hslWgsl:()=>j3,hslgl:()=>Ws,hslgpu:()=>Xs,injectBits:()=>vc,insertVersion:()=>ip,isMobile:()=>Sf,isPow2:()=>tc,isRenderingToScreen:()=>Ig,isSafari:()=>Em,isSingleItem:()=>Oi,isWebGLSupported:()=>gi,isWebGPUSupported:()=>xi,ktxTranscoderUrls:()=>al,loadBasis:()=>cw,loadBasisOnWorker:()=>zx,loadBitmapFont:()=>vx,loadDDS:()=>gw,loadEnvironmentExtensions:()=>gh,loadFontAsBase64:()=>Rm,loadFontCSS:()=>Xc,loadImageBitmap:()=>US,loadJson:()=>Rx,loadKTX:()=>_w,loadKTX2:()=>Sw,loadKTX2onWorker:()=>qx,loadSVGImage:()=>km,loadSvg:()=>Ix,loadTextures:()=>Ju,loadTxt:()=>Mx,loadVideoTextures:()=>Fx,loadWebFont:()=>Dx,localUniformBit:()=>Xi,localUniformBitGl:()=>Vs,localUniformBitGroup2:()=>Om,localUniformMSDFBit:()=>gm,localUniformMSDFBitGl:()=>xm,log2:()=>JE,logDebugTexture:()=>_R,logProgramError:()=>rx,logRenderGroupScene:()=>sE,logScene:()=>iE,mSDFBit:()=>_m,mSDFBitGl:()=>bm,mapFormatToGlFormat:()=>gx,mapFormatToGlInternalFormat:()=>xx,mapFormatToGlType:()=>_x,mapGlToVertexFormat:()=>Zg,mapSize:()=>cB,mapType:()=>Bh,mapWebGLBlendModesToPixi:()=>ux,maskFrag:()=>ug,maskVert:()=>lg,maskWgsl:()=>yh,matrixPool:()=>je,measureHtmlText:()=>gu,measureMixin:()=>hf,migrateFragmentFromV7toV8:()=>uB,mipmapScaleModeToGlFilter:()=>px,mixHexColors:()=>DB,multiplyColors:()=>os,multiplyHexColors:()=>Ta,nextPow2:()=>Ur,noiseFrag:()=>T_,noiseWgsl:()=>dd,nonCompressedFormats:()=>YS,normalizeExtensionPriority:()=>xa,nssvg:()=>Am,nsxhtml:()=>Cm,onRenderMixin:()=>df,parseAttribute:()=>lm,parseDDS:()=>$x,parseFunctionBody:()=>AB,parseKTX:()=>jx,parseSVGDefinitions:()=>am,parseSVGFloatAttribute:()=>Ue,parseSVGPath:()=>qp,parseSVGStyle:()=>Lc,particleData:()=>_d,particlesFrag:()=>Wp,particlesVert:()=>Xp,particlesWgsl:()=>Dc,path:()=>De,pointInTriangle:()=>fd,preloadVideo:()=>NS,removeItems:()=>ba,removeStructAndGroupDuplicates:()=>lp,resetUids:()=>$E,resolveCharacters:()=>fu,resolveCompressedTextureUrl:()=>kw,resolveJsonUrl:()=>Gx,resolveTextureUrl:()=>el,resourceToTexture:()=>_y,roundPixelsBit:()=>Er,roundPixelsBitGl:()=>Ar,roundedShapeArc:()=>sm,roundedShapeQuadraticCurve:()=>nm,sayHello:()=>dg,scaleModeToGlFilter:()=>Rh,setBasisTranscoderPath:()=>uw,setKTXTranscoderPath:()=>vw,setPositions:()=>Lm,setProgramName:()=>sp,setUvs:()=>Hm,shapeBuilders:()=>Ka,sortMixin:()=>ff,spritesheetAsset:()=>Of,squaredDistanceToLineSegment:()=>ks,stripVersion:()=>np,styleAttributes:()=>um,testImageFormat:()=>ju,testVideoFormat:()=>Js,textStyleToCSS:()=>wm,textureBit:()=>Qm,textureBitGl:()=>Jm,textureFrom:()=>by,tilingBit:()=>Gm,tilingBitGl:()=>Um,toFillStyle:()=>$r,toLocalGlobalMixin:()=>pf,toStrokeStyle:()=>Os,transformVertices:()=>Ln,triangulateWithHoles:()=>Ya,uboSyncFunctionsSTD40:()=>Th,uboSyncFunctionsWGSL:()=>Cg,uid:()=>oe,uniformParsers:()=>Zr,unpremultiplyAlpha:()=>zP,unsafeEvalSupported:()=>bu,updateLocalTransform:()=>kB,updateQuadBounds:()=>Ma,updateRenderGroupTransform:()=>f2,updateRenderGroupTransforms:()=>_h,updateTextBounds:()=>jn,updateTransformAndChildren:()=>sg,updateTransformBackwards:()=>va,updateWorldTransform:()=>OB,v8_0_0:()=>V,v8_3_4:()=>qd,validFormats:()=>ul,validateRenderables:()=>ng,vertexGPUTemplate:()=>fp,vertexGlTemplate:()=>mp,viewportFromFrame:()=>xB,vkFormatToGPUFormat:()=>Zx,warn:()=>k,webworkerExt:()=>t2,wrapModeToGlAddress:()=>Xu});var TR,Pe=f(()=>{XC();$C();E();E();zf();Gf();jb();qb();KC();ZC();QC();JC();eP();tP();rP();iP();sP();nP();oP();aP();uP();lP();cP();hP();dP();fP();pP();mP();gP();ZP();Kb();Qb();sw();vS();ci();TS();SS();ES();AS();CS();PS();wS();Sx();Oh();BS();ur();RS();MS();IS();kS();kx();VS();Yi();GS();zS();Ox();ms();en();dr();Ra();Ff();ay();lc();st();ow();hw();fw();mw();$S();jS();qS();xw();KS();bw();JS();QS();Ew();Pw();Bw();Mw();i1();Iw();e1();s1();t1();Ow();n1();a1();Gw();vb();CA();ny();Ae();a2();oy();k3();ty();Rf();Pf();sc();sy();oc();wf();Bf();i2();s2();n2();q3();S1();E1();w1();M1();D1();ad();I1();k1();F1();O1();G1();y2();v2();T2();$e();$c();jc();U3();H3();R1();h_();A1();P1();C1();B1();V3();z3();$3();pi();Zl();Kv();Qv();S2();_f();de();jd();Sa();Kp();ss();Ht();U1();j0();q0();K0();Ze();Z0();K3();L1();z1();eB();Y1();vT();vy();ys();rB();sB();pc();c2();Ay();b2();wy();Sy();vp();o0();Ui();Jy();Yy();jy();qy();Ky();oB();Zy();e0();Na();Ha();t0();ro();Li();eg();hy();A2();dy();C2();Cb();aB();fy();P2();dc();fc();pS();TT();ST();ET();ao();CT();BT();wT();MT();DT();IT();UT();kT();GT();LT();NT();HT();Sc();Zt();VT();KT();JT();lB();zT();qg();Rg();XT();qT();Ry();Xf();YT();$T();jT();hB();Qg();My();Dy();Iy();ky();Fy();Wg();OT();FT();QT();ZT();rS();eS();Ng();iS();dS();sS();nS();dx();oS();uS();WS();lS();cS();hS();aS();WP();fS();$2();j2();fB();rT();q2();K2();Z2();Q2();tT();iT();sT();nT();aT();uT();lT();Gi();lr();cT();Sg();eT();Ly();Ny();J2();Vy();zy();Wy();hT();dT();Mg();xT();fT();pT();Gg();mT();XS();gT();_T();B2();R2();hi();Sh();Wr();jf();I2();F2();gB();Ss();Tp();Cy();Es();Py();Sp();mf();O2();oT();xg();kg();_B();G2();Hy();Cr();s0();vg();Qe();Ag();n0();Pg();Eg();L2();Ts();Fa();hr();yu();yg();qm();Kn();vB();V2();k2();bf();Fn();tl();On();mt();Vf();he();W2();yf();Lr();gf();TB();EB();_g();Hx();il();yy();Ua();CB();Y2();cr();O0();G0();U0();vt();wB();yn();Jl();Zv();ns();Sb();Eb();Ab();Pb();wb();Bb();cf();Ib();kb();Fb();Ob();qt();h2();BB();Lb();d2();g2();vf();Db();ig();MB();ls();rg();IB();uf();af();FB();p2();GB();m2();bT();zn();u2();Ep();Jp();tv();tm();rv();nv();Pp();u0();l0();Up();Lp();Np();JA();Vn();kc();mm();Qn();Bc();w0();Gc();ov();av();uv();om();$0();cv();hv();lv();_0();LB();hm();x0();a0();Gp();zB();KB();Z1();q1();K1();ZB();Yc();iR();sR();Q1();yT();l2();Rc();oR();ia();Wi();R0();D0();H0();N0();V0();lR();F0();dR();Yp();eE();L0();I0();k0();N1();zm();mR();jv();Uv();Hv();V1();Yv();Wv();Vv();zv();Xv();tu();gs();x2();ym();xS();_S();bS();yS();gS();zc();W1();Ev();Tv();Tm();vm();X1();Cv();Pm();Wc();Ov();Bv();Dv();Iv();kv();Rv();Mv();Fv();Fm();wv();pd();Hc();W0();mv();Nc();pm();vv();xv();_v();P_();Hi();xR();dm();fm();$p();Hr();ly();cy();wn();fs();Zb();Nf();Yb();Pv();vu();Tu();jm();X0();og();Pt();N2();Qd();ft();Uf();$f();ag();_e();bR();yR();xe();Ub();H1();Gh();ps();Kd();wt();U2();TR=ga(p0());G.add(e2,t2);});var DR=Fr((j_,MR)=>{(function(r,e){typeof j_=="object"?MR.exports=j_=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(j_,function(){var r=r||function(e,t){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof db=="function")try{i=db("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function g(){}return function(y){var T;return g.prototype=y,T=new g,g.prototype=null,T}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(g){var y=n(this);return g&&y.mixIn(g),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var y in g)g.hasOwnProperty(y)&&(this[y]=g[y]);g.hasOwnProperty("toString")&&(this.toString=g.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(g,y){g=this.words=g||[],y!=t?this.sigBytes=y:this.sigBytes=g.length*4;},toString:function(g){return (g||h).stringify(this)},concat:function(g){var y=this.words,T=g.words,S=this.sigBytes,R=g.sigBytes;if(this.clamp(),S%4)for(var A=0;A<R;A++){var P=T[A>>>2]>>>24-A%4*8&255;y[S+A>>>2]|=P<<24-(S+A)%4*8;}else for(var F=0;F<R;F+=4)y[S+F>>>2]=T[F>>>2];return this.sigBytes+=R,this},clamp:function(){var g=this.words,y=this.sigBytes;g[y>>>2]&=4294967295<<32-y%4*8,g.length=e.ceil(y/4);},clone:function(){var g=u.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var y=[],T=0;T<g;T+=4)y.push(s());return new l.init(y,g)}}),c=o.enc={},h=c.Hex={stringify:function(g){for(var y=g.words,T=g.sigBytes,S=[],R=0;R<T;R++){var A=y[R>>>2]>>>24-R%4*8&255;S.push((A>>>4).toString(16)),S.push((A&15).toString(16));}return S.join("")},parse:function(g){for(var y=g.length,T=[],S=0;S<y;S+=2)T[S>>>3]|=parseInt(g.substr(S,2),16)<<24-S%8*4;return new l.init(T,y/2)}},d=c.Latin1={stringify:function(g){for(var y=g.words,T=g.sigBytes,S=[],R=0;R<T;R++){var A=y[R>>>2]>>>24-R%4*8&255;S.push(String.fromCharCode(A));}return S.join("")},parse:function(g){for(var y=g.length,T=[],S=0;S<y;S++)T[S>>>2]|=(g.charCodeAt(S)&255)<<24-S%4*8;return new l.init(T,y)}},p=c.Utf8={stringify:function(g){try{return decodeURIComponent(escape(d.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return d.parse(unescape(encodeURIComponent(g)))}},m=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(g){typeof g=="string"&&(g=p.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes;},_process:function(g){var y,T=this._data,S=T.words,R=T.sigBytes,A=this.blockSize,P=A*4,F=R/P;g?F=e.ceil(F):F=e.max((F|0)-this._minBufferSize,0);var O=F*A,L=e.min(O*4,R);if(O){for(var I=0;I<O;I+=A)this._doProcessBlock(S,I);y=S.splice(0,O),T.sigBytes-=L;}return new l.init(y,L)},clone:function(){var g=u.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});a.Hasher=m.extend({cfg:u.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset();},reset:function(){m.reset.call(this),this._doReset();},update:function(g){return this._append(g),this._process(),this},finalize:function(g){g&&this._append(g);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(g){return function(y,T){return new g.init(T).finalize(y)}},_createHmacHelper:function(g){return function(y,T){return new _.HMAC.init(g,T).finalize(y)}}});var _=o.algo={};return o}(Math);return r});});var kR=Fr((q_,IR)=>{(function(r,e){typeof q_=="object"?IR.exports=q_=e(DR()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(q_,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],d=c[1],p=c[2],m=c[3],b=c[4],_=0;_<80;_++){if(_<16)o[_]=u[l+_]|0;else {var g=o[_-3]^o[_-8]^o[_-14]^o[_-16];o[_]=g<<1|g>>>31;}var y=(h<<5|h>>>27)+b+o[_];_<20?y+=(d&p|~d&m)+1518500249:_<40?y+=(d^p^m)+1859775393:_<60?y+=(d&p|d&m|p&m)-1894007588:y+=(d^p^m)-899497514,b=m,m=p,p=d<<30|d>>>2,d=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+p|0,c[3]=c[3]+m|0,c[4]=c[4]+b|0;},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,h=u.sigBytes*8;return l[h>>>5]|=128<<24-h%32,l[(h+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(h+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});Pe();var Si={};Nd(Si,{DistortionFilter:()=>U_,EqualizerFilter:()=>kr,Filter:()=>ct,MonoFilter:()=>L_,ReverbFilter:()=>N_,StereoFilter:()=>H_,StreamFilter:()=>V_,TelephoneFilter:()=>z_});var SR;function ER(r){return SR=r,r}function Te(){return SR}var ct=class{constructor(e,t){this.init(e,t);}init(e,t){this.destination=e,this.source=t||e;}connect(e){this.source?.connect(e);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var U_=class extends ct{constructor(e=0){let t;if(!Te().useLegacy){let{audioContext:i}=Te().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Te().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var at=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Te().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Se=class extends ct{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Se.F32,type:"lowshelf",gain:r},{f:Se.F64,type:"peaking",gain:e},{f:Se.F125,type:"peaking",gain:t},{f:Se.F250,type:"peaking",gain:i},{f:Se.F500,type:"peaking",gain:s},{f:Se.F1K,type:"peaking",gain:n},{f:Se.F2K,type:"peaking",gain:o},{f:Se.F4K,type:"peaking",gain:a},{f:Se.F8K,type:"peaking",gain:u},{f:Se.F16K,type:"highshelf",gain:l}];Te().useLegacy||(c=h.map(d=>{let p=Te().context.audioContext.createBiquadFilter();return p.type=d.type,at.setParamValue(p.Q,1),p.frequency.value=d.f,at.setParamValue(p.gain,d.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let p=this.bands[d];d>0&&this.bands[d-1].connect(p),this.bandsMap[p.frequency.value]=p;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);at.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(Se.F32,r);}get f32(){return this.getGain(Se.F32)}set f64(r){this.setGain(Se.F64,r);}get f64(){return this.getGain(Se.F64)}set f125(r){this.setGain(Se.F125,r);}get f125(){return this.getGain(Se.F125)}set f250(r){this.setGain(Se.F250,r);}get f250(){return this.getGain(Se.F250)}set f500(r){this.setGain(Se.F500,r);}get f500(){return this.getGain(Se.F500)}set f1k(r){this.setGain(Se.F1K,r);}get f1k(){return this.getGain(Se.F1K)}set f2k(r){this.setGain(Se.F2K,r);}get f2k(){return this.getGain(Se.F2K)}set f4k(r){this.setGain(Se.F4K,r);}get f4k(){return this.getGain(Se.F4K)}set f8k(r){this.setGain(Se.F8K,r);}get f8k(){return this.getGain(Se.F8K)}set f16k(r){this.setGain(Se.F16K,r);}get f16k(){return this.getGain(Se.F16K)}reset(){this.bands.forEach(r=>{at.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},kr=Se;kr.F32=32;kr.F64=64;kr.F125=125;kr.F250=250;kr.F500=500;kr.F1K=1e3;kr.F2K=2e3;kr.F4K=4e3;kr.F8K=8e3;kr.F16K=16e3;var L_=class extends ct{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().context;t=i.createChannelSplitter(),e=i.createChannelMerger(),e.connect(t);}super(e,t),this._merger=e;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var N_=class extends ct{constructor(e=3,t=2,i=false){super(null),this._seconds=this._clamp(e,1,50),this._decay=this._clamp(t,0,100),this._reverse=i,this._rebuild();}_clamp(e,t,i){return Math.min(i,Math.max(t,e))}get seconds(){return this._seconds}set seconds(e){this._seconds=this._clamp(e,1,50),this._rebuild();}get decay(){return this._decay}set decay(e){this._decay=this._clamp(e,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(e){this._reverse=e,this._rebuild();}_rebuild(){if(Te().useLegacy)return;let{audioContext:e}=Te().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var H_=class extends ct{constructor(e=0){let t,i,s;if(!Te().useLegacy){let{audioContext:n}=Te().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?at.setParamValue(this._stereo.pan,e):this._panner&&this._panner.setPosition(e,0,1-Math.abs(e));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var V_=class extends ct{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().context;e=i.createMediaStreamDestination(),t=i.createMediaStreamSource(e.stream);}super(e,t),this._stream=e?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var z_=class extends ct{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",at.setParamValue(s.frequency,2e3),n.type="lowpass",at.setParamValue(n.frequency,2e3),o.type="highpass",at.setParamValue(o.frequency,500),a.type="highpass",at.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};Pe();var bd=class extends le{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};Pe();var CF=0,nE=class extends le{constructor(r){super(),this.id=CF++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-nE.PADDING),this._end=Math.min(this._end+nE.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),ve.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){ve.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){ve.shared.remove(this._onUpdate,this),this.removeAllListeners();let r=this._source;r&&(r.onended=null,r.onplay=null,r.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},W_=nE;W_.PADDING=.1;Pe();var yd=class extends le{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new W_(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};Pe();var vd=class{constructor(e,t){this.parent=e,Object.assign(this,t),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(e){return this.parent.play({complete:e,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var sa=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],oE=["audio/mpeg","audio/ogg"],na={};function AR(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;sa.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(na,i);}AR();Pe();Pe();var wF=0,Td=class extends le{constructor(e){super(),this.id=wF++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);at.setParamValue(this._gain.gain,n*s*i),at.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){ve.shared.remove(this._updateListener,this),e&&ve.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var oa=class{constructor(e,t){this._output=t,this._input=e;}get destination(){return this._input}get filters(){return this._filters}set filters(e){if(this._filters&&(this._filters.forEach(t=>{t&&t.disconnect();}),this._filters=null,this._input.connect(this._output)),e&&e.length){this._filters=e.slice(0),this._input.disconnect();let t=null;e.forEach(i=>{t===null?this._input.connect(i.destination):t.connect(i.destination),t=i;}),t.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var CR=class extends oa{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(CR.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let r=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=r.buffer,at.setParamValue(e.playbackRate,r.playbackRate.value),e.loop=r.loop;let t=this.context.audioContext.createGain();return e.connect(t),t.connect(this.destination),{source:e,gain:t}}get bufferSize(){return this.script.bufferSize}},X_=CR;X_.BUFFER_SIZE=0;var aa=class{init(e){this.parent=e,this._nodes=new X_(this.context),this._source=this._nodes.bufferSource,this.source=e.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null,this.source=null;}create(){return new Td(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await W.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var Pl=class{static from(r){let e={};typeof r=="string"?e.url=r:r instanceof ArrayBuffer||r instanceof AudioBuffer||r instanceof HTMLAudioElement?e.source=r:Array.isArray(r)?e.url=r:e=r,e={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...e},Object.freeze(e);let t=Te().useLegacy?new yd:new aa;return new Pl(t,e)}constructor(r,e){this.media=r,this.options=e,this._instances=[],this._sprites={},this.media.init(this);let t=e.complete;this._autoPlayOptions=t?{complete:t}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=Array.isArray(e.url)?this.preferUrl(e.url):e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded);}preferUrl(r){let[e]=r.map(t=>({url:t,ext:De.extname(t).slice(1)})).filter(({ext:t})=>na[t]).sort((t,i)=>sa.indexOf(t.ext)-sa.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Te().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new vd(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(Pl._pool.length>0){let r=Pl._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Pl._pool.indexOf(r)<0&&Pl._pool.push(r);}},an=Pl;an._pool=[];Pe();var wl=class r extends oa{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new le,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var Y_=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new wl),this._htmlAudioContext=new bd,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(e){this.useLegacy||(this._context.filters=e);}get supported(){return wl.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof an)return this._sounds[e]=t,t;let i=this._getOptions(t),s=an.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};Pe();Pe();var PR=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=De.basename(e,De.extname(e))),t},wR={extension:x.Asset,detection:{test:async()=>true,add:async r=>[...r,...sa.filter(e=>na[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[x.LoadParser],priority:Me.High},test(r){let e=De.extname(r).slice(1);return !!na[e]||oE.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>an.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Te().add(PR(e),t),t},async unload(r,e){Te().remove(PR(e));}}};G.add(wR);ER(new Y_);var Sd="repeat";({DistortionFilter:Si.DistortionFilter,EqualizerFilter:Si.EqualizerFilter,MonoFilter:Si.MonoFilter,ReverbFilter:Si.ReverbFilter,StereoFilter:Si.StereoFilter,StreamFilter:Si.StreamFilter,TelephoneFilter:Si.TelephoneFilter});var BR=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],Jr="__game_layer__",Bl="Container",$_="ImageContainer",aE="Image",Rl="Sprite",Ml="Text",uE="Video";var H;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(H||(H={}));function Ut(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw H.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function RR(r){var e;let t={importPixi:false,...r};t.app&&(t.renderer=t.app.renderer,t.stage=t.app.stage),t.importPixi&&!t.pixi&&(t.pixi=await Promise.resolve().then(()=>(Pe(),vR))),window.__PIXI_DEVTOOLS__={...window.__PIXI_DEVTOOLS__||{},app:t.app,stage:t.stage,renderer:t.renderer,extensions:[...((e=window.__PIXI_DEVTOOLS__)==null?void 0:e.extensions)||[],...t.extensions||[]],plugins:{}};}var OR=ga(kR());Pe();var MF={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof we||r instanceof Xt||r instanceof Ne},testProp(r){switch(r){case "xAlign":case "yAlign":case "xPercentagePosition":case "yPercentagePosition":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof we||r instanceof Xt||r instanceof Ne)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "xPercentagePosition":r.xPercentagePosition=t/100;break;case "yPercentagePosition":r.yPercentagePosition=t/100;break}},getProperties(r){return [{value:r.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:r.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:r.xPercentagePosition*100,prop:"xPercentagePosition",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yPercentagePosition*100,prop:"yPercentagePosition",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},FR=MF;function DF(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var X=class X{constructor(){}static get app(){if(!X._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return X._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(Jr);return e||(e=new ie,e.label=Jr,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return X.canvasWidth=t,X.canvasHeight=i,X._app=new Ih,X.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=X.app,extensions:a=[],...u}=n||{};RR({app:o,extensions:[FR,...a],...u}),X._isInitialized=true,X.addCanvasIntoHTMLElement(e),window.addEventListener("resize",X.resize),X.resize(),X.gameLayer;})}static addCanvasIntoHTMLElement(e){X._isInitialized?e.appendChild(X.app.canvas):H.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return X.htmlLayers.push(s),X.resize(),n}static removeHtmlLayer(e){let t=X.htmlLayers.find(i=>i.id===e);t&&(t.remove(),X.htmlLayers=X.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return X.htmlLayers.find(t=>t.id===e)}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/X.canvasWidth,t/X.canvasHeight)}static get screenWidth(){return Math.floor(X.screenScale*X.canvasWidth)}static get screenHeight(){return Math.floor(X.screenScale*X.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-X.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-X.screenHeight)/2}static async resize(){await DF(async()=>{if(X._isInitialized){let i=X.app.canvas.style;i.width=`${X.screenWidth}px`,i.height=`${X.screenHeight}px`,i.marginLeft=`${X.horizontalMargin}px`,i.marginRight=`${X.horizontalMargin}px`,i.marginTop=`${X.verticalMargin}px`,i.marginBottom=`${X.verticalMargin}px`;}let t=X.htmlLayers.map(i=>{i.style.width=`${X.screenWidth}px`,i.style.height=`${X.screenHeight}px`,i.style.marginLeft=`${X.horizontalMargin}px`,i.style.marginRight=`${X.horizontalMargin}px`,i.style.marginTop=`${X.verticalMargin}px`,i.style.marginBottom=`${X.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return X.gameLayer.children.filter(e=>e.label).sort((e,t)=>X.gameLayer.getChildIndex(e)-X.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(X._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static generateTickerId(e){try{return (0,OR.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),X._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),X._currentTickersTimeouts[e]&&delete X._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),X.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(X._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&X.removeTickerTimeout(i);}else X._currentTickersTimeouts[i].aliases=n;});}};N(X,"_app"),N(X,"htmlLayers",[]),N(X,"canvasWidth",300),N(X,"canvasHeight",300),N(X,"_isInitialized",false),N(X,"_currentTickers",{}),N(X,"_currentTickersSequence",{}),N(X,"_currentTickersTimeouts",{}),N(X,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),N(X,"_tickersOnPause",{});var B=X;Pe();var Dl=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,NR=new Set,lE=typeof process=="object"&&process?process:{},HR=(r,e,t,i)=>{typeof lE.emitWarning=="function"?lE.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},Q_=globalThis.AbortController,GR=globalThis.AbortSignal;if(typeof Q_>"u"){GR=class{constructor(){N(this,"onabort");N(this,"_onabort",[]);N(this,"reason");N(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Q_=class{constructor(){N(this,"signal",new GR);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=lE.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,HR("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var IF=r=>!NR.has(r),un=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),VR=r=>un(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Il:null:null,Il=class extends Array{constructor(e){super(e),this.fill(0);}},kl,ua=class ua{constructor(e,t){N(this,"heap");N(this,"length");if(!v(ua,kl))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=VR(e);if(!t)return [];q(ua,kl,true);let i=new ua(e,t);return q(ua,kl,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};kl=new WeakMap,me(ua,kl,false);var cE=ua,UR,LR,ei,fr,ti,la,ri,Fl,Ol,ht,ii,ut,Ve,ne,Yt,pr,Lt,bt,si,yt,ni,oi,mr,ai,dn,$t,Gl,U,hE,ca,Ki,Ad,gr,zR,ha,Ul,Cd,ln,cn,dE,K_,Z_,He,fE,Ed,hn,pE,mE=class mE{constructor(e){me(this,U);me(this,ei);me(this,fr);me(this,ti);me(this,la);me(this,ri);me(this,Fl);me(this,Ol);N(this,"ttl");N(this,"ttlResolution");N(this,"ttlAutopurge");N(this,"updateAgeOnGet");N(this,"updateAgeOnHas");N(this,"allowStale");N(this,"noDisposeOnSet");N(this,"noUpdateTTL");N(this,"maxEntrySize");N(this,"sizeCalculation");N(this,"noDeleteOnFetchRejection");N(this,"noDeleteOnStaleGet");N(this,"allowStaleOnFetchAbort");N(this,"allowStaleOnFetchRejection");N(this,"ignoreFetchAbort");me(this,ht);me(this,ii);me(this,ut);me(this,Ve);me(this,ne);me(this,Yt);me(this,pr);me(this,Lt);me(this,bt);me(this,si);me(this,yt);me(this,ni);me(this,oi);me(this,mr);me(this,ai);me(this,dn);me(this,$t);me(this,Gl);me(this,ca,()=>{});me(this,Ki,()=>{});me(this,Ad,()=>{});me(this,gr,()=>false);me(this,ha,e=>{});me(this,Ul,(e,t,i)=>{});me(this,Cd,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});N(this,UR,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:p,maxSize:m=0,maxEntrySize:b=0,sizeCalculation:_,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:A,ignoreFetchAbort:P}=e;if(t!==0&&!un(t))throw new TypeError("max option must be a nonnegative integer");let F=t?VR(t):Array;if(!F)throw new Error("invalid max value: "+t);if(q(this,ei,t),q(this,fr,m),this.maxEntrySize=b||v(this,fr),this.sizeCalculation=_,this.sizeCalculation){if(!v(this,fr)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(q(this,Ol,y),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(q(this,Fl,g),q(this,dn,!!g),q(this,ut,new Map),q(this,Ve,new Array(t).fill(void 0)),q(this,ne,new Array(t).fill(void 0)),q(this,Yt,new F(t)),q(this,pr,new F(t)),q(this,Lt,0),q(this,bt,0),q(this,si,cE.create(t)),q(this,ht,0),q(this,ii,0),typeof l=="function"&&q(this,ti,l),typeof c=="function"&&q(this,la,c),typeof h=="function"?(q(this,ri,h),q(this,yt,[])):(q(this,ri,void 0),q(this,yt,void 0)),q(this,ai,!!v(this,ti)),q(this,Gl,!!v(this,la)),q(this,$t,!!v(this,ri)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(v(this,fr)!==0&&!un(v(this,fr)))throw new TypeError("maxSize must be a positive integer if specified");if(!un(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Y(this,U,zR).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=un(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!un(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Y(this,U,hE).call(this);}if(v(this,ei)===0&&this.ttl===0&&v(this,fr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!v(this,ei)&&!v(this,fr)){let O="LRU_CACHE_UNBOUNDED";IF(O)&&(NR.add(O),HR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,mE));}}static unsafeExposeInternals(e){return {starts:v(e,oi),ttls:v(e,mr),sizes:v(e,ni),keyMap:v(e,ut),keyList:v(e,Ve),valList:v(e,ne),next:v(e,Yt),prev:v(e,pr),get head(){return v(e,Lt)},get tail(){return v(e,bt)},free:v(e,si),isBackgroundFetch:t=>{var i;return Y(i=e,U,He).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return Y(o=e,U,Z_).call(o,t,i,s,n)},moveToTail:t=>{var i;return Y(i=e,U,Ed).call(i,t)},indexes:t=>{var i;return Y(i=e,U,ln).call(i,t)},rindexes:t=>{var i;return Y(i=e,U,cn).call(i,t)},isStale:t=>{var i;return v(i=e,gr).call(i,t)}}}get max(){return v(this,ei)}get maxSize(){return v(this,fr)}get calculatedSize(){return v(this,ii)}get size(){return v(this,ht)}get fetchMethod(){return v(this,Fl)}get memoMethod(){return v(this,Ol)}get dispose(){return v(this,ti)}get onInsert(){return v(this,la)}get disposeAfter(){return v(this,ri)}getRemainingTTL(e){return v(this,ut).has(e)?1/0:0}*entries(){for(let e of Y(this,U,ln).call(this))v(this,ne)[e]!==void 0&&v(this,Ve)[e]!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield [v(this,Ve)[e],v(this,ne)[e]]);}*rentries(){for(let e of Y(this,U,cn).call(this))v(this,ne)[e]!==void 0&&v(this,Ve)[e]!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield [v(this,Ve)[e],v(this,ne)[e]]);}*keys(){for(let e of Y(this,U,ln).call(this)){let t=v(this,Ve)[e];t!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield t);}}*rkeys(){for(let e of Y(this,U,cn).call(this)){let t=v(this,Ve)[e];t!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield t);}}*values(){for(let e of Y(this,U,ln).call(this))v(this,ne)[e]!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield v(this,ne)[e]);}*rvalues(){for(let e of Y(this,U,cn).call(this))v(this,ne)[e]!==void 0&&!Y(this,U,He).call(this,v(this,ne)[e])&&(yield v(this,ne)[e]);}[(LR=Symbol.iterator,UR=Symbol.toStringTag,LR)](){return this.entries()}find(e,t={}){for(let i of Y(this,U,ln).call(this)){let s=v(this,ne)[i],n=Y(this,U,He).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,v(this,Ve)[i],this))return this.get(v(this,Ve)[i],t)}}forEach(e,t=this){for(let i of Y(this,U,ln).call(this)){let s=v(this,ne)[i],n=Y(this,U,He).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,Ve)[i],this);}}rforEach(e,t=this){for(let i of Y(this,U,cn).call(this)){let s=v(this,ne)[i],n=Y(this,U,He).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,Ve)[i],this);}}purgeStale(){let e=false;for(let t of Y(this,U,cn).call(this,{allowStale:true}))v(this,gr).call(this,t)&&(Y(this,U,hn).call(this,v(this,Ve)[t],"expire"),e=true);return e}info(e){let t=v(this,ut).get(e);if(t===void 0)return;let i=v(this,ne)[t],s=Y(this,U,He).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(v(this,mr)&&v(this,oi)){let o=v(this,mr)[t],a=v(this,oi)[t];if(o&&a){let u=o-(Dl.now()-a);n.ttl=u,n.start=Date.now();}}return v(this,ni)&&(n.size=v(this,ni)[t]),n}dump(){let e=[];for(let t of Y(this,U,ln).call(this,{allowStale:true})){let i=v(this,Ve)[t],s=v(this,ne)[t],n=Y(this,U,He).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(v(this,mr)&&v(this,oi)){o.ttl=v(this,mr)[t];let a=Dl.now()-v(this,oi)[t];o.start=Math.floor(Date.now()-a);}v(this,ni)&&(o.size=v(this,ni)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=Dl.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,p,m,b;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=v(this,Cd).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),Y(this,U,hn).call(this,e,"set"),this;let h=v(this,ht)===0?void 0:v(this,ut).get(e);if(h===void 0)h=v(this,ht)===0?v(this,bt):v(this,si).length!==0?v(this,si).pop():v(this,ht)===v(this,ei)?Y(this,U,K_).call(this,false):v(this,ht),v(this,Ve)[h]=e,v(this,ne)[h]=t,v(this,ut).set(e,h),v(this,Yt)[v(this,bt)]=h,v(this,pr)[h]=v(this,bt),q(this,bt,h),Hd(this,ht)._++,v(this,Ul).call(this,h,c,u),u&&(u.set="add"),l=false,v(this,Gl)&&((d=v(this,la))==null||d.call(this,t,e,"add"));else {Y(this,U,Ed).call(this,h);let _=v(this,ne)[h];if(t!==_){if(v(this,dn)&&Y(this,U,He).call(this,_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=_;g!==void 0&&!o&&(v(this,ai)&&((p=v(this,ti))==null||p.call(this,g,e,"set")),v(this,$t)&&v(this,yt)?.push([g,e,"set"]));}else o||(v(this,ai)&&((m=v(this,ti))==null||m.call(this,_,e,"set")),v(this,$t)&&v(this,yt)?.push([_,e,"set"]));if(v(this,ha).call(this,h),v(this,Ul).call(this,h,c,u),v(this,ne)[h]=t,u){u.set="replace";let g=_&&Y(this,U,He).call(this,_)?_.__staleWhileFetching:_;g!==void 0&&(u.oldValue=g);}}else u&&(u.set="update");v(this,Gl)&&this.onInsert?.(t,e,t===_?"update":"replace");}if(s!==0&&!v(this,mr)&&Y(this,U,hE).call(this),v(this,mr)&&(l||v(this,Ad).call(this,h,s,n),u&&v(this,Ki).call(this,u,h)),!o&&v(this,$t)&&v(this,yt)){let _=v(this,yt),g;for(;g=_?.shift();)(b=v(this,ri))==null||b.call(this,...g);}return this}pop(){var e;try{for(;v(this,ht);){let t=v(this,ne)[v(this,Lt)];if(Y(this,U,K_).call(this,!0),Y(this,U,He).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(v(this,$t)&&v(this,yt)){let t=v(this,yt),i;for(;i=t?.shift();)(e=v(this,ri))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=v(this,ut).get(e);if(n!==void 0){let o=v(this,ne)[n];if(Y(this,U,He).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(v(this,gr).call(this,n))s&&(s.has="stale",v(this,Ki).call(this,s,n));else return i&&v(this,ca).call(this,n),s&&(s.has="hit",v(this,Ki).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=v(this,ut).get(e);if(s===void 0||!i&&v(this,gr).call(this,s))return;let n=v(this,ne)[s];return Y(this,U,He).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:b,forceRefresh:_=false,status:g,signal:y}=t;if(!v(this,dn))return g&&(g.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});let T={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:p,status:g,signal:y},S=v(this,ut).get(e);if(S===void 0){g&&(g.fetch="miss");let R=Y(this,U,Z_).call(this,e,S,T,b);return R.__returned=R}else {let R=v(this,ne)[S];if(Y(this,U,He).call(this,R)){let L=i&&R.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",L&&(g.returnedStale=true)),L?R.__staleWhileFetching:R.__returned=R}let A=v(this,gr).call(this,S);if(!_&&!A)return g&&(g.fetch="hit"),Y(this,U,Ed).call(this,S),s&&v(this,ca).call(this,S),g&&v(this,Ki).call(this,g,S),R;let P=Y(this,U,Z_).call(this,e,S,T,b),O=P.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=A?"stale":"refresh",O&&A&&(g.returnedStale=true)),O?P.__staleWhileFetching:P.__returned=P}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=v(this,Ol);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=v(this,ut).get(e);if(a!==void 0){let u=v(this,ne)[a],l=Y(this,U,He).call(this,u);return o&&v(this,Ki).call(this,o,a),v(this,gr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||Y(this,U,hn).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(Y(this,U,Ed).call(this,a),s&&v(this,ca).call(this,a),u))}else o&&(o.get="miss");}delete(e){return Y(this,U,hn).call(this,e,"delete")}clear(){return Y(this,U,pE).call(this,"delete")}};ei=new WeakMap,fr=new WeakMap,ti=new WeakMap,la=new WeakMap,ri=new WeakMap,Fl=new WeakMap,Ol=new WeakMap,ht=new WeakMap,ii=new WeakMap,ut=new WeakMap,Ve=new WeakMap,ne=new WeakMap,Yt=new WeakMap,pr=new WeakMap,Lt=new WeakMap,bt=new WeakMap,si=new WeakMap,yt=new WeakMap,ni=new WeakMap,oi=new WeakMap,mr=new WeakMap,ai=new WeakMap,dn=new WeakMap,$t=new WeakMap,Gl=new WeakMap,U=new WeakSet,hE=function(){let e=new Il(v(this,ei)),t=new Il(v(this,ei));q(this,mr,e),q(this,oi,t),q(this,Ad,(n,o,a=Dl.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{v(this,gr).call(this,n)&&Y(this,U,hn).call(this,v(this,Ve)[n],"expire");},o+1);u.unref&&u.unref();}}),q(this,ca,n=>{t[n]=e[n]!==0?Dl.now():0;}),q(this,Ki,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=Dl.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=v(this,ut).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},q(this,gr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},ca=new WeakMap,Ki=new WeakMap,Ad=new WeakMap,gr=new WeakMap,zR=function(){let e=new Il(v(this,ei));q(this,ii,0),q(this,ni,e),q(this,ha,t=>{q(this,ii,v(this,ii)-e[t]),e[t]=0;}),q(this,Cd,(t,i,s,n)=>{if(Y(this,U,He).call(this,i))return 0;if(!un(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!un(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),q(this,Ul,(t,i,s)=>{if(e[t]=i,v(this,fr)){let n=v(this,fr)-e[t];for(;v(this,ii)>n;)Y(this,U,K_).call(this,true);}q(this,ii,v(this,ii)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=v(this,ii));});},ha=new WeakMap,Ul=new WeakMap,Cd=new WeakMap,ln=function*({allowStale:e=this.allowStale}={}){if(v(this,ht))for(let t=v(this,bt);!(!Y(this,U,dE).call(this,t)||((e||!v(this,gr).call(this,t))&&(yield t),t===v(this,Lt)));)t=v(this,pr)[t];},cn=function*({allowStale:e=this.allowStale}={}){if(v(this,ht))for(let t=v(this,Lt);!(!Y(this,U,dE).call(this,t)||((e||!v(this,gr).call(this,t))&&(yield t),t===v(this,bt)));)t=v(this,Yt)[t];},dE=function(e){return e!==void 0&&v(this,ut).get(v(this,Ve)[e])===e},K_=function(e){var n;let t=v(this,Lt),i=v(this,Ve)[t],s=v(this,ne)[t];return v(this,dn)&&Y(this,U,He).call(this,s)?s.__abortController.abort(new Error("evicted")):(v(this,ai)||v(this,$t))&&(v(this,ai)&&((n=v(this,ti))==null||n.call(this,s,i,"evict")),v(this,$t)&&v(this,yt)?.push([s,i,"evict"])),v(this,ha).call(this,t),e&&(v(this,Ve)[t]=void 0,v(this,ne)[t]=void 0,v(this,si).push(t)),v(this,ht)===1?(q(this,Lt,q(this,bt,0)),v(this,si).length=0):q(this,Lt,v(this,Yt)[t]),v(this,ut).delete(i),Hd(this,ht)._--,t},Z_=function(e,t,i,s){let n=t===void 0?void 0:v(this,ne)[t];if(Y(this,U,He).call(this,n))return n;let o=new Q_,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(b,_=false)=>{let{aborted:g}=o.signal,y=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(g&&!_?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),g&&!y&&!_)return h(o.signal.reason);let T=p;return v(this,ne)[t]===p&&(b===void 0?T.__staleWhileFetching?v(this,ne)[t]=T.__staleWhileFetching:Y(this,U,hn).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,b,u.options))),b},c=b=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=b),h(b)),h=b=>{let{aborted:_}=o.signal,g=_&&i.allowStaleOnFetchAbort,y=g||i.allowStaleOnFetchRejection,T=y||i.noDeleteOnFetchRejection,S=p;if(v(this,ne)[t]===p&&(!T||S.__staleWhileFetching===void 0?Y(this,U,hn).call(this,e,"fetch"):g||(v(this,ne)[t]=S.__staleWhileFetching)),y)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw b},d=(b,_)=>{var y;let g=(y=v(this,Fl))==null?void 0:y.call(this,e,n,u);g&&g instanceof Promise&&g.then(T=>b(T===void 0?void 0:T),_),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=T=>l(T,true)));});};i.status&&(i.status.fetchDispatched=true);let p=new Promise(d).then(l,c),m=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,m,{...u.options,status:void 0}),t=v(this,ut).get(e)):v(this,ne)[t]=m,m},He=function(e){if(!v(this,dn))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Q_},fE=function(e,t){v(this,pr)[t]=e,v(this,Yt)[e]=t;},Ed=function(e){e!==v(this,bt)&&(e===v(this,Lt)?q(this,Lt,v(this,Yt)[e]):Y(this,U,fE).call(this,v(this,pr)[e],v(this,Yt)[e]),Y(this,U,fE).call(this,v(this,bt),e),q(this,bt,e));},hn=function(e,t){var s,n;let i=false;if(v(this,ht)!==0){let o=v(this,ut).get(e);if(o!==void 0)if(i=true,v(this,ht)===1)Y(this,U,pE).call(this,t);else {v(this,ha).call(this,o);let a=v(this,ne)[o];if(Y(this,U,He).call(this,a)?a.__abortController.abort(new Error("deleted")):(v(this,ai)||v(this,$t))&&(v(this,ai)&&((s=v(this,ti))==null||s.call(this,a,e,t)),v(this,$t)&&v(this,yt)?.push([a,e,t])),v(this,ut).delete(e),v(this,Ve)[o]=void 0,v(this,ne)[o]=void 0,o===v(this,bt))q(this,bt,v(this,pr)[o]);else if(o===v(this,Lt))q(this,Lt,v(this,Yt)[o]);else {let u=v(this,pr)[o];v(this,Yt)[u]=v(this,Yt)[o];let l=v(this,Yt)[o];v(this,pr)[l]=v(this,pr)[o];}Hd(this,ht)._--,v(this,si).push(o);}}if(v(this,$t)&&v(this,yt)?.length){let o=v(this,yt),a;for(;a=o?.shift();)(n=v(this,ri))==null||n.call(this,...a);}return i},pE=function(e){var t,i;for(let s of Y(this,U,cn).call(this,{allowStale:true})){let n=v(this,ne)[s];if(Y(this,U,He).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=v(this,Ve)[s];v(this,ai)&&((t=v(this,ti))==null||t.call(this,n,o,e)),v(this,$t)&&v(this,yt)?.push([n,o,e]);}}if(v(this,ut).clear(),v(this,ne).fill(void 0),v(this,Ve).fill(void 0),v(this,mr)&&v(this,oi)&&(v(this,mr).fill(0),v(this,oi).fill(0)),v(this,ni)&&v(this,ni).fill(0),q(this,Lt,0),q(this,bt,0),v(this,si).length=0,q(this,ii,0),q(this,ht,0),v(this,$t)&&v(this,yt)){let s=v(this,yt),n;for(;n=s?.shift();)(i=v(this,ri))==null||i.call(this,...n);}};var J_=mE;var Ei=class{constructor(e){N(this,"cache");N(this,"map",new Map);this.cache=new J_({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Pd=new Ei({cacheSize:5});function kF(r){return function(e){eb.add(e,r);}}var eb;(s=>{function r(n,o){o||(o=n.name),Pd.get(o)&&H.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Pd.set(o,n);}s.add=r;function e(n){try{let o=Pd.get(n);if(!o){H.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){H.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Pd.values())}s.values=t;function i(n){return Pd.has(n)}s.has=i;})(eb||(eb={}));var jt=eb;var Ll=new Ei({cacheSize:5});function FF(r){return function(e){tb.add(e,r);}}var tb;(n=>{function r(o,a){a||(a=o.name),Ll.get(a)&&H.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,Ll.set(a,o);}n.add=r;function e(o){try{let a=Ll.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=Ll.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(Ll.values())}n.values=i;function s(o){return Ll.has(o)}n.has=s;})(tb||(tb={}));var Zi=tb;async function rb(r){let e=OF(r.pixivnId);if(e)await e.setMemory(r);else throw new Error("[Pixi\u2019VN] The element "+r.pixivnId+" could not be created");return e}function OF(r){try{let e=jt.get(r);return e?new e:void 0}catch(e){H.error(`Error while getting CanvasElement ${r}`,e);return}}Pe();function gE(r){return "memory"in r?r.memory:r instanceof Ir?xE(r):r instanceof Ee?wd(r):da(r)}function GF(r){return {width:r.width,height:r.height,isRenderGroup:r.isRenderGroup,blendMode:r.blendMode,tint:r.tint,alpha:r.alpha,angle:r.angle,renderable:r.renderable,rotation:r.rotation,scale:{x:r.scale.x,y:r.scale.y},pivot:{x:r.pivot.x,y:r.pivot.y},position:{x:r.position.x,y:r.position.y},skew:{x:r.skew.x,y:r.skew.y},visible:r.visible,x:r.x,y:r.y,boundsArea:r.boundsArea,cursor:r.cursor,eventMode:r.eventMode,interactive:r.interactive,interactiveChildren:r.interactiveChildren,hitArea:r.hitArea}}function WR(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function da(r,e){let t=UF(r,Bl),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>gE(n)):[];return {pixivnId:t,elements:s,...GF(r)}}function wd(r){let e=da(r),t=e.pixivnId??Rl,i=YR(r),s="textureAlias"in r?WR(r.texture,r.textureAlias):WR(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function xE(r){let e=da(r),t=e.pixivnId??Ml,i=YR(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:LF(r.style),roundPixels:r.roundPixels,onEvents:i}}function UF(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function YR(r){return "onEvents"in r?r.onEvents:{}}function XR(r,e){if(typeof r!="object"||r===null)return r;H.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function LF(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:XR(r.stroke,"fill"),fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontVariant:r.fontVariant,fontWeight:r.fontWeight,leading:r.leading,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,padding:r.padding,stroke:XR(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var fa=class extends ie{constructor(t){super(t);N(this,"pixivnId",Bl);N(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Bl;}get memory(){return da(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await Ai(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await rb(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Zi.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};jt.add(fa,Bl);async function Ai(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}Pe();var Bd=class Bd{static init(e){Bd._getScreen=e.getScreen;}static get screen(){return Bd._getScreen()}};N(Bd,"_getScreen");var sr=Bd;function Qi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(sr.screen.width-t)+i+n*t+(s?t:0):e*(sr.screen.height-t)+i+n*t+(s?t:0)}function Ci(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(sr.screen.width-t):(e-i-n*t-(s?t:0))/(sr.screen.height-t)}function Ji(r,e){return r==="width"?e*sr.screen.width:e*sr.screen.height}function Pi(r,e){return r==="width"?e/sr.screen.width:e/sr.screen.height}function it(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i-r.y*s,y:r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*s-r.x*i,y:r.y*i-r.x*s}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i+r.y*s,y:-r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*s-r.x*i,y:-r.y*i-r.x*s}}return {x:0,y:0}}function _E(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function wi(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?e:i===90||i===270?t:Math.abs(e*Math.cos(i*Math.PI/180))+Math.abs(t*Math.sin(i*Math.PI/180))}function Bi(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?t:i===90||i===270?e:Math.abs(t*Math.cos(i*Math.PI/180))+Math.abs(e*Math.sin(i*Math.PI/180))}Pe();var NF=new RegExp(`(${BR.join("|")})$`);function Rd(r){let e=tt.cache.has(r)?tt.get(r):null;return e instanceof C&&(r=e.source?.label||r),NF.test(r)}function pa(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===void 0?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===void 0?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.xPercentagePosition},delete r.xPercentagePosition):(r.percentagePosition.x=r.xPercentagePosition,delete r.xPercentagePosition)),r.yPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.yPercentagePosition},delete r.yPercentagePosition):(r.percentagePosition.y=r.yPercentagePosition,delete r.yPercentagePosition))),r)}Pe();Pe();async function Ri(r){if(r!=="EMPTY"){if(!r){H.error("Texture not found",r);return}if(tt.cache.has(r)){let e=tt.get(r);if(e)return e}return tt.load(r).then(e=>{if(!e){H.error("Texture not found",r);return}if(!(e instanceof C)){H.error("File not is a file",r);return}return e}).catch(e=>{H.error("Error loading file",e);})}}Pe();var es=class r extends Ee{constructor(t){super(t);N(this,"pixivnId",Rl);N(this,"_textureAlias");N(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Rl;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return wd(this)}set memory(t){}async setMemory(t){return this.memory=t,await Md(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Zi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}};jt.add(es,Rl);async function Md(r,e,t){let i=t?.ignoreTexture||false;if(await Ai(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await Ri(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&tt.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await Ri(n);o&&(r.texture=o);}}let s=t?.half;if(s&&await s(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=Zi.get(o);a&&r.onEvent(n,a);}}var we=class r extends es{constructor(t,i){t=pa(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);N(this,"pixivnId",aE);N(this,"_loadIsStarted",false);N(this,"_align");N(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...wd(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Dd(this,t),this.reloadPosition();}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Ri(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,H.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return {x:Ci("width",this.x,wi(this),t.x,i.x<0,this.anchor.x),y:Ci("height",this.y,Bi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return Ci("width",this.x,wi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return Ci("height",this.y,Bi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Pi("width",this.x),y:Pi("height",this.y)}}get xPercentagePosition(){return Pi("width",this.x)}set xPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get yPercentagePosition(){return Pi("height",this.y)}set yPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);this._align.x!==void 0&&(super.x=Qi("width",this._align.x,wi(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=Qi("height",this._align.y,Bi(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Ji("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Ji("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};jt.add(we,aE);async function Dd(r,e,t){let i=t?.ignoreTexture||false;return e=pa(e),await Md(r,e,{half:async()=>{"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();},ignoreTexture:t?.ignoreTexture})}Pe();var Xt=class r extends we{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);N(this,"pixivnId",uE);N(this,"_looop",false);N(this,"_paused",false);N(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await bE(this,t)}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};jt.add(Xt,uE);async function bE(r,e,t){await Dd(r,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(r.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(r.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(r.paused=e.paused);}var Ne=class extends fa{constructor(t,i=[]){t=pa(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);N(this,"pixivnId",$_);N(this,"_loadIsStarted",false);N(this,"_anchor");N(this,"_align");N(this,"_percentagePosition");t=pa(t),i&&i.forEach(a=>{let u;Rd(a)?u=new Xt(void 0,a):u=new we(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:$_,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await yE(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,H.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new C}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return {x:Ci("width",this.x,wi(this),t.x,i.x<0,this.anchor.x),y:Ci("height",this.y,Bi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return Ci("width",this.x,wi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);return Ci("height",this.y,Bi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Pi("width",this.x),y:Pi("height",this.y)}}set xPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get xPercentagePosition(){return Pi("width",this.x)}set yPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get yPercentagePosition(){return Pi("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=it(this.pivot,this.angle),i=it(this.scale,this.angle);this._align.x!==void 0&&(super.x=Qi("width",this._align.x,wi(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=Qi("height",this._align.y,Bi(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Ji("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Ji("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};jt.add(Ne,$_);async function yE(r,e,t){e=pa(e),Ai(r,e,{...t,end:async()=>{"anchor"in e&&e.anchor!==void 0&&(r.anchor=e.anchor),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}Pe();var ma=class extends Ir{constructor(t){super(t);N(this,"pixivnId",Ml);N(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Ml;}get memory(){return xE(this)}set memory(t){}async setMemory(t){return this.memory=t,await vE(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Zi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};jt.add(ma,Ml);async function vE(r,e){if(await Ai(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=Zi.get(i);s&&r.onEvent(t,s);}}var nr=class{constructor(e,t,i){N(this,"id","ticker_id_not_set");N(this,"args");N(this,"duration");N(this,"priority");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}fn(e,t,i,s){throw new Error("[Pixi\u2019VN] The method TickerBase.fn() must be overridden")}onEndOfTicker(e,t,i){let s="aliasToRemoveAfter"in i&&i.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in i&&i.tickerAliasToResume||[];typeof n=="string"&&(n=[n]),w.onEndOfTicker(t,{aliasToRemoveAfter:s,tickerAliasToResume:n});}};var Nl=new Ei({cacheSize:5});function HF(r){return function(e){ib.add(e,r);}}var ib;(n=>{function r(o,a){a||(a=o.name),Nl.get(a)&&H.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,Nl.set(a,o);}n.add=r;function e(o){try{let a=Nl.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=Nl.get(o);if(!c){H.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){H.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(Nl.values())}n.values=i;function s(o){return Nl.has(o)}n.has=s;})(ib||(ib={}));var or=ib;var Hl="aliasToRemoveAfter";var Id=class{get app(){return B.app}get gameLayer(){return B.gameLayer}get isInitialized(){return B._isInitialized}get htmlLayout(){return B.htmlLayers[0]}set htmlLayout(e){this.addHtmlLayer("ui",e);}get canvasWidth(){return B.canvasWidth}get canvasHeight(){return B.canvasHeight}set canvasWidth(e){B.canvasWidth=e;}set canvasHeight(e){B.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await B.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await B.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){this.addHtmlLayer("ui",e);}get children(){return B.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {H.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {H.error(`Canvas element ${e} not found`);return}}e instanceof ie&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof Xt?await bE(t,e,{ignoreTexture:true}):t instanceof we?await Dd(t,e,{ignoreTexture:true}):t instanceof es?await Md(t,e,{ignoreTexture:true}):t instanceof ma?await vE(t,e):t instanceof Ne?await yE(t,e):t instanceof ie&&await Ai(t,e);}transferTickers(e,t,i="move"){B._currentTickersSequence[e]&&(i==="move"?B._currentTickersSequence[t]=Ut(B._currentTickersSequence[e]):i==="duplicate"&&(B._currentTickersSequence[t]=Ut(B._currentTickersSequence[e]))),Object.entries(B._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.canvasElementAliases.includes(e)&&(i==="move"?n.canvasElementAliases=n.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&n.canvasElementAliases.find(o=>o===e)&&n.canvasElementAliases.push(t),n.args.hasOwnProperty(Hl))){let o=n.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?n.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(n.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(B._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),B._currentTickersSequence[t]&&Object.keys(B._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&B._currentTickersSequence[e]&&Object.keys(B._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===Jr){H.error(`The alias ${Jr} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?H.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===Jr){H.error(`The alias ${Jr} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}find(e){if(e===Jr)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren(),this.removeAllTickers();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return B._currentTickers}get currentTickersSteps(){return B._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!or.getInstance(i,t.args,t.duration,t.priority)){H.error(`Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:Ut(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=B.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{B.removeTickerTimeoutInfo(o),B._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:Hl in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);B.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){B._currentTickers[e]=t,t.fn=s=>{let n=B._currentTickers[e];if(n){let o=n.canvasElementAliases;if(t.createdByTicketSteps){if(this.isTickerPaused(t.createdByTicketSteps.canvasElementAlias,t.createdByTicketSteps.id))return}else o=o.filter(a=>!this.isTickerPaused(a,e));i?.fn(s,n.args,o,e);}},this.app.ticker.add(t.fn,void 0,t.priority);}pushEndOfTicker(e,t,i){t.onEndOfTicker=()=>{i.onEndOfTicker(t.canvasElementAliases,e,t.args);};}addTickersSequence(e,t,i=0){if(t.length==0){H.warn("The steps of the tickers is empty");return}e in B._currentTickersSequence||(B._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Sd||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:Ut(o.args),duration:o.duration})},n=B.generateTickerId(s);return B._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!B._currentTickersSequence[e]||!B._currentTickersSequence[e][t])return;let i=B._currentTickersSequence[e][t].steps[B._currentTickersSequence[e][t].currentStepNumber];if(i===Sd&&(i=B._currentTickersSequence[e][t].steps[0],B._currentTickersSequence[e][t].currentStepNumber=0,i===Sd)){H.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=B._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),B.removeTickerTimeoutInfo(u);},i.duration*1e3);B.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=or.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){H.error(`Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:Ut(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=B.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=B._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Hl in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),B.removeTickerTimeoutInfo(u);},s.duration*1e3);B.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(B._currentTickersSequence[e]&&B._currentTickersSequence[e][t]){let i=B._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,B._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&B._currentTickersSequence[e]&&B._currentTickersSequence[e][t]&&(delete B._currentTickersSequence[e][t],Object.entries(B._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=B._currentTickers[e],s=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!s&&i.duration==null&&i.createdByTicketSteps&&this.nextTickerStep(i.createdByTicketSteps.canvasElementAlias,i.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(B._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),B._currentTickersSequence[s]&&delete B._currentTickersSequence[s],B.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof nr?i=t.id:i=t.prototype.id,e.forEach(s=>{B._currentTickersSequence[s]&&Object.entries(B._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete B._currentTickersSequence[s][n];});}),Object.entries(B._currentTickers).forEach(([s,n])=>{n.id===i&&(B._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(B._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(B._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(B._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Hl in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(B._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete B._currentTickersSequence[e];}),Object.entries(B._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&B.removeTickerTimeout(e);});}removeAllTickers(){B._currentTickersSequence={},Object.keys(B._currentTickers).forEach(e=>{this.removeTicker(e);}),B._currentTickers={};for(let e in B._currentTickersTimeouts)B.removeTickerTimeout(e);B._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},B._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=B._currentTickers[t];if(i){if(i.args.hasOwnProperty(Hl)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete B._currentTickers[t];}});}pauseTicker(e,t={}){let i=B._tickersOnPause[e];if(!i){B._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?B._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:B._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?B._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:B._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete B._tickersOnPause[t];});}isTickerPaused(e,t){let i=B._tickersOnPause[e];if(i){if(t){if("tickerIdsIncluded"in i&&i.tickerIdsIncluded)return i.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in i&&i.tickerIdsExcluded)return !i.tickerIdsExcluded.includes(t)}return true}return false}completeTickerOnStepEnd(e){e.alias?B._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):B._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=B._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Sd)?H.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(s=>{if(typeof s=="object"&&"ticker"in s){let n=or.getInstance(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=B._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===Jr){H.error(`The alias ${Jr} is reserved`);return}return t.label=e,B.app.stage.addChild(t)}getLayer(e){return B.app.stage.getChildByLabel(e)}removeLayer(e){B.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return B.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return B.removeHtmlLayer(e)}getHtmlLayer(e){return B.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=gE(t));}),{tickers:Ut(B.currentTickersWithoutCreatedBySteps),tickersSteps:Ut(B._currentTickersSequence),elements:Ut(e),stage:Ut(da(this.gameLayer)),elementAliasesOrder:Ut(B.childrenAliasesOrder),tickersOnPause:Ut(B._tickersOnPause),tickersToCompleteOnStepEnd:Ut(B._tickersToCompleteOnStepEnd)}}async restore(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,s=e.elementAliasesOrder,n=s.filter(a=>i[a]).map(a=>rb(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),B.childrenAliasesOrder.push(l);});}else {H.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Ai(this.gameLayer,e.stage,{ignoreScale:!0}):H.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([s,n])=>{let o=n.canvasElementAliases,a=or.getInstance(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else H.error(`Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{B._currentTickersSequence[s]=n,Object.keys(n).forEach(o=>{this.runTickersSequence(s,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(s=>{let n=i[s];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(i[s].tickerIdsExcluded=n.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(i[s].tickerIdsIncluded=n.tickerIdsIncluded.map(o=>t[o]||o));}),B._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds.map(o=>({id:t[o.id]||o.id})),n=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));B._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){H.error("Error importing data",t);}}};var sb=class{constructor(){N(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var nb=class{constructor(){N(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};Pe();Pe();function fn(r){return (r instanceof we||r instanceof Ne)&&r.haveEmptyTexture?false:!(r instanceof Ee&&r.texture?.label=="EMPTY")}function pn(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=TE(r[e],t):t.type==="exponential"&&(r[e]=SE(r[e],t)):r[e]!==void 0&&typeof r[e]=="object"&&r[e].haveOwnProperty("x")&&r[e].haveOwnProperty("y")&&typeof r[e].x=="number"&&typeof r[e].y=="number"&&(t.type==="linear"?(r[e].x=TE(r[e].x,t),r[e].y=TE(r[e].y,t)):t.type==="exponential"&&(r[e].x=SE(r[e].x,t),r[e].y=SE(r[e].y,t))));}function TE(r,e){let{limit:t,amt:i}=e;if(t!==void 0){if(r>t&&i>0)return t;if(r<t&&i<0)return t}return r+i}function SE(r,e){let{limit:t}=e;if(t!==void 0){if(r>t&&e.percentage>0)return t;if(r<t&&e.percentage<0)return t}return r+r*e.percentage}var VF=5,ts=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=VF:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=w.find(c);return !(!h||o&&!fn(h))}).forEach(c=>{let h=w.find(c);if(h&&h instanceof ie){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.onEndOfTicker(c,s,t);return}else if(n==="hide"&&h.alpha<=l){this.onEndOfTicker(c,s,t);return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){H.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,s,t,{editAlpha:false});return}}}),a&&pn(t,"speed",a);}onEndOfTicker(e,t,i,s={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=w.find(n);if(o&&s.editAlpha){let a=this.getLimit(i);o.alpha=a;}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}};or.add(ts);Pe();var zF=10;function WF(r,e){let t=Ut(r.destination);if(t.type==="align"){let i,s;e instanceof Ee&&(i=e.anchor.x,s=e.anchor.y);let n=it(e.pivot,e.angle),o=it(e.scale,e.angle);t.x=Qi("width",t.x,wi(e),n.x,o.x<0,i),t.y=Qi("height",t.y,Bi(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=Ji("width",t.x),t.y=Ji("height",t.y)),t}var xr=class extends nr{fn(e,t,i,s){t.speed===void 0&&(t.speed=zF);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=w.find(u);return !(!l||o&&!fn(l))}).forEach(u=>{let l=w.find(u);if(l&&l instanceof ie){let c=WF(t,l),h=c.x-l.x,d=c.y-l.y,p=h>0?1:-1,m=d>0?1:-1,b,_;if(typeof n=="number"){let g=this.speedConvert(n);h===0||d===0?b=_=g:(b=Math.abs(h/(h+d))*g,_=Math.abs(d/(h+d))*g);}else b=this.speedConvert(n.x),_=this.speedConvert(n.y);if(b>0){l.x+=p*b*e.deltaTime;let g=c.x-l.x;(p<0&&g>0||p>0&&g<0)&&(l.x=c.x);}if(_>0){l.y+=m*_*e.deltaTime;let g=c.y-l.y;(m<0&&g>0||m>0&&g<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.onEndOfTicker(u,s,t);return}else if(b<1e-5&&_<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){H.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,s,t,{editPosition:false});return}}}),a&&pn(t,"speed",a);}onEndOfTicker(e,t,i,s={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=w.find(n);if(o){let a=i.destination;s.editPosition&&(o instanceof we||o instanceof Ne?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};or.add(xr);Pe();var XF=1,kd=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=XF);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=w.find(l);return !(!c||t.startOnlyIfHaveTexture&&!fn(c))}).forEach(l=>{let c=w.find(l);if(c&&c instanceof ie&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.onEndOfTicker(l,s,t)):!n&&c.angle<=a&&(c.angle=a,this.onEndOfTicker(l,s,t))),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){H.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,s,t,{editRotation:false});return}}),o&&pn(t,"speed",o);}onEndOfTicker(e,t,i,s={editRotation:true}){let{limit:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=w.find(o);a&&s.editRotation&&n!==void 0&&(a.angle=n);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};or.add(kd);Pe();var YF=10,mn=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=YF);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(d=>{let p=w.find(d);return !(!p||a&&!fn(p))}).forEach(d=>{let p=w.find(d);if(p&&p instanceof ie){if(o==="zoom"&&(p.scale.x<h.x||p.scale.y<h.y)?(p.scale.x+=l*e.deltaTime,p.scale.y+=c*e.deltaTime):o==="unzoom"&&(p.scale.x>h.x||p.scale.y>h.y)&&(p.scale.x-=l*e.deltaTime,p.scale.y-=c*e.deltaTime),o==="zoom"){if(p.scale.x>h.x&&(p.scale.x=h.x),p.scale.y>h.y&&(p.scale.y=h.y),p.scale.x>=h.x&&p.scale.y>=h.y){this.onEndOfTicker(d,s,t);return}}else if(o==="unzoom"&&(p.scale.x<h.x&&(p.scale.x=h.x),p.scale.y<h.y&&(p.scale.y=h.y),p.scale.x<=h.x&&p.scale.y<=h.y)){this.onEndOfTicker(d,s,t);return}if((l<1e-5&&c<1e-5||l<1e-5&&p.scale.y==h.y||c<1e-5&&p.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){H.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(d,s,t,{editScale:false});return}}}),u&&pn(t,"speed",u);}speedConvert(e){return e/600}onEndOfTicker(e,t,i,s={editScale:true}){let{isZoomInOut:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=w.find(o);if(a){if(s.editScale){let u=this.getLimit(i);a.scale.x=u.x,a.scale.y=u.y;}if(n){let{pivot:u,position:l}=n;a.pivot=u.x,a.position=l;}}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}};or.add(mn);async function $F(r,e={},t){let i=w.find(r);if(!i){H.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},n=e.speed||20,o=e.speedProgression||void 0,a=e.startOnlyIfHaveTexture||false,u=e.type||"horizontal",l=e.maximumShockSize||10,c=(e.shocksNumber||10)-1;if(c<2){H.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),d=Math.ceil(c/2),p=[];for(let _=0;_<h;_++){let g={x:s.x,y:s.y},y=l*(_+1)/h;u==="horizontal"?_%2!==0?g.x=s.x+y:g.x=s.x-y:_%2!==0?g.y=s.y+y:g.y=s.y-y,p.push(new xr({destination:g,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let m=h%2===0;for(let _=d;_>0;_--){let g={x:s.x,y:s.y},y=l*(_+1)/(d-1);u==="horizontal"?_%2===0&&!m||_%2!==0&&m?g.x=s.x-y:g.x=s.x+y:_%2===0&&!m||_%2!==0&&m?g.y=s.y-y:g.y=s.y+y,p.push(new xr({destination:g,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}p.push(new xr({destination:s,speed:n,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let b=w.addTickersSequence(r,p);b&&(w.completeTickerOnStepEnd({id:b,alias:r}),w.pauseTicker(r,{tickerIdsExcluded:[b]}));}function ob(r,e,t){let i=new Ne(t,e);return w.add(r,i),i}async function jF(r,e,t){let i=new Ne(t,e);return await i.load(),w.add(r,i),i}Pe();function ab(r,e,t){if(!e)if(tt.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new we(t,e);return w.add(r,i),i}async function qF(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Ri(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function KF(r,e,t){if(!e)if(tt.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new we(t,e);return await i.load(),w.add(r,i),i}Pe();function ub(r,e,t){if(!e)if(tt.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Xt(t,e);return w.add(r,i),i}async function ZF(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Ri(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function QF(r,e,t){if(!e)if(tt.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Xt(t,e);return await i.load(),w.add(r,i),i}function Fd(r,e){if(typeof e=="string")return Rd(e)?ub(r,e):ab(r,e);if(Array.isArray(e))return ob(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Rd(e.value)?ub(r,e.value,e.options):ab(r,e.value,e.options);if(Array.isArray(e.value))return ob(r,e.value,e.options)}return w.add(r,e),e}async function $R(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(w.find(r)&&(a=r+"_temp_disolve",w.editAlias(r,a)),e=Fd(r,e),a&&w.copyCanvasElementProperty(a,r),a&&w.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=lb(a,t,i);c&&(o.push(...c),w.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new ts({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},void 0,i),l=w.addTicker(r,u);if(l&&(s&&w.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof we||e instanceof Ne)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function lb(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:s=[]}=e;typeof r=="string"&&(r=[r]),typeof s=="string"&&(s=[s]),s.push(...r);let n=new ts({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},void 0,t),o=w.addTicker(r,n);if(o)return i&&w.completeTickerOnStepEnd({id:o}),[o]}async function JF(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!w.find(r))return $R(r,e,t,i);let a=r+"_temp_fade";w.editAlias(r,a),n.push(a),e=Fd(r,e),a&&w.copyCanvasElementProperty(a,r),a&&w.transferTickers(a,r,"duplicate"),e.alpha=0;let u=lb(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new ts({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,i),c=w.addTicker(r,l);if(c&&(s&&w.completeTickerOnStepEnd({id:c}),o.push(c),w.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof we||e instanceof Ne)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function eO(r,e={},t){return lb(r,e,t)}async function tO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;w.find(r)&&(c=r+"_temp_movein",w.editAlias(r,c)),e=Fd(r,e),c&&w.copyCanvasElementProperty(c,r),c&&w.transferTickers(c,r,"move");let h;e instanceof we||e instanceof Ne?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d;switch(c&&(u?(d=EE(c,t,i),d&&(l.push(...d),o.push(c))):a.push(c)),(e instanceof we||e instanceof Ne)&&e.haveEmptyTexture&&await e.load(),c&&w.pauseTicker(c,{tickerIdsIncluded:d}),s){case "up":e.y=w.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=w.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new xr({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),m=w.addTicker(r,p);if(m&&(w.pauseTicker(r,{tickerIdsExcluded:[m]}),n&&w.completeTickerOnStepEnd({id:m}),l.push(m)),l.length>0)return l}function EE(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=w.find(r);if(!o){H.warn("The canvas component is not found.");return}let a={x:o.x,y:o.y};switch(i){case "up":a.y=-o.height;break;case "down":a.y=w.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=w.canvasWidth+o.width;break}let u=new xr({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,t),l=w.addTicker(r,u);if(l)return w.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&w.completeTickerOnStepEnd({id:l}),[l]}async function rO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=w.find(r);c&&(l=r+"_temp_zoom",w.editAlias(r,l)),e=Fd(r,e),l&&w.copyCanvasElementProperty(l,r),l&&w.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=w.canvasHeight-e.y,e.pivot.x=w.canvasWidth/2-e.x,e.y=w.canvasHeight,e.x=w.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=w.canvasWidth/2-e.x,e.y=0,e.x=w.canvasWidth/2):s=="left"?(e.pivot.x=w.canvasWidth-e.x,e.pivot.y=w.canvasHeight/2-e.y,e.x=w.canvasWidth,e.y=w.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=w.canvasHeight/2-e.y,e.x=0,e.y=w.canvasHeight/2),e.pivot=_E(e.pivot,e.angle),e.scale.set(0);let h=c?{pivot:{x:c.pivot.x,y:c.pivot.y},position:{x:c.x,y:c.y}}:void 0;if(l){if(t.removeOldComponentWithZoomOut){let m=jR(l,t,i);m&&(u.push(...m),o.push(l));}else a.push(l);w.pauseTicker(l);}o.push(r);let d=new mn({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),p=w.addTicker(r,d);if(p&&(w.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&w.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof we||e instanceof Ne)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function jR(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=w.find(r);if(!o){H.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=w.canvasHeight-o.y,o.pivot.x=w.canvasWidth/2-o.x,o.y=w.canvasHeight,o.x=w.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=w.canvasWidth/2-o.x,o.y=0,o.x=w.canvasWidth/2):i=="left"?(o.pivot.x=w.canvasWidth-o.x,o.pivot.y=w.canvasHeight/2-o.y,o.x=w.canvasWidth,o.y=w.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=w.canvasHeight/2-o.y,o.x=0,o.y=w.canvasHeight/2),o.pivot=_E(o.pivot,o.angle),o.scale.set(1);let a=new mn({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},void 0,t),u=w.addTicker(r,a);if(u)return w.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&w.completeTickerOnStepEnd({id:u}),[u]}async function iO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;w.find(r)&&(u=r+"_temp_push",w.editAlias(r,u)),e=Fd(r,e),u&&w.copyCanvasElementProperty(u,r),u&&w.transferTickers(u,r,"move");let l;if((e instanceof we||e instanceof Ne)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-w.canvasHeight+e.y:s=="down"?e.y=w.canvasHeight+e.y:s=="left"?e.x=-w.canvasWidth+e.x:s=="right"&&(e.x=w.canvasWidth+e.x),u){let d=qR(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);d&&a.push(...d);}o.push(r);let c=new xr({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=w.addTicker(r,c);if(h&&(w.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&w.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof we||e instanceof Ne)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function qR(r,e={direction:"right"},t){return EE(r,e,t)}var w=new Id;sr.init({getScreen:()=>w.screen});exports.CanvasBaseItem=nb;exports.CanvasEvent=sb;exports.CanvasManagerStatic=B;exports.Container=fa;exports.FadeAlphaTicker=ts;exports.ImageContainer=Ne;exports.ImageSprite=we;exports.MoveTicker=xr;exports.RegisteredCanvasComponents=jt;exports.RegisteredEvents=Zi;exports.RegisteredTickers=or;exports.RotateTicker=kd;exports.Sprite=es;exports.Text=ma;exports.TickerBase=nr;exports.VideoSprite=Xt;exports.ZoomTicker=mn;exports.addImage=ab;exports.addImageCointainer=ob;exports.addVideo=ub;exports.canvas=w;exports.canvasComponentDecorator=kF;exports.eventDecorator=FF;exports.getTexture=Ri;exports.loadImage=qF;exports.loadVideo=ZF;exports.moveIn=tO;exports.moveOut=EE;exports.pushIn=iO;exports.pushOut=qR;exports.removeWithDissolve=lb;exports.removeWithFade=eO;exports.shakeEffect=$F;exports.showImage=KF;exports.showImageContainer=jF;exports.showVideo=QF;exports.showWithDissolve=$R;exports.showWithFade=JF;exports.tickerDecorator=HF;exports.zoomIn=rO;exports.zoomOut=jR;
|