@drincs/pixi-vn 1.2.9 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3307,7 +3307,7 @@ 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 Dk,eR,tR,rR=p(()=>{bt();Gr();OE();Dk=new xe(0,0,0,0),eR=class kE extends Ze{constructor(e={}){e={...kE.defaultOptions,...e,dynamicProperties:{...kE.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:n,texture:s,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=s||null,this.shader=i,this._properties={};for(let u in sd){let l=sd[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=n??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 n=this.particleChildren.indexOf(e[i]);n>-1&&(this.particleChildren.splice(n,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return Dk}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,n=this.texture??this.particleChildren[0]?.texture;n&&n.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")}};eR.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};tR=eR;});var iR,FE,B_,sR=p(()=>{qi();de();ye();Gr();km();iR=class nR extends Ze{constructor(e){e instanceof exports.Texture&&(e={texture:e});let{width:t,height:i,anchor:n,leftWidth:s,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=s??l?.defaultBorders?.left??Yr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Yr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Yr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Yr.defaultOptions.bottomHeight,this._width=t??l.width??Yr.defaultOptions.width,this._height=i??l.height??Yr.defaultOptions.height,this.allowChildren=false,this.texture=l??nR.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new Me({_onUpdate:()=>{this.onViewUpdate();}}),n?this.anchor=n: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=exports.Texture.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,n=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*n,e.maxY=e.minY+n;}};iR.defaultOptions={texture:exports.Texture.EMPTY};FE=iR,B_=class extends FE{constructor(...e){let t=e[0];t instanceof exports.Texture&&(F(z,"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]}),F(z,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function oR(r,e){return e instanceof tt||e instanceof Xr?e:r==="html"?new Xr(e):new tt(e)}var aR=p(()=>{Mc();Ii();});async function uR(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let n=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let s=["font-size: 1px;",`padding: ${n}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",s);}var lR=p(()=>{});function GE(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=Ok[kk++]);let i="";for(let o=0;o<e;o++)i+=" ";let n=r.label;!n&&r instanceof Pe&&(n=`sprite:${r.texture.label}`);let s=`%c ${i}|- ${n} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(s+=" (RenderGroup)"),r.filters&&(s+="(*filters)"),console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];GE(a,e,{...t});}}function UE(r,e=0,t={index:0,color:"#000000"}){let i="";for(let s=0;s<e;s++)i+=" ";let n=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let s=0;s<r.renderGroupChildren.length;s++){let o=r.renderGroupChildren[s];UE(o,e,{...t,index:s});}}var Ok,kk,cR=p(()=>{un();Ok=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],kk=0;});var hR={};vi(hR,{AbstractBitmapFont:()=>Mn,AbstractRenderer:()=>ii,AbstractText:()=>ci,AccessibilitySystem:()=>xf,AlphaFilter:()=>P3,AlphaMask:()=>Es,AlphaMaskPipe:()=>ho,AnimatedSprite:()=>dl,Application:()=>yh,ApplicationInitHook:()=>lo,Assets:()=>exports.Assets,AssetsClass:()=>Ph,BLEND_TO_NPM:()=>Hf,BUFFER_TYPE:()=>Fo,BackgroundLoader:()=>Lu,BackgroundSystem:()=>rg,Batch:()=>ic,BatchGeometry:()=>Ba,BatchTextureArray:()=>wa,BatchableGraphics:()=>Mi,BatchableMesh:()=>ei,BatchableSprite:()=>Er,Batcher:()=>zf,BatcherPipe:()=>oh,BigPool:()=>K,BindGroup:()=>ot,BindGroupSystem:()=>yo,BitmapFont:()=>jo,BitmapFontManager:()=>Oi,BitmapText:()=>ml,BitmapTextPipe:()=>Ys,BlendModeFilter:()=>ee,BlendModePipe:()=>mo,BlurFilter:()=>Kh,BlurFilterPass:()=>hl,Bounds:()=>xe,BrowserAdapter:()=>Cf,Buffer:()=>Ge,BufferImageSource:()=>Ci,BufferResource:()=>oi,BufferUsage:()=>Q,CLEAR:()=>at,Cache:()=>me,CanvasPool:()=>It,CanvasPoolClass:()=>yc,CanvasSource:()=>ct,CanvasTextMetrics:()=>$t,CanvasTextPipe:()=>Hs,CanvasTextSystem:()=>Xs,Circle:()=>$a,Color:()=>$,ColorBlend:()=>Fc,ColorBurnBlend:()=>Gc,ColorDodgeBlend:()=>Uc,ColorMask:()=>Cs,ColorMaskPipe:()=>fo,ColorMatrixFilter:()=>c_,CompressedSource:()=>Pr,Container:()=>re,Culler:()=>Xx,CullerPlugin:()=>kh,CustomRenderPipe:()=>io,D3D10_RESOURCE_DIMENSION:()=>Gx,D3DFMT:()=>Vt,DATA_URI:()=>dP,DDS:()=>Z,DEG_TO_RAD:()=>Ld,DEPRECATED_SCALE_MODES:()=>nd,DEPRECATED_WRAP_MODES:()=>id,DOMAdapter:()=>W,DOMContainer:()=>Ef,DOMPipe:()=>Ts,DRAW_MODES:()=>sB,DXGI_FORMAT:()=>Fx,DXGI_TO_TEXTURE_FORMAT:()=>kt,DarkenBlend:()=>Lc,DefaultBatcher:()=>Rs,DefaultShader:()=>Oa,DifferenceBlend:()=>Nc,DisplacementFilter:()=>f_,DivideBlend:()=>Hc,DynamicBitmapFont:()=>Bc,Ellipse:()=>qa,EventBoundary:()=>ya,EventEmitter:()=>ce,EventSystem:()=>va,EventsTicker:()=>pr,ExclusionBlend:()=>Vc,ExtensionType:()=>g,ExtractSystem:()=>ig,FOURCC_TO_TEXTURE_FORMAT:()=>Ih,FederatedContainer:()=>Sf,FederatedEvent:()=>Zr,FederatedMouseEvent:()=>Fr,FederatedPointerEvent:()=>yt,FederatedWheelEvent:()=>mr,FillGradient:()=>Mt,FillPattern:()=>Vr,Filter:()=>gt,FilterEffect:()=>Dr,FilterPipe:()=>Zs,FilterSystem:()=>Qs,FontStylePromiseCache:()=>au,GAUSSIAN_VALUES:()=>cl,GL_FORMATS:()=>Ru,GL_INTERNAL_FORMAT:()=>M2,GL_TARGETS:()=>fh,GL_TYPES:()=>ge,GL_WRAP_MODES:()=>aS,GenerateTextureSystem:()=>go,Geometry:()=>Bt,GlBackBufferSystem:()=>Og,GlBatchAdaptor:()=>ko,GlBuffer:()=>Bu,GlBufferSystem:()=>Go,GlColorMaskSystem:()=>Lo,GlContextSystem:()=>Mg,GlEncoderSystem:()=>No,GlGeometrySystem:()=>Uo,GlGraphicsAdaptor:()=>Do,GlMeshAdaptor:()=>Oo,GlParticleContainerAdaptor:()=>za,GlParticleContainerPipe:()=>Us,GlProgram:()=>Ue,GlProgramData:()=>Du,GlRenderTarget:()=>Mu,GlRenderTargetAdaptor:()=>Iu,GlRenderTargetSystem:()=>zo,GlShaderSystem:()=>Wo,GlStateSystem:()=>tx,GlStencilSystem:()=>Ho,GlTexture:()=>ku,GlTextureSystem:()=>Yo,GlUboSystem:()=>Vo,GlUniformGroupSystem:()=>Xo,GlobalUniformSystem:()=>xo,GpuBatchAdaptor:()=>ro,GpuBlendModesToPixi:()=>St,GpuBufferSystem:()=>vo,GpuColorMaskSystem:()=>To,GpuDeviceSystem:()=>Hn,GpuEncoderSystem:()=>So,GpuGraphicsAdaptor:()=>eo,GpuGraphicsContext:()=>pc,GpuMeshAdapter:()=>to,GpuMipmapGenerator:()=>wu,GpuParticleContainerAdaptor:()=>Ya,GpuParticleContainerPipe:()=>Ls,GpuProgram:()=>Le,GpuReadBuffer:()=>rB,GpuRenderTarget:()=>Cu,GpuRenderTargetAdaptor:()=>Au,GpuRenderTargetSystem:()=>Bo,GpuShaderSystem:()=>Ro,GpuStateSystem:()=>Mo,GpuStencilModesToPixi:()=>Ar,GpuStencilSystem:()=>Eo,GpuTextureSystem:()=>Io,GpuUboSystem:()=>Ao,GpuUniformBatchPipe:()=>Po,Graphics:()=>Rn,GraphicsContext:()=>et,GraphicsContextRenderData:()=>mc,GraphicsContextSystem:()=>En,GraphicsPath:()=>Cr,GraphicsPipe:()=>Fs,HTMLText:()=>gl,HTMLTextPipe:()=>js,HTMLTextRenderData:()=>In,HTMLTextStyle:()=>Xr,HTMLTextSystem:()=>Dn,HardLightBlend:()=>zc,HardMixBlend:()=>Wc,HelloSystem:()=>Nn,IGLUniformData:()=>Ng,ImageSource:()=>wt,InstructionSet:()=>Ji,KTX:()=>je,LightenBlend:()=>Xc,LinearBurnBlend:()=>Yc,LinearDodgeBlend:()=>jc,LinearLightBlend:()=>$c,Loader:()=>Hu,LoaderParserPriority:()=>De,LuminosityBlend:()=>qc,MSAA_QUALITY:()=>PE,MaskEffectManager:()=>da,MaskEffectManagerClass:()=>Ll,MaskFilter:()=>mu,Matrix:()=>k,Mesh:()=>Jt,MeshGeometry:()=>Dt,MeshPipe:()=>Gs,MeshPlane:()=>A_,MeshRope:()=>YB,MeshSimple:()=>w_,NOOP:()=>zl,NegationBlend:()=>Kc,NineSliceGeometry:()=>Yr,NineSlicePlane:()=>B_,NineSliceSprite:()=>FE,NineSliceSpritePipe:()=>Ks,NoiseFilter:()=>F3,ObservablePoint:()=>Me,OverlayBlend:()=>Zc,PI_2:()=>Gd,Particle:()=>QB,ParticleBuffer:()=>Wa,ParticleContainer:()=>tR,ParticleContainerPipe:()=>Cn,ParticleShader:()=>Xa,PerspectiveMesh:()=>LB,PerspectivePlaneGeometry:()=>_l,PinLightBlend:()=>Qc,PipelineSystem:()=>wo,PlaneGeometry:()=>kn,Point:()=>ne,Polygon:()=>Pn,Pool:()=>Si,PoolGroupClass:()=>Gl,PrepareBase:()=>g_,PrepareQueue:()=>pl,PrepareSystem:()=>rd,PrepareUpload:()=>xl,QuadGeometry:()=>cu,RAD_TO_DEG:()=>Ud,Rectangle:()=>exports.Rectangle,RenderContainer:()=>T_,RenderGroup:()=>xa,RenderGroupPipe:()=>so,RenderGroupSystem:()=>ao,RenderLayer:()=>IB,RenderLayerClass:()=>wE,RenderTarget:()=>bo,RenderTargetSystem:()=>Wn,RenderTexture:()=>gu,RenderableGCSystem:()=>ag,RendererInitHook:()=>co,RendererType:()=>Ne,ResizePlugin:()=>bs,Resolver:()=>Tt,RopeGeometry:()=>P_,RoundedRectangle:()=>Ka,SCALE_MODES:()=>cB,STENCIL_MODES:()=>Ie,SVGParser:()=>rm,SaturationBlend:()=>Jc,SchedulerSystem:()=>_o,ScissorMask:()=>y_,SdfShader:()=>nu,Shader:()=>We,ShaderStage:()=>xn,ShapePath:()=>eu,SharedRenderPipes:()=>yu,SharedSystems:()=>bu,SoftLightBlend:()=>eh,Sprite:()=>Pe,SpritePipe:()=>uo,Spritesheet:()=>Ql,State:()=>ze,StencilMask:()=>As,StencilMaskPipe:()=>po,SubtractBlend:()=>th,SystemRunner:()=>Un,TEXTURE_FORMAT_BLOCK_SIZE:()=>Ux,Text:()=>wr,TextStyle:()=>tt,Texture:()=>exports.Texture,TextureGCSystem:()=>ug,TextureMatrix:()=>tn,TexturePool:()=>Te,TexturePoolClass:()=>Wl,TextureSource:()=>he,TextureStyle:()=>ga,TextureUvs:()=>v_,Ticker:()=>Se,TickerListener:()=>nn,TickerPlugin:()=>vs,TilingSprite:()=>__,TilingSpritePipe:()=>qs,TilingSpriteShader:()=>lu,Transform:()=>fl,Triangle:()=>m_,UNIFORM_TO_ARRAY_SETTERS:()=>Qg,UNIFORM_TO_SINGLE_SETTERS:()=>Zg,UNIFORM_TYPES_MAP:()=>hp,UNIFORM_TYPES_VALUES:()=>lc,UPDATE_BLEND:()=>_a,UPDATE_COLOR:()=>_s,UPDATE_PRIORITY:()=>exports.UPDATE_PRIORITY,UPDATE_TRANSFORM:()=>Z1,UPDATE_VISIBLE:()=>rn,UboBatch:()=>Su,UboSystem:()=>Vn,UniformGroup:()=>ae,VERSION:()=>Ln,VideoSource:()=>hn,ViewContainer:()=>Ze,ViewSystem:()=>hg,ViewableBuffer:()=>gr,VividLightBlend:()=>rh,WGSL_ALIGN_SIZE_DATA:()=>Co,WGSL_TO_STD40_SIZE:()=>ph,WRAP_MODES:()=>lB,WebGLRenderer:()=>bh,WebGPURenderer:()=>dh,WebWorkerAdapter:()=>S3,WorkerManager:()=>Ah,_getGlobalBounds:()=>Zd,accessibilityTarget:()=>_f,addBits:()=>sc,addMaskBounds:()=>ln,addMaskLocalBounds:()=>cn,addProgramDefines:()=>jf,alphaFrag:()=>r_,alphaWgsl:()=>qh,applyMatrix:()=>Im,applyProjectiveTransformationToPlane:()=>S_,applyStyleParams:()=>_h,assignWithIgnore:()=>xs,autoDetectEnvironment:()=>aP,autoDetectRenderer:()=>hx,autoDetectSource:()=>SC,basisTranscoderUrls:()=>Zu,bgr2rgb:()=>Ei,bitmapFontCachePlugin:()=>dx,bitmapFontTextParser:()=>Uu,bitmapFontXMLParser:()=>vh,bitmapFontXMLStringParser:()=>Th,blendTemplateFrag:()=>Gm,blendTemplateVert:()=>Um,blendTemplateWgsl:()=>Lm,blockDataMap:()=>hh,blurTemplateWgsl:()=>a_,boundsPool:()=>Ht,browserExt:()=>Ov,buildAdaptiveBezier:()=>Qa,buildAdaptiveQuadratic:()=>Yp,buildArc:()=>Ja,buildArcTo:()=>$p,buildArcToSvg:()=>qp,buildCircle:()=>Tr,buildContextBatches:()=>Op,buildEllipse:()=>xp,buildGeometryFromPath:()=>wB,buildLine:()=>Sp,buildPixelLine:()=>Ep,buildPolygon:()=>La,buildRectangle:()=>Na,buildRoundedRectangle:()=>_p,buildSimpleUvs:()=>Fa,buildTriangle:()=>Ha,buildUvs:()=>ka,cacheAsTextureMixin:()=>zd,cacheTextureArray:()=>px,calculateProjection:()=>Eg,checkChildrenDidChange:()=>Hl,checkDataUrl:()=>qt,checkExtension:()=>Xe,checkMaxIfStatementsInShader:()=>Uf,childrenHelperMixin:()=>Xd,cleanArray:()=>og,cleanHash:()=>sg,clearList:()=>oo,closePointEps:()=>yp,collectAllRenderables:()=>yB,collectRenderablesMixin:()=>Yd,color32BitToUniform:()=>Sr,colorBit:()=>bn,colorBitGl:()=>yn,colorMatrixFilterFrag:()=>l_,colorMatrixFilterWgsl:()=>Zh,colorToUniform:()=>tA,compareModeToGlCompare:()=>ax,compileHighShader:()=>ip,compileHighShaderGl:()=>np,compileHighShaderGlProgram:()=>_r,compileHighShaderGpuProgram:()=>xr,compileHooks:()=>oc,compileInputs:()=>ac,compileOutputs:()=>rp,compileShader:()=>mh,compute2DProjection:()=>C_,convertFormatIfRequired:()=>gw,convertToList:()=>vt,copySearchParams:()=>Ss,createIdFromString:()=>Hr,createIndicesForQuads:()=>_c,createLevelBuffers:()=>rw,createLevelBuffersFromKTX:()=>_w,createStringVariations:()=>Af,createTexture:()=>Ot,createUboElementsSTD40:()=>kg,createUboElementsWGSL:()=>pg,createUboSyncFunction:()=>vu,createUboSyncFunctionSTD40:()=>Ug,createUboSyncFunctionWGSL:()=>vg,crossOrigin:()=>b2,cullingMixin:()=>Fd,curveEps:()=>vp,defaultFilterVert:()=>Kn,defaultValue:()=>Ou,definedProps:()=>pt,deprecation:()=>F,detectAvif:()=>gx,detectBasis:()=>qP,detectCompressed:()=>Cw,detectDefaults:()=>xx,detectMp4:()=>_x,detectOgv:()=>bx,detectVideoAlphaMode:()=>Ea,detectWebm:()=>yx,detectWebp:()=>vx,determineCrossOrigin:()=>v2,displacementFrag:()=>h_,displacementVert:()=>d_,displacementWgsl:()=>Qh,earcut:()=>dR.default,effectsMixin:()=>jd,ensureAttributes:()=>Eu,ensureIsBuffer:()=>nc,ensurePrecision:()=>$f,ensureTextOptions:()=>Zn,ensureTextStyle:()=>oR,executeInstructions:()=>no,extensions:()=>N,extractAttributesFromGlProgram:()=>Xg,extractAttributesFromGpuProgram:()=>Qf,extractFontFamilies:()=>vm,extractStructAndGroups:()=>Ma,extractSvgUrlId:()=>Cc,fastCopy:()=>Bs,findHooksRx:()=>Py,findMixin:()=>$d,fontStringFromTextStyle:()=>Di,formatShader:()=>q3,fragmentGPUTemplate:()=>op,fragmentGlTemplate:()=>up,generateArraySyncSTD40:()=>Gg,generateArraySyncWGSL:()=>yg,generateBlurFragSource:()=>n_,generateBlurGlProgram:()=>o_,generateBlurProgram:()=>u_,generateBlurVertSource:()=>s_,generateGPULayout:()=>X3,generateGpuLayoutGroups:()=>Jf,generateLayout:()=>j3,generateLayoutHash:()=>ep,generateParticleUpdateFunction:()=>kp,generateProgram:()=>qg,generateShaderSyncCode:()=>Lg,generateTextStyleKey:()=>tu,generateTextureBatchBit:()=>vn,generateTextureBatchBitGl:()=>Tn,generateTextureMatrix:()=>Dp,generateUID:()=>fB,generateUniformsSync:()=>Jg,getAdjustedBlendModeBlend:()=>Lr,getAttributeInfoFromFormat:()=>Rt,getBatchSamplersUniformGroup:()=>Sn,getBitmapTextLayout:()=>ou,getCanvasBoundingBox:()=>Np,getCanvasFillStyle:()=>Bn,getCanvasTexture:()=>_u,getDefaultUniformValue:()=>dp,getFastGlobalBounds:()=>xB,getFastGlobalBoundsMixin:()=>Kd,getFontCss:()=>Sm,getFontFamilyName:()=>d2,getGeometryBounds:()=>Wf,getGlTypeFromFormat:()=>Dg,getGlobalBounds:()=>Kr,getGlobalMixin:()=>ef,getGlobalRenderableBounds:()=>Fm,getLocalBounds:()=>Qi,getMatrixRelativeToParent:()=>Mf,getMaxFragmentPrecision:()=>Yf,getMaxTexturesPerBatch:()=>Yt,getOrientationOfPoints:()=>Tp,getParent:()=>hb,getPo2TextureFromSource:()=>iu,getResolutionOfUrl:()=>jn,getSVGUrl:()=>Em,getSupportedCompressedTextureFormats:()=>$u,getSupportedGPUCompressedTextureFormats:()=>Bh,getSupportedGlCompressedTextureFormats:()=>wh,getSupportedTextureFormats:()=>ai,getTemporaryCanvasFromImage:()=>Cm,getTestContext:()=>Ca,getTextureBatchBindGroup:()=>fn,getTextureDefaultMatrix:()=>qB,getTextureFormatFromKTXTexture:()=>yw,getUboData:()=>Yg,getUniformData:()=>jg,getUrlExtension:()=>Vb,glFormatToGPUFormat:()=>Vx,glUploadBufferImageResource:()=>rx,glUploadCompressedTextureResource:()=>ix,glUploadImageResource:()=>Fu,glUploadVideoResource:()=>sx,globalUniformsBit:()=>lp,globalUniformsBitGl:()=>cp,globalUniformsUBOBitGl:()=>FC,gpuFormatToBasisTranscoderFormat:()=>nw,gpuFormatToKTXBasisTranscoderFormat:()=>Tw,gpuUploadBufferImageResource:()=>Pg,gpuUploadCompressedTextureResource:()=>wg,gpuUploadImageResource:()=>Pu,gpuUploadVideoResource:()=>Rg,groupD8:()=>ue,hasCachedCanvasTexture:()=>vP,hslWgsl:()=>U3,hslgl:()=>Fn,hslgpu:()=>Gn,injectBits:()=>uc,insertVersion:()=>qf,isMobile:()=>mf,isPow2:()=>Vl,isRenderingToScreen:()=>Cg,isSafari:()=>gm,isSingleItem:()=>Pi,isWebGLSupported:()=>ni,isWebGPUSupported:()=>si,ktxTranscoderUrls:()=>Ju,loadBasis:()=>ew,loadBasisOnWorker:()=>kx,loadBitmapFont:()=>fx,loadDDS:()=>ow,loadEnvironmentExtensions:()=>ih,loadFontAsBase64:()=>Tm,loadFontCSS:()=>Ic,loadImageBitmap:()=>_2,loadJson:()=>Tx,loadKTX:()=>uw,loadKTX2:()=>fw,loadKTX2onWorker:()=>Hx,loadSVGImage:()=>Am,loadSvg:()=>Cx,loadTextures:()=>Xu,loadTxt:()=>Sx,loadVideoTextures:()=>Px,loadWebFont:()=>Ex,localUniformBit:()=>Fi,localUniformBitGl:()=>On,localUniformBitGroup2:()=>wm,localUniformMSDFBit:()=>um,localUniformMSDFBitGl:()=>lm,log2:()=>z1,logDebugTexture:()=>uR,logProgramError:()=>$g,logRenderGroupScene:()=>UE,logScene:()=>GE,mSDFBit:()=>cm,mSDFBitGl:()=>hm,mapFormatToGlFormat:()=>ux,mapFormatToGlInternalFormat:()=>lx,mapFormatToGlType:()=>cx,mapGlToVertexFormat:()=>zg,mapSize:()=>eB,mapType:()=>gh,mapWebGLBlendModesToPixi:()=>ex,maskFrag:()=>eg,maskVert:()=>tg,maskWgsl:()=>ah,matrixPool:()=>Ke,measureHtmlText:()=>uu,measureMixin:()=>rf,migrateFragmentFromV7toV8:()=>Q3,mipmapScaleModeToGlFilter:()=>ox,mixHexColors:()=>TB,multiplyColors:()=>Zi,multiplyHexColors:()=>pa,nextPow2:()=>Or,noiseFrag:()=>p_,noiseWgsl:()=>Jh,nonCompressedFormats:()=>A2,normalizeExtensionPriority:()=>la,nssvg:()=>xm,nsxhtml:()=>_m,onRenderMixin:()=>nf,parseAttribute:()=>tm,parseDDS:()=>Lx,parseFunctionBody:()=>mB,parseKTX:()=>Nx,parseSVGDefinitions:()=>Jp,parseSVGFloatAttribute:()=>He,parseSVGPath:()=>Hp,parseSVGStyle:()=>Ac,particleData:()=>sd,particlesFrag:()=>Fp,particlesVert:()=>Gp,particlesWgsl:()=>bc,path:()=>Oe,pointInTriangle:()=>ed,preloadVideo:()=>y2,removeItems:()=>ha,removeStructAndGroupDuplicates:()=>tp,resetUids:()=>G1,resolveCharacters:()=>su,resolveCompressedTextureUrl:()=>Ew,resolveJsonUrl:()=>Bx,resolveTextureUrl:()=>Yu,resourceToTexture:()=>Qb,roundPixelsBit:()=>br,roundPixelsBitGl:()=>yr,roundedShapeArc:()=>Kp,roundedShapeQuadraticCurve:()=>Zp,sayHello:()=>ng,scaleModeToGlFilter:()=>xh,setBasisTranscoderPath:()=>QP,setKTXTranscoderPath:()=>hw,setPositions:()=>Mm,setProgramName:()=>Kf,setUvs:()=>Dm,shapeBuilders:()=>Va,sortMixin:()=>sf,spritesheetAsset:()=>wf,squaredDistanceToLineSegment:()=>An,stripVersion:()=>Zf,styleAttributes:()=>em,testImageFormat:()=>Nu,testVideoFormat:()=>Xn,textStyleToCSS:()=>ym,textureBit:()=>Wm,textureBitGl:()=>Xm,textureFrom:()=>Jb,tilingBit:()=>Bm,tilingBitGl:()=>Rm,toFillStyle:()=>zr,toLocalGlobalMixin:()=>of,toStrokeStyle:()=>wn,transformVertices:()=>Ms,triangulateWithHoles:()=>Ua,uboSyncFunctionsSTD40:()=>lh,uboSyncFunctionsWGSL:()=>_g,uid:()=>oe,uniformParsers:()=>jr,unpremultiplyAlpha:()=>DP,unsafeEvalSupported:()=>hu,updateLocalTransform:()=>EB,updateQuadBounds:()=>Sa,updateRenderGroupTransform:()=>jv,updateRenderGroupTransforms:()=>sh,updateTextBounds:()=>Ns,updateTransformAndChildren:()=>Km,updateTransformBackwards:()=>fa,updateWorldTransform:()=>AB,v8_0_0:()=>z,v8_3_4:()=>Hd,validFormats:()=>el,validateRenderables:()=>Zm,vertexGPUTemplate:()=>sp,vertexGlTemplate:()=>ap,viewportFromFrame:()=>aB,vkFormatToGPUFormat:()=>zx,warn:()=>G,webworkerExt:()=>kv,wrapModeToGlAddress:()=>Gu});var dR,Ee=p(()=>{kA();GA();P();P();kf();Bf();wb();Bb();NA();HA();VA();zA();WA();XA();YA();jA();$A();qA();KA();ZA();QA();JA();eP();tP();rP();iP();nP();sP();oP();HP();Rb();Ib();$P();t2();Qr();r2();i2();n2();s2();o2();a2();u2();mx();Sh();l2();sr();c2();h2();f2();p2();Ax();T2();Gi();x2();S2();wx();an();Yn();lr();Ta();Pf();Hb();Kl();st();KP();tw();iw();sw();P2();w2();B2();aw();R2();lw();D2();I2();pw();xw();bw();vw();G2();Sw();O2();U2();k2();Aw();L2();H2();Pw();tb();gC();Lb();Be();Hv();Nb();E3();kb();Tf();bf();Xl();Ub();jl();yf();vf();Gv();Uv();Lv();L3();iE();nE();uE();hE();dE();$h();fE();pE();mE();gE();xE();eT();tT();rT();qe();Oc();kc();w3();M3();cE();i_();sE();aE();oE();lE();I3();D3();G3();ri();Ul();Rv();Iv();iT();cf();pe();Nd();ma();Vp();qi();Nt();_E();w0();B0();R0();Qe();M0();N3();bE();SE();W3();AE();tS();ty();dn();Y3();$3();tc();Wv();sy();Jv();uy();iy();fp();Ny();Bi();Dy();Ay();wy();By();Ry();K3();My();Oy();Ia();Da();ky();$s();Ri();Ym();Xb();sT();Yb();oT();ob();Z3();jb();aT();Jl();ec();$S();rS();iS();nS();Js();oS();lS();uS();hS();dS();fS();_S();pS();xS();bS();yS();vS();cc();jt();TS();RS();DS();J3();SS();Hg();Tg();CS();BS();cy();Gf();AS();PS();wS();tB();Wg();hy();dy();fy();py();my();Fg();gS();mS();IS();MS();FS();OS();Ig();GS();YS();US();LS();nx();NS();VS();E2();zS();WS();XS();HS();OP();jS();PT();wT();iB();FT();BT();RT();MT();IT();kT();GT();UT();LT();HT();VT();zT();wi();or();WT();mg();OT();by();yy();DT();Ty();Sy();Ey();XT();YT();Sg();ZT();jT();$T();Bg();qT();C2();KT();QT();lT();cT();Jr();ch();Nr();Nf();fT();mT();oB();mn();pp();oy();gn();ay();mp();af();gT();NT();lg();Ag();uB();xT();vy();vr();Uy();fg();Je();xg();Ly();bg();gg();bT();pn();Pa();ur();du();dg();Hm();Vs();hB();TT();pT();hf();Ps();ju();ws();mt();Of();de();ET();df();kr();uf();dB();pB();cg();Dx();qu();ey();Ra();gB();AT();ar();g0();x0();_0();bt();_B();ds();Nl();Mv();Ki();ib();nb();sb();ab();ub();lb();tf();fb();pb();mb();gb();Xt();Xv();bB();bb();Yv();Kv();ff();db();qm();vB();en();$m();SB();Jd();Qd();CB();$v();PB();qv();JT();ks();Vv();gp();Xp();k0();jp();F0();L0();bp();Vy();zy();Rp();Mp();Ip();zC();Os();vc();am();Ws();gc();u0();Ec();N0();H0();V0();Qp();P0();W0();X0();z0();Qy();BB();im();Zy();Hy();Bp();DB();NB();ME();BE();RE();HB();Dc();jB();$B();IE();eS();zv();xc();KB();qo();ki();c0();d0();v0();y0();T0();JB();m0();rR();Up();OE();b0();f0();p0();yE();km();sR();wv();_v();vv();TE();Av();Ev();Tv();Sv();Cv();ja();un();Zv();dm();ZS();QS();JS();e2();KS();Rc();EE();nv();rv();pm();fm();CE();ov();bm();Mc();gv();lv();dv();fv();pv();cv();hv();mv();Pm();uv();td();wc();E0();q0();Pc();om();tv();Z0();Q0();b_();Ii();aR();nm();sm();Lp();Gr();zb();Wb();ys();sn();Mb();If();Ab();av();fu();pu();Nm();C0();Qm();Ct();yT();Wd();ft();Rf();Lf();Jm();ye();lR();cR();_e();_b();vE();Eh();on();Vd();At();_T();dR=$i($y());N.add(Ov,kv);});var TR=dr((L_,vR)=>{(function(r,e){typeof L_=="object"?vR.exports=L_=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(L_,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 j_=="function")try{i=j_("crypto");}catch{}var n=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.")},s=Object.create||function(){function x(){}return function(y){var S;return x.prototype=y,S=new x,x.prototype=null,S}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(x){var y=s(this);return x&&y.mixIn(x),(!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 x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var y in x)x.hasOwnProperty(y)&&(this[y]=x[y]);x.hasOwnProperty("toString")&&(this.toString=x.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(x,y){x=this.words=x||[],y!=t?this.sigBytes=y:this.sigBytes=x.length*4;},toString:function(x){return (x||h).stringify(this)},concat:function(x){var y=this.words,S=x.words,T=this.sigBytes,O=x.sigBytes;if(this.clamp(),T%4)for(var v=0;v<O;v++){var E=S[v>>>2]>>>24-v%4*8&255;y[T+v>>>2]|=E<<24-(T+v)%4*8;}else for(var C=0;C<O;C+=4)y[T+C>>>2]=S[C>>>2];return this.sigBytes+=O,this},clamp:function(){var x=this.words,y=this.sigBytes;x[y>>>2]&=4294967295<<32-y%4*8,x.length=e.ceil(y/4);},clone:function(){var x=u.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var y=[],S=0;S<x;S+=4)y.push(n());return new l.init(y,x)}}),c=o.enc={},h=c.Hex={stringify:function(x){for(var y=x.words,S=x.sigBytes,T=[],O=0;O<S;O++){var v=y[O>>>2]>>>24-O%4*8&255;T.push((v>>>4).toString(16)),T.push((v&15).toString(16));}return T.join("")},parse:function(x){for(var y=x.length,S=[],T=0;T<y;T+=2)S[T>>>3]|=parseInt(x.substr(T,2),16)<<24-T%8*4;return new l.init(S,y/2)}},d=c.Latin1={stringify:function(x){for(var y=x.words,S=x.sigBytes,T=[],O=0;O<S;O++){var v=y[O>>>2]>>>24-O%4*8&255;T.push(String.fromCharCode(v));}return T.join("")},parse:function(x){for(var y=x.length,S=[],T=0;T<y;T++)S[T>>>2]|=(x.charCodeAt(T)&255)<<24-T%4*8;return new l.init(S,y)}},f=c.Utf8={stringify:function(x){try{return decodeURIComponent(escape(d.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return d.parse(unescape(encodeURIComponent(x)))}},m=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(x){typeof x=="string"&&(x=f.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes;},_process:function(x){var y,S=this._data,T=S.words,O=S.sigBytes,v=this.blockSize,E=v*4,C=O/E;x?C=e.ceil(C):C=e.max((C|0)-this._minBufferSize,0);var w=C*v,B=e.min(w*4,O);if(w){for(var I=0;I<w;I+=v)this._doProcessBlock(T,I);y=T.splice(0,w),S.sigBytes-=B;}return new l.init(y,B)},clone:function(){var x=u.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});a.Hasher=m.extend({cfg:u.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset();},reset:function(){m.reset.call(this),this._doReset();},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(x){return function(y,S){return new x.init(S).finalize(y)}},_createHmacHelper:function(x){return function(y,S){return new b.HMAC.init(x,S).finalize(y)}}});var b=o.algo={};return o}(Math);return r});});var XE=dr((N_,SR)=>{(function(r,e){typeof N_=="object"?SR.exports=N_=e(TR()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(N_,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,n=t.Hasher,s=e.algo,o=[],a=s.SHA1=n.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],f=c[2],m=c[3],_=c[4],b=0;b<80;b++){if(b<16)o[b]=u[l+b]|0;else {var x=o[b-3]^o[b-8]^o[b-14]^o[b-16];o[b]=x<<1|x>>>31;}var y=(h<<5|h>>>27)+_+o[b];b<20?y+=(d&f|~d&m)+1518500249:b<40?y+=(d^f^m)+1859775393:b<60?y+=(d&f|d&m|f&m)-1894007588:y+=(d^f^m)-899497514,_=m,m=f,f=d<<30|d>>>2,d=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+f|0,c[3]=c[3]+m|0,c[4]=c[4]+_|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=n.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=n._createHelper(a),e.HmacSHA1=n._createHmacHelper(a);}(),r.SHA1});});var QR=dr((h1,ZR)=>{(function(r,e){var t=e(r);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return t});else if(typeof h1=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))ZR.exports=t;else {var i=r.DeepDiff;t.noConflict=function(){return r.DeepDiff===t&&(r.DeepDiff=i),t},r.DeepDiff=t;}})(h1,function(r){var e=["N","E","A","D"];function t(v,E){v.super_=E,v.prototype=Object.create(E.prototype,{constructor:{value:v,enumerable:false,writable:true,configurable:true}});}function i(v,E){Object.defineProperty(this,"kind",{value:v,enumerable:true}),E&&E.length&&Object.defineProperty(this,"path",{value:E,enumerable:true});}function n(v,E,C){n.super_.call(this,"E",v),Object.defineProperty(this,"lhs",{value:E,enumerable:true}),Object.defineProperty(this,"rhs",{value:C,enumerable:true});}t(n,i);function s(v,E){s.super_.call(this,"N",v),Object.defineProperty(this,"rhs",{value:E,enumerable:true});}t(s,i);function o(v,E){o.super_.call(this,"D",v),Object.defineProperty(this,"lhs",{value:E,enumerable:true});}t(o,i);function a(v,E,C){a.super_.call(this,"A",v),Object.defineProperty(this,"index",{value:E,enumerable:true}),Object.defineProperty(this,"item",{value:C,enumerable:true});}t(a,i);function u(v,E,C){var w=v.slice((E)+1||v.length);return v.length=E<0?v.length+E:E,v.push.apply(v,w),v}function l(v){var E=typeof v;return E!=="object"?E:v===Math?"math":v===null?"null":Array.isArray(v)?"array":Object.prototype.toString.call(v)==="[object Date]"?"date":typeof v.toString=="function"&&/^\/.*\//.test(v.toString())?"regexp":"object"}function c(v){var E=0;if(v.length===0)return E;for(var C=0;C<v.length;C++){var w=v.charCodeAt(C);E=(E<<5)-E+w,E=E&E;}return E}function h(v){var E=0,C=l(v);if(C==="array"){v.forEach(function(le){E+=h(le);});var w="[type: array, hash: "+E+"]";return E+c(w)}if(C==="object"){for(var B in v)if(v.hasOwnProperty(B)){var I="[ type: object, key: "+B+", value hash: "+h(v[B])+"]";E+=c(I);}return E}var U="[ type: "+C+" ; value: "+v+"]";return E+c(U)}function d(v,E,C,w,B,I,U,le){C=C||[],B=B||[],U=U||[];var fe=B.slice(0);if(typeof I<"u"&&I!==null){if(w){if(typeof w=="function"&&w(fe,I))return;if(typeof w=="object"){if(w.prefilter&&w.prefilter(fe,I))return;if(w.normalize){var hr=w.normalize(fe,I,v,E);hr&&(v=hr[0],E=hr[1]);}}}fe.push(I);}l(v)==="regexp"&&l(E)==="regexp"&&(v=v.toString(),E=E.toString());var V=typeof v,Y=typeof E,Fe,ve,nt,Mr,Yi=V!=="undefined"||U&&U.length>0&&U[U.length-1].lhs&&Object.getOwnPropertyDescriptor(U[U.length-1].lhs,I),ji=Y!=="undefined"||U&&U.length>0&&U[U.length-1].rhs&&Object.getOwnPropertyDescriptor(U[U.length-1].rhs,I);if(!Yi&&ji)C.push(new s(fe,E));else if(!ji&&Yi)C.push(new o(fe,v));else if(l(v)!==l(E))C.push(new n(fe,v,E));else if(l(v)==="date"&&v-E!==0)C.push(new n(fe,v,E));else if(V==="object"&&v!==null&&E!==null){for(Fe=U.length-1;Fe>-1;--Fe)if(U[Fe].lhs===v){Mr=true;break}if(Mr)v!==E&&C.push(new n(fe,v,E));else {if(U.push({lhs:v,rhs:E}),Array.isArray(v)){for(le&&(v.sort(function(yi,ua){return h(yi)-h(ua)}),E.sort(function(yi,ua){return h(yi)-h(ua)})),Fe=E.length-1,ve=v.length-1;Fe>ve;)C.push(new a(fe,Fe,new s(void 0,E[Fe--])));for(;ve>Fe;)C.push(new a(fe,ve,new o(void 0,v[ve--])));for(;Fe>=0;--Fe)d(v[Fe],E[Fe],C,w,fe,Fe,U,le);}else {var Il=Object.keys(v),bi=Object.keys(E);for(Fe=0;Fe<Il.length;++Fe)nt=Il[Fe],Mr=bi.indexOf(nt),Mr>=0?(d(v[nt],E[nt],C,w,fe,nt,U,le),bi[Mr]=null):d(v[nt],void 0,C,w,fe,nt,U,le);for(Fe=0;Fe<bi.length;++Fe)nt=bi[Fe],nt&&d(void 0,E[nt],C,w,fe,nt,U,le);}U.length=U.length-1;}}else v!==E&&(V==="number"&&isNaN(v)&&isNaN(E)||C.push(new n(fe,v,E)));}function f(v,E,C,w,B){var I=[];if(d(v,E,I,w,null,null,null,B),C)for(var U=0;U<I.length;++U)C(I[U]);return I}function m(v,E,C,w,B,I,U){return d(v,E,C,w,B,I,U,true)}function _(v,E,C,w){var B=w?function(U){U&&w.push(U);}:void 0,I=f(v,E,B,C);return w||(I.length?I:void 0)}function b(v,E,C,w){var B=w?function(U){U&&w.push(U);}:void 0,I=f(v,E,B,C,true);return w||(I.length?I:void 0)}function x(v,E,C){if(C.path&&C.path.length){var w=v[E],B,I=C.path.length-1;for(B=0;B<I;B++)w=w[C.path[B]];switch(C.kind){case "A":x(w[C.path[B]],C.index,C.item);break;case "D":delete w[C.path[B]];break;case "E":case "N":w[C.path[B]]=C.rhs;break}}else switch(C.kind){case "A":x(v[E],C.index,C.item);break;case "D":v=u(v,E);break;case "E":case "N":v[E]=C.rhs;break}return v}function y(v,E,C){if(typeof C>"u"&&E&&~e.indexOf(E.kind)&&(C=E),v&&C&&C.kind){for(var w=v,B=-1,I=C.path?C.path.length-1:0;++B<I;)typeof w[C.path[B]]>"u"&&(w[C.path[B]]=typeof C.path[B+1]<"u"&&typeof C.path[B+1]=="number"?[]:{}),w=w[C.path[B]];switch(C.kind){case "A":C.path&&typeof w[C.path[B]]>"u"&&(w[C.path[B]]=[]),x(C.path?w[C.path[B]]:w,C.index,C.item);break;case "D":delete w[C.path[B]];break;case "E":case "N":w[C.path[B]]=C.rhs;break}}}function S(v,E,C){if(C.path&&C.path.length){var w=v[E],B,I=C.path.length-1;for(B=0;B<I;B++)w=w[C.path[B]];switch(C.kind){case "A":S(w[C.path[B]],C.index,C.item);break;case "D":w[C.path[B]]=C.lhs;break;case "E":w[C.path[B]]=C.lhs;break;case "N":delete w[C.path[B]];break}}else switch(C.kind){case "A":S(v[E],C.index,C.item);break;case "D":v[E]=C.lhs;break;case "E":v[E]=C.lhs;break;case "N":v=u(v,E);break}return v}function T(v,E,C){if(v&&E&&C&&C.kind){var w=v,B,I;for(I=C.path.length-1,B=0;B<I;B++)typeof w[C.path[B]]>"u"&&(w[C.path[B]]={}),w=w[C.path[B]];switch(C.kind){case "A":S(w[C.path[B]],C.index,C.item);break;case "D":w[C.path[B]]=C.lhs;break;case "E":w[C.path[B]]=C.lhs;break;case "N":delete w[C.path[B]];break}}}function O(v,E,C){if(v&&E){var w=function(B){(!C||C(v,E,B))&&y(v,E,B);};f(v,E,w);}}return Object.defineProperties(_,{diff:{value:_,enumerable:true},orderIndependentDiff:{value:b,enumerable:true},observableDiff:{value:f,enumerable:true},orderIndependentObservableDiff:{value:m,enumerable:true},orderIndepHash:{value:h,enumerable:true},applyDiff:{value:O,enumerable:true},applyChange:{value:y,enumerable:true},revertChange:{value:T,enumerable:true},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:true}}),_.DeepDiff=_,r&&(r.DeepDiff=_),_});});Ee();var l1={};vi(l1,{CanvasBaseItem:()=>_d,CanvasEvent:()=>xd,CanvasManagerStatic:()=>D,Container:()=>es,FadeAlphaTicker:()=>_i,ImageContainer:()=>Ve,ImageSprite:()=>we,MoveTicker:()=>rr,RegisteredCanvasComponents:()=>Ut,RegisteredEvents:()=>hi,RegisteredTickers:()=>Wt,RotateTicker:()=>Rl,Sprite:()=>xi,Text:()=>ts,TickerBase:()=>zt,VideoSprite:()=>Gt,ZoomTicker:()=>zi,addImage:()=>yd,addImageCointainer:()=>bd,addVideo:()=>vd,canvas:()=>R,canvasComponentDecorator:()=>RR,eventDecorator:()=>MR,getTexture:()=>qr,loadImage:()=>UR,loadVideo:()=>NR,moveIn:()=>WR,moveOut:()=>W_,pushIn:()=>YR,pushOut:()=>u1,removeWithDissolve:()=>Sd,removeWithFade:()=>zR,shakeEffect:()=>FR,showImage:()=>LR,showImageContainer:()=>GR,showVideo:()=>HR,showWithDissolve:()=>o1,showWithFade:()=>VR,tickerDecorator:()=>kR,zoomIn:()=>XR,zoomOut:()=>a1});Ee();var ke={};vi(ke,{DistortionFilter:()=>R_,EqualizerFilter:()=>Br,Filter:()=>ht,MonoFilter:()=>M_,ReverbFilter:()=>I_,StereoFilter:()=>D_,StreamFilter:()=>O_,TelephoneFilter:()=>k_});var fR;function pR(r){return fR=r,r}function Ce(){return fR}var ht=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 R_=class extends ht{constructor(e=0){let t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Ce().useLegacy)return;let t=e*1e3,i=44100,n=new Float32Array(i),s=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,n[o]=(3+t)*a*20*s/(Math.PI+t*Math.abs(a));this._distortion.curve=n,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var ut=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Ce().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Ae=class extends ht{constructor(r=0,e=0,t=0,i=0,n=0,s=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Ae.F32,type:"lowshelf",gain:r},{f:Ae.F64,type:"peaking",gain:e},{f:Ae.F125,type:"peaking",gain:t},{f:Ae.F250,type:"peaking",gain:i},{f:Ae.F500,type:"peaking",gain:n},{f:Ae.F1K,type:"peaking",gain:s},{f:Ae.F2K,type:"peaking",gain:o},{f:Ae.F4K,type:"peaking",gain:a},{f:Ae.F8K,type:"peaking",gain:u},{f:Ae.F16K,type:"highshelf",gain:l}];Ce().useLegacy||(c=h.map(d=>{let f=Ce().context.audioContext.createBiquadFilter();return f.type=d.type,ut.setParamValue(f.Q,1),f.frequency.value=d.f,ut.setParamValue(f.gain,d.gain),f})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let f=this.bands[d];d>0&&this.bands[d-1].connect(f),this.bandsMap[f.frequency.value]=f;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);ut.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(Ae.F32,r);}get f32(){return this.getGain(Ae.F32)}set f64(r){this.setGain(Ae.F64,r);}get f64(){return this.getGain(Ae.F64)}set f125(r){this.setGain(Ae.F125,r);}get f125(){return this.getGain(Ae.F125)}set f250(r){this.setGain(Ae.F250,r);}get f250(){return this.getGain(Ae.F250)}set f500(r){this.setGain(Ae.F500,r);}get f500(){return this.getGain(Ae.F500)}set f1k(r){this.setGain(Ae.F1K,r);}get f1k(){return this.getGain(Ae.F1K)}set f2k(r){this.setGain(Ae.F2K,r);}get f2k(){return this.getGain(Ae.F2K)}set f4k(r){this.setGain(Ae.F4K,r);}get f4k(){return this.getGain(Ae.F4K)}set f8k(r){this.setGain(Ae.F8K,r);}get f8k(){return this.getGain(Ae.F8K)}set f16k(r){this.setGain(Ae.F16K,r);}get f16k(){return this.getGain(Ae.F16K)}reset(){this.bands.forEach(r=>{ut.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},Br=Ae;Br.F32=32;Br.F64=64;Br.F125=125;Br.F250=250;Br.F500=500;Br.F1K=1e3;Br.F2K=2e3;Br.F4K=4e3;Br.F8K=8e3;Br.F16K=16e3;var M_=class extends ht{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().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 I_=class extends ht{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(Ce().useLegacy)return;let{audioContext:e}=Ce().context,t=e.sampleRate,i=t*this._seconds,n=e.createBuffer(2,i,t),s=n.getChannelData(0),o=n.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,s[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=n,this.init(u);}};var D_=class extends ht{constructor(e=0){let t,i,n;if(!Ce().useLegacy){let{audioContext:s}=Ce().context;s.createStereoPanner?(t=s.createStereoPanner(),n=t):(i=s.createPanner(),i.panningModel="equalpower",n=i);}super(n),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?ut.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 O_=class extends ht{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().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 k_=class extends ht{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context,n=i.createBiquadFilter(),s=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();n.type="lowpass",ut.setParamValue(n.frequency,2e3),s.type="lowpass",ut.setParamValue(s.frequency,2e3),o.type="highpass",ut.setParamValue(o.frequency,500),a.type="highpass",ut.setParamValue(a.frequency,500),n.connect(s),s.connect(o),o.connect(a),e=n,t=a;}super(e,t);}};Ee();var od=class extends ce{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();}};Ee();var Fk=0,LE=class extends ce{constructor(r){super(),this.id=Fk++,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),n=this._volume*(this._muted?0:1);this._source.volume=n*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:n,volume:s,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=s,this._loop=!!n,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-LE.PADDING),this._end=Math.min(this._end+LE.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),Se.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(){Se.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){Se.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}]`}},F_=LE;F_.PADDING=.1;Ee();var ad=class extends ce{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new F_(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 n=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},s=()=>{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",n),t.removeEventListener("load",n),t.removeEventListener("abort",s),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",n,false),t.addEventListener("load",n,false),t.addEventListener("abort",s,false),t.addEventListener("error",o,false),t.load();}};Ee();var ud=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 Ko=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],NE=["audio/mpeg","audio/ogg"],Zo={};function mR(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={},n=/^no$/;Ko.forEach(s=>{let o=t.canPlayType(`audio/${s}`).replace(n,""),a=e[s]?t.canPlayType(e[s]).replace(n,""):"";i[s]=!!o||!!a;}),Object.assign(Zo,i);}mR();Ee();Ee();var Uk=0,ld=class extends ce{constructor(e){super(),this.id=Uk++,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),n=t.volume*(t.muted?0:1),s=this._volume*(this._muted?0:1);ut.setParamValue(this._gain.gain,s*n*i),ut.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:n,loop:s,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=n,this._volume=o,this._loop=!!s,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){Se.shared.remove(this._updateListener,this),e&&Se.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 n=this._source.playbackRate.value;this._elapsed+=i*n,this._lastUpdate=t;let s=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/s;}else o=this._elapsed%s/s;this._progress=o,this.emit("progress",this._progress,s);}}}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 Qo=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 gR=class extends Qo{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),n=e.createAnalyser();t.connect(n),n.connect(i),i.connect(r.destination),super(n,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=n;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(gR.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,ut.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}},G_=gR;G_.BUFFER_SIZE=0;var Jo=class{init(e){this.parent=e,this._nodes=new G_(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 ld(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=(n,s)=>{if(n)t&&t(n);else {this.parent.isLoaded=true,this.buffer=s;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var bl=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=Ce().useLegacy?new ad:new Jo;return new bl(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:Oe.extname(t).slice(1)})).filter(({ext:t})=>Zo[t]).sort((t,i)=>Ko.indexOf(t.ext)-Ko.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Ce().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 n in r)i[n]=this.addSprites(n,r[n]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new ud(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 n=t.sprite;console.assert(!!this._sprites[n],`Alias ${n} is not available`);let s=this._sprites[n];t.start=s.start+(t.start||0),t.end=s.end,t.speed=s.speed||1,t.loop=s.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(n=>{this._preloadQueue.push(()=>{n(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((n,s)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?s(o):(t.loaded&&t.loaded(o,a,u),n(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(bl._pool.length>0){let r=bl._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),bl._pool.indexOf(r)<0&&bl._pool.push(r);}},cr=bl;cr._pool=[];Ee();var yl=class r extends Qo{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),n=t.createAnalyser();n.connect(i),i.connect(t.destination),super(n,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=n,this.events=new ce,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=s=>{t(new Error(s?.message||"Unable to decode file"));},n=this._offlineCtx.decodeAudioData(e,s=>{t(null,s);},i);n&&n.catch(i);}};var vl=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new yl),this._htmlAudioContext=new od,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 yl.AudioContext!==null}add(e,t){if(typeof e=="object"){let s={};for(let o in e){let a=this._getOptions(e[o],t);s[o]=this.add(o,a);}return s}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof cr)return this._sounds[e]=t,t;let i=this._getOptions(t),n=cr.from(i);return this._sounds[e]=n,n}_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}};Ee();Ee();var xR=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=Oe.basename(e,Oe.extname(e))),t},_R={extension:g.Asset,detection:{test:async()=>true,add:async r=>[...r,...Ko.filter(e=>Zo[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[g.LoadParser],priority:De.High},test(r){let e=Oe.extname(r).slice(1);return !!Zo[e]||NE.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,n)=>cr.from({...e.data,url:r,preload:true,loaded(s,o){s?n(s):i(o),e.data?.loaded?.(s,o);}}));return Ce().add(xR(e),t),t},async unload(r,e){Ce().remove(xR(e));}}};N.add(_R);var be=pR(new vl);var cd="1.2.9";var Qn="repeat";function HE(r){return {type:"pause",duration:r}}var VE={DistortionFilter:ke.DistortionFilter,EqualizerFilter:ke.EqualizerFilter,MonoFilter:ke.MonoFilter,ReverbFilter:ke.ReverbFilter,StereoFilter:ke.StereoFilter,StreamFilter:ke.StreamFilter,TelephoneFilter:ke.TelephoneFilter},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"],er="__game_layer__",Tl="Container",U_="ImageContainer",zE="Image",Sl="Sprite",El="Text",WE="Video",ie={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};var A;(n=>(n.log=(s,...o)=>console.log(`[Pixi\u2019VN] ${s}`,...o),n.warn=(s,...o)=>console.warn(`[Pixi\u2019VN] ${s}`,...o),n.error=(s,...o)=>console.error(`[Pixi\u2019VN] ${s}`,...o),n.info=(s,...o)=>console.info(`[Pixi\u2019VN] ${s}`,...o)))(A||={});function se(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw A.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function yR(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(()=>(Ee(),hR))),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 CR=$i(XE());Ee();var Vk={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof we||r instanceof Gt||r instanceof Ve},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 Gt||r instanceof Ve)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}}}]}},ER=Vk;function zk(r,e){let t=0;return async(...i)=>{let n=Date.now();if(n-t>=e)return t=n,await r(...i)}}var D=class r{constructor(){}static _app=void 0;static get app(){if(!r._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return r._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(er);return e||(e=new re,e.label=er,this.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,t,i,n,s){return r.canvasWidth=t,r.canvasHeight=i,r._app=new yh,r.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...n}).then(()=>{let{app:o=r.app,extensions:a=[],...u}=s||{};yR({app:o,extensions:[ER,...a],...u}),r._isInitialized=true,r.addCanvasIntoHTMLElement(e),window.addEventListener("resize",r.resize),r.resize(),r.gameLayer;})}static addCanvasIntoHTMLElement(e){r._isInitialized?e.appendChild(r.app.canvas):A.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let n=document.createElement("div");n.setAttribute("id",e),n.style.position=i.position,n.style.pointerEvents=i.pointerEvents;let s=t.appendChild(n);return r.htmlLayers.push(n),r.resize(),s}static removeHtmlLayer(e){let t=r.htmlLayers.find(i=>i.id===e);t&&(t.remove(),r.htmlLayers=r.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return r.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/r.canvasWidth,t/r.canvasHeight)}static get screenWidth(){return Math.floor(r.screenScale*r.canvasWidth)}static get screenHeight(){return Math.floor(r.screenScale*r.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-r.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-r.screenHeight)/2}static async resize(){await zk(async()=>{if(r._isInitialized){let i=r.app.canvas.style;i.width=`${r.screenWidth}px`,i.height=`${r.screenHeight}px`,i.marginLeft=`${r.horizontalMargin}px`,i.marginRight=`${r.horizontalMargin}px`,i.marginTop=`${r.verticalMargin}px`,i.marginBottom=`${r.verticalMargin}px`;}let t=r.htmlLayers.map(i=>{i.style.width=`${r.screenWidth}px`,i.style.height=`${r.screenHeight}px`,i.style.marginLeft=`${r.horizontalMargin}px`,i.style.marginRight=`${r.horizontalMargin}px`,i.style.marginTop=`${r.verticalMargin}px`,i.style.marginBottom=`${r.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return r.gameLayer.children.filter(e=>e.label).sort((e,t)=>r.gameLayer.getChildIndex(e)-r.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(r._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static _currentTickers={};static _currentTickersSequence={};static _currentTickersTimeouts={};static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static _tickersOnPause={};static generateTickerId(e){try{return (0,CR.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,n){typeof e=="string"&&(e=[e]),r._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:n};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),r._currentTickersTimeouts[e]&&delete r._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),r.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(r._currentTickersTimeouts).forEach(([i,n])=>{let s=n.aliases.filter(o=>o!==e);if(s.length===0){let o=n.canBeDeletedBeforeEnd;(!t||o)&&r.removeTickerTimeout(i);}else r._currentTickersTimeouts[i].aliases=s;});}};Ee();var Cl=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,PR=new Set,YE=typeof process=="object"&&process?process:{},wR=(r,e,t,i)=>{typeof YE.emitWarning=="function"?YE.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},H_=globalThis.AbortController,AR=globalThis.AbortSignal;if(typeof H_>"u"){AR=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,n){this._onabort.push(n);}},H_=class{constructor(){e();}signal=new AR;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i);}}};let r=YE.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,wR("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 Wk=r=>!PR.has(r),Jn=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),BR=r=>Jn(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Al:null:null,Al=class extends Array{constructor(e){super(e),this.fill(0);}},jE=class r{heap;length;static#u=false;static create(e){let t=BR(e);if(!t)return [];r.#u=true;let i=new r(e,t);return r.#u=false,i}constructor(e,t){if(!r.#u)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},V_=class r{#u;#h;#m;#P;#g;#M;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#x;#i;#r;#e;#l;#d;#a;#s;#_;#o;#b;#y;#f;#v;#A;#c;#D;static unsafeExposeInternals(e){return {starts:e.#y,ttls:e.#f,sizes:e.#b,keyMap:e.#i,keyList:e.#r,valList:e.#e,next:e.#l,prev:e.#d,get head(){return e.#a},get tail(){return e.#s},free:e.#_,isBackgroundFetch:t=>e.#t(t),backgroundFetch:(t,i,n,s)=>e.#F(t,i,n,s),moveToTail:t=>e.#R(t),indexes:t=>e.#T(t),rindexes:t=>e.#S(t),isStale:t=>e.#p(t)}}get max(){return this.#u}get maxSize(){return this.#h}get calculatedSize(){return this.#x}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#m}get onInsert(){return this.#P}get disposeAfter(){return this.#g}constructor(e){let{max:t=0,ttl:i,ttlResolution:n=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:_=0,sizeCalculation:b,fetchMethod:x,memoMethod:y,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:v,ignoreFetchAbort:E}=e;if(t!==0&&!Jn(t))throw new TypeError("max option must be a nonnegative integer");let C=t?BR(t):Array;if(!C)throw new Error("invalid max value: "+t);if(this.#u=t,this.#h=m,this.maxEntrySize=_||this.#h,this.sizeCalculation=b,this.sizeCalculation){if(!this.#h&&!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(this.#I=y,x!==void 0&&typeof x!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=x,this.#A=!!x,this.#i=new Map,this.#r=new Array(t).fill(void 0),this.#e=new Array(t).fill(void 0),this.#l=new C(t),this.#d=new C(t),this.#a=0,this.#s=0,this.#_=jE.create(t),this.#n=0,this.#x=0,typeof l=="function"&&(this.#m=l),typeof c=="function"&&(this.#P=c),typeof h=="function"?(this.#g=h,this.#o=[]):(this.#g=void 0,this.#o=void 0),this.#v=!!this.#m,this.#D=!!this.#P,this.#c=!!this.#g,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#h!==0&&!Jn(this.#h))throw new TypeError("maxSize must be a positive integer if specified");if(!Jn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#z();}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Jn(n)||n===0?n:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!Jn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#G();}if(this.#u===0&&this.ttl===0&&this.#h===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#u&&!this.#h){let w="LRU_CACHE_UNBOUNDED";Wk(w)&&(PR.add(w),wR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",w,r));}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#G(){let e=new Al(this.#u),t=new Al(this.#u);this.#f=e,this.#y=t,this.#U=(s,o,a=Cl.now())=>{if(t[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#p(s)&&this.#E(this.#r[s],"expire");},o+1);u.unref&&u.unref();}},this.#w=s=>{t[s]=e[s]!==0?Cl.now():0;},this.#C=(s,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;s.ttl=a,s.start=u,s.now=i||n();let l=s.now-u;s.remainingTTL=a-l;}};let i=0,n=()=>{let s=Cl.now();if(this.ttlResolution>0){i=s;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return s};this.getRemainingTTL=s=>{let o=this.#i.get(s);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||n())-u;return a-l},this.#p=s=>{let o=t[s],a=e[s];return !!a&&!!o&&(i||n())-o>a};}#w=()=>{};#C=()=>{};#U=()=>{};#p=()=>false;#z(){let e=new Al(this.#u);this.#x=0,this.#b=e,this.#B=t=>{this.#x-=e[t],e[t]=0;},this.#L=(t,i,n,s)=>{if(this.#t(i))return 0;if(!Jn(n))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(n=s(i,t),!Jn(n))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 n},this.#O=(t,i,n)=>{if(e[t]=i,this.#h){let s=this.#h-e[t];for(;this.#x>s;)this.#k(true);}this.#x+=e[t],n&&(n.entrySize=i,n.totalCalculatedSize=this.#x);};}#B=e=>{};#O=(e,t,i)=>{};#L=(e,t,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#s;!(!this.#N(t)||((e||!this.#p(t))&&(yield t),t===this.#a));)t=this.#d[t];}*#S({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;!(!this.#N(t)||((e||!this.#p(t))&&(yield t),t===this.#s));)t=this.#l[t];}#N(e){return e!==void 0&&this.#i.get(this.#r[e])===e}*entries(){for(let e of this.#T())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*rentries(){for(let e of this.#S())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*keys(){for(let e of this.#T()){let t=this.#r[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*rkeys(){for(let e of this.#S()){let t=this.#r[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*values(){for(let e of this.#T())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#S())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#T()){let n=this.#e[i],s=this.#t(n)?n.__staleWhileFetching:n;if(s!==void 0&&e(s,this.#r[i],this))return this.get(this.#r[i],t)}}forEach(e,t=this){for(let i of this.#T()){let n=this.#e[i],s=this.#t(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(t,s,this.#r[i],this);}}rforEach(e,t=this){for(let i of this.#S()){let n=this.#e[i],s=this.#t(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(t,s,this.#r[i],this);}}purgeStale(){let e=false;for(let t of this.#S({allowStale:true}))this.#p(t)&&(this.#E(this.#r[t],"expire"),e=true);return e}info(e){let t=this.#i.get(e);if(t===void 0)return;let i=this.#e[t],n=this.#t(i)?i.__staleWhileFetching:i;if(n===void 0)return;let s={value:n};if(this.#f&&this.#y){let o=this.#f[t],a=this.#y[t];if(o&&a){let u=o-(Cl.now()-a);s.ttl=u,s.start=Date.now();}}return this.#b&&(s.size=this.#b[t]),s}dump(){let e=[];for(let t of this.#T({allowStale:true})){let i=this.#r[t],n=this.#e[t],s=this.#t(n)?n.__staleWhileFetching:n;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#f&&this.#y){o.ttl=this.#f[t];let a=Cl.now()-this.#y[t];o.start=Math.floor(Date.now()-a);}this.#b&&(o.size=this.#b[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let n=Date.now()-i.start;i.start=Cl.now()-n;}this.set(t,i.value,i);}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=this.#L(e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),this.#E(e,"set"),this;let h=this.#n===0?void 0:this.#i.get(e);if(h===void 0)h=this.#n===0?this.#s:this.#_.length!==0?this.#_.pop():this.#n===this.#u?this.#k(false):this.#n,this.#r[h]=e,this.#e[h]=t,this.#i.set(e,h),this.#l[this.#s]=h,this.#d[h]=this.#s,this.#s=h,this.#n++,this.#O(h,c,u),u&&(u.set="add"),l=false,this.#D&&this.#P?.(t,e,"add");else {this.#R(h);let d=this.#e[h];if(t!==d){if(this.#A&&this.#t(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=d;f!==void 0&&!o&&(this.#v&&this.#m?.(f,e,"set"),this.#c&&this.#o?.push([f,e,"set"]));}else o||(this.#v&&this.#m?.(d,e,"set"),this.#c&&this.#o?.push([d,e,"set"]));if(this.#B(h),this.#O(h,c,u),this.#e[h]=t,u){u.set="replace";let f=d&&this.#t(d)?d.__staleWhileFetching:d;f!==void 0&&(u.oldValue=f);}}else u&&(u.set="update");this.#D&&this.onInsert?.(t,e,t===d?"update":"replace");}if(n!==0&&!this.#f&&this.#G(),this.#f&&(l||this.#U(h,n,s),u&&this.#C(u,h)),!o&&this.#c&&this.#o){let d=this.#o,f;for(;f=d?.shift();)this.#g?.(...f);}return this}pop(){try{for(;this.#n;){let e=this.#e[this.#a];if(this.#k(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#c&&this.#o){let e=this.#o,t;for(;t=e?.shift();)this.#g?.(...t);}}}#k(e){let t=this.#a,i=this.#r[t],n=this.#e[t];return this.#A&&this.#t(n)?n.__abortController.abort(new Error("evicted")):(this.#v||this.#c)&&(this.#v&&this.#m?.(n,i,"evict"),this.#c&&this.#o?.push([n,i,"evict"])),this.#B(t),e&&(this.#r[t]=void 0,this.#e[t]=void 0,this.#_.push(t)),this.#n===1?(this.#a=this.#s=0,this.#_.length=0):this.#a=this.#l[t],this.#i.delete(i),this.#n--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=t,s=this.#i.get(e);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return false;if(this.#p(s))n&&(n.has="stale",this.#C(n,s));else return i&&this.#w(s),n&&(n.has="hit",this.#C(n,s)),true}else n&&(n.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,n=this.#i.get(e);if(n===void 0||!i&&this.#p(n))return;let s=this.#e[n];return this.#t(s)?s.__staleWhileFetching:s}#F(e,t,i,n){let s=t===void 0?void 0:this.#e[t];if(this.#t(s))return s;let o=new H_,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:n},l=(_,b=false)=>{let{aborted:x}=o.signal,y=i.ignoreFetchAbort&&_!==void 0;if(i.status&&(x&&!b?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),x&&!y&&!b)return h(o.signal.reason);let S=f;return this.#e[t]===f&&(_===void 0?S.__staleWhileFetching?this.#e[t]=S.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,_,u.options))),_},c=_=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=_),h(_)),h=_=>{let{aborted:b}=o.signal,x=b&&i.allowStaleOnFetchAbort,y=x||i.allowStaleOnFetchRejection,S=y||i.noDeleteOnFetchRejection,T=f;if(this.#e[t]===f&&(!S||T.__staleWhileFetching===void 0?this.#E(e,"fetch"):x||(this.#e[t]=T.__staleWhileFetching)),y)return i.status&&T.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),T.__staleWhileFetching;if(T.__returned===T)throw _},d=(_,b)=>{let x=this.#M?.(e,s,u);x&&x instanceof Promise&&x.then(y=>_(y===void 0?void 0:y),b),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=y=>l(y,true)));});};i.status&&(i.status.fetchDispatched=true);let f=new Promise(d).then(l,c),m=Object.assign(f,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,m,{...u.options,status:void 0}),t=this.#i.get(e)):this.#e[t]=m,m}#t(e){if(!this.#A)return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof H_}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=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:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:_,forceRefresh:b=false,status:x,signal:y}=t;if(!this.#A)return x&&(x.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,status:x});let S={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:x,signal:y},T=this.#i.get(e);if(T===void 0){x&&(x.fetch="miss");let O=this.#F(e,T,S,_);return O.__returned=O}else {let O=this.#e[T];if(this.#t(O)){let B=i&&O.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",B&&(x.returnedStale=true)),B?O.__staleWhileFetching:O.__returned=O}let v=this.#p(T);if(!b&&!v)return x&&(x.fetch="hit"),this.#R(T),n&&this.#w(T),x&&this.#C(x,T),O;let E=this.#F(e,T,S,_),w=E.__staleWhileFetching!==void 0&&i;return x&&(x.fetch=v?"stale":"refresh",w&&v&&(x.returnedStale=true)),w?E.__staleWhileFetching:E.__returned=E}}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=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:s,...o}=t,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=i(e,a,{options:o,context:n});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,a=this.#i.get(e);if(a!==void 0){let u=this.#e[a],l=this.#t(u);return o&&this.#C(o,a),this.#p(a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(s||this.#E(e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#R(a),n&&this.#w(a),u))}else o&&(o.get="miss");}#H(e,t){this.#d[t]=e,this.#l[e]=t;}#R(e){e!==this.#s&&(e===this.#a?this.#a=this.#l[e]:this.#H(this.#d[e],this.#l[e]),this.#H(this.#s,e),this.#s=e);}delete(e){return this.#E(e,"delete")}#E(e,t){let i=false;if(this.#n!==0){let n=this.#i.get(e);if(n!==void 0)if(i=true,this.#n===1)this.#V(t);else {this.#B(n);let s=this.#e[n];if(this.#t(s)?s.__abortController.abort(new Error("deleted")):(this.#v||this.#c)&&(this.#v&&this.#m?.(s,e,t),this.#c&&this.#o?.push([s,e,t])),this.#i.delete(e),this.#r[n]=void 0,this.#e[n]=void 0,n===this.#s)this.#s=this.#d[n];else if(n===this.#a)this.#a=this.#l[n];else {let o=this.#d[n];this.#l[o]=this.#l[n];let a=this.#l[n];this.#d[a]=this.#d[n];}this.#n--,this.#_.push(n);}}if(this.#c&&this.#o?.length){let n=this.#o,s;for(;s=n?.shift();)this.#g?.(...s);}return i}clear(){return this.#V("delete")}#V(e){for(let t of this.#S({allowStale:true})){let i=this.#e[t];if(this.#t(i))i.__abortController.abort(new Error("deleted"));else {let n=this.#r[t];this.#v&&this.#m?.(i,n,e),this.#c&&this.#o?.push([i,n,e]);}}if(this.#i.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#f&&this.#y&&(this.#f.fill(0),this.#y.fill(0)),this.#b&&this.#b.fill(0),this.#a=0,this.#s=0,this.#_.length=0,this.#x=0,this.#n=0,this.#c&&this.#o){let t=this.#o,i;for(;i=t?.shift();)this.#g?.(...i);}}};var lt=class{cache;map=new Map;constructor(e){this.cache=new V_({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 hd=new lt({cacheSize:5});function RR(r){return function(e){$E.add(e,r);}}var $E;(n=>{function r(s,o){o||(o=s.name),hd.get(o)&&A.warn(`CanvasElement "${o}" already registered`),s.prototype.pixivnId=o,hd.set(o,s);}n.add=r;function e(s){try{let o=hd.get(s);if(!o){A.error(`CanvasElement "${s}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){A.error(`Error while getting CanvasElement "${s}"`,o);return}}n.get=e;function t(){return Array.from(hd.values())}n.values=t;function i(s){return hd.has(s)}n.has=i;})($E||={});var Ut=$E;var Pl=new lt({cacheSize:5});function MR(r){return function(e){qE.add(e,r);}}var qE;(s=>{function r(o,a){a||(a=o.name),Pl.get(a)&&A.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,Pl.set(a,o);}s.add=r;function e(o){try{let a=Pl.get(o);if(!a){A.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){A.error(`Error while getting Event "${o}"`,a);return}}s.get=e;function t(o){try{let a=Pl.get(o);if(!a){A.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){A.error(`Error while getting Event "${o}"`,a);return}}s.getInstance=t;function i(){return Array.from(Pl.values())}s.values=i;function n(o){return Pl.has(o)}s.has=n;})(qE||={});var hi=qE;async function z_(r){let e=Xk(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 Xk(r){try{let e=Ut.get(r);return e?new e:void 0}catch(e){A.error(`Error while getting CanvasElement ${r}`,e);return}}Ee();function KE(r){return "memory"in r?r.memory:r instanceof wr?ZE(r):r instanceof Pe?dd(r):ea(r)}function Yk(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 IR(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function ea(r,e){let t=jk(r,Tl),n=e?.childrenExport||false?r.children.sort((s,o)=>r.getChildIndex(s)-r.getChildIndex(o)).map(s=>KE(s)):[];return {pixivnId:t,elements:n,...Yk(r)}}function dd(r){let e=ea(r),t=e.pixivnId??Sl,i=OR(r),n="textureAlias"in r?IR(r.texture,r.textureAlias):IR(r.texture);return {...e,pixivnId:t,textureData:n,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function ZE(r){let e=ea(r),t=e.pixivnId??El,i=OR(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:$k(r.style),roundPixels:r.roundPixels,onEvents:i}}function jk(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function OR(r){return "onEvents"in r?r.onEvents:{}}function DR(r,e){if(typeof r!="object"||r===null)return r;A.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function $k(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:DR(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:DR(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var es=class extends re{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||Tl;}pixivnId=Tl;get memory(){return ea(this,{childrenExport:true})}set memory(e){}async setMemory(e){return this.memory=e,await this.importChildren(e),await di(this,e)}async importChildren(e){for(let t=0;t<e.elements.length;t++){let i=e.elements[t],n=await z_(i);this.addChild(n);}}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,n=hi.getInstance(i);return this._onEvents[e]=i,n?super.on(e,()=>{n.fn(e,this);}):A.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}};Ut.add(es,Tl);async function di(r,e,t){let i=t?.ignoreScale||false,n=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),n&&await n(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}Ee();var tr=class r{static init(e){r._getScreen=e.getScreen;}static _getScreen;static get screen(){return r._getScreen()}};function Hi(r,e,t,i,n,s=0){return i=i*(n?-1:1),r==="width"?e*(tr.screen.width-t)+i+s*t+(n?t:0):e*(tr.screen.height-t)+i+s*t+(n?t:0)}function fi(r,e,t,i,n,s=0){return i=i*(n?-1:1),r==="width"?(e-i-s*t-(n?t:0))/(tr.screen.width-t):(e-i-s*t-(n?t:0))/(tr.screen.height-t)}function Vi(r,e){return r==="width"?e*tr.screen.width:e*tr.screen.height}function pi(r,e){return r==="width"?e/tr.screen.width:e/tr.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),n=Math.sin(t);return {x:r.x*i-r.y*n,y:r.x*n+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:-r.y*n-r.x*i,y:r.y*i-r.x*n}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:-r.x*i+r.y*n,y:-r.x*n-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:r.y*n-r.x*i,y:-r.y*i-r.x*n}}return {x:0,y:0}}function QE(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),n=Math.sin(t);return {x:r.x*i+r.y*n,y:-r.x*n+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:r.y*i-r.x*n,y:-r.y*n-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:-r.x*i-r.y*n,y:r.x*n-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:-r.y*i+r.x*n,y:r.y*n+r.x*i}}return {x:0,y:0}}function mi(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 gi(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))}Ee();var qk=new RegExp(`(${bR.join("|")})$`);function fd(r){let e=exports.Assets.cache.has(r)?exports.Assets.get(r):null;return e instanceof exports.Texture&&(r=e.source?.label||r),qk.test(r)}function ta(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)}Ee();Ee();async function qr(r){if(r!=="EMPTY"){if(!r){A.error("Texture not found",r);return}if(exports.Assets.cache.has(r)){let e=exports.Assets.get(r);if(e)return e}return exports.Assets.load(r).then(e=>{if(!e){A.error("Texture not found",r);return}if(!(e instanceof exports.Texture)){A.error("File not is a file",r);return}return e}).catch(e=>{A.error("Error loading file",e);})}}Ee();var xi=class r extends Pe{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||Sl;}pixivnId=Sl;_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(e){this._textureAlias=e;}get memory(){return dd(this)}set memory(e){}async setMemory(e){return this.memory=e,await pd(this,e)}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,n=hi.getInstance(i);return this._onEvents[e]=i,n?(super.on(e,()=>{n.fn(e,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):A.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}static from(e,t){let i=Pe.from(e,t),n=new r;return n.texture=i.texture,n}};Ut.add(xi,Sl);async function pd(r,e,t){let i=t?.ignoreTexture||false;if(await di(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let s=await qr(e.textureImage.image);s&&(r.texture=s);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let s=e.textureData.url;e.textureData.alias&&exports.Assets.resolver.hasKey(e.textureData.alias)&&(s=e.textureData.alias);let o=await qr(s);o&&(r.texture=o);}}let n=t?.half;if(n&&await n(),"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 s in e.onEvents){let o=e.onEvents[s],a=hi.get(o);a&&r.onEvent(s,a);}}var we=class r extends xi{pixivnId=zE;constructor(e,t){e=ta(e);let i,n;e&&"align"in e&&e?.align!==void 0&&(i=e.align,delete e.align),e&&"percentagePosition"in e&&e?.percentagePosition!==void 0&&(n=e.percentagePosition,delete e.percentagePosition),super(e),t&&(this.textureAlias=t),i&&(this.align=i),n&&(this.percentagePosition=n);}get memory(){return {...dd(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(e){}async setMemory(e){this.memory=e,await md(this,e),this.reloadPosition();}static from(e,t){let i=Pe.from(e,t),n=new r;return n.texture=i.texture,n}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,qr(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,A.error("Error into ImageSprite.load()",e);})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return {x:fi("width",this.x,mi(this),e.x,t.x<0,this.anchor.x),y:fi("height",this.y,gi(this),e.y,t.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return fi("width",this.x,mi(this),e.x,t.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return fi("height",this.y,gi(this),e.y,t.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.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(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get yPercentagePosition(){return pi("height",this.y)}set yPercentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,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(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);this._align.x!==void 0&&(super.x=Hi("width",this._align.x,mi(this),e.x,t.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=Hi("height",this._align.y,gi(this),e.y,t.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Vi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Vi("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};Ut.add(we,zE);async function md(r,e,t){let i=t?.ignoreTexture||false;return e=ta(e),await pd(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})}Ee();var Gt=class r extends we{constructor(e,t){let i,n,s;e&&"loop"in e&&e?.loop!==void 0&&(i=e.loop,delete e.loop),e&&"paused"in e&&e?.paused!==void 0&&(n=e.paused,delete e.paused),e&&"currentTime"in e&&e?.currentTime!==void 0&&(s=e.currentTime,delete e.currentTime),super(e,t),i&&(this.loop=i),n&&(this.paused=n),s&&(this.currentTime=s);}pixivnId=WE;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(e){}async setMemory(e){return this.memory=e,await JE(this,e)}static from(e,t){let i=Pe.from(e,t),n=new r;return n.texture=i.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?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();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let t=this.duration;t&&e>=t&&(e=0),this._currentTime=e,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=e);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};Ut.add(Gt,WE);async function JE(r,e,t){await md(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 Ve=class extends es{constructor(e,t=[]){e=ta(e);let i,n,s;e&&"anchor"in e&&e?.anchor!==void 0&&(s=e.anchor,delete e.anchor),e&&"align"in e&&e?.align!==void 0&&(i=e.align,delete e.align),e&&"percentagePosition"in e&&e?.percentagePosition!==void 0&&(n=e.percentagePosition,delete e.percentagePosition),super(e),e=ta(e),t&&t.forEach(o=>{let a;fd(o)?a=new Gt(void 0,o):a=new we(void 0,o),this.addChild(a);}),s&&(this.anchor=s),i&&(this.align=i),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:U_,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(e){}async setMemory(e){this.memory=e,await this.importChildren(e),await e1(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=U_;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=Array(this.children.length);for(let t=0;t<this.children.length;t++)e[t]=this.children[t].load();return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(t=>{this._loadIsStarted=false,A.error("Error into ImageContainer.load()",t);})}get texture(){return this.children.length>0?this.children[0].texture:new exports.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}_anchor;get anchor(){let e=super.pivot.x/this.width,t=super.pivot.y/this.height;return {x:e,y:t}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,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(e){this._anchor=void 0,super.pivot=e;}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return {x:fi("width",this.x,mi(this),e.x,t.x<0,this.anchor.x),y:fi("height",this.y,gi(this),e.y,t.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return fi("width",this.x,mi(this),e.x,t.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return fi("height",this.y,gi(this),e.y,t.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:pi("width",this.x),y:pi("height",this.y)}}set xPercentagePosition(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get xPercentagePosition(){return pi("width",this.x)}set yPercentagePosition(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,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(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);this._align.x!==void 0&&(super.x=Hi("width",this._align.x,mi(this),e.x,t.x<0)),this._align.y!==void 0&&(super.y=Hi("height",this._align.y,gi(this),e.y,t.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Vi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Vi("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};Ut.add(Ve,U_);async function e1(r,e,t){e=ta(e),di(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();}});}Ee();var ts=class extends wr{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||El;}pixivnId=El;get memory(){return ZE(this)}set memory(e){}async setMemory(e){return this.memory=e,await t1(this,e)}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,n=hi.getInstance(i);return this._onEvents[e]=i,n?(super.on(e,()=>{n.fn(e,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):A.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}};Ut.add(ts,El);async function t1(r,e){if(await di(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],n=hi.get(i);n&&r.onEvent(t,n);}}var zt=class{constructor(e,t,i){this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}id="ticker_id_not_set";args;duration;priority;fn(e,t,i,n){throw new Error("[Pixi\u2019VN] The method TickerBase.fn() must be overridden")}onEndOfTicker(e,t,i){let n="aliasToRemoveAfter"in i&&i.aliasToRemoveAfter||[];typeof n=="string"&&(n=[n]);let s="tickerAliasToResume"in i&&i.tickerAliasToResume||[];typeof s=="string"&&(s=[s]),R.onEndOfTicker(t,{aliasToRemoveAfter:n,tickerAliasToResume:s});}};var wl=new lt({cacheSize:5});function kR(r){return function(e){r1.add(e,r);}}var r1;(s=>{function r(o,a){a||(a=o.name),wl.get(a)&&A.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,wl.set(a,o);}s.add=r;function e(o){try{let a=wl.get(o);if(!a){A.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){A.error(`Error while getting Event "${o}"`,a);return}}s.get=e;function t(o,a,u,l){try{let c=wl.get(o);if(!c){A.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){A.error(`Error while getting Ticker "${o}"`,c);return}}s.getInstance=t;function i(){return Array.from(wl.values())}s.values=i;function n(o){return wl.has(o)}s.has=n;})(r1||={});var Wt=r1;var Bl="aliasToRemoveAfter";var gd=class{get app(){return D.app}get gameLayer(){return D.gameLayer}get isInitialized(){return D._isInitialized}get htmlLayout(){return D.htmlLayers[0]}set htmlLayout(e){this.addHtmlLayer("ui",e);}get canvasWidth(){return D.canvasWidth}get canvasHeight(){return D.canvasHeight}set canvasWidth(e){D.canvasWidth=e;}set canvasHeight(e){D.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,n,s){if(typeof t=="number"&&typeof i=="number")return await D.init(e,t,i,n,s);if(typeof t!="number"&&typeof i!="number")return await D.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){this.addHtmlLayer("ui",e);}get children(){return D.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {A.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {A.error(`Canvas element ${e} not found`);return}}e instanceof re&&(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 Gt?await JE(t,e,{ignoreTexture:true}):t instanceof we?await md(t,e,{ignoreTexture:true}):t instanceof xi?await pd(t,e,{ignoreTexture:true}):t instanceof ts?await t1(t,e):t instanceof Ve?await e1(t,e):t instanceof re&&await di(t,e);}transferTickers(e,t,i="move"){D._currentTickersSequence[e]&&(i==="move"?D._currentTickersSequence[t]=se(D._currentTickersSequence[e]):i==="duplicate"&&(D._currentTickersSequence[t]=se(D._currentTickersSequence[e]))),Object.entries(D._currentTickers).forEach(([n,s])=>{if(s.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(n),s.canvasElementAliases.includes(e)&&(i==="move"?s.canvasElementAliases=s.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&s.canvasElementAliases.find(o=>o===e)&&s.canvasElementAliases.push(t),s.args.hasOwnProperty(Bl))){let o=s.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?s.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(s.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(D._currentTickersTimeouts).forEach(n=>{n.aliases.includes(e)&&(i==="move"?n.aliases=n.aliases.map(s=>s===e?t:s):i==="duplicate"&&n.aliases.find(s=>s===e)&&n.aliases.push(t));}),D._currentTickersSequence[t]&&Object.keys(D._currentTickersSequence[t]).forEach(n=>{this.runTickersSequence(t,n);}),i==="duplicate"&&D._currentTickersSequence[e]&&Object.keys(D._currentTickersSequence[e]).forEach(n=>{this.runTickersSequence(e,n);});}add(e,t,i={}){if(e===er){A.error(`The alias ${er} is reserved`);return}let n=this.find(e),s=i?.ignoreOldStyle;n&&!s&&this.copyCanvasElementProperty(n,t);let o=i.zIndex;n&&!this.gameLayer.children.includes(n)?A.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):n&&(o===void 0&&(o=this.gameLayer.getChildIndex(n)),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===er){A.error(`The alias ${er} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(n=>{this.gameLayer.getChildrenByLabel(n).forEach(s=>{this.gameLayer.removeChild(s),!i&&this.unlinkComponentFromTicker(n);});});}find(e){if(e===er)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 n=this.find(e);n&&(n.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return D._currentTickers}get currentTickersSteps(){return D._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!Wt.getInstance(i,t.args,t.duration,t.priority)){A.error(`Ticker ${i} not found`);return}let n={fn:()=>{},id:i,args:se(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},s=D.generateTickerId(n);if(this.pushTicker(s,n,t),this.pushEndOfTicker(s,n,t),t.duration){let o=setTimeout(()=>{D.removeTickerTimeoutInfo(o),D._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(s,{aliasToRemoveAfter:Bl in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);D.addTickerTimeoutInfo(e,i,o.toString(),true);}return s}pushTicker(e,t,i){D._currentTickers[e]=t,t.fn=n=>{let s=D._currentTickers[e];if(s){let o=s.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(n,s.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){A.warn("The steps of the tickers is empty");return}e in D._currentTickersSequence||(D._currentTickersSequence[e]={});let n={currentStepNumber:i,steps:t.map(o=>o===Qn||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:se(o.args),duration:o.duration})},s=D.generateTickerId(n);return D._currentTickersSequence[e][s]=n,this.runTickersSequence(e,s),s}runTickersSequence(e,t){if(!D._currentTickersSequence[e]||!D._currentTickersSequence[e][t])return;let i=D._currentTickersSequence[e][t].steps[D._currentTickersSequence[e][t].currentStepNumber];if(i===Qn&&(i=D._currentTickersSequence[e][t].steps[0],D._currentTickersSequence[e][t].currentStepNumber=0,i===Qn)){A.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=D._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),D.removeTickerTimeoutInfo(u);},i.duration*1e3);D.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let n=Wt.getInstance(i.ticker,i.args,i.duration,i.priority);if(!n){A.error(`Ticker ${i.ticker} not found`);return}let s=n.id,o={fn:()=>{},id:s,args:se(n.args),canvasElementAliases:[e],priority:n.priority,duration:n.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=D.generateTickerId(o);if(this.pushTicker(a,o,n),n.duration){let u=setTimeout(()=>{let l=D._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Bl in n.args?n.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in n.args?n.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),D.removeTickerTimeoutInfo(u);},n.duration*1e3);D.addTickerTimeoutInfo(e,s,u.toString(),false);}}nextTickerStep(e,t){if(D._currentTickersSequence[e]&&D._currentTickersSequence[e][t]){let i=D._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,D._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&D._currentTickersSequence[e]&&D._currentTickersSequence[e][t]&&(delete D._currentTickersSequence[e][t],Object.entries(D._currentTickers).forEach(([n,s])=>{s.createdByTicketSteps?.canvasElementAlias===e&&s.createdByTicketSteps.id===t&&this.removeTicker(n);}));}}onEndOfTicker(e,t){let i=D._currentTickers[e],n=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!n&&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(n=>{Object.entries(D._currentTickers).forEach(([s,o])=>{o.canvasElementAliases.includes(n)&&(o.canvasElementAliases.length===1?this.removeTicker(s):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==n));}),D._currentTickersSequence[n]&&delete D._currentTickersSequence[n],D.removeTickerTimeoutsByAlias(n,false);});return}let i;typeof t=="string"?i=t:t instanceof zt?i=t.id:i=t.prototype.id,e.forEach(n=>{D._currentTickersSequence[n]&&Object.entries(D._currentTickersSequence[n]).forEach(([s,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete D._currentTickersSequence[n][s];});}),Object.entries(D._currentTickers).forEach(([n,s])=>{s.id===i&&(D._currentTickers[n].canvasElementAliases=s.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(D._currentTickersTimeouts).forEach(([n,s])=>{s.ticker===i&&s.canBeDeletedBeforeEnd&&(D._currentTickersTimeouts[n].aliases=s.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(D._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Bl in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(D._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete D._currentTickersSequence[e];}),Object.entries(D._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&D.removeTickerTimeout(e);});}removeAllTickers(){D._currentTickersSequence={},Object.keys(D._currentTickers).forEach(e=>{this.removeTicker(e);}),D._currentTickers={};for(let e in D._currentTickersTimeouts)D.removeTickerTimeout(e);D._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},D._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=D._currentTickers[t];if(i){if(i.args.hasOwnProperty(Bl)){let n=i.args.aliasToRemoveAfter;this.remove(n);}this.app.ticker.remove(i.fn),delete D._currentTickers[t];}});}pauseTicker(e,t={}){let i=D._tickersOnPause[e];if(!i){D._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?D._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:D._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?D._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:D._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete D._tickersOnPause[t];});}isTickerPaused(e,t){let i=D._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?D._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):D._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=D._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Qn)?A.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(n=>{if(typeof n=="object"&&"ticker"in n){let s=Wt.getInstance(n.ticker,n.args,n.duration,n.priority);s&&s.onEndOfTicker([t],e,n.args);}}));}else {let i=D._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===er){A.error(`The alias ${er} is reserved`);return}return t.label=e,D.app.stage.addChild(t)}getLayer(e){return D.app.stage.getChildByLabel(e)}removeLayer(e){D.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return D.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return D.removeHtmlLayer(e)}getHtmlLayer(e){return D.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]=KE(t));}),{tickers:se(D.currentTickersWithoutCreatedBySteps),tickersSteps:se(D._currentTickersSequence),elements:se(e),stage:se(ea(this.gameLayer)),elementAliasesOrder:se(D.childrenAliasesOrder),tickersOnPause:se(D._tickersOnPause),tickersToCompleteOnStepEnd:se(D._tickersToCompleteOnStepEnd)}}async restore(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,n=e.elementAliasesOrder,s=n.filter(a=>i[a]).map(a=>z_(i[a])),o=await Promise.all(s);this.clear(),o.forEach((a,u)=>{let l=n[u];this.add(l,a),D.childrenAliasesOrder.push(l);});}else {A.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?di(this.gameLayer,e.stage,{ignoreScale:!0}):A.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([n,s])=>{let o=s.canvasElementAliases,a=Wt.getInstance(s.id,s.args,s.duration,s.priority);if(a){let u=this.addTicker(o,a);u&&(t[n]=u);}else A.error(`Ticker ${s.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([n,s])=>{D._currentTickersSequence[n]=s,Object.keys(s).forEach(o=>{this.runTickersSequence(n,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(n=>{let s=i[n];"tickerIdsExcluded"in s&&s.tickerIdsExcluded&&(i[n].tickerIdsExcluded=s.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in s&&s.tickerIdsIncluded&&(i[n].tickerIdsIncluded=s.tickerIdsIncluded.map(o=>t[o]||o));}),D._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,n=i.tikersIds.map(o=>({id:t[o.id]||o.id})),s=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));D._tickersToCompleteOnStepEnd={tikersIds:n,stepAlias:s};}}catch(t){A.error("Error importing data",t);}}};var xd=class{constructor(){this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}id="event_id_not_set"};var _d=class{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")}pixivnId="canvas_element_id_not_set"};Ee();Ee();function rs(r){return (r instanceof we||r instanceof Ve)&&r.haveEmptyTexture?false:!(r instanceof Pe&&r.texture?.label=="EMPTY")}function is(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=i1(r[e],t):t.type==="exponential"&&(r[e]=n1(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=i1(r[e].x,t),r[e].y=i1(r[e].y,t)):t.type==="exponential"&&(r[e].x=n1(r[e].x,t),r[e].y=n1(r[e].y,t))));}function i1(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 n1(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 Kk=5,_i=class extends zt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,n){t.speed===void 0&&(t.duration===void 0?t.speed=Kk:t.speed=600/(t.duration*60));let{type:s="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);s==="hide"&&l<0&&(l=0),s==="show"&&l>1&&(l=1),i.filter(c=>{let h=R.find(c);return !(!h||o&&!rs(h))}).forEach(c=>{let h=R.find(c);if(h&&h instanceof re){if(s==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:s==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),s==="show"&&h.alpha>=l){this.onEndOfTicker(c,n,t);return}else if(s==="hide"&&h.alpha<=l){this.onEndOfTicker(c,n,t);return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){A.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,n,t,{editAlpha:false});return}}}),a&&is(t,"speed",a);}onEndOfTicker(e,t,i,n={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(s=>{let o=R.find(s);if(o&&n.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}};Wt.add(_i);Ee();var s1={};vi(s1,{createExportableElement:()=>se});var Zk=10;function Qk(r,e){let t=se(r.destination);if(t.type==="align"){let i,n;e instanceof Pe&&(i=e.anchor.x,n=e.anchor.y);let s=it(e.pivot,e.angle),o=it(e.scale,e.angle);t.x=Hi("width",t.x,mi(e),s.x,o.x<0,i),t.y=Hi("height",t.y,gi(e),s.y,o.y<0,n);}return t.type==="percentage"&&(t.x=Vi("width",t.x),t.y=Vi("height",t.y)),t}var rr=class extends zt{fn(e,t,i,n){t.speed===void 0&&(t.speed=Zk);let{speed:s,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=R.find(u);return !(!l||o&&!rs(l))}).forEach(u=>{let l=R.find(u);if(l&&l instanceof re){let c=Qk(t,l),h=c.x-l.x,d=c.y-l.y,f=h>0?1:-1,m=d>0?1:-1,_,b;if(typeof s=="number"){let x=this.speedConvert(s);h===0||d===0?_=b=x:(_=Math.abs(h/(h+d))*x,b=Math.abs(d/(h+d))*x);}else _=this.speedConvert(s.x),b=this.speedConvert(s.y);if(_>0){l.x+=f*_*e.deltaTime;let x=c.x-l.x;(f<0&&x>0||f>0&&x<0)&&(l.x=c.x);}if(b>0){l.y+=m*b*e.deltaTime;let x=c.y-l.y;(m<0&&x>0||m>0&&x<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.onEndOfTicker(u,n,t);return}else if(_<1e-5&&b<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){A.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,n,t,{editPosition:false});return}}}),a&&is(t,"speed",a);}onEndOfTicker(e,t,i,n={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(s=>{let o=R.find(s);if(o){let a=i.destination;n.editPosition&&(o instanceof we||o instanceof Ve?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};Wt.add(rr);Ee();var Jk=1,Rl=class extends zt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,n){t.speed===void 0&&(t.speed=Jk);let{clockwise:s=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=R.find(l);return !(!c||t.startOnlyIfHaveTexture&&!rs(c))}).forEach(l=>{let c=R.find(l);if(c&&c instanceof re&&(s?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(s&&c.angle>=a?(c.angle=a,this.onEndOfTicker(l,n,t)):!s&&c.angle<=a&&(c.angle=a,this.onEndOfTicker(l,n,t))),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){A.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,n,t,{editRotation:false});return}}),o&&is(t,"speed",o);}onEndOfTicker(e,t,i,n={editRotation:true}){let{limit:s}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=R.find(o);a&&n.editRotation&&s!==void 0&&(a.angle=s);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};Wt.add(Rl);Ee();var eF=10,zi=class extends zt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,n){t.speed===void 0&&(t.speed=eF);let{speed:s,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof s=="number"?(l=this.speedConvert(s),c=this.speedConvert(s)):(l=this.speedConvert(s.x),c=this.speedConvert(s.y));let h=this.getLimit(t);i.filter(d=>{let f=R.find(d);return !(!f||a&&!rs(f))}).forEach(d=>{let f=R.find(d);if(f&&f instanceof re){if(o==="zoom"&&(f.scale.x<h.x||f.scale.y<h.y)?(f.scale.x+=l*e.deltaTime,f.scale.y+=c*e.deltaTime):o==="unzoom"&&(f.scale.x>h.x||f.scale.y>h.y)&&(f.scale.x-=l*e.deltaTime,f.scale.y-=c*e.deltaTime),o==="zoom"){if(f.scale.x>h.x&&(f.scale.x=h.x),f.scale.y>h.y&&(f.scale.y=h.y),f.scale.x>=h.x&&f.scale.y>=h.y){this.onEndOfTicker(d,n,t);return}}else if(o==="unzoom"&&(f.scale.x<h.x&&(f.scale.x=h.x),f.scale.y<h.y&&(f.scale.y=h.y),f.scale.x<=h.x&&f.scale.y<=h.y)){this.onEndOfTicker(d,n,t);return}if((l<1e-5&&c<1e-5||l<1e-5&&f.scale.y==h.y||c<1e-5&&f.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){A.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(d,n,t,{editScale:false});return}}}),u&&is(t,"speed",u);}speedConvert(e){return e/600}onEndOfTicker(e,t,i,n={editScale:true}){let{isZoomInOut:s}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=R.find(o);if(a){if(n.editScale){let u=this.getLimit(i);a.scale.x=u.x,a.scale.y=u.y;}if(s){let{pivot:u,position:l}=s;a.pivot=u.x,a.position=l;}}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="zoom",limit:i}=e,n=t==="zoom"?1/0:0,s=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(n=i,s=i):(n=i.x,s=i.y)),{x:n,y:s}}};Wt.add(zi);async function FR(r,e={},t){let i=R.find(r);if(!i){A.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let n={x:i.position.x,y:i.position.y},s=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){A.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),d=Math.ceil(c/2),f=[];for(let b=0;b<h;b++){let x={x:n.x,y:n.y},y=l*(b+1)/h;u==="horizontal"?b%2!==0?x.x=n.x+y:x.x=n.x-y:b%2!==0?x.y=n.y+y:x.y=n.y-y,f.push(new rr({destination:x,speed:s,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let m=h%2===0;for(let b=d;b>0;b--){let x={x:n.x,y:n.y},y=l*(b+1)/(d-1);u==="horizontal"?b%2===0&&!m||b%2!==0&&m?x.x=n.x-y:x.x=n.x+y:b%2===0&&!m||b%2!==0&&m?x.y=n.y-y:x.y=n.y+y,f.push(new rr({destination:x,speed:s,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}f.push(new rr({destination:n,speed:s,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let _=R.addTickersSequence(r,f);_&&(R.completeTickerOnStepEnd({id:_,alias:r}),R.pauseTicker(r,{tickerIdsExcluded:[_]}));}function bd(r,e,t){let i=new Ve(t,e);return R.add(r,i),i}async function GR(r,e,t){let i=new Ve(t,e);return await i.load(),R.add(r,i),i}Ee();function yd(r,e,t){if(!e)if(exports.Assets.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 R.add(r,i),i}async function UR(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=qr(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,n)=>i?(r[n].texture=i,r[n]):(r[n].load(),r[n])))}async function LR(r,e,t){if(!e)if(exports.Assets.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(),R.add(r,i),i}Ee();function vd(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Gt(t,e);return R.add(r,i),i}async function NR(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=qr(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,n)=>i?(r[n].texture=i,r[n]):(r[n].load(),r[n])))}async function HR(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Gt(t,e);return await i.load(),R.add(r,i),i}function Td(r,e){if(typeof e=="string")return fd(e)?vd(r,e):yd(r,e);if(Array.isArray(e))return bd(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return fd(e.value)?vd(r,e.value,e.options):yd(r,e.value,e.options);if(Array.isArray(e.value))return bd(r,e.value,e.options)}return R.add(r,e),e}async function o1(r,e,t={},i){let{mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:s=[]}=t,o=[];e||(e=r),typeof s=="string"&&(s=[s]);let a;if(R.find(r)&&(a=r+"_temp_disolve",R.editAlias(r,a)),e=Td(r,e),a&&R.copyCanvasElementProperty(a,r),a&&R.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=Sd(a,t,i);c&&(o.push(...c),R.pauseTicker(a,{tickerIdsIncluded:c}),s.push(a));}let u=new _i({...t,type:"show",tickerAliasToResume:s,startOnlyIfHaveTexture:true},void 0,i),l=R.addTicker(r,u);if(l&&(n&&R.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof we||e instanceof Ve)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function Sd(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:n=[]}=e;typeof r=="string"&&(r=[r]),typeof n=="string"&&(n=[n]),n.push(...r);let s=new _i({...e,type:"hide",aliasToRemoveAfter:n,startOnlyIfHaveTexture:true},void 0,t),o=R.addTicker(r,s);if(o)return i&&R.completeTickerOnStepEnd({id:o}),[o]}async function VR(r,e,t={},i){let{mustBeCompletedBeforeNextStep:n=true,aliasToRemoveAfter:s=[]}=t,o=[];if(e||(e=r),typeof s=="string"&&(s=[s]),!R.find(r))return o1(r,e,t,i);let a=r+"_temp_fade";R.editAlias(r,a),s.push(a),e=Td(r,e),a&&R.copyCanvasElementProperty(a,r),a&&R.transferTickers(a,r,"duplicate"),e.alpha=0;let u=Sd(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new _i({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:s},void 0,i),c=R.addTicker(r,l);if(c&&(n&&R.completeTickerOnStepEnd({id:c}),o.push(c),R.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof we||e instanceof Ve)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function zR(r,e={},t){return Sd(r,e,t)}async function WR(r,e,t={},i){let{direction:n="right",mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;R.find(r)&&(c=r+"_temp_movein",R.editAlias(r,c)),e=Td(r,e),c&&R.copyCanvasElementProperty(c,r),c&&R.transferTickers(c,r,"move");let h;e instanceof we||e instanceof Ve?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d;switch(c&&(u?(d=W_(c,t,i),d&&(l.push(...d),o.push(c))):a.push(c)),(e instanceof we||e instanceof Ve)&&e.haveEmptyTexture&&await e.load(),c&&R.pauseTicker(c,{tickerIdsIncluded:d}),n){case "up":e.y=R.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=R.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let f=new rr({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),m=R.addTicker(r,f);if(m&&(R.pauseTicker(r,{tickerIdsExcluded:[m]}),s&&R.completeTickerOnStepEnd({id:m}),l.push(m)),l.length>0)return l}function W_(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:n=true,aliasToRemoveAfter:s=[]}=e;typeof s=="string"&&(s=[s]),s.push(r);let o=R.find(r);if(!o){A.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=R.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=R.canvasWidth+o.width;break}let u=new rr({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:s},void 0,t),l=R.addTicker(r,u);if(l)return R.pauseTicker(r,{tickerIdsExcluded:[l]}),n&&R.completeTickerOnStepEnd({id:l}),[l]}async function XR(r,e,t={},i){let{direction:n="right",mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=R.find(r);c&&(l=r+"_temp_zoom",R.editAlias(r,l)),e=Td(r,e),l&&R.copyCanvasElementProperty(l,r),l&&R.transferTickers(l,r,"move"),n=="up"?(e.pivot.y=R.canvasHeight-e.y,e.pivot.x=R.canvasWidth/2-e.x,e.y=R.canvasHeight,e.x=R.canvasWidth/2):n=="down"?(e.pivot.y=0-e.y,e.pivot.x=R.canvasWidth/2-e.x,e.y=0,e.x=R.canvasWidth/2):n=="left"?(e.pivot.x=R.canvasWidth-e.x,e.pivot.y=R.canvasHeight/2-e.y,e.x=R.canvasWidth,e.y=R.canvasHeight/2):n=="right"&&(e.pivot.x=0-e.x,e.pivot.y=R.canvasHeight/2-e.y,e.x=0,e.y=R.canvasHeight/2),e.pivot=QE(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=a1(l,t,i);m&&(u.push(...m),o.push(l));}else a.push(l);R.pauseTicker(l);}o.push(r);let d=new zi({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),f=R.addTicker(r,d);if(f&&(R.pauseTicker(r,{tickerIdsExcluded:[f]}),s&&R.completeTickerOnStepEnd({id:f}),u.push(f)),(e instanceof we||e instanceof Ve)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function a1(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:n=true,aliasToRemoveAfter:s=[]}=e;typeof s=="string"&&(s=[s]),s.push(r);let o=R.find(r);if(!o){A.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=R.canvasHeight-o.y,o.pivot.x=R.canvasWidth/2-o.x,o.y=R.canvasHeight,o.x=R.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=R.canvasWidth/2-o.x,o.y=0,o.x=R.canvasWidth/2):i=="left"?(o.pivot.x=R.canvasWidth-o.x,o.pivot.y=R.canvasHeight/2-o.y,o.x=R.canvasWidth,o.y=R.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=R.canvasHeight/2-o.y,o.x=0,o.y=R.canvasHeight/2),o.pivot=QE(o.pivot,o.angle),o.scale.set(1);let a=new zi({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:s},void 0,t),u=R.addTicker(r,a);if(u)return R.pauseTicker(r,{tickerIdsExcluded:[u]}),n&&R.completeTickerOnStepEnd({id:u}),[u]}async function YR(r,e,t={},i){let{direction:n="right",mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;R.find(r)&&(u=r+"_temp_push",R.editAlias(r,u)),e=Td(r,e),u&&R.copyCanvasElementProperty(u,r),u&&R.transferTickers(u,r,"move");let l;if((e instanceof we||e instanceof Ve)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},n=="up"?e.y=-R.canvasHeight+e.y:n=="down"?e.y=R.canvasHeight+e.y:n=="left"?e.x=-R.canvasWidth+e.x:n=="right"&&(e.x=R.canvasWidth+e.x),u){let d=u1(u,{...t,direction:n=="up"?"down":n=="down"?"up":n=="left"?"right":"left"},i);d&&a.push(...d);}o.push(r);let c=new rr({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=R.addTicker(r,c);if(h&&(R.pauseTicker(r,{tickerIdsExcluded:[h]}),s&&R.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof we||e instanceof Ve)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function u1(r,e={direction:"right"},t){return W_(r,e,t)}var R=new gd;tr.init({getScreen:()=>R.screen});var c1={};vi(c1,{CharacterBaseModel:()=>Cd,CharacterStoredClass:()=>ra,RegisteredCharacters:()=>KR,getAllCharacters:()=>qR,getCharacterById:()=>$R,saveCharacter:()=>jR});var H=class r{static init(e){r._getStepCounter=e.getStepCounter,r._setStepCounter=e.setStepCounter,r._getCurrentGameStepState=e.getCurrentGameStepState,r._restoreGameStepState=e.restoreGameStepState,r._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(r._onGoNextEnd=e.onGoNextEnd),r._getVariable=e.getVariable,r._setVariable=e.setVariable,r._removeVariable=e.removeVariable,r._getFlag=e.getFlag,r._setFlag=e.setFlag,e.onLabelClosing&&(r._onLabelClosing=e.onLabelClosing),r._addHistoryItem=e.addHistoryItem,r._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,r._getCharacter=e.getCharacter;}static _getStepCounter=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return r._getStepCounter()}static set stepCounter(e){r._setStepCounter(e);}static _getCurrentGameStepState=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return r._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return r._restoreGameStepState}static _getOpenedLabels=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return r._getOpenedLabels()}static _onGoNextEnd=async()=>{};static get onGoNextEnd(){return r._onGoNextEnd}static _getVariable=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return r._getVariable}static _setVariable=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return r._setVariable}static _removeVariable=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return r._removeVariable}static _getFlag=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return r._getFlag}static _setFlag=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return r._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return r._onLabelClosing}static _addHistoryItem=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return r._addHistoryItem}static _getCurrentStepsRunningNumber=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentStepsRunningNumber(){return r._getCurrentStepsRunningNumber()}static _getCharacter=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")};static get getCharacter(){return r._getCharacter}static onEnd;static onError};var J=class r{static storage=new lt({cacheSize:20});static startingStorage=[];static flags=Array();static tempStorage=new Map;static tempStorageDeadlines=new Map;constructor(){}static clearOldTempVariables(e){r.tempStorageDeadlines.forEach((t,i)=>{t>e&&(r.tempStorage.delete(i),r.tempStorageDeadlines.delete(i),r.storage.cache.delete(i));});}static setVariable(e,t){let i=r.tempStorage.has(e);t==null?(r.storage.map.delete(e),!i&&r.storage.cache.delete(e)):(r.storage.map.set(e,t),!i&&r.storage.cache.set(e,t));}static getVariable(e){let t=r.storage.cache.get(e);return t===void 0&&(t=r.tempStorage.get(e)),t===void 0&&(t=r.storage.map.get(e)),se(t)}static removeVariable(e){r.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let i=this.flags.indexOf(e);i>-1&&this.flags.splice(i,1);}}static getFlag(e){return this.flags.includes(e)}};var Ed=class{get storage(){return J.storage.map}get cache(){return J.storage.cache}get flags(){return J.flags}get tempStorage(){return J.tempStorage}get tempStorageDeadlines(){return J.tempStorageDeadlines}set startingStorage(e){let t=[];Object.entries(e).forEach(([i,n])=>{t.push({key:i,value:n});}),J.startingStorage=t;}setVariable(e,t){return J.setVariable(e,t)}getVariable(e){return J.getVariable(e)}removeVariable(e){return J.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else J.tempStorage.set(e,t),J.storage.cache.set(e,t),J.tempStorageDeadlines.has(e)||J.tempStorageDeadlines.set(e,H.openedLabels);}removeTempVariable(e){J.tempStorage.has(e)&&(J.tempStorage.delete(e),J.tempStorageDeadlines.delete(e),J.storage.cache.delete(e));}setFlag(e,t){return J.setFlag(e,t)}getFlag(e){return J.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),J.flags=[],J.tempStorage.clear(),J.tempStorageDeadlines.clear(),J.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(n=>{e.push({key:n,value:this.storage.get(n)});});let t=[];[...J.tempStorage.keys()].forEach(n=>{t.push({key:n,value:J.tempStorage.get(n)});});let i=[];return [...J.tempStorageDeadlines.keys()].forEach(n=>{i.push({key:n,value:J.tempStorageDeadlines.get(n)});}),se({base:e,temp:t,tempDeadlines:i,flags:J.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let i=t.value;Object.entries(i).forEach(([n,s])=>{J.tempStorage.set(n,s);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([n,s])=>{J.tempStorageDeadlines.set(n,s);});}else t.key==="___flags___"?t.value.forEach(n=>{J.flags.push(n);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{J.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{J.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([n,s])=>{J.tempStorage.set(n,s);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([n,s])=>{J.tempStorageDeadlines.set(n,s);}):t==="___flags___"?i.forEach(n=>{J.flags.push(n);}):this.storage.set(t,i);})):A.warn("No storage data found");}catch(t){A.error("Error importing data",t);}}};var Ml=class{constructor(e,t){this.categoryId=e,this._id=t;}_id;get id(){return this._id}categoryId;setStorageProperty(e,t){let i=J.getVariable(this.categoryId);i||(i={}),i.hasOwnProperty(this.id)||(i[this.id]={}),t==null?i[this.id].hasOwnProperty(e)&&delete i[this.id][e]:i[this.id]={...i[this.id],[e]:t},Object.keys(i[this.id]).length===0&&delete i[this.id],J.setVariable(this.categoryId,i);}getStorageProperty(e,t=this.id){let i=J.getVariable(this.categoryId);if(i&&i.hasOwnProperty(t)&&i[t].hasOwnProperty(e))return i[t][e]}};var Rr=new Ed;var rF="@",ra=class extends Ml{sourceId;constructor(e,t=""){super(ie.CHARACTER_CATEGORY_KEY,e+(t?rF+t:"")),this.sourceId=e;}getStorageProperty(e){let t=super.getStorageProperty(e);return t===void 0&&(t=super.getStorageProperty(e,this.sourceId)),t}};var Cd=class extends ra{constructor(e,t){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion),this.defaultName=t.name,this.defaultSurname=t.surname,this.defaultAge=t.age,this._icon=t.icon,this._color=t.color;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}defaultSurname;get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}defaultAge;get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}_icon;get icon(){return this._icon}_color;get color(){return this._color}};var ia=new lt({cacheSize:10});function jR(r){return Ad.add(r)}function $R(r){return Ad.get(r)}function qR(){return Ad.values()}var Ad;(n=>{function r(s){try{let o=ia.get(s);if(!o){A.warn(`Character "${s}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return o}catch(o){A.error(`Error while getting Character "${s}"`,o);return}}n.get=r;function e(s){if(Array.isArray(s)){s.forEach(o=>e(o));return}ia.get(s.id)&&A.info(`Character id "${s.id}" already exists, it will be overwritten`),ia.set(s.id,s);}n.add=e;function t(){return Array.from(ia.values())}n.values=t;function i(s){return ia.has(s)}n.has=i;})(Ad||={});var KR=Ad;var eM=$i(QR());function JR(r,e){let t=se(r);return e.length>1&&"type"in e[0]&&(e=e.reverse()),e.forEach(i=>{"type"in i?iF(t,i):nF(t,i);}),t}function iF(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,n)=>{if(e.path&&n===e.path.length-1)switch(e.type){case "CHANGE":case "REMOVE":t[i]=e.oldValue;break;case "CREATE":Array.isArray(t)&&typeof i=="number"?t.splice(i,1):delete t[i];break}else t=t[i];}):A.warn("No path found, skipping diff",e);}function nF(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,n)=>{if(e.path&&n===e.path.length-1){if(e.kind==="E"||e.kind==="D")t[i]=e.lhs;else if(e.kind==="N")Number.isInteger(i)?Array.isArray(t)&&t.splice(i,1):typeof i=="string"&&delete t[i];else if(e.kind==="A"){let s=e.index;e.item.kind==="N"?t[i].splice(s,1):e.item.kind==="E"||e.item.kind==="D"?t[i][s]=e.item.lhs:e.item.kind==="A"?A.warn("Nested array found, skipping diff",e):A.warn("No array found, skipping diff",e);}}else t=t[i];}):A.warn("No path found, skipping diff",e);}var j=class r{static _diffHistory=new lt({cacheSize:5});static _stepsInfoHistory=new lt({cacheSize:5});static _narrationHistory=new lt({cacheSize:50});static stepLimitSaved=20;static goBackRunning=false;static _originalStepData=void 0;static get originalStepData(){return r._originalStepData?se(r._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:void 0},labelIndex:-1,openedLabels:[]}}static set originalStepData(e){r._originalStepData=se(e);}};var Pd=class{get stepsInfoMap(){return j._stepsInfoHistory}get diffMap(){return j._diffHistory}get narrationMap(){return j._narrationHistory}get size(){return j._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return j._stepsInfoHistory.keys()}get(e){let t=j._narrationHistory.get(e);if(!(t&&Object.keys(t).length===1&&t.stepIndex!==void 0))return t}delete(e){j._stepsInfoHistory.delete(e),j._diffHistory.delete(e),j._narrationHistory.delete(e);}internalRestoreOldGameState(e,t){if(e<=0||this.size==0)return t;let i=this.lastKey;if(typeof i!="number")return A.error("You can't go back, there is no step to go back"),t;let n=j._diffHistory.get(i);if(n)try{let s=JR(t,n);return H.stepCounter=i,this.delete(i),this.internalRestoreOldGameState(e-1,s)}catch(s){return A.error("Error applying diff",s),t}else return A.error("You can't go back, there is no step to go back"),t}async goBack(e,t=1){if(t<=0){A.warn("The parameter steps must be greater than 0");return}if(j._diffHistory.size<1){A.warn("You can't go back, there is no step to go back");return}if(j.goBackRunning){A.warn("Go back is already running");return}j.goBackRunning=true;try{let i=se(this.internalRestoreOldGameState(t,j.originalStepData));i?await H.restoreGameStepState(i,e):A.error("Error going back"),j.goBackRunning=!1;}catch(i){A.error("Error going back",i),j.goBackRunning=false;}}add(e,t={}){let i=j.originalStepData,{ignoreSameStep:n}=t,s=H.currentGameStepState;if(!n&&this.isSameStep(i,s))return;let o=this.lastKey;(async()=>{try{let u,l;if(typeof o=="number"&&(u=j._stepsInfoHistory.get(o),l=j._narrationHistory.get(o)),j._stepsInfoHistory.set(e.index,e),e.index!==0){let d=(0,eM.diff)(i,s);d?j._diffHistory.set(e.index,d):A.warn("It was not possible to create the difference between the two steps");}let c={},h=this.itemMapper({step:e},c);if(j._narrationHistory.set(e.index,h),u&&l&&typeof o=="number"){let d=this.itemMapper({...c,step:u},{});j._narrationHistory.set(o,d);}}catch(u){A.error("Error adding history step",u);}})(),j.originalStepData=s;}itemMapper(e,t){let{step:i,choiceIndexMade:n,inputValue:s,removeDialogue:o}=e,a=i.dialogue||i.dialoge;t&&i.isGlued&&(t.removeDialogue=true),o&&(a=void 0);let u=i.choices;if(t&&i.currentLabel&&i.choiceIndexMade!==void 0&&(t.choiceIndexMade=i.choiceIndexMade),i.inputValue&&t&&(t.inputValue=i.inputValue),a||u||s){let l=u?.map((c,h)=>{let d=false;return c.oneTime&&i.alreadyMadeChoices&&i.alreadyMadeChoices.includes(h)&&(d=true),{text:c.text,type:c.type,isResponse:false,hidden:d}});if(l){if(l.every(c=>c.hidden)){let c=l.find(h=>h.hidden===false);c&&(c.hidden=false);}n!==void 0&&(l[n].isResponse=true);}return {dialogue:a?{...a,character:a.character?H.getCharacter(a.character)||a.character:void 0}:void 0,playerMadeChoice:typeof n=="number",choices:l,stepIndex:i.index,inputValue:s}}return {stepIndex:i.index}}get narrativeHistory(){let e=[];return Array.from(this.keys()).sort((i,n)=>i-n).forEach(i=>{let n=this.get(i);n&&e.push(n);}),e}get currentLabelHistory(){let e=[],t=Array.from(this.keys()).sort((l,c)=>c-l);if(t.length===0)return e;let i=t[0];if(typeof i!="number")return e;let n=j._stepsInfoHistory.get(i);if(!n)return e;let s=n.currentLabel,o=n.index,a=n.labelStepIndex||-1,u=n.openedLabelsNumber||-1;return t.every(l=>{let c=this.get(l);if(c){let h=j._stepsInfoHistory.get(l);if(!h||!(h.currentLabel===s&&h.index<=o&&(h.labelStepIndex||-1)<=a&&(h.openedLabelsNumber||-1)===u))return false;e.push(c);}return o=l,true}),e.reverse()}removeNarrativeHistory(e){if(e){let t=Array.from(this.keys()).sort((i,n)=>i-n);t=t.slice(0,e),t.forEach(i=>{j._narrationHistory.delete(i),j._stepsInfoHistory.delete(i),j._diffHistory.delete(i);});}else j._stepsInfoHistory.clear(),j._diffHistory.clear(),j._narrationHistory.clear();}get canGoBack(){let e=this.lastKey;return typeof e!="number"?false:j._diffHistory.has(e)}blockGoBack(){H.currentStepsRunningNumber===0&&j._diffHistory.clear();}isSameStep(e,t){if(e.openedLabels.length===t.openedLabels.length)try{let i=JSON.stringify(e.openedLabels),n=JSON.stringify(t.openedLabels);if(i===n&&e.path===t.path&&e.labelIndex===t.labelIndex)return !0}catch(i){return A.error("Error comparing opened labels",i),true}return false}clear(){j._stepsInfoHistory.clear(),j._diffHistory.clear(),j._narrationHistory.clear(),j._originalStepData=void 0;}get stepLimitSaved(){return j.stepLimitSaved}set stepLimitSaved(e){j.stepLimitSaved=e;}export(){let e=Array.from(this.keys()).sort((i,n)=>i-n);e.length>this.stepLimitSaved&&(e=e.slice(e.length-this.stepLimitSaved));let t=[];return e.forEach(i=>{let n=j._stepsInfoHistory.get(i);if(n){let s=j._diffHistory.get(i);t.push({...n,diff:s});}}),{stepsHistory:se(t),originalStepData:se(j._originalStepData)}}restoreNarrativeHistory(){let e=Array.from(this.keys()).sort((i,n)=>i-n),t={};e.forEach(i=>{let n=j._stepsInfoHistory.get(i);if(n){let s={...t};t={};let o=this.itemMapper({step:n,choiceIndexMade:s.choiceIndexMade,inputValue:s.inputValue,removeDialogue:s.removeDialogue},t);o&&j._narrationHistory.set(i,o);}});}async restore(e){this.clear();try{e.hasOwnProperty("stepsHistory")?(e.stepsHistory.forEach(i=>{i.diff&&j._diffHistory.set(i.index,i.diff);let n={...i,diff:void 0};j._stepsInfoHistory.set(i.index,n);}),this.restoreNarrativeHistory()):A.warn("Could not import stepsHistory data, so will be ignored"),e.hasOwnProperty("originalStepData")?j._originalStepData=e.originalStepData:A.warn("Could not import originalStepData data, so will be ignored");}catch(t){A.error("Error importing data",t);}}};var ns=new Pd;var tM={};var p1={};vi(p1,{ChoiceMenuOption:()=>sa,ChoiceMenuOptionClose:()=>aa,Close:()=>oa,Label:()=>Wi,LabelAbstract:()=>na,NarrationManagerStatic:()=>L,RegisteredLabels:()=>ir,narration:()=>Xi,newChoiceOption:()=>nM,newCloseChoiceOption:()=>sM,newLabel:()=>f1});var wd=new lt({cacheSize:10}),rM;(n=>{function r(s){let o=wd.get(s);if(!o){A.error(`Label "${s}" not found`);return}return o}n.get=r;function e(s){if(Array.isArray(s)){s.forEach(o=>e(o));return}wd.has(s.id)&&A.info(`Label "${s.id}" already exists, it will be overwritten`),wd.set(s.id,s);}n.add=e;function t(){return Array.from(wd.values())}n.values=t;function i(s){return wd.has(s)}n.has=i;})(rM||={});var ir=rM;var iM=$i(XE());var na=class{constructor(e,t){this._id=e,this._onStepStart=t?.onStepStart,this._onLoadingLabel=t?.onLoadingLabel,this._onStepEnd=t?.onStepEnd;}_id;get id(){return this._id}_onStepStart;get onStepStart(){return async(e,t)=>{if(this._onLoadingLabel&&e===0&&await this._onLoadingLabel(e,t),this._onStepStart)return await this._onStepStart(e,t)}}_onLoadingLabel;get onLoadingLabel(){return this._onLoadingLabel}_onStepEnd;get onStepEnd(){return this._onStepEnd}};var Wi=class extends na{get stepCount(){return this.steps.length}getStepById(e){return this.steps[e]}constructor(e,t,i){super(e,i),this._steps=t;}_steps;get steps(){return typeof this._steps=="function"?this._steps():this._steps}getStepSha(e){if(e<0||e>=this.steps.length)return A.warn("stepSha not found, setting to ERROR"),"error";try{let t=this.steps[e];return (0,iM.default)(t.toString().toLocaleLowerCase()).toString()}catch(t){return A.warn("stepSha not found, setting to ERROR",t),"error"}}};var aF="__close-label-id__";function d1(){return new Wi(aF,[],{})}var sa=class{text;_label;get label(){let e=this._label;if(typeof e=="string"){let t=ir.get(e);t?e=t:(A.error(`Label ${e} not found, so it will be closed`),e=d1());}return e}type;oneTime;onlyHaveNoChoice;autoSelect;props={};devProps={};constructor(e,t,i,n){let{type:s="call",oneTime:o=false,onlyHaveNoChoice:a=false,autoSelect:u=false,...l}=n||{};this.text=e,this._label=t,this.type=s,this.oneTime=o,this.onlyHaveNoChoice=a,this.autoSelect=u,this.devProps=l,this.props=i;}};function nM(r,e,t,i){let n=typeof e=="string"?e:e.id;return {...i,label:n,props:t,text:r,type:i?.type||"call"}}var oa="close";var aa=class{text;closeCurrentLabel;type=oa;oneTime;onlyHaveNoChoice;autoSelect;props={};devProps={};constructor(e,t){let{closeCurrentLabel:i=false,oneTime:n=false,onlyHaveNoChoice:s=false,autoSelect:o=false,...a}=t||{};this.text=e,this.closeCurrentLabel=i,this.oneTime=n,this.onlyHaveNoChoice=s,this.autoSelect=o,this.devProps=a;}};function sM(r,e){return {...e,type:oa,text:r}}var L=class r{constructor(){}static stepsRunning=0;static goNextRequests=0;static choiceMadeTemp=void 0;static lastHistoryStep=null;static get allOpenedLabels(){return H.getVariable(ie.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(e){H.setVariable(ie.OPENED_LABELS_COUNTER_KEY,e);}static getCurrentStepTimesCounterData(e=""){let t=r.currentLabelStepIndex;if(t===null)return A.error("currentLabelStepIndex is null"),null;let i=`${t}${e}`,n=r.currentLabelId,s=r._currentLabel;if(!n||t===null||!s)return A.error("currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let o=s.getStepSha(t)||"error",a=H.getVariable(ie.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[n]||(a[n]={}),(!a[n][i]||a[n][i].stepSha1!=o)&&(a[n][i]={stepSha1:o}),a[n][i]}static setCurrentStepTimesCounterData(e="",t){let i=r.currentLabelStepIndex,n=i+e,s=r.currentLabelId;if(!s||i===null){A.error("currentLabelId or currentLabelStepIndex is null");return}let o=H.getVariable(ie.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[s]||(o[s]={}),o[s][n]=t,H.setVariable(ie.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static getCurrentStepTimesCounter(e=""){let t=r._stepCounter,i=r.getCurrentStepTimesCounterData(e);if(!i)return A.error("getCurrentStepTimesCounter obj is null"),0;let n=i.stepCounters||i.lastStepIndexs||[];return n.find(o=>o===t)||(n.push(t),delete i.lastStepIndexs,i.stepCounters=n,r.setCurrentStepTimesCounterData(e,i)),n.length}static getRandomNumber(e,t,i={}){let n=i.nestedId||"";if(i.onceOnly||false){let o=r.getCurrentStepTimesCounterData(n);if(!o)return;let a=o.usedRandomNumbers||{},u=Array.from({length:t-e+1},(h,d)=>d+e).filter(h=>!a[`${e}-${t}`]?.includes(h));if(u.length===0)return;let l=Math.floor(Math.random()*u.length),c=u[l];return a[`${e}-${t}`]||(a[`${e}-${t}`]=[]),a[`${e}-${t}`].push(c),o.usedRandomNumbers=a,r.setCurrentStepTimesCounterData(n,o),c}return Math.floor(Math.random()*(t-e+1))+e}static resetCurrentStepTimesCounter(e=""){let t=r.currentLabelStepIndex,i=t+e,n=r.currentLabelId;if(!n||t===null){A.error("currentLabelId or currentLabelStepIndex is null");return}let s=H.getVariable(ie.CURRENT_STEP_TIMES_COUNTER_KEY)||{};s[n]||(s[n]={}),s[n][i]={stepCounters:[],stepSha1:""},H.setVariable(ie.CURRENT_STEP_TIMES_COUNTER_KEY,s);}static get allChoicesMade(){return H.getVariable(ie.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(e){H.setVariable(ie.ALL_CHOICES_MADE_KEY,e);}static _stepCounter=0;static increaseStepCounter(){r._stepCounter++;}static _openedLabels=[];static get openedLabels(){return se(r._openedLabels)}static set openedLabels(e){r._openedLabels=se(e);}static _originalOpenedLabels=[];static get originalOpenedLabels(){return se(r._originalOpenedLabels)}static set originalOpenedLabels(e){r._originalOpenedLabels=se(e);}static get _currentLabel(){if(r.currentLabelId)return ir.get(r.currentLabelId)}static get currentLabelId(){if(r._openedLabels.length>0)return r._openedLabels[r._openedLabels.length-1].label}static get currentLabelStepIndex(){return r._openedLabels.length>0?r._openedLabels[r._openedLabels.length-1].currentStepIndex:null}static addLabelHistory(e,t){let i=r.allOpenedLabels,n=r.allOpenedLabels[e]?.biggestStep||0,s=r.allOpenedLabels[e]?.openCount||0;(!n||n<t)&&(i[e]={biggestStep:t,openCount:s},r.allOpenedLabels=i);}static addChoicesMade(e,t,i,n){let s=r.allChoicesMade,o=s.findIndex(a=>a.labelId===e&&a.stepIndex===t&&a.choiceIndex===n&&a.stepSha1===i);o<0?s.push({labelId:e,stepIndex:t,choiceIndex:n,stepSha1:i,madeTimes:1}):s[o].madeTimes++,r.allChoicesMade=s;}static pushNewLabel(e){if(!ir.get(e))throw new Error(`[Pixi\u2019VN] Label ${e} not found`);r._openedLabels.push({label:e,currentStepIndex:0});let i=r.allOpenedLabels,n=r.allOpenedLabels[e]?.biggestStep||0,s=r.allOpenedLabels[e]?.openCount||0;i[e]={biggestStep:n,openCount:s+1},r.allOpenedLabels=i;}static increaseCurrentStepIndex(){if(r._openedLabels.length>0){let e=r._openedLabels[r._openedLabels.length-1];r._openedLabels[r._openedLabels.length-1]={...e,currentStepIndex:e.currentStepIndex+1};}}static _onStepStart;static set onStepStart(e){r._onStepStart=e;}static get onStepStart(){return async(e,t)=>{let i=[];return r.onLoadingLabel&&e===0&&i.push(r.onLoadingLabel(e,t)),r._onStepStart&&i.push(r._onStepStart(e,t)),await Promise.all(i)}}static onLoadingLabel;static onStepEnd};var Bd=class{get currentStepTimesCounter(){return L.getCurrentStepTimesCounter()}set currentStepTimesCounter(e){L.resetCurrentStepTimesCounter();}getRandomNumber(e,t,i={}){return L.getRandomNumber(e,t,i)}get stepCounter(){return L._stepCounter}get openedLabels(){return L.openedLabels}get currentLabel(){return L._currentLabel}addStepHistory(e,t={}){let{choiceMade:i,ignoreSameStep:n}=t,s,o,a,u=H.getVariable(ie.LAST_STEP_GLUED)===this.stepCounter;H.getVariable(ie.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(s=H.getVariable(ie.CURRENT_DIALOGUE_MEMORY_KEY)),H.getVariable(ie.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(o=H.getVariable(ie.CURRENT_MENU_OPTIONS_MEMORY_KEY)),H.getVariable(ie.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(a=H.getVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY));let l=L.openedLabels,c={currentLabel:L.currentLabelId,dialogue:s,choices:o,stepSha1:e,index:this.stepCounter,labelStepIndex:L.currentLabelStepIndex,choiceIndexMade:i,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices,isGlued:u,openedLabelsNumber:l.length};L.originalOpenedLabels=l,H.addHistoryItem(c,{ignoreSameStep:n}),L.lastHistoryStep=c,L.increaseStepCounter();}closeCurrentLabel(){if(!L.currentLabelId){A.warn("No label to close");return}if(!this.currentLabel){A.error("currentLabel not found");return}let e=L.openedLabels;e.pop(),L.openedLabels=e,H.onLabelClosing(this.openedLabels.length);}closeAllLabels(){for(;L.openedLabels.length>0;)this.closeCurrentLabel(),H.onLabelClosing(this.openedLabels.length);}isLabelAlreadyCompleted(e){let t;typeof e=="string"?t=e:t=e.id;let n=L.allOpenedLabels[t]?.biggestStep||0;if(n){let s=ir.get(t);if(s)return s.stepCount<=n}return false}get alreadyCurrentStepMadeChoicesObj(){let e=L.currentLabelStepIndex,t=this.currentLabel;if(e===null||!t)return;let i=t.getStepSha(e);return i||(A.warn("stepSha not found, setting to ERROR"),i="error"),L.allChoicesMade.filter(n=>n.labelId===t?.id&&n.stepIndex===e&&n.stepSha1===i)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(e=>e.choiceIndex)}get isCurrentStepAlreadyOpened(){let e=L.currentLabelId;if(e){let t=L.allOpenedLabels[e]?.openCount||0;if(L.currentLabelStepIndex&&t>=L.currentLabelStepIndex)return true}return false}getTimesLabelOpened(e){return L.allOpenedLabels[e]?.openCount||0}getTimesChoiceMade(e){return this.alreadyCurrentStepMadeChoicesObj?.find(t=>t.choiceIndex===e)?.madeTimes||0}addCurrentStepToHistory(){this.addStepHistory("dev",{ignoreSameStep:true});}getCanGoNext(e){let t=e?.showWarn||false,i=this.choiceMenuOptions;return i&&i.length>0?(t&&A.warn("The player must make a choice"),false):this.isRequiredInput?(t&&A.warn("The player must enter a value"),false):true}get canGoNext(){return L.stepsRunning!==0?false:this.getCanGoNext()}async onStepRun(e,t){let i=[];return e.onStepStart&&i.push(e.onStepStart(t,e)),L.onStepStart&&i.push(L.onStepStart(t,e)),await Promise.all(i)}async onStepEnd(e,t){let i=[];return e.onStepEnd&&i.push(e.onStepEnd(t,e)),L.onStepEnd&&i.push(L.onStepEnd(t,e)),await Promise.all(i)}async goNext(e,t={}){let{runNow:i=false}=t;if(!(!i&&!this.getCanGoNext({showWarn:true}))){if(!i&&L.stepsRunning!==0){L.goNextRequests++;return}try{this.currentLabel&&await this.onStepEnd(this.currentLabel,L.currentLabelStepIndex||0);}catch(n){A.error("Error running onStepEnd",n);}return L.stepsRunning===0&&await H.onGoNextEnd(),L.increaseCurrentStepIndex(),await this.runCurrentStep(e,t)}}async runCurrentStep(e,t={}){let{choiceMade:i}=t;if(L.currentLabelId){let n=L.currentLabelStepIndex;if(n===null){A.error("currentLabelStepIndex is null");return}let s=L._currentLabel;if(!s){A.error("currentLabel not found");return}if(s.stepCount>n){try{await this.onStepRun(s,n);}catch(u){A.error("Error running onStepStart",u),this.onStepError&&this.onStepError(u,e);return}let o=s.getStepById(n);if(!o){A.error("step not found");return}let a=s.getStepSha(n);a||(A.warn("stepSha not found, setting to ERROR"),a="error");try{L.stepsRunning++;let u=await o(e,{labelId:s.id}),l=this.choiceMenuOptions;if(l?.length===1&&l[0].autoSelect){let h=l[0];u=await this.selectChoice(h,e);}let c=L.lastHistoryStep;if(i!==void 0&&c){let h=c.stepSha1;h||(A.warn("stepSha not found, setting to ERROR"),h="error"),L.addChoicesMade(c.currentLabel||"error",typeof c.labelStepIndex=="number"?c.labelStepIndex:-1,c.stepSha1||"error",i),L.choiceMadeTemp=i;}return L.stepsRunning--,L.stepsRunning===0&&(L.addLabelHistory(s.id,n),this.addStepHistory(a,{...t,choiceMade:L.choiceMadeTemp}),L.choiceMadeTemp=void 0,L.goNextRequests>0)?(L.goNextRequests--,await this.goNext(e)):u}catch(u){L.stepsRunning>0&&L.stepsRunning--,A.error("Error running step",u),this.onStepError&&this.onStepError(u,e);return}}else {if(this.openedLabels.length>1)return this.closeCurrentLabel(),await this.goNext(e,t);if(this.openedLabels.length===1)return L.openedLabels=[],this.onGameEnd?await this.onGameEnd(e,{labelId:"end"}):void 0}}else if(this.openedLabels.length===0){if(L.openedLabels=L.originalOpenedLabels,this.onGameEnd)return await this.onGameEnd(e,{labelId:"end"});A.error("The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");return}else A.error("currentLabelId not found");}async callLabel(e,t,i){let{choiceMade:n}=i||{},s;typeof e=="string"?s=e:s=e.id;try{let o=ir.get(s);if(!o)throw new Error(`[Pixi\u2019VN] Label ${s} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,L.currentLabelStepIndex||0);}catch(a){A.error("Error running onStepEnd",a);}L.pushNewLabel(o.id);}catch(o){A.error("Error calling label",o);return}return await this.runCurrentStep(t,{choiceMade:n})}async jumpLabel(e,t,i){this.openedLabels.length>0&&this.closeCurrentLabel();let{choiceMade:n}=i||{},s;typeof e=="string"?s=e:s=e.id;try{let o=ir.get(s);if(!o)throw new Error(`[Pixi\u2019VN] Label ${s} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,L.currentLabelStepIndex||0);}catch(a){A.error("Error running onStepEnd",a);}L.pushNewLabel(o.id);}catch(o){A.error("Error jumping label",o);return}return await this.runCurrentStep(t,{choiceMade:n})}async selectChoice(e,t){this.choiceMenuOptions=void 0;let i=e.type;switch(i){case "call":return await this.callLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "jump":return await this.jumpLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "close":return await this.closeChoiceMenu(e,{...e.props,...t});default:throw A.error(`Type ${i} not found`),new Error(`[Pixi\u2019VN] Type ${i} not found`)}}async closeChoiceMenu(e,t){if(e.type!=="close")throw A.error("For closeChoiceMenu, the type must be close"),new Error("[Pixi\u2019VN] For closeChoiceMenu, the type must be close");let i;return typeof e.choiceIndex=="number"&&(i=e.choiceIndex),e.closeCurrentLabel&&this.closeCurrentLabel(),this.goNext(t,{choiceMade:i})}get onGameEnd(){return H.onEnd}set onGameEnd(e){H.onEnd=e;}get onStepError(){let e=H.onError;return e?(t,i)=>e("step",t,i):void 0}set onStepError(e){H.onError=(t,i,n)=>e(i,n);}get dialogue(){let e=H.getVariable(ie.CURRENT_DIALOGUE_MEMORY_KEY);if(e)return {...e,character:e.character?H.getCharacter(e.character)||e.character:void 0}}set dialogue(e){if(!e){H.setVariable(ie.CURRENT_DIALOGUE_MEMORY_KEY,void 0);return}if((typeof e=="string"||Array.isArray(e))&&(e={text:e}),this.dialogGlue){let t=H.getVariable(ie.CURRENT_DIALOGUE_MEMORY_KEY);if(t){let i=[];Array.isArray(t.text)?i=[...t.text]:i=[t.text],Array.isArray(e.text)?i=[...i,...e.text]:i=[...i,e.text],e.text=i,e.character=e.character||t.character;}H.setVariable(ie.LAST_STEP_GLUED,this.stepCounter),this.dialogGlue=false;}try{H.setVariable(ie.CURRENT_DIALOGUE_MEMORY_KEY,se({...e,character:typeof e.character=="string"?e.character:e.character?.id})),H.setVariable(ie.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw A.error("DialogueInterface cannot contain functions or classes"),t}}get choiceMenuOptions(){let e=H.getVariable(ie.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(e){let t=[],i=e.map((s,o)=>({...s,choiceIndex:o})),n=this.alreadyCurrentStepMadeChoices;if(i=i.filter((s,o)=>s.oneTime&&n&&n.includes(o)?false:s.onlyHaveNoChoice?(t.push(s),false):true),i.length>0)return i;if(t.length>0)return [t[0]]}}set choiceMenuOptions(e){if(!e||e.length===0){H.setVariable(ie.CURRENT_MENU_OPTIONS_MEMORY_KEY,void 0);return}let t=e.map(i=>i instanceof aa?{...i.devProps,text:i.text,type:oa,closeCurrentLabel:i.closeCurrentLabel,oneTime:i.oneTime,onlyHaveNoChoice:i.onlyHaveNoChoice,autoSelect:i.autoSelect,props:i.props}:i instanceof sa?{...i.devProps,type:i.type,text:i.text,label:i.label.id,autoSelect:i.autoSelect,oneTime:i.oneTime,onlyHaveNoChoice:i.onlyHaveNoChoice,props:i.props}:i);try{H.setVariable(ie.CURRENT_MENU_OPTIONS_MEMORY_KEY,se(t)),H.setVariable(ie.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(i){throw A.error("ChoiceInterface cannot contain functions or classes"),i}}get dialogGlue(){return H.getFlag(ie.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(e){H.setFlag(ie.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,e);}get inputValue(){return H.getVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(e){this.removeInputRequest(),H.setVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY,e),H.setVariable(ie.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}get isRequiredInput(){return H.getVariable(ie.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return H.getVariable(ie.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(e,t){e.isRequired=true,H.setVariable(ie.CURRENT_INPUT_INFO_MEMORY_KEY,e),t!==void 0?H.setVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY,t):H.removeVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){H.removeVariable(ie.CURRENT_INPUT_INFO_MEMORY_KEY),H.removeVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){L.openedLabels=[],L._stepCounter=0;}export(){return {openedLabels:se(L.openedLabels),stepCounter:this.stepCounter}}async onLoadingLabel(e){let t=this.openedLabels.map(async i=>{let n=[],s=ir.get(i.label);return s&&(s.onLoadingLabel&&n.push(s.onLoadingLabel(e,s)),L.onLoadingLabel&&n.push(L.onLoadingLabel(e,s))),await Promise.all(n)});return await Promise.all(t)}async restore(e,t){this.clear();try{L.lastHistoryStep=t,e.hasOwnProperty("openedLabels")?(L.openedLabels=e.openedLabels,L.originalOpenedLabels=L.openedLabels):A.warn("Could not import openedLabels data, so will be ignored"),e.hasOwnProperty("stepCounter")?L._stepCounter=e.stepCounter:e.hasOwnProperty("lastStepIndex")?L._stepCounter=e.lastStepIndex:A.warn("Could not import stepCounter data, so will be ignored");try{await this.onLoadingLabel(L.currentLabelStepIndex||0);}catch(i){A.error("Error running onLoadingLabel",i);}}catch(i){A.error("Error importing data",i);}}};function f1(r,e,t){let i=new Wi(r,e,t);return ir.add(i),i}var Xi=new Bd;var g1={};vi(g1,{Sound:()=>ss,SoundManagerStatic:()=>te,sound:()=>os});var te=class{constructor(){}static soundAliasesOrder=[];static soundsPlaying={};static sounds={}};var ss=class r extends cr{alias;pause(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let e=te.soundsPlaying[this.alias];if(!e)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return te.soundsPlaying[this.alias]={...e,paused:true},super.pause()}resume(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let e=te.soundsPlaying[this.alias];if(!e)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return te.soundsPlaying[this.alias]={options:e.options,stepIndex:H.stepCounter,paused:false},super.resume()}destroy(){return this.alias&&delete te.soundsPlaying[this.alias],super.destroy()}stop(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return delete te.soundsPlaying[this.alias],super.stop()}play(e){if(typeof e=="string"&&(this.alias=e),!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return te.soundsPlaying[this.alias]={stepIndex:H.stepCounter,options:e,paused:false},super.play(e)}static from(e){let t=cr.from(e);return new r(t.media,t.options)}};function Rd(r){let e=[];for(let t of r)t.type==="TelephoneFilter"?e.push(new ke.TelephoneFilter):t.type==="StreamFilter"?e.push(new ke.StreamFilter):t.type==="StereoFilter"?e.push(new ke.StereoFilter(t.pan)):t.type==="ReverbFilter"?e.push(new ke.ReverbFilter(t.seconds,t.decay,t.reverse)):t.type==="MonoFilter"?e.push(new ke.MonoFilter):t.type==="EqualizerFilter"?e.push(new ke.EqualizerFilter(t.f32,t.f64,t.f125,t.f250,t.f500,t.f1k,t.f2k,t.f4k,t.f8k,t.f16k)):t.type==="DistortionFilter"?e.push(new ke.DistortionFilter(t.amount)):A.error("Unknown sound filter type");return e}function m1(r){if(!r)return;let e=[];for(let t of r)t instanceof ke.TelephoneFilter?e.push({type:"TelephoneFilter"}):t instanceof ke.StreamFilter?e.push({type:"StreamFilter"}):t instanceof ke.StereoFilter?e.push({type:"StereoFilter",pan:t.pan}):t instanceof ke.ReverbFilter?e.push({type:"ReverbFilter",seconds:t.seconds,decay:t.decay,reverse:t.reverse}):t instanceof ke.MonoFilter?e.push({type:"MonoFilter"}):t instanceof ke.EqualizerFilter?e.push({type:"EqualizerFilter",f32:t.f32,f64:t.f64,f125:t.f125,f250:t.f250,f500:t.f500,f1k:t.f1k,f2k:t.f2k,f4k:t.f4k,f8k:t.f8k,f16k:t.f16k}):t instanceof ke.DistortionFilter?e.push({type:"DistortionFilter",amount:t.amount}):A.error("Unknown sound filter type");return e}var Md=class extends vl{constructor(){super();}get context(){return be.context}get filtersAll(){return be.filtersAll}set filtersAll(e){be.filtersAll=e.filter(t=>!(t instanceof ke.Filter));}get supported(){return be.supported}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}add(e,t){if(typeof e=="object")throw new Error("[Pixi\u2019VN] The method add(map: SoundSourceMap, globalOptions?: Options) is deprecated. Use add(alias: string, options: Options | string | ArrayBuffer | AudioBuffer | HTMLAudioElement | Sound): Sound; instead.");this.exists(e)&&this.remove(e),t instanceof cr&&(t=t.options);let i;if(t instanceof ss)i=t;else {let n=this.getOptions(t||{});i=ss.from(n);}return i.alias=e,!te.soundAliasesOrder.includes(e)&&te.soundAliasesOrder.push(e),te.sounds[e]=i,be.add(e,i),i}get useLegacy(){return be.useLegacy}set useLegacy(e){be.useLegacy=e;}get disableAutoPause(){return be.disableAutoPause}set disableAutoPause(e){be.disableAutoPause=e;}remove(e){return te.soundAliasesOrder=te.soundAliasesOrder.filter(t=>t!==e),delete te.soundsPlaying[e],delete te.sounds[e],be.remove(e)}get volumeAll(){return be.volumeAll}set volumeAll(e){be.volumeAll=e;}get speedAll(){return be.speedAll}set speedAll(e){be.speedAll=e;}togglePauseAll(){return be.togglePauseAll()}pauseAll(){return be.pauseAll()}resumeAll(){return be.resumeAll()}toggleMuteAll(){return be.toggleMuteAll()}muteAll(){return be.muteAll()}unmuteAll(){return be.unmuteAll()}removeAll(){return te.soundAliasesOrder=[],te.soundsPlaying={},te.sounds={},be.removeAll()}stopAll(){for(let e in te.sounds)te.sounds[e].stop();return te.soundsPlaying={},be.stopAll()}exists(e,t){return be.exists(e,t)||e in te.sounds}isPlaying(){return be.isPlaying()}find(e){let t=te.sounds[e];return t||(t=be.find(e),t&&(te.sounds[e]=t),t)}play(e,t){if(!this.exists(e))throw new Error("[Pixi\u2019VN] The alias is not found in the sound library.");return te.soundsPlaying[e]={stepIndex:H.stepCounter,options:t,paused:false},be.play(e,t)}stop(e){return delete te.soundsPlaying[e],be.stop(e)}pause(e){let t=te.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return te.soundsPlaying[e]={...t,paused:true},be.pause(e)}resume(e){let t=te.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return te.soundsPlaying[e]={options:t.options,stepIndex:H.stepCounter,paused:false},be.resume(e)}volume(e,t){return be.volume(e,t)}speed(e,t){return be.speed(e,t)}duration(e){return be.duration(e)}close(){return be.close()}clear(){this.stopAll();}export(){let e={};for(let t in te.soundsPlaying){let i=te.soundsPlaying[t],n=this.find(t);n&&(e[t]={...i,sound:{options:{...n.options,autoPlay:n.autoPlay,loop:n.loop,preload:n.preload,singleInstance:n.singleInstance,url:n.options.url,volume:n.options.volume},filters:m1(n.media.filters)}});}return {soundsPlaying:se(e),soundAliasesOrder:se(te.soundAliasesOrder),filters:se(m1(this.filtersAll))}}removeOldSoundAndExport(){return this.export()}restore(e){let t=H.stepCounter-1;this.clear();try{if(e.hasOwnProperty("soundAliasesOrder"))te.soundAliasesOrder=e.soundAliasesOrder;else {A.error("The data does not have the properties soundAliasesOrder");return}if(e.hasOwnProperty("filters")){let i=e.filters;i&&(this.filtersAll=Rd(i));}if(e.hasOwnProperty("playInStepIndex")){let i=e.playInStepIndex;i&&(te.soundsPlaying=i);}if(e.hasOwnProperty("sounds")){let i=e.sounds;for(let n in i){let s=i[n],o=!1,a=this.add(n,{...s.options,autoPlay:!1});if(n in te.soundsPlaying){let u=te.soundsPlaying[n];(s.options.loop||u.options&&typeof u.options=="object"&&u.options.loop||u.stepIndex===t)&&(o=!0),s.filters&&(a.filters=Rd(s.filters)),o&&a.play();}}}if(e.hasOwnProperty("soundsPlaying")){let i=e.soundsPlaying;for(let n in i){let s=i[n];te.soundsPlaying[n]={paused:s.paused,stepIndex:s.stepIndex,options:s.options};let o=i[n].sound,a=!1,u;if(this.exists(n)?(u=this.find(n),o.options.url=u.options.url,o.options.volume=u.options.volume,u.options=o.options,u.autoPlay=!1,u.filters=o.filters?Rd(o.filters):[]):u=this.add(n,{...o.options,autoPlay:!1}),n in te.soundsPlaying){let l=te.soundsPlaying[n];(o.options.loop||l.options&&typeof l.options=="object"&&l.options.loop||l.stepIndex===t)&&(a=!0),o.filters&&(u.filters=Rd(o.filters)),a&&u.play();}}}else {A.error("The data does not have the properties soundsPlaying");return}}catch(i){A.error("Error importing data",i);}}};var os=new Md;Ee();function oM(){console.info(`
3310
+ `,dynamic:false}};});var Dk,eR,tR,rR=p(()=>{bt();Gr();OE();Dk=new xe(0,0,0,0),eR=class kE extends Ze{constructor(e={}){e={...kE.defaultOptions,...e,dynamicProperties:{...kE.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:n,texture:s,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=s||null,this.shader=i,this._properties={};for(let u in sd){let l=sd[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=n??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 n=this.particleChildren.indexOf(e[i]);n>-1&&(this.particleChildren.splice(n,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return Dk}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,n=this.texture??this.particleChildren[0]?.texture;n&&n.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")}};eR.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};tR=eR;});var iR,FE,B_,sR=p(()=>{qi();de();ye();Gr();km();iR=class nR extends Ze{constructor(e){e instanceof exports.Texture&&(e={texture:e});let{width:t,height:i,anchor:n,leftWidth:s,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=s??l?.defaultBorders?.left??Yr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Yr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Yr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Yr.defaultOptions.bottomHeight,this._width=t??l.width??Yr.defaultOptions.width,this._height=i??l.height??Yr.defaultOptions.height,this.allowChildren=false,this.texture=l??nR.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new Me({_onUpdate:()=>{this.onViewUpdate();}}),n?this.anchor=n: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=exports.Texture.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,n=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*n,e.maxY=e.minY+n;}};iR.defaultOptions={texture:exports.Texture.EMPTY};FE=iR,B_=class extends FE{constructor(...e){let t=e[0];t instanceof exports.Texture&&(F(z,"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]}),F(z,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function oR(r,e){return e instanceof tt||e instanceof Xr?e:r==="html"?new Xr(e):new tt(e)}var aR=p(()=>{Mc();Ii();});async function uR(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let n=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let s=["font-size: 1px;",`padding: ${n}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",s);}var lR=p(()=>{});function GE(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=Ok[kk++]);let i="";for(let o=0;o<e;o++)i+=" ";let n=r.label;!n&&r instanceof Pe&&(n=`sprite:${r.texture.label}`);let s=`%c ${i}|- ${n} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(s+=" (RenderGroup)"),r.filters&&(s+="(*filters)"),console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];GE(a,e,{...t});}}function UE(r,e=0,t={index:0,color:"#000000"}){let i="";for(let s=0;s<e;s++)i+=" ";let n=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let s=0;s<r.renderGroupChildren.length;s++){let o=r.renderGroupChildren[s];UE(o,e,{...t,index:s});}}var Ok,kk,cR=p(()=>{un();Ok=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],kk=0;});var hR={};vi(hR,{AbstractBitmapFont:()=>Mn,AbstractRenderer:()=>ii,AbstractText:()=>ci,AccessibilitySystem:()=>xf,AlphaFilter:()=>P3,AlphaMask:()=>Es,AlphaMaskPipe:()=>ho,AnimatedSprite:()=>dl,Application:()=>yh,ApplicationInitHook:()=>lo,Assets:()=>exports.Assets,AssetsClass:()=>Ph,BLEND_TO_NPM:()=>Hf,BUFFER_TYPE:()=>Fo,BackgroundLoader:()=>Lu,BackgroundSystem:()=>rg,Batch:()=>ic,BatchGeometry:()=>Ba,BatchTextureArray:()=>wa,BatchableGraphics:()=>Mi,BatchableMesh:()=>ei,BatchableSprite:()=>Er,Batcher:()=>zf,BatcherPipe:()=>oh,BigPool:()=>K,BindGroup:()=>ot,BindGroupSystem:()=>yo,BitmapFont:()=>jo,BitmapFontManager:()=>Oi,BitmapText:()=>ml,BitmapTextPipe:()=>Ys,BlendModeFilter:()=>ee,BlendModePipe:()=>mo,BlurFilter:()=>Kh,BlurFilterPass:()=>hl,Bounds:()=>xe,BrowserAdapter:()=>Cf,Buffer:()=>Ge,BufferImageSource:()=>Ci,BufferResource:()=>oi,BufferUsage:()=>Q,CLEAR:()=>at,Cache:()=>me,CanvasPool:()=>It,CanvasPoolClass:()=>yc,CanvasSource:()=>ct,CanvasTextMetrics:()=>$t,CanvasTextPipe:()=>Hs,CanvasTextSystem:()=>Xs,Circle:()=>$a,Color:()=>$,ColorBlend:()=>Fc,ColorBurnBlend:()=>Gc,ColorDodgeBlend:()=>Uc,ColorMask:()=>Cs,ColorMaskPipe:()=>fo,ColorMatrixFilter:()=>c_,CompressedSource:()=>Pr,Container:()=>re,Culler:()=>Xx,CullerPlugin:()=>kh,CustomRenderPipe:()=>io,D3D10_RESOURCE_DIMENSION:()=>Gx,D3DFMT:()=>Vt,DATA_URI:()=>dP,DDS:()=>Z,DEG_TO_RAD:()=>Ld,DEPRECATED_SCALE_MODES:()=>nd,DEPRECATED_WRAP_MODES:()=>id,DOMAdapter:()=>W,DOMContainer:()=>Ef,DOMPipe:()=>Ts,DRAW_MODES:()=>sB,DXGI_FORMAT:()=>Fx,DXGI_TO_TEXTURE_FORMAT:()=>kt,DarkenBlend:()=>Lc,DefaultBatcher:()=>Rs,DefaultShader:()=>Oa,DifferenceBlend:()=>Nc,DisplacementFilter:()=>f_,DivideBlend:()=>Hc,DynamicBitmapFont:()=>Bc,Ellipse:()=>qa,EventBoundary:()=>ya,EventEmitter:()=>ce,EventSystem:()=>va,EventsTicker:()=>pr,ExclusionBlend:()=>Vc,ExtensionType:()=>g,ExtractSystem:()=>ig,FOURCC_TO_TEXTURE_FORMAT:()=>Ih,FederatedContainer:()=>Sf,FederatedEvent:()=>Zr,FederatedMouseEvent:()=>Fr,FederatedPointerEvent:()=>yt,FederatedWheelEvent:()=>mr,FillGradient:()=>Mt,FillPattern:()=>Vr,Filter:()=>gt,FilterEffect:()=>Dr,FilterPipe:()=>Zs,FilterSystem:()=>Qs,FontStylePromiseCache:()=>au,GAUSSIAN_VALUES:()=>cl,GL_FORMATS:()=>Ru,GL_INTERNAL_FORMAT:()=>M2,GL_TARGETS:()=>fh,GL_TYPES:()=>ge,GL_WRAP_MODES:()=>aS,GenerateTextureSystem:()=>go,Geometry:()=>Bt,GlBackBufferSystem:()=>Og,GlBatchAdaptor:()=>ko,GlBuffer:()=>Bu,GlBufferSystem:()=>Go,GlColorMaskSystem:()=>Lo,GlContextSystem:()=>Mg,GlEncoderSystem:()=>No,GlGeometrySystem:()=>Uo,GlGraphicsAdaptor:()=>Do,GlMeshAdaptor:()=>Oo,GlParticleContainerAdaptor:()=>za,GlParticleContainerPipe:()=>Us,GlProgram:()=>Ue,GlProgramData:()=>Du,GlRenderTarget:()=>Mu,GlRenderTargetAdaptor:()=>Iu,GlRenderTargetSystem:()=>zo,GlShaderSystem:()=>Wo,GlStateSystem:()=>tx,GlStencilSystem:()=>Ho,GlTexture:()=>ku,GlTextureSystem:()=>Yo,GlUboSystem:()=>Vo,GlUniformGroupSystem:()=>Xo,GlobalUniformSystem:()=>xo,GpuBatchAdaptor:()=>ro,GpuBlendModesToPixi:()=>St,GpuBufferSystem:()=>vo,GpuColorMaskSystem:()=>To,GpuDeviceSystem:()=>Hn,GpuEncoderSystem:()=>So,GpuGraphicsAdaptor:()=>eo,GpuGraphicsContext:()=>pc,GpuMeshAdapter:()=>to,GpuMipmapGenerator:()=>wu,GpuParticleContainerAdaptor:()=>Ya,GpuParticleContainerPipe:()=>Ls,GpuProgram:()=>Le,GpuReadBuffer:()=>rB,GpuRenderTarget:()=>Cu,GpuRenderTargetAdaptor:()=>Au,GpuRenderTargetSystem:()=>Bo,GpuShaderSystem:()=>Ro,GpuStateSystem:()=>Mo,GpuStencilModesToPixi:()=>Ar,GpuStencilSystem:()=>Eo,GpuTextureSystem:()=>Io,GpuUboSystem:()=>Ao,GpuUniformBatchPipe:()=>Po,Graphics:()=>Rn,GraphicsContext:()=>et,GraphicsContextRenderData:()=>mc,GraphicsContextSystem:()=>En,GraphicsPath:()=>Cr,GraphicsPipe:()=>Fs,HTMLText:()=>gl,HTMLTextPipe:()=>js,HTMLTextRenderData:()=>In,HTMLTextStyle:()=>Xr,HTMLTextSystem:()=>Dn,HardLightBlend:()=>zc,HardMixBlend:()=>Wc,HelloSystem:()=>Nn,IGLUniformData:()=>Ng,ImageSource:()=>wt,InstructionSet:()=>Ji,KTX:()=>je,LightenBlend:()=>Xc,LinearBurnBlend:()=>Yc,LinearDodgeBlend:()=>jc,LinearLightBlend:()=>$c,Loader:()=>Hu,LoaderParserPriority:()=>De,LuminosityBlend:()=>qc,MSAA_QUALITY:()=>PE,MaskEffectManager:()=>da,MaskEffectManagerClass:()=>Ll,MaskFilter:()=>mu,Matrix:()=>k,Mesh:()=>Jt,MeshGeometry:()=>Dt,MeshPipe:()=>Gs,MeshPlane:()=>A_,MeshRope:()=>YB,MeshSimple:()=>w_,NOOP:()=>zl,NegationBlend:()=>Kc,NineSliceGeometry:()=>Yr,NineSlicePlane:()=>B_,NineSliceSprite:()=>FE,NineSliceSpritePipe:()=>Ks,NoiseFilter:()=>F3,ObservablePoint:()=>Me,OverlayBlend:()=>Zc,PI_2:()=>Gd,Particle:()=>QB,ParticleBuffer:()=>Wa,ParticleContainer:()=>tR,ParticleContainerPipe:()=>Cn,ParticleShader:()=>Xa,PerspectiveMesh:()=>LB,PerspectivePlaneGeometry:()=>_l,PinLightBlend:()=>Qc,PipelineSystem:()=>wo,PlaneGeometry:()=>kn,Point:()=>ne,Polygon:()=>Pn,Pool:()=>Si,PoolGroupClass:()=>Gl,PrepareBase:()=>g_,PrepareQueue:()=>pl,PrepareSystem:()=>rd,PrepareUpload:()=>xl,QuadGeometry:()=>cu,RAD_TO_DEG:()=>Ud,Rectangle:()=>exports.Rectangle,RenderContainer:()=>T_,RenderGroup:()=>xa,RenderGroupPipe:()=>so,RenderGroupSystem:()=>ao,RenderLayer:()=>IB,RenderLayerClass:()=>wE,RenderTarget:()=>bo,RenderTargetSystem:()=>Wn,RenderTexture:()=>gu,RenderableGCSystem:()=>ag,RendererInitHook:()=>co,RendererType:()=>Ne,ResizePlugin:()=>bs,Resolver:()=>Tt,RopeGeometry:()=>P_,RoundedRectangle:()=>Ka,SCALE_MODES:()=>cB,STENCIL_MODES:()=>Ie,SVGParser:()=>rm,SaturationBlend:()=>Jc,SchedulerSystem:()=>_o,ScissorMask:()=>y_,SdfShader:()=>nu,Shader:()=>We,ShaderStage:()=>xn,ShapePath:()=>eu,SharedRenderPipes:()=>yu,SharedSystems:()=>bu,SoftLightBlend:()=>eh,Sprite:()=>Pe,SpritePipe:()=>uo,Spritesheet:()=>Ql,State:()=>ze,StencilMask:()=>As,StencilMaskPipe:()=>po,SubtractBlend:()=>th,SystemRunner:()=>Un,TEXTURE_FORMAT_BLOCK_SIZE:()=>Ux,Text:()=>wr,TextStyle:()=>tt,Texture:()=>exports.Texture,TextureGCSystem:()=>ug,TextureMatrix:()=>tn,TexturePool:()=>Te,TexturePoolClass:()=>Wl,TextureSource:()=>he,TextureStyle:()=>ga,TextureUvs:()=>v_,Ticker:()=>Se,TickerListener:()=>nn,TickerPlugin:()=>vs,TilingSprite:()=>__,TilingSpritePipe:()=>qs,TilingSpriteShader:()=>lu,Transform:()=>fl,Triangle:()=>m_,UNIFORM_TO_ARRAY_SETTERS:()=>Qg,UNIFORM_TO_SINGLE_SETTERS:()=>Zg,UNIFORM_TYPES_MAP:()=>hp,UNIFORM_TYPES_VALUES:()=>lc,UPDATE_BLEND:()=>_a,UPDATE_COLOR:()=>_s,UPDATE_PRIORITY:()=>exports.UPDATE_PRIORITY,UPDATE_TRANSFORM:()=>Z1,UPDATE_VISIBLE:()=>rn,UboBatch:()=>Su,UboSystem:()=>Vn,UniformGroup:()=>ae,VERSION:()=>Ln,VideoSource:()=>hn,ViewContainer:()=>Ze,ViewSystem:()=>hg,ViewableBuffer:()=>gr,VividLightBlend:()=>rh,WGSL_ALIGN_SIZE_DATA:()=>Co,WGSL_TO_STD40_SIZE:()=>ph,WRAP_MODES:()=>lB,WebGLRenderer:()=>bh,WebGPURenderer:()=>dh,WebWorkerAdapter:()=>S3,WorkerManager:()=>Ah,_getGlobalBounds:()=>Zd,accessibilityTarget:()=>_f,addBits:()=>sc,addMaskBounds:()=>ln,addMaskLocalBounds:()=>cn,addProgramDefines:()=>jf,alphaFrag:()=>r_,alphaWgsl:()=>qh,applyMatrix:()=>Im,applyProjectiveTransformationToPlane:()=>S_,applyStyleParams:()=>_h,assignWithIgnore:()=>xs,autoDetectEnvironment:()=>aP,autoDetectRenderer:()=>hx,autoDetectSource:()=>SC,basisTranscoderUrls:()=>Zu,bgr2rgb:()=>Ei,bitmapFontCachePlugin:()=>dx,bitmapFontTextParser:()=>Uu,bitmapFontXMLParser:()=>vh,bitmapFontXMLStringParser:()=>Th,blendTemplateFrag:()=>Gm,blendTemplateVert:()=>Um,blendTemplateWgsl:()=>Lm,blockDataMap:()=>hh,blurTemplateWgsl:()=>a_,boundsPool:()=>Ht,browserExt:()=>Ov,buildAdaptiveBezier:()=>Qa,buildAdaptiveQuadratic:()=>Yp,buildArc:()=>Ja,buildArcTo:()=>$p,buildArcToSvg:()=>qp,buildCircle:()=>Tr,buildContextBatches:()=>Op,buildEllipse:()=>xp,buildGeometryFromPath:()=>wB,buildLine:()=>Sp,buildPixelLine:()=>Ep,buildPolygon:()=>La,buildRectangle:()=>Na,buildRoundedRectangle:()=>_p,buildSimpleUvs:()=>Fa,buildTriangle:()=>Ha,buildUvs:()=>ka,cacheAsTextureMixin:()=>zd,cacheTextureArray:()=>px,calculateProjection:()=>Eg,checkChildrenDidChange:()=>Hl,checkDataUrl:()=>qt,checkExtension:()=>Xe,checkMaxIfStatementsInShader:()=>Uf,childrenHelperMixin:()=>Xd,cleanArray:()=>og,cleanHash:()=>sg,clearList:()=>oo,closePointEps:()=>yp,collectAllRenderables:()=>yB,collectRenderablesMixin:()=>Yd,color32BitToUniform:()=>Sr,colorBit:()=>bn,colorBitGl:()=>yn,colorMatrixFilterFrag:()=>l_,colorMatrixFilterWgsl:()=>Zh,colorToUniform:()=>tA,compareModeToGlCompare:()=>ax,compileHighShader:()=>ip,compileHighShaderGl:()=>np,compileHighShaderGlProgram:()=>_r,compileHighShaderGpuProgram:()=>xr,compileHooks:()=>oc,compileInputs:()=>ac,compileOutputs:()=>rp,compileShader:()=>mh,compute2DProjection:()=>C_,convertFormatIfRequired:()=>gw,convertToList:()=>vt,copySearchParams:()=>Ss,createIdFromString:()=>Hr,createIndicesForQuads:()=>_c,createLevelBuffers:()=>rw,createLevelBuffersFromKTX:()=>_w,createStringVariations:()=>Af,createTexture:()=>Ot,createUboElementsSTD40:()=>kg,createUboElementsWGSL:()=>pg,createUboSyncFunction:()=>vu,createUboSyncFunctionSTD40:()=>Ug,createUboSyncFunctionWGSL:()=>vg,crossOrigin:()=>b2,cullingMixin:()=>Fd,curveEps:()=>vp,defaultFilterVert:()=>Kn,defaultValue:()=>Ou,definedProps:()=>pt,deprecation:()=>F,detectAvif:()=>gx,detectBasis:()=>qP,detectCompressed:()=>Cw,detectDefaults:()=>xx,detectMp4:()=>_x,detectOgv:()=>bx,detectVideoAlphaMode:()=>Ea,detectWebm:()=>yx,detectWebp:()=>vx,determineCrossOrigin:()=>v2,displacementFrag:()=>h_,displacementVert:()=>d_,displacementWgsl:()=>Qh,earcut:()=>dR.default,effectsMixin:()=>jd,ensureAttributes:()=>Eu,ensureIsBuffer:()=>nc,ensurePrecision:()=>$f,ensureTextOptions:()=>Zn,ensureTextStyle:()=>oR,executeInstructions:()=>no,extensions:()=>N,extractAttributesFromGlProgram:()=>Xg,extractAttributesFromGpuProgram:()=>Qf,extractFontFamilies:()=>vm,extractStructAndGroups:()=>Ma,extractSvgUrlId:()=>Cc,fastCopy:()=>Bs,findHooksRx:()=>Py,findMixin:()=>$d,fontStringFromTextStyle:()=>Di,formatShader:()=>q3,fragmentGPUTemplate:()=>op,fragmentGlTemplate:()=>up,generateArraySyncSTD40:()=>Gg,generateArraySyncWGSL:()=>yg,generateBlurFragSource:()=>n_,generateBlurGlProgram:()=>o_,generateBlurProgram:()=>u_,generateBlurVertSource:()=>s_,generateGPULayout:()=>X3,generateGpuLayoutGroups:()=>Jf,generateLayout:()=>j3,generateLayoutHash:()=>ep,generateParticleUpdateFunction:()=>kp,generateProgram:()=>qg,generateShaderSyncCode:()=>Lg,generateTextStyleKey:()=>tu,generateTextureBatchBit:()=>vn,generateTextureBatchBitGl:()=>Tn,generateTextureMatrix:()=>Dp,generateUID:()=>fB,generateUniformsSync:()=>Jg,getAdjustedBlendModeBlend:()=>Lr,getAttributeInfoFromFormat:()=>Rt,getBatchSamplersUniformGroup:()=>Sn,getBitmapTextLayout:()=>ou,getCanvasBoundingBox:()=>Np,getCanvasFillStyle:()=>Bn,getCanvasTexture:()=>_u,getDefaultUniformValue:()=>dp,getFastGlobalBounds:()=>xB,getFastGlobalBoundsMixin:()=>Kd,getFontCss:()=>Sm,getFontFamilyName:()=>d2,getGeometryBounds:()=>Wf,getGlTypeFromFormat:()=>Dg,getGlobalBounds:()=>Kr,getGlobalMixin:()=>ef,getGlobalRenderableBounds:()=>Fm,getLocalBounds:()=>Qi,getMatrixRelativeToParent:()=>Mf,getMaxFragmentPrecision:()=>Yf,getMaxTexturesPerBatch:()=>Yt,getOrientationOfPoints:()=>Tp,getParent:()=>hb,getPo2TextureFromSource:()=>iu,getResolutionOfUrl:()=>jn,getSVGUrl:()=>Em,getSupportedCompressedTextureFormats:()=>$u,getSupportedGPUCompressedTextureFormats:()=>Bh,getSupportedGlCompressedTextureFormats:()=>wh,getSupportedTextureFormats:()=>ai,getTemporaryCanvasFromImage:()=>Cm,getTestContext:()=>Ca,getTextureBatchBindGroup:()=>fn,getTextureDefaultMatrix:()=>qB,getTextureFormatFromKTXTexture:()=>yw,getUboData:()=>Yg,getUniformData:()=>jg,getUrlExtension:()=>Vb,glFormatToGPUFormat:()=>Vx,glUploadBufferImageResource:()=>rx,glUploadCompressedTextureResource:()=>ix,glUploadImageResource:()=>Fu,glUploadVideoResource:()=>sx,globalUniformsBit:()=>lp,globalUniformsBitGl:()=>cp,globalUniformsUBOBitGl:()=>FC,gpuFormatToBasisTranscoderFormat:()=>nw,gpuFormatToKTXBasisTranscoderFormat:()=>Tw,gpuUploadBufferImageResource:()=>Pg,gpuUploadCompressedTextureResource:()=>wg,gpuUploadImageResource:()=>Pu,gpuUploadVideoResource:()=>Rg,groupD8:()=>ue,hasCachedCanvasTexture:()=>vP,hslWgsl:()=>U3,hslgl:()=>Fn,hslgpu:()=>Gn,injectBits:()=>uc,insertVersion:()=>qf,isMobile:()=>mf,isPow2:()=>Vl,isRenderingToScreen:()=>Cg,isSafari:()=>gm,isSingleItem:()=>Pi,isWebGLSupported:()=>ni,isWebGPUSupported:()=>si,ktxTranscoderUrls:()=>Ju,loadBasis:()=>ew,loadBasisOnWorker:()=>kx,loadBitmapFont:()=>fx,loadDDS:()=>ow,loadEnvironmentExtensions:()=>ih,loadFontAsBase64:()=>Tm,loadFontCSS:()=>Ic,loadImageBitmap:()=>_2,loadJson:()=>Tx,loadKTX:()=>uw,loadKTX2:()=>fw,loadKTX2onWorker:()=>Hx,loadSVGImage:()=>Am,loadSvg:()=>Cx,loadTextures:()=>Xu,loadTxt:()=>Sx,loadVideoTextures:()=>Px,loadWebFont:()=>Ex,localUniformBit:()=>Fi,localUniformBitGl:()=>On,localUniformBitGroup2:()=>wm,localUniformMSDFBit:()=>um,localUniformMSDFBitGl:()=>lm,log2:()=>z1,logDebugTexture:()=>uR,logProgramError:()=>$g,logRenderGroupScene:()=>UE,logScene:()=>GE,mSDFBit:()=>cm,mSDFBitGl:()=>hm,mapFormatToGlFormat:()=>ux,mapFormatToGlInternalFormat:()=>lx,mapFormatToGlType:()=>cx,mapGlToVertexFormat:()=>zg,mapSize:()=>eB,mapType:()=>gh,mapWebGLBlendModesToPixi:()=>ex,maskFrag:()=>eg,maskVert:()=>tg,maskWgsl:()=>ah,matrixPool:()=>Ke,measureHtmlText:()=>uu,measureMixin:()=>rf,migrateFragmentFromV7toV8:()=>Q3,mipmapScaleModeToGlFilter:()=>ox,mixHexColors:()=>TB,multiplyColors:()=>Zi,multiplyHexColors:()=>pa,nextPow2:()=>Or,noiseFrag:()=>p_,noiseWgsl:()=>Jh,nonCompressedFormats:()=>A2,normalizeExtensionPriority:()=>la,nssvg:()=>xm,nsxhtml:()=>_m,onRenderMixin:()=>nf,parseAttribute:()=>tm,parseDDS:()=>Lx,parseFunctionBody:()=>mB,parseKTX:()=>Nx,parseSVGDefinitions:()=>Jp,parseSVGFloatAttribute:()=>He,parseSVGPath:()=>Hp,parseSVGStyle:()=>Ac,particleData:()=>sd,particlesFrag:()=>Fp,particlesVert:()=>Gp,particlesWgsl:()=>bc,path:()=>Oe,pointInTriangle:()=>ed,preloadVideo:()=>y2,removeItems:()=>ha,removeStructAndGroupDuplicates:()=>tp,resetUids:()=>G1,resolveCharacters:()=>su,resolveCompressedTextureUrl:()=>Ew,resolveJsonUrl:()=>Bx,resolveTextureUrl:()=>Yu,resourceToTexture:()=>Qb,roundPixelsBit:()=>br,roundPixelsBitGl:()=>yr,roundedShapeArc:()=>Kp,roundedShapeQuadraticCurve:()=>Zp,sayHello:()=>ng,scaleModeToGlFilter:()=>xh,setBasisTranscoderPath:()=>QP,setKTXTranscoderPath:()=>hw,setPositions:()=>Mm,setProgramName:()=>Kf,setUvs:()=>Dm,shapeBuilders:()=>Va,sortMixin:()=>sf,spritesheetAsset:()=>wf,squaredDistanceToLineSegment:()=>An,stripVersion:()=>Zf,styleAttributes:()=>em,testImageFormat:()=>Nu,testVideoFormat:()=>Xn,textStyleToCSS:()=>ym,textureBit:()=>Wm,textureBitGl:()=>Xm,textureFrom:()=>Jb,tilingBit:()=>Bm,tilingBitGl:()=>Rm,toFillStyle:()=>zr,toLocalGlobalMixin:()=>of,toStrokeStyle:()=>wn,transformVertices:()=>Ms,triangulateWithHoles:()=>Ua,uboSyncFunctionsSTD40:()=>lh,uboSyncFunctionsWGSL:()=>_g,uid:()=>oe,uniformParsers:()=>jr,unpremultiplyAlpha:()=>DP,unsafeEvalSupported:()=>hu,updateLocalTransform:()=>EB,updateQuadBounds:()=>Sa,updateRenderGroupTransform:()=>jv,updateRenderGroupTransforms:()=>sh,updateTextBounds:()=>Ns,updateTransformAndChildren:()=>Km,updateTransformBackwards:()=>fa,updateWorldTransform:()=>AB,v8_0_0:()=>z,v8_3_4:()=>Hd,validFormats:()=>el,validateRenderables:()=>Zm,vertexGPUTemplate:()=>sp,vertexGlTemplate:()=>ap,viewportFromFrame:()=>aB,vkFormatToGPUFormat:()=>zx,warn:()=>G,webworkerExt:()=>kv,wrapModeToGlAddress:()=>Gu});var dR,Ee=p(()=>{kA();GA();P();P();kf();Bf();wb();Bb();NA();HA();VA();zA();WA();XA();YA();jA();$A();qA();KA();ZA();QA();JA();eP();tP();rP();iP();nP();sP();oP();HP();Rb();Ib();$P();t2();Qr();r2();i2();n2();s2();o2();a2();u2();mx();Sh();l2();sr();c2();h2();f2();p2();Ax();T2();Gi();x2();S2();wx();an();Yn();lr();Ta();Pf();Hb();Kl();st();KP();tw();iw();sw();P2();w2();B2();aw();R2();lw();D2();I2();pw();xw();bw();vw();G2();Sw();O2();U2();k2();Aw();L2();H2();Pw();tb();gC();Lb();Be();Hv();Nb();E3();kb();Tf();bf();Xl();Ub();jl();yf();vf();Gv();Uv();Lv();L3();iE();nE();uE();hE();dE();$h();fE();pE();mE();gE();xE();eT();tT();rT();qe();Oc();kc();w3();M3();cE();i_();sE();aE();oE();lE();I3();D3();G3();ri();Ul();Rv();Iv();iT();cf();pe();Nd();ma();Vp();qi();Nt();_E();w0();B0();R0();Qe();M0();N3();bE();SE();W3();AE();tS();ty();dn();Y3();$3();tc();Wv();sy();Jv();uy();iy();fp();Ny();Bi();Dy();Ay();wy();By();Ry();K3();My();Oy();Ia();Da();ky();$s();Ri();Ym();Xb();sT();Yb();oT();ob();Z3();jb();aT();Jl();ec();$S();rS();iS();nS();Js();oS();lS();uS();hS();dS();fS();_S();pS();xS();bS();yS();vS();cc();jt();TS();RS();DS();J3();SS();Hg();Tg();CS();BS();cy();Gf();AS();PS();wS();tB();Wg();hy();dy();fy();py();my();Fg();gS();mS();IS();MS();FS();OS();Ig();GS();YS();US();LS();nx();NS();VS();E2();zS();WS();XS();HS();OP();jS();PT();wT();iB();FT();BT();RT();MT();IT();kT();GT();UT();LT();HT();VT();zT();wi();or();WT();mg();OT();by();yy();DT();Ty();Sy();Ey();XT();YT();Sg();ZT();jT();$T();Bg();qT();C2();KT();QT();lT();cT();Jr();ch();Nr();Nf();fT();mT();oB();mn();pp();oy();gn();ay();mp();af();gT();NT();lg();Ag();uB();xT();vy();vr();Uy();fg();Je();xg();Ly();bg();gg();bT();pn();Pa();ur();du();dg();Hm();Vs();hB();TT();pT();hf();Ps();ju();ws();mt();Of();de();ET();df();kr();uf();dB();pB();cg();Dx();qu();ey();Ra();gB();AT();ar();g0();x0();_0();bt();_B();ds();Nl();Mv();Ki();ib();nb();sb();ab();ub();lb();tf();fb();pb();mb();gb();Xt();Xv();bB();bb();Yv();Kv();ff();db();qm();vB();en();$m();SB();Jd();Qd();CB();$v();PB();qv();JT();ks();Vv();gp();Xp();k0();jp();F0();L0();bp();Vy();zy();Rp();Mp();Ip();zC();Os();vc();am();Ws();gc();u0();Ec();N0();H0();V0();Qp();P0();W0();X0();z0();Qy();BB();im();Zy();Hy();Bp();DB();NB();ME();BE();RE();HB();Dc();jB();$B();IE();eS();zv();xc();KB();qo();ki();c0();d0();v0();y0();T0();JB();m0();rR();Up();OE();b0();f0();p0();yE();km();sR();wv();_v();vv();TE();Av();Ev();Tv();Sv();Cv();ja();un();Zv();dm();ZS();QS();JS();e2();KS();Rc();EE();nv();rv();pm();fm();CE();ov();bm();Mc();gv();lv();dv();fv();pv();cv();hv();mv();Pm();uv();td();wc();E0();q0();Pc();om();tv();Z0();Q0();b_();Ii();aR();nm();sm();Lp();Gr();zb();Wb();ys();sn();Mb();If();Ab();av();fu();pu();Nm();C0();Qm();Ct();yT();Wd();ft();Rf();Lf();Jm();ye();lR();cR();_e();_b();vE();Eh();on();Vd();At();_T();dR=$i($y());N.add(Ov,kv);});var TR=dr((L_,vR)=>{(function(r,e){typeof L_=="object"?vR.exports=L_=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(L_,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 j_=="function")try{i=j_("crypto");}catch{}var n=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.")},s=Object.create||function(){function x(){}return function(y){var S;return x.prototype=y,S=new x,x.prototype=null,S}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(x){var y=s(this);return x&&y.mixIn(x),(!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 x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var y in x)x.hasOwnProperty(y)&&(this[y]=x[y]);x.hasOwnProperty("toString")&&(this.toString=x.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(x,y){x=this.words=x||[],y!=t?this.sigBytes=y:this.sigBytes=x.length*4;},toString:function(x){return (x||h).stringify(this)},concat:function(x){var y=this.words,S=x.words,T=this.sigBytes,O=x.sigBytes;if(this.clamp(),T%4)for(var v=0;v<O;v++){var E=S[v>>>2]>>>24-v%4*8&255;y[T+v>>>2]|=E<<24-(T+v)%4*8;}else for(var C=0;C<O;C+=4)y[T+C>>>2]=S[C>>>2];return this.sigBytes+=O,this},clamp:function(){var x=this.words,y=this.sigBytes;x[y>>>2]&=4294967295<<32-y%4*8,x.length=e.ceil(y/4);},clone:function(){var x=u.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var y=[],S=0;S<x;S+=4)y.push(n());return new l.init(y,x)}}),c=o.enc={},h=c.Hex={stringify:function(x){for(var y=x.words,S=x.sigBytes,T=[],O=0;O<S;O++){var v=y[O>>>2]>>>24-O%4*8&255;T.push((v>>>4).toString(16)),T.push((v&15).toString(16));}return T.join("")},parse:function(x){for(var y=x.length,S=[],T=0;T<y;T+=2)S[T>>>3]|=parseInt(x.substr(T,2),16)<<24-T%8*4;return new l.init(S,y/2)}},d=c.Latin1={stringify:function(x){for(var y=x.words,S=x.sigBytes,T=[],O=0;O<S;O++){var v=y[O>>>2]>>>24-O%4*8&255;T.push(String.fromCharCode(v));}return T.join("")},parse:function(x){for(var y=x.length,S=[],T=0;T<y;T++)S[T>>>2]|=(x.charCodeAt(T)&255)<<24-T%4*8;return new l.init(S,y)}},f=c.Utf8={stringify:function(x){try{return decodeURIComponent(escape(d.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return d.parse(unescape(encodeURIComponent(x)))}},m=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(x){typeof x=="string"&&(x=f.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes;},_process:function(x){var y,S=this._data,T=S.words,O=S.sigBytes,v=this.blockSize,E=v*4,C=O/E;x?C=e.ceil(C):C=e.max((C|0)-this._minBufferSize,0);var w=C*v,B=e.min(w*4,O);if(w){for(var I=0;I<w;I+=v)this._doProcessBlock(T,I);y=T.splice(0,w),S.sigBytes-=B;}return new l.init(y,B)},clone:function(){var x=u.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});a.Hasher=m.extend({cfg:u.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset();},reset:function(){m.reset.call(this),this._doReset();},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(x){return function(y,S){return new x.init(S).finalize(y)}},_createHmacHelper:function(x){return function(y,S){return new b.HMAC.init(x,S).finalize(y)}}});var b=o.algo={};return o}(Math);return r});});var XE=dr((N_,SR)=>{(function(r,e){typeof N_=="object"?SR.exports=N_=e(TR()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(N_,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,n=t.Hasher,s=e.algo,o=[],a=s.SHA1=n.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],f=c[2],m=c[3],_=c[4],b=0;b<80;b++){if(b<16)o[b]=u[l+b]|0;else {var x=o[b-3]^o[b-8]^o[b-14]^o[b-16];o[b]=x<<1|x>>>31;}var y=(h<<5|h>>>27)+_+o[b];b<20?y+=(d&f|~d&m)+1518500249:b<40?y+=(d^f^m)+1859775393:b<60?y+=(d&f|d&m|f&m)-1894007588:y+=(d^f^m)-899497514,_=m,m=f,f=d<<30|d>>>2,d=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+f|0,c[3]=c[3]+m|0,c[4]=c[4]+_|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=n.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=n._createHelper(a),e.HmacSHA1=n._createHmacHelper(a);}(),r.SHA1});});var QR=dr((h1,ZR)=>{(function(r,e){var t=e(r);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return t});else if(typeof h1=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))ZR.exports=t;else {var i=r.DeepDiff;t.noConflict=function(){return r.DeepDiff===t&&(r.DeepDiff=i),t},r.DeepDiff=t;}})(h1,function(r){var e=["N","E","A","D"];function t(v,E){v.super_=E,v.prototype=Object.create(E.prototype,{constructor:{value:v,enumerable:false,writable:true,configurable:true}});}function i(v,E){Object.defineProperty(this,"kind",{value:v,enumerable:true}),E&&E.length&&Object.defineProperty(this,"path",{value:E,enumerable:true});}function n(v,E,C){n.super_.call(this,"E",v),Object.defineProperty(this,"lhs",{value:E,enumerable:true}),Object.defineProperty(this,"rhs",{value:C,enumerable:true});}t(n,i);function s(v,E){s.super_.call(this,"N",v),Object.defineProperty(this,"rhs",{value:E,enumerable:true});}t(s,i);function o(v,E){o.super_.call(this,"D",v),Object.defineProperty(this,"lhs",{value:E,enumerable:true});}t(o,i);function a(v,E,C){a.super_.call(this,"A",v),Object.defineProperty(this,"index",{value:E,enumerable:true}),Object.defineProperty(this,"item",{value:C,enumerable:true});}t(a,i);function u(v,E,C){var w=v.slice((E)+1||v.length);return v.length=E<0?v.length+E:E,v.push.apply(v,w),v}function l(v){var E=typeof v;return E!=="object"?E:v===Math?"math":v===null?"null":Array.isArray(v)?"array":Object.prototype.toString.call(v)==="[object Date]"?"date":typeof v.toString=="function"&&/^\/.*\//.test(v.toString())?"regexp":"object"}function c(v){var E=0;if(v.length===0)return E;for(var C=0;C<v.length;C++){var w=v.charCodeAt(C);E=(E<<5)-E+w,E=E&E;}return E}function h(v){var E=0,C=l(v);if(C==="array"){v.forEach(function(le){E+=h(le);});var w="[type: array, hash: "+E+"]";return E+c(w)}if(C==="object"){for(var B in v)if(v.hasOwnProperty(B)){var I="[ type: object, key: "+B+", value hash: "+h(v[B])+"]";E+=c(I);}return E}var U="[ type: "+C+" ; value: "+v+"]";return E+c(U)}function d(v,E,C,w,B,I,U,le){C=C||[],B=B||[],U=U||[];var fe=B.slice(0);if(typeof I<"u"&&I!==null){if(w){if(typeof w=="function"&&w(fe,I))return;if(typeof w=="object"){if(w.prefilter&&w.prefilter(fe,I))return;if(w.normalize){var hr=w.normalize(fe,I,v,E);hr&&(v=hr[0],E=hr[1]);}}}fe.push(I);}l(v)==="regexp"&&l(E)==="regexp"&&(v=v.toString(),E=E.toString());var V=typeof v,Y=typeof E,Fe,ve,nt,Mr,Yi=V!=="undefined"||U&&U.length>0&&U[U.length-1].lhs&&Object.getOwnPropertyDescriptor(U[U.length-1].lhs,I),ji=Y!=="undefined"||U&&U.length>0&&U[U.length-1].rhs&&Object.getOwnPropertyDescriptor(U[U.length-1].rhs,I);if(!Yi&&ji)C.push(new s(fe,E));else if(!ji&&Yi)C.push(new o(fe,v));else if(l(v)!==l(E))C.push(new n(fe,v,E));else if(l(v)==="date"&&v-E!==0)C.push(new n(fe,v,E));else if(V==="object"&&v!==null&&E!==null){for(Fe=U.length-1;Fe>-1;--Fe)if(U[Fe].lhs===v){Mr=true;break}if(Mr)v!==E&&C.push(new n(fe,v,E));else {if(U.push({lhs:v,rhs:E}),Array.isArray(v)){for(le&&(v.sort(function(yi,ua){return h(yi)-h(ua)}),E.sort(function(yi,ua){return h(yi)-h(ua)})),Fe=E.length-1,ve=v.length-1;Fe>ve;)C.push(new a(fe,Fe,new s(void 0,E[Fe--])));for(;ve>Fe;)C.push(new a(fe,ve,new o(void 0,v[ve--])));for(;Fe>=0;--Fe)d(v[Fe],E[Fe],C,w,fe,Fe,U,le);}else {var Il=Object.keys(v),bi=Object.keys(E);for(Fe=0;Fe<Il.length;++Fe)nt=Il[Fe],Mr=bi.indexOf(nt),Mr>=0?(d(v[nt],E[nt],C,w,fe,nt,U,le),bi[Mr]=null):d(v[nt],void 0,C,w,fe,nt,U,le);for(Fe=0;Fe<bi.length;++Fe)nt=bi[Fe],nt&&d(void 0,E[nt],C,w,fe,nt,U,le);}U.length=U.length-1;}}else v!==E&&(V==="number"&&isNaN(v)&&isNaN(E)||C.push(new n(fe,v,E)));}function f(v,E,C,w,B){var I=[];if(d(v,E,I,w,null,null,null,B),C)for(var U=0;U<I.length;++U)C(I[U]);return I}function m(v,E,C,w,B,I,U){return d(v,E,C,w,B,I,U,true)}function _(v,E,C,w){var B=w?function(U){U&&w.push(U);}:void 0,I=f(v,E,B,C);return w||(I.length?I:void 0)}function b(v,E,C,w){var B=w?function(U){U&&w.push(U);}:void 0,I=f(v,E,B,C,true);return w||(I.length?I:void 0)}function x(v,E,C){if(C.path&&C.path.length){var w=v[E],B,I=C.path.length-1;for(B=0;B<I;B++)w=w[C.path[B]];switch(C.kind){case "A":x(w[C.path[B]],C.index,C.item);break;case "D":delete w[C.path[B]];break;case "E":case "N":w[C.path[B]]=C.rhs;break}}else switch(C.kind){case "A":x(v[E],C.index,C.item);break;case "D":v=u(v,E);break;case "E":case "N":v[E]=C.rhs;break}return v}function y(v,E,C){if(typeof C>"u"&&E&&~e.indexOf(E.kind)&&(C=E),v&&C&&C.kind){for(var w=v,B=-1,I=C.path?C.path.length-1:0;++B<I;)typeof w[C.path[B]]>"u"&&(w[C.path[B]]=typeof C.path[B+1]<"u"&&typeof C.path[B+1]=="number"?[]:{}),w=w[C.path[B]];switch(C.kind){case "A":C.path&&typeof w[C.path[B]]>"u"&&(w[C.path[B]]=[]),x(C.path?w[C.path[B]]:w,C.index,C.item);break;case "D":delete w[C.path[B]];break;case "E":case "N":w[C.path[B]]=C.rhs;break}}}function S(v,E,C){if(C.path&&C.path.length){var w=v[E],B,I=C.path.length-1;for(B=0;B<I;B++)w=w[C.path[B]];switch(C.kind){case "A":S(w[C.path[B]],C.index,C.item);break;case "D":w[C.path[B]]=C.lhs;break;case "E":w[C.path[B]]=C.lhs;break;case "N":delete w[C.path[B]];break}}else switch(C.kind){case "A":S(v[E],C.index,C.item);break;case "D":v[E]=C.lhs;break;case "E":v[E]=C.lhs;break;case "N":v=u(v,E);break}return v}function T(v,E,C){if(v&&E&&C&&C.kind){var w=v,B,I;for(I=C.path.length-1,B=0;B<I;B++)typeof w[C.path[B]]>"u"&&(w[C.path[B]]={}),w=w[C.path[B]];switch(C.kind){case "A":S(w[C.path[B]],C.index,C.item);break;case "D":w[C.path[B]]=C.lhs;break;case "E":w[C.path[B]]=C.lhs;break;case "N":delete w[C.path[B]];break}}}function O(v,E,C){if(v&&E){var w=function(B){(!C||C(v,E,B))&&y(v,E,B);};f(v,E,w);}}return Object.defineProperties(_,{diff:{value:_,enumerable:true},orderIndependentDiff:{value:b,enumerable:true},observableDiff:{value:f,enumerable:true},orderIndependentObservableDiff:{value:m,enumerable:true},orderIndepHash:{value:h,enumerable:true},applyDiff:{value:O,enumerable:true},applyChange:{value:y,enumerable:true},revertChange:{value:T,enumerable:true},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:true}}),_.DeepDiff=_,r&&(r.DeepDiff=_),_});});Ee();var l1={};vi(l1,{CanvasBaseItem:()=>_d,CanvasEvent:()=>xd,CanvasManagerStatic:()=>D,Container:()=>es,FadeAlphaTicker:()=>_i,ImageContainer:()=>Ve,ImageSprite:()=>we,MoveTicker:()=>rr,RegisteredCanvasComponents:()=>Ut,RegisteredEvents:()=>hi,RegisteredTickers:()=>Wt,RotateTicker:()=>Rl,Sprite:()=>xi,Text:()=>ts,TickerBase:()=>zt,VideoSprite:()=>Gt,ZoomTicker:()=>zi,addImage:()=>yd,addImageCointainer:()=>bd,addVideo:()=>vd,canvas:()=>R,canvasComponentDecorator:()=>RR,eventDecorator:()=>MR,getTexture:()=>qr,loadImage:()=>UR,loadVideo:()=>NR,moveIn:()=>WR,moveOut:()=>W_,pushIn:()=>YR,pushOut:()=>u1,removeWithDissolve:()=>Sd,removeWithFade:()=>zR,shakeEffect:()=>FR,showImage:()=>LR,showImageContainer:()=>GR,showVideo:()=>HR,showWithDissolve:()=>o1,showWithFade:()=>VR,tickerDecorator:()=>kR,zoomIn:()=>XR,zoomOut:()=>a1});Ee();var ke={};vi(ke,{DistortionFilter:()=>R_,EqualizerFilter:()=>Br,Filter:()=>ht,MonoFilter:()=>M_,ReverbFilter:()=>I_,StereoFilter:()=>D_,StreamFilter:()=>O_,TelephoneFilter:()=>k_});var fR;function pR(r){return fR=r,r}function Ce(){return fR}var ht=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 R_=class extends ht{constructor(e=0){let t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Ce().useLegacy)return;let t=e*1e3,i=44100,n=new Float32Array(i),s=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,n[o]=(3+t)*a*20*s/(Math.PI+t*Math.abs(a));this._distortion.curve=n,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var ut=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Ce().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Ae=class extends ht{constructor(r=0,e=0,t=0,i=0,n=0,s=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Ae.F32,type:"lowshelf",gain:r},{f:Ae.F64,type:"peaking",gain:e},{f:Ae.F125,type:"peaking",gain:t},{f:Ae.F250,type:"peaking",gain:i},{f:Ae.F500,type:"peaking",gain:n},{f:Ae.F1K,type:"peaking",gain:s},{f:Ae.F2K,type:"peaking",gain:o},{f:Ae.F4K,type:"peaking",gain:a},{f:Ae.F8K,type:"peaking",gain:u},{f:Ae.F16K,type:"highshelf",gain:l}];Ce().useLegacy||(c=h.map(d=>{let f=Ce().context.audioContext.createBiquadFilter();return f.type=d.type,ut.setParamValue(f.Q,1),f.frequency.value=d.f,ut.setParamValue(f.gain,d.gain),f})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let f=this.bands[d];d>0&&this.bands[d-1].connect(f),this.bandsMap[f.frequency.value]=f;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);ut.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(Ae.F32,r);}get f32(){return this.getGain(Ae.F32)}set f64(r){this.setGain(Ae.F64,r);}get f64(){return this.getGain(Ae.F64)}set f125(r){this.setGain(Ae.F125,r);}get f125(){return this.getGain(Ae.F125)}set f250(r){this.setGain(Ae.F250,r);}get f250(){return this.getGain(Ae.F250)}set f500(r){this.setGain(Ae.F500,r);}get f500(){return this.getGain(Ae.F500)}set f1k(r){this.setGain(Ae.F1K,r);}get f1k(){return this.getGain(Ae.F1K)}set f2k(r){this.setGain(Ae.F2K,r);}get f2k(){return this.getGain(Ae.F2K)}set f4k(r){this.setGain(Ae.F4K,r);}get f4k(){return this.getGain(Ae.F4K)}set f8k(r){this.setGain(Ae.F8K,r);}get f8k(){return this.getGain(Ae.F8K)}set f16k(r){this.setGain(Ae.F16K,r);}get f16k(){return this.getGain(Ae.F16K)}reset(){this.bands.forEach(r=>{ut.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},Br=Ae;Br.F32=32;Br.F64=64;Br.F125=125;Br.F250=250;Br.F500=500;Br.F1K=1e3;Br.F2K=2e3;Br.F4K=4e3;Br.F8K=8e3;Br.F16K=16e3;var M_=class extends ht{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().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 I_=class extends ht{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(Ce().useLegacy)return;let{audioContext:e}=Ce().context,t=e.sampleRate,i=t*this._seconds,n=e.createBuffer(2,i,t),s=n.getChannelData(0),o=n.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,s[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=n,this.init(u);}};var D_=class extends ht{constructor(e=0){let t,i,n;if(!Ce().useLegacy){let{audioContext:s}=Ce().context;s.createStereoPanner?(t=s.createStereoPanner(),n=t):(i=s.createPanner(),i.panningModel="equalpower",n=i);}super(n),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?ut.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 O_=class extends ht{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().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 k_=class extends ht{constructor(){let e,t;if(!Ce().useLegacy){let{audioContext:i}=Ce().context,n=i.createBiquadFilter(),s=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();n.type="lowpass",ut.setParamValue(n.frequency,2e3),s.type="lowpass",ut.setParamValue(s.frequency,2e3),o.type="highpass",ut.setParamValue(o.frequency,500),a.type="highpass",ut.setParamValue(a.frequency,500),n.connect(s),s.connect(o),o.connect(a),e=n,t=a;}super(e,t);}};Ee();var od=class extends ce{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();}};Ee();var Fk=0,LE=class extends ce{constructor(r){super(),this.id=Fk++,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),n=this._volume*(this._muted?0:1);this._source.volume=n*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:n,volume:s,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=s,this._loop=!!n,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-LE.PADDING),this._end=Math.min(this._end+LE.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),Se.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(){Se.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){Se.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}]`}},F_=LE;F_.PADDING=.1;Ee();var ad=class extends ce{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new F_(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 n=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},s=()=>{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",n),t.removeEventListener("load",n),t.removeEventListener("abort",s),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",n,false),t.addEventListener("load",n,false),t.addEventListener("abort",s,false),t.addEventListener("error",o,false),t.load();}};Ee();var ud=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 Ko=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],NE=["audio/mpeg","audio/ogg"],Zo={};function mR(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={},n=/^no$/;Ko.forEach(s=>{let o=t.canPlayType(`audio/${s}`).replace(n,""),a=e[s]?t.canPlayType(e[s]).replace(n,""):"";i[s]=!!o||!!a;}),Object.assign(Zo,i);}mR();Ee();Ee();var Uk=0,ld=class extends ce{constructor(e){super(),this.id=Uk++,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),n=t.volume*(t.muted?0:1),s=this._volume*(this._muted?0:1);ut.setParamValue(this._gain.gain,s*n*i),ut.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:n,loop:s,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=n,this._volume=o,this._loop=!!s,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){Se.shared.remove(this._updateListener,this),e&&Se.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 n=this._source.playbackRate.value;this._elapsed+=i*n,this._lastUpdate=t;let s=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/s;}else o=this._elapsed%s/s;this._progress=o,this.emit("progress",this._progress,s);}}}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 Qo=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 gR=class extends Qo{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),n=e.createAnalyser();t.connect(n),n.connect(i),i.connect(r.destination),super(n,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=n;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(gR.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,ut.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}},G_=gR;G_.BUFFER_SIZE=0;var Jo=class{init(e){this.parent=e,this._nodes=new G_(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 ld(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=(n,s)=>{if(n)t&&t(n);else {this.parent.isLoaded=true,this.buffer=s;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var bl=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=Ce().useLegacy?new ad:new Jo;return new bl(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:Oe.extname(t).slice(1)})).filter(({ext:t})=>Zo[t]).sort((t,i)=>Ko.indexOf(t.ext)-Ko.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Ce().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 n in r)i[n]=this.addSprites(n,r[n]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new ud(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 n=t.sprite;console.assert(!!this._sprites[n],`Alias ${n} is not available`);let s=this._sprites[n];t.start=s.start+(t.start||0),t.end=s.end,t.speed=s.speed||1,t.loop=s.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(n=>{this._preloadQueue.push(()=>{n(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((n,s)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?s(o):(t.loaded&&t.loaded(o,a,u),n(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(bl._pool.length>0){let r=bl._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),bl._pool.indexOf(r)<0&&bl._pool.push(r);}},cr=bl;cr._pool=[];Ee();var yl=class r extends Qo{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),n=t.createAnalyser();n.connect(i),i.connect(t.destination),super(n,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=n,this.events=new ce,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=s=>{t(new Error(s?.message||"Unable to decode file"));},n=this._offlineCtx.decodeAudioData(e,s=>{t(null,s);},i);n&&n.catch(i);}};var vl=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new yl),this._htmlAudioContext=new od,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 yl.AudioContext!==null}add(e,t){if(typeof e=="object"){let s={};for(let o in e){let a=this._getOptions(e[o],t);s[o]=this.add(o,a);}return s}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof cr)return this._sounds[e]=t,t;let i=this._getOptions(t),n=cr.from(i);return this._sounds[e]=n,n}_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}};Ee();Ee();var xR=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=Oe.basename(e,Oe.extname(e))),t},_R={extension:g.Asset,detection:{test:async()=>true,add:async r=>[...r,...Ko.filter(e=>Zo[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[g.LoadParser],priority:De.High},test(r){let e=Oe.extname(r).slice(1);return !!Zo[e]||NE.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,n)=>cr.from({...e.data,url:r,preload:true,loaded(s,o){s?n(s):i(o),e.data?.loaded?.(s,o);}}));return Ce().add(xR(e),t),t},async unload(r,e){Ce().remove(xR(e));}}};N.add(_R);var be=pR(new vl);var cd="1.2.11";var Qn="repeat";function HE(r){return {type:"pause",duration:r}}var VE={DistortionFilter:ke.DistortionFilter,EqualizerFilter:ke.EqualizerFilter,MonoFilter:ke.MonoFilter,ReverbFilter:ke.ReverbFilter,StereoFilter:ke.StereoFilter,StreamFilter:ke.StreamFilter,TelephoneFilter:ke.TelephoneFilter},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"],er="__game_layer__",Tl="Container",U_="ImageContainer",zE="Image",Sl="Sprite",El="Text",WE="Video",ie={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};var A;(n=>(n.log=(s,...o)=>console.log(`[Pixi\u2019VN] ${s}`,...o),n.warn=(s,...o)=>console.warn(`[Pixi\u2019VN] ${s}`,...o),n.error=(s,...o)=>console.error(`[Pixi\u2019VN] ${s}`,...o),n.info=(s,...o)=>console.info(`[Pixi\u2019VN] ${s}`,...o)))(A||={});function se(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw A.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function yR(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(()=>(Ee(),hR))),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 CR=$i(XE());Ee();var Vk={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof we||r instanceof Gt||r instanceof Ve},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 Gt||r instanceof Ve)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}}}]}},ER=Vk;function zk(r,e){let t=0;return async(...i)=>{let n=Date.now();if(n-t>=e)return t=n,await r(...i)}}var D=class r{constructor(){}static _app=void 0;static get app(){if(!r._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return r._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(er);return e||(e=new re,e.label=er,this.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,t,i,n,s){return r.canvasWidth=t,r.canvasHeight=i,r._app=new yh,r.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...n}).then(()=>{let{app:o=r.app,extensions:a=[],...u}=s||{};yR({app:o,extensions:[ER,...a],...u}),r._isInitialized=true,r.addCanvasIntoHTMLElement(e),window.addEventListener("resize",r.resize),r.resize(),r.gameLayer;})}static addCanvasIntoHTMLElement(e){r._isInitialized?e.appendChild(r.app.canvas):A.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let n=document.createElement("div");n.setAttribute("id",e),n.style.position=i.position,n.style.pointerEvents=i.pointerEvents;let s=t.appendChild(n);return r.htmlLayers.push(n),r.resize(),s}static removeHtmlLayer(e){let t=r.htmlLayers.find(i=>i.id===e);t&&(t.remove(),r.htmlLayers=r.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return r.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/r.canvasWidth,t/r.canvasHeight)}static get screenWidth(){return Math.floor(r.screenScale*r.canvasWidth)}static get screenHeight(){return Math.floor(r.screenScale*r.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-r.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-r.screenHeight)/2}static async resize(){await zk(async()=>{if(r._isInitialized){let i=r.app.canvas.style;i.width=`${r.screenWidth}px`,i.height=`${r.screenHeight}px`,i.marginLeft=`${r.horizontalMargin}px`,i.marginRight=`${r.horizontalMargin}px`,i.marginTop=`${r.verticalMargin}px`,i.marginBottom=`${r.verticalMargin}px`;}let t=r.htmlLayers.map(i=>{i.style.width=`${r.screenWidth}px`,i.style.height=`${r.screenHeight}px`,i.style.marginLeft=`${r.horizontalMargin}px`,i.style.marginRight=`${r.horizontalMargin}px`,i.style.marginTop=`${r.verticalMargin}px`,i.style.marginBottom=`${r.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return r.gameLayer.children.filter(e=>e.label).sort((e,t)=>r.gameLayer.getChildIndex(e)-r.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(r._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static _currentTickers={};static _currentTickersSequence={};static _currentTickersTimeouts={};static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static _tickersOnPause={};static generateTickerId(e){try{return (0,CR.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,n){typeof e=="string"&&(e=[e]),r._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:n};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),r._currentTickersTimeouts[e]&&delete r._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),r.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(r._currentTickersTimeouts).forEach(([i,n])=>{let s=n.aliases.filter(o=>o!==e);if(s.length===0){let o=n.canBeDeletedBeforeEnd;(!t||o)&&r.removeTickerTimeout(i);}else r._currentTickersTimeouts[i].aliases=s;});}};Ee();var Cl=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,PR=new Set,YE=typeof process=="object"&&process?process:{},wR=(r,e,t,i)=>{typeof YE.emitWarning=="function"?YE.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},H_=globalThis.AbortController,AR=globalThis.AbortSignal;if(typeof H_>"u"){AR=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,n){this._onabort.push(n);}},H_=class{constructor(){e();}signal=new AR;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i);}}};let r=YE.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,wR("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 Wk=r=>!PR.has(r),Jn=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),BR=r=>Jn(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Al:null:null,Al=class extends Array{constructor(e){super(e),this.fill(0);}},jE=class r{heap;length;static#u=false;static create(e){let t=BR(e);if(!t)return [];r.#u=true;let i=new r(e,t);return r.#u=false,i}constructor(e,t){if(!r.#u)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},V_=class r{#u;#h;#m;#P;#g;#M;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#x;#i;#r;#e;#l;#d;#a;#s;#_;#o;#b;#y;#f;#v;#A;#c;#D;static unsafeExposeInternals(e){return {starts:e.#y,ttls:e.#f,sizes:e.#b,keyMap:e.#i,keyList:e.#r,valList:e.#e,next:e.#l,prev:e.#d,get head(){return e.#a},get tail(){return e.#s},free:e.#_,isBackgroundFetch:t=>e.#t(t),backgroundFetch:(t,i,n,s)=>e.#F(t,i,n,s),moveToTail:t=>e.#R(t),indexes:t=>e.#T(t),rindexes:t=>e.#S(t),isStale:t=>e.#p(t)}}get max(){return this.#u}get maxSize(){return this.#h}get calculatedSize(){return this.#x}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#m}get onInsert(){return this.#P}get disposeAfter(){return this.#g}constructor(e){let{max:t=0,ttl:i,ttlResolution:n=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:_=0,sizeCalculation:b,fetchMethod:x,memoMethod:y,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:v,ignoreFetchAbort:E}=e;if(t!==0&&!Jn(t))throw new TypeError("max option must be a nonnegative integer");let C=t?BR(t):Array;if(!C)throw new Error("invalid max value: "+t);if(this.#u=t,this.#h=m,this.maxEntrySize=_||this.#h,this.sizeCalculation=b,this.sizeCalculation){if(!this.#h&&!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(this.#I=y,x!==void 0&&typeof x!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=x,this.#A=!!x,this.#i=new Map,this.#r=new Array(t).fill(void 0),this.#e=new Array(t).fill(void 0),this.#l=new C(t),this.#d=new C(t),this.#a=0,this.#s=0,this.#_=jE.create(t),this.#n=0,this.#x=0,typeof l=="function"&&(this.#m=l),typeof c=="function"&&(this.#P=c),typeof h=="function"?(this.#g=h,this.#o=[]):(this.#g=void 0,this.#o=void 0),this.#v=!!this.#m,this.#D=!!this.#P,this.#c=!!this.#g,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#h!==0&&!Jn(this.#h))throw new TypeError("maxSize must be a positive integer if specified");if(!Jn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#z();}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Jn(n)||n===0?n:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!Jn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#G();}if(this.#u===0&&this.ttl===0&&this.#h===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#u&&!this.#h){let w="LRU_CACHE_UNBOUNDED";Wk(w)&&(PR.add(w),wR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",w,r));}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#G(){let e=new Al(this.#u),t=new Al(this.#u);this.#f=e,this.#y=t,this.#U=(s,o,a=Cl.now())=>{if(t[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#p(s)&&this.#E(this.#r[s],"expire");},o+1);u.unref&&u.unref();}},this.#w=s=>{t[s]=e[s]!==0?Cl.now():0;},this.#C=(s,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;s.ttl=a,s.start=u,s.now=i||n();let l=s.now-u;s.remainingTTL=a-l;}};let i=0,n=()=>{let s=Cl.now();if(this.ttlResolution>0){i=s;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return s};this.getRemainingTTL=s=>{let o=this.#i.get(s);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||n())-u;return a-l},this.#p=s=>{let o=t[s],a=e[s];return !!a&&!!o&&(i||n())-o>a};}#w=()=>{};#C=()=>{};#U=()=>{};#p=()=>false;#z(){let e=new Al(this.#u);this.#x=0,this.#b=e,this.#B=t=>{this.#x-=e[t],e[t]=0;},this.#L=(t,i,n,s)=>{if(this.#t(i))return 0;if(!Jn(n))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(n=s(i,t),!Jn(n))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 n},this.#O=(t,i,n)=>{if(e[t]=i,this.#h){let s=this.#h-e[t];for(;this.#x>s;)this.#k(true);}this.#x+=e[t],n&&(n.entrySize=i,n.totalCalculatedSize=this.#x);};}#B=e=>{};#O=(e,t,i)=>{};#L=(e,t,i,n)=>{if(i||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#s;!(!this.#N(t)||((e||!this.#p(t))&&(yield t),t===this.#a));)t=this.#d[t];}*#S({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;!(!this.#N(t)||((e||!this.#p(t))&&(yield t),t===this.#s));)t=this.#l[t];}#N(e){return e!==void 0&&this.#i.get(this.#r[e])===e}*entries(){for(let e of this.#T())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*rentries(){for(let e of this.#S())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*keys(){for(let e of this.#T()){let t=this.#r[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*rkeys(){for(let e of this.#S()){let t=this.#r[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*values(){for(let e of this.#T())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#S())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#T()){let n=this.#e[i],s=this.#t(n)?n.__staleWhileFetching:n;if(s!==void 0&&e(s,this.#r[i],this))return this.get(this.#r[i],t)}}forEach(e,t=this){for(let i of this.#T()){let n=this.#e[i],s=this.#t(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(t,s,this.#r[i],this);}}rforEach(e,t=this){for(let i of this.#S()){let n=this.#e[i],s=this.#t(n)?n.__staleWhileFetching:n;s!==void 0&&e.call(t,s,this.#r[i],this);}}purgeStale(){let e=false;for(let t of this.#S({allowStale:true}))this.#p(t)&&(this.#E(this.#r[t],"expire"),e=true);return e}info(e){let t=this.#i.get(e);if(t===void 0)return;let i=this.#e[t],n=this.#t(i)?i.__staleWhileFetching:i;if(n===void 0)return;let s={value:n};if(this.#f&&this.#y){let o=this.#f[t],a=this.#y[t];if(o&&a){let u=o-(Cl.now()-a);s.ttl=u,s.start=Date.now();}}return this.#b&&(s.size=this.#b[t]),s}dump(){let e=[];for(let t of this.#T({allowStale:true})){let i=this.#r[t],n=this.#e[t],s=this.#t(n)?n.__staleWhileFetching:n;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#f&&this.#y){o.ttl=this.#f[t];let a=Cl.now()-this.#y[t];o.start=Math.floor(Date.now()-a);}this.#b&&(o.size=this.#b[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let n=Date.now()-i.start;i.start=Cl.now()-n;}this.set(t,i.value,i);}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=this.#L(e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),this.#E(e,"set"),this;let h=this.#n===0?void 0:this.#i.get(e);if(h===void 0)h=this.#n===0?this.#s:this.#_.length!==0?this.#_.pop():this.#n===this.#u?this.#k(false):this.#n,this.#r[h]=e,this.#e[h]=t,this.#i.set(e,h),this.#l[this.#s]=h,this.#d[h]=this.#s,this.#s=h,this.#n++,this.#O(h,c,u),u&&(u.set="add"),l=false,this.#D&&this.#P?.(t,e,"add");else {this.#R(h);let d=this.#e[h];if(t!==d){if(this.#A&&this.#t(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=d;f!==void 0&&!o&&(this.#v&&this.#m?.(f,e,"set"),this.#c&&this.#o?.push([f,e,"set"]));}else o||(this.#v&&this.#m?.(d,e,"set"),this.#c&&this.#o?.push([d,e,"set"]));if(this.#B(h),this.#O(h,c,u),this.#e[h]=t,u){u.set="replace";let f=d&&this.#t(d)?d.__staleWhileFetching:d;f!==void 0&&(u.oldValue=f);}}else u&&(u.set="update");this.#D&&this.onInsert?.(t,e,t===d?"update":"replace");}if(n!==0&&!this.#f&&this.#G(),this.#f&&(l||this.#U(h,n,s),u&&this.#C(u,h)),!o&&this.#c&&this.#o){let d=this.#o,f;for(;f=d?.shift();)this.#g?.(...f);}return this}pop(){try{for(;this.#n;){let e=this.#e[this.#a];if(this.#k(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#c&&this.#o){let e=this.#o,t;for(;t=e?.shift();)this.#g?.(...t);}}}#k(e){let t=this.#a,i=this.#r[t],n=this.#e[t];return this.#A&&this.#t(n)?n.__abortController.abort(new Error("evicted")):(this.#v||this.#c)&&(this.#v&&this.#m?.(n,i,"evict"),this.#c&&this.#o?.push([n,i,"evict"])),this.#B(t),e&&(this.#r[t]=void 0,this.#e[t]=void 0,this.#_.push(t)),this.#n===1?(this.#a=this.#s=0,this.#_.length=0):this.#a=this.#l[t],this.#i.delete(i),this.#n--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=t,s=this.#i.get(e);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return false;if(this.#p(s))n&&(n.has="stale",this.#C(n,s));else return i&&this.#w(s),n&&(n.has="hit",this.#C(n,s)),true}else n&&(n.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,n=this.#i.get(e);if(n===void 0||!i&&this.#p(n))return;let s=this.#e[n];return this.#t(s)?s.__staleWhileFetching:s}#F(e,t,i,n){let s=t===void 0?void 0:this.#e[t];if(this.#t(s))return s;let o=new H_,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:n},l=(_,b=false)=>{let{aborted:x}=o.signal,y=i.ignoreFetchAbort&&_!==void 0;if(i.status&&(x&&!b?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),x&&!y&&!b)return h(o.signal.reason);let S=f;return this.#e[t]===f&&(_===void 0?S.__staleWhileFetching?this.#e[t]=S.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,_,u.options))),_},c=_=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=_),h(_)),h=_=>{let{aborted:b}=o.signal,x=b&&i.allowStaleOnFetchAbort,y=x||i.allowStaleOnFetchRejection,S=y||i.noDeleteOnFetchRejection,T=f;if(this.#e[t]===f&&(!S||T.__staleWhileFetching===void 0?this.#E(e,"fetch"):x||(this.#e[t]=T.__staleWhileFetching)),y)return i.status&&T.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),T.__staleWhileFetching;if(T.__returned===T)throw _},d=(_,b)=>{let x=this.#M?.(e,s,u);x&&x instanceof Promise&&x.then(y=>_(y===void 0?void 0:y),b),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=y=>l(y,true)));});};i.status&&(i.status.fetchDispatched=true);let f=new Promise(d).then(l,c),m=Object.assign(f,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,m,{...u.options,status:void 0}),t=this.#i.get(e)):this.#e[t]=m,m}#t(e){if(!this.#A)return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof H_}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=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:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:_,forceRefresh:b=false,status:x,signal:y}=t;if(!this.#A)return x&&(x.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,status:x});let S={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:x,signal:y},T=this.#i.get(e);if(T===void 0){x&&(x.fetch="miss");let O=this.#F(e,T,S,_);return O.__returned=O}else {let O=this.#e[T];if(this.#t(O)){let B=i&&O.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",B&&(x.returnedStale=true)),B?O.__staleWhileFetching:O.__returned=O}let v=this.#p(T);if(!b&&!v)return x&&(x.fetch="hit"),this.#R(T),n&&this.#w(T),x&&this.#C(x,T),O;let E=this.#F(e,T,S,_),w=E.__staleWhileFetching!==void 0&&i;return x&&(x.fetch=v?"stale":"refresh",w&&v&&(x.returnedStale=true)),w?E.__staleWhileFetching:E.__returned=E}}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=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:s,...o}=t,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=i(e,a,{options:o,context:n});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,a=this.#i.get(e);if(a!==void 0){let u=this.#e[a],l=this.#t(u);return o&&this.#C(o,a),this.#p(a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(s||this.#E(e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(this.#R(a),n&&this.#w(a),u))}else o&&(o.get="miss");}#H(e,t){this.#d[t]=e,this.#l[e]=t;}#R(e){e!==this.#s&&(e===this.#a?this.#a=this.#l[e]:this.#H(this.#d[e],this.#l[e]),this.#H(this.#s,e),this.#s=e);}delete(e){return this.#E(e,"delete")}#E(e,t){let i=false;if(this.#n!==0){let n=this.#i.get(e);if(n!==void 0)if(i=true,this.#n===1)this.#V(t);else {this.#B(n);let s=this.#e[n];if(this.#t(s)?s.__abortController.abort(new Error("deleted")):(this.#v||this.#c)&&(this.#v&&this.#m?.(s,e,t),this.#c&&this.#o?.push([s,e,t])),this.#i.delete(e),this.#r[n]=void 0,this.#e[n]=void 0,n===this.#s)this.#s=this.#d[n];else if(n===this.#a)this.#a=this.#l[n];else {let o=this.#d[n];this.#l[o]=this.#l[n];let a=this.#l[n];this.#d[a]=this.#d[n];}this.#n--,this.#_.push(n);}}if(this.#c&&this.#o?.length){let n=this.#o,s;for(;s=n?.shift();)this.#g?.(...s);}return i}clear(){return this.#V("delete")}#V(e){for(let t of this.#S({allowStale:true})){let i=this.#e[t];if(this.#t(i))i.__abortController.abort(new Error("deleted"));else {let n=this.#r[t];this.#v&&this.#m?.(i,n,e),this.#c&&this.#o?.push([i,n,e]);}}if(this.#i.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#f&&this.#y&&(this.#f.fill(0),this.#y.fill(0)),this.#b&&this.#b.fill(0),this.#a=0,this.#s=0,this.#_.length=0,this.#x=0,this.#n=0,this.#c&&this.#o){let t=this.#o,i;for(;i=t?.shift();)this.#g?.(...i);}}};var lt=class{cache;map=new Map;constructor(e){this.cache=new V_({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 hd=new lt({cacheSize:5});function RR(r){return function(e){$E.add(e,r);}}var $E;(n=>{function r(s,o){o||(o=s.name),hd.get(o)&&A.warn(`CanvasElement "${o}" already registered`),s.prototype.pixivnId=o,hd.set(o,s);}n.add=r;function e(s){try{let o=hd.get(s);if(!o){A.error(`CanvasElement "${s}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){A.error(`Error while getting CanvasElement "${s}"`,o);return}}n.get=e;function t(){return Array.from(hd.values())}n.values=t;function i(s){return hd.has(s)}n.has=i;})($E||={});var Ut=$E;var Pl=new lt({cacheSize:5});function MR(r){return function(e){qE.add(e,r);}}var qE;(s=>{function r(o,a){a||(a=o.name),Pl.get(a)&&A.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,Pl.set(a,o);}s.add=r;function e(o){try{let a=Pl.get(o);if(!a){A.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){A.error(`Error while getting Event "${o}"`,a);return}}s.get=e;function t(o){try{let a=Pl.get(o);if(!a){A.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){A.error(`Error while getting Event "${o}"`,a);return}}s.getInstance=t;function i(){return Array.from(Pl.values())}s.values=i;function n(o){return Pl.has(o)}s.has=n;})(qE||={});var hi=qE;async function z_(r){let e=Xk(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 Xk(r){try{let e=Ut.get(r);return e?new e:void 0}catch(e){A.error(`Error while getting CanvasElement ${r}`,e);return}}Ee();function KE(r){return "memory"in r?r.memory:r instanceof wr?ZE(r):r instanceof Pe?dd(r):ea(r)}function Yk(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 IR(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function ea(r,e){let t=jk(r,Tl),n=e?.childrenExport||false?r.children.sort((s,o)=>r.getChildIndex(s)-r.getChildIndex(o)).map(s=>KE(s)):[];return {pixivnId:t,elements:n,...Yk(r)}}function dd(r){let e=ea(r),t=e.pixivnId??Sl,i=OR(r),n="textureAlias"in r?IR(r.texture,r.textureAlias):IR(r.texture);return {...e,pixivnId:t,textureData:n,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function ZE(r){let e=ea(r),t=e.pixivnId??El,i=OR(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:$k(r.style),roundPixels:r.roundPixels,onEvents:i}}function jk(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function OR(r){return "onEvents"in r?r.onEvents:{}}function DR(r,e){if(typeof r!="object"||r===null)return r;A.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function $k(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:DR(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:DR(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var es=class extends re{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||Tl;}pixivnId=Tl;get memory(){return ea(this,{childrenExport:true})}set memory(e){}async setMemory(e){return this.memory=e,await this.importChildren(e),await di(this,e)}async importChildren(e){for(let t=0;t<e.elements.length;t++){let i=e.elements[t],n=await z_(i);this.addChild(n);}}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,n=hi.getInstance(i);return this._onEvents[e]=i,n?super.on(e,()=>{n.fn(e,this);}):A.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}};Ut.add(es,Tl);async function di(r,e,t){let i=t?.ignoreScale||false,n=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),n&&await n(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}Ee();var tr=class r{static init(e){r._getScreen=e.getScreen;}static _getScreen;static get screen(){return r._getScreen()}};function Hi(r,e,t,i,n,s=0){return i=i*(n?-1:1),r==="width"?e*(tr.screen.width-t)+i+s*t+(n?t:0):e*(tr.screen.height-t)+i+s*t+(n?t:0)}function fi(r,e,t,i,n,s=0){return i=i*(n?-1:1),r==="width"?(e-i-s*t-(n?t:0))/(tr.screen.width-t):(e-i-s*t-(n?t:0))/(tr.screen.height-t)}function Vi(r,e){return r==="width"?e*tr.screen.width:e*tr.screen.height}function pi(r,e){return r==="width"?e/tr.screen.width:e/tr.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),n=Math.sin(t);return {x:r.x*i-r.y*n,y:r.x*n+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:-r.y*n-r.x*i,y:r.y*i-r.x*n}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:-r.x*i+r.y*n,y:-r.x*n-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:r.y*n-r.x*i,y:-r.y*i-r.x*n}}return {x:0,y:0}}function QE(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),n=Math.sin(t);return {x:r.x*i+r.y*n,y:-r.x*n+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:r.y*i-r.x*n,y:-r.y*n-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:-r.x*i-r.y*n,y:r.x*n-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),n=Math.sin(t);return {x:-r.y*i+r.x*n,y:r.y*n+r.x*i}}return {x:0,y:0}}function mi(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 gi(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))}Ee();var qk=new RegExp(`(${bR.join("|")})$`);function fd(r){let e=exports.Assets.cache.has(r)?exports.Assets.get(r):null;return e instanceof exports.Texture&&(r=e.source?.label||r),qk.test(r)}function ta(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)}Ee();Ee();async function qr(r){if(r!=="EMPTY"){if(!r){A.error("Texture not found",r);return}if(exports.Assets.cache.has(r)){let e=exports.Assets.get(r);if(e)return e}return exports.Assets.load(r).then(e=>{if(!e){A.error("Texture not found",r);return}if(!(e instanceof exports.Texture)){A.error("File not is a file",r);return}return e}).catch(e=>{A.error("Error loading file",e);})}}Ee();var xi=class r extends Pe{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||Sl;}pixivnId=Sl;_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(e){this._textureAlias=e;}get memory(){return dd(this)}set memory(e){}async setMemory(e){return this.memory=e,await pd(this,e)}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,n=hi.getInstance(i);return this._onEvents[e]=i,n?(super.on(e,()=>{n.fn(e,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):A.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}static from(e,t){let i=Pe.from(e,t),n=new r;return n.texture=i.texture,n}};Ut.add(xi,Sl);async function pd(r,e,t){let i=t?.ignoreTexture||false;if(await di(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let s=await qr(e.textureImage.image);s&&(r.texture=s);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let s=e.textureData.url;e.textureData.alias&&exports.Assets.resolver.hasKey(e.textureData.alias)&&(s=e.textureData.alias);let o=await qr(s);o&&(r.texture=o);}}let n=t?.half;if(n&&await n(),"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 s in e.onEvents){let o=e.onEvents[s],a=hi.get(o);a&&r.onEvent(s,a);}}var we=class r extends xi{pixivnId=zE;constructor(e,t){e=ta(e);let i,n;e&&"align"in e&&e?.align!==void 0&&(i=e.align,delete e.align),e&&"percentagePosition"in e&&e?.percentagePosition!==void 0&&(n=e.percentagePosition,delete e.percentagePosition),super(e),t&&(this.textureAlias=t),i&&(this.align=i),n&&(this.percentagePosition=n);}get memory(){return {...dd(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(e){}async setMemory(e){this.memory=e,await md(this,e),this.reloadPosition();}static from(e,t){let i=Pe.from(e,t),n=new r;return n.texture=i.texture,n}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,qr(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,A.error("Error into ImageSprite.load()",e);})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return {x:fi("width",this.x,mi(this),e.x,t.x<0,this.anchor.x),y:fi("height",this.y,gi(this),e.y,t.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return fi("width",this.x,mi(this),e.x,t.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return fi("height",this.y,gi(this),e.y,t.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.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(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get yPercentagePosition(){return pi("height",this.y)}set yPercentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,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(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);this._align.x!==void 0&&(super.x=Hi("width",this._align.x,mi(this),e.x,t.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=Hi("height",this._align.y,gi(this),e.y,t.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Vi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Vi("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};Ut.add(we,zE);async function md(r,e,t){let i=t?.ignoreTexture||false;return e=ta(e),await pd(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})}Ee();var Gt=class r extends we{constructor(e,t){let i,n,s;e&&"loop"in e&&e?.loop!==void 0&&(i=e.loop,delete e.loop),e&&"paused"in e&&e?.paused!==void 0&&(n=e.paused,delete e.paused),e&&"currentTime"in e&&e?.currentTime!==void 0&&(s=e.currentTime,delete e.currentTime),super(e,t),i&&(this.loop=i),n&&(this.paused=n),s&&(this.currentTime=s);}pixivnId=WE;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(e){}async setMemory(e){return this.memory=e,await JE(this,e)}static from(e,t){let i=Pe.from(e,t),n=new r;return n.texture=i.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?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();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let t=this.duration;t&&e>=t&&(e=0),this._currentTime=e,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=e);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};Ut.add(Gt,WE);async function JE(r,e,t){await md(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 Ve=class extends es{constructor(e,t=[]){e=ta(e);let i,n,s;e&&"anchor"in e&&e?.anchor!==void 0&&(s=e.anchor,delete e.anchor),e&&"align"in e&&e?.align!==void 0&&(i=e.align,delete e.align),e&&"percentagePosition"in e&&e?.percentagePosition!==void 0&&(n=e.percentagePosition,delete e.percentagePosition),super(e),e=ta(e),t&&t.forEach(o=>{let a;fd(o)?a=new Gt(void 0,o):a=new we(void 0,o),this.addChild(a);}),s&&(this.anchor=s),i&&(this.align=i),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:U_,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(e){}async setMemory(e){this.memory=e,await this.importChildren(e),await e1(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=U_;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=Array(this.children.length);for(let t=0;t<this.children.length;t++)e[t]=this.children[t].load();return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(t=>{this._loadIsStarted=false,A.error("Error into ImageContainer.load()",t);})}get texture(){return this.children.length>0?this.children[0].texture:new exports.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}_anchor;get anchor(){let e=super.pivot.x/this.width,t=super.pivot.y/this.height;return {x:e,y:t}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,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(e){this._anchor=void 0,super.pivot=e;}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return {x:fi("width",this.x,mi(this),e.x,t.x<0,this.anchor.x),y:fi("height",this.y,gi(this),e.y,t.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return fi("width",this.x,mi(this),e.x,t.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);return fi("height",this.y,gi(this),e.y,t.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:pi("width",this.x),y:pi("height",this.y)}}set xPercentagePosition(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get xPercentagePosition(){return pi("width",this.x)}set yPercentagePosition(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,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(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=it(this.pivot,this.angle),t=it(this.scale,this.angle);this._align.x!==void 0&&(super.x=Hi("width",this._align.x,mi(this),e.x,t.x<0)),this._align.y!==void 0&&(super.y=Hi("height",this._align.y,gi(this),e.y,t.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Vi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Vi("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};Ut.add(Ve,U_);async function e1(r,e,t){e=ta(e),di(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();}});}Ee();var ts=class extends wr{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||El;}pixivnId=El;get memory(){return ZE(this)}set memory(e){}async setMemory(e){return this.memory=e,await t1(this,e)}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,n=hi.getInstance(i);return this._onEvents[e]=i,n?(super.on(e,()=>{n.fn(e,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):A.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}};Ut.add(ts,El);async function t1(r,e){if(await di(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],n=hi.get(i);n&&r.onEvent(t,n);}}var zt=class{constructor(e,t,i){this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}id="ticker_id_not_set";args;duration;priority;fn(e,t,i,n){throw new Error("[Pixi\u2019VN] The method TickerBase.fn() must be overridden")}onEndOfTicker(e,t,i){let n="aliasToRemoveAfter"in i&&i.aliasToRemoveAfter||[];typeof n=="string"&&(n=[n]);let s="tickerAliasToResume"in i&&i.tickerAliasToResume||[];typeof s=="string"&&(s=[s]),R.onEndOfTicker(t,{aliasToRemoveAfter:n,tickerAliasToResume:s});}};var wl=new lt({cacheSize:5});function kR(r){return function(e){r1.add(e,r);}}var r1;(s=>{function r(o,a){a||(a=o.name),wl.get(a)&&A.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,wl.set(a,o);}s.add=r;function e(o){try{let a=wl.get(o);if(!a){A.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){A.error(`Error while getting Event "${o}"`,a);return}}s.get=e;function t(o,a,u,l){try{let c=wl.get(o);if(!c){A.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){A.error(`Error while getting Ticker "${o}"`,c);return}}s.getInstance=t;function i(){return Array.from(wl.values())}s.values=i;function n(o){return wl.has(o)}s.has=n;})(r1||={});var Wt=r1;var Bl="aliasToRemoveAfter";var gd=class{get app(){return D.app}get gameLayer(){return D.gameLayer}get isInitialized(){return D._isInitialized}get htmlLayout(){return D.htmlLayers[0]}set htmlLayout(e){this.addHtmlLayer("ui",e);}get canvasWidth(){return D.canvasWidth}get canvasHeight(){return D.canvasHeight}set canvasWidth(e){D.canvasWidth=e;}set canvasHeight(e){D.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,n,s){if(typeof t=="number"&&typeof i=="number")return await D.init(e,t,i,n,s);if(typeof t!="number"&&typeof i!="number")return await D.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){this.addHtmlLayer("ui",e);}get children(){return D.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {A.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {A.error(`Canvas element ${e} not found`);return}}e instanceof re&&(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 Gt?await JE(t,e,{ignoreTexture:true}):t instanceof we?await md(t,e,{ignoreTexture:true}):t instanceof xi?await pd(t,e,{ignoreTexture:true}):t instanceof ts?await t1(t,e):t instanceof Ve?await e1(t,e):t instanceof re&&await di(t,e);}transferTickers(e,t,i="move"){D._currentTickersSequence[e]&&(i==="move"?D._currentTickersSequence[t]=se(D._currentTickersSequence[e]):i==="duplicate"&&(D._currentTickersSequence[t]=se(D._currentTickersSequence[e]))),Object.entries(D._currentTickers).forEach(([n,s])=>{if(s.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(n),s.canvasElementAliases.includes(e)&&(i==="move"?s.canvasElementAliases=s.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&s.canvasElementAliases.find(o=>o===e)&&s.canvasElementAliases.push(t),s.args.hasOwnProperty(Bl))){let o=s.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?s.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(s.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(D._currentTickersTimeouts).forEach(n=>{n.aliases.includes(e)&&(i==="move"?n.aliases=n.aliases.map(s=>s===e?t:s):i==="duplicate"&&n.aliases.find(s=>s===e)&&n.aliases.push(t));}),D._currentTickersSequence[t]&&Object.keys(D._currentTickersSequence[t]).forEach(n=>{this.runTickersSequence(t,n);}),i==="duplicate"&&D._currentTickersSequence[e]&&Object.keys(D._currentTickersSequence[e]).forEach(n=>{this.runTickersSequence(e,n);});}add(e,t,i={}){if(e===er){A.error(`The alias ${er} is reserved`);return}let n=this.find(e),s=i?.ignoreOldStyle;n&&!s&&this.copyCanvasElementProperty(n,t);let o=i.zIndex;n&&!this.gameLayer.children.includes(n)?A.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):n&&(o===void 0&&(o=this.gameLayer.getChildIndex(n)),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===er){A.error(`The alias ${er} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(n=>{this.gameLayer.getChildrenByLabel(n).forEach(s=>{this.gameLayer.removeChild(s),!i&&this.unlinkComponentFromTicker(n);});});}find(e){if(e===er)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 n=this.find(e);n&&(n.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return D._currentTickers}get currentTickersSteps(){return D._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!Wt.getInstance(i,t.args,t.duration,t.priority)){A.error(`Ticker ${i} not found`);return}let n={fn:()=>{},id:i,args:se(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},s=D.generateTickerId(n);if(this.pushTicker(s,n,t),this.pushEndOfTicker(s,n,t),t.duration){let o=setTimeout(()=>{D.removeTickerTimeoutInfo(o),D._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(s,{aliasToRemoveAfter:Bl in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);D.addTickerTimeoutInfo(e,i,o.toString(),true);}return s}pushTicker(e,t,i){D._currentTickers[e]=t,t.fn=n=>{let s=D._currentTickers[e];if(s){let o=s.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(n,s.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){A.warn("The steps of the tickers is empty");return}e in D._currentTickersSequence||(D._currentTickersSequence[e]={});let n={currentStepNumber:i,steps:t.map(o=>o===Qn||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:se(o.args),duration:o.duration})},s=D.generateTickerId(n);return D._currentTickersSequence[e][s]=n,this.runTickersSequence(e,s),s}runTickersSequence(e,t){if(!D._currentTickersSequence[e]||!D._currentTickersSequence[e][t])return;let i=D._currentTickersSequence[e][t].steps[D._currentTickersSequence[e][t].currentStepNumber];if(i===Qn&&(i=D._currentTickersSequence[e][t].steps[0],D._currentTickersSequence[e][t].currentStepNumber=0,i===Qn)){A.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=D._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),D.removeTickerTimeoutInfo(u);},i.duration*1e3);D.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let n=Wt.getInstance(i.ticker,i.args,i.duration,i.priority);if(!n){A.error(`Ticker ${i.ticker} not found`);return}let s=n.id,o={fn:()=>{},id:s,args:se(n.args),canvasElementAliases:[e],priority:n.priority,duration:n.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=D.generateTickerId(o);if(this.pushTicker(a,o,n),n.duration){let u=setTimeout(()=>{let l=D._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Bl in n.args?n.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in n.args?n.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),D.removeTickerTimeoutInfo(u);},n.duration*1e3);D.addTickerTimeoutInfo(e,s,u.toString(),false);}}nextTickerStep(e,t){if(D._currentTickersSequence[e]&&D._currentTickersSequence[e][t]){let i=D._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,D._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&D._currentTickersSequence[e]&&D._currentTickersSequence[e][t]&&(delete D._currentTickersSequence[e][t],Object.entries(D._currentTickers).forEach(([n,s])=>{s.createdByTicketSteps?.canvasElementAlias===e&&s.createdByTicketSteps.id===t&&this.removeTicker(n);}));}}onEndOfTicker(e,t){let i=D._currentTickers[e],n=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!n&&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(n=>{Object.entries(D._currentTickers).forEach(([s,o])=>{o.canvasElementAliases.includes(n)&&(o.canvasElementAliases.length===1?this.removeTicker(s):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==n));}),D._currentTickersSequence[n]&&delete D._currentTickersSequence[n],D.removeTickerTimeoutsByAlias(n,false);});return}let i;typeof t=="string"?i=t:t instanceof zt?i=t.id:i=t.prototype.id,e.forEach(n=>{D._currentTickersSequence[n]&&Object.entries(D._currentTickersSequence[n]).forEach(([s,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete D._currentTickersSequence[n][s];});}),Object.entries(D._currentTickers).forEach(([n,s])=>{s.id===i&&(D._currentTickers[n].canvasElementAliases=s.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(D._currentTickersTimeouts).forEach(([n,s])=>{s.ticker===i&&s.canBeDeletedBeforeEnd&&(D._currentTickersTimeouts[n].aliases=s.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(D._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Bl in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(D._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete D._currentTickersSequence[e];}),Object.entries(D._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&D.removeTickerTimeout(e);});}removeAllTickers(){D._currentTickersSequence={},Object.keys(D._currentTickers).forEach(e=>{this.removeTicker(e);}),D._currentTickers={};for(let e in D._currentTickersTimeouts)D.removeTickerTimeout(e);D._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},D._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=D._currentTickers[t];if(i){if(i.args.hasOwnProperty(Bl)){let n=i.args.aliasToRemoveAfter;this.remove(n);}this.app.ticker.remove(i.fn),delete D._currentTickers[t];}});}pauseTicker(e,t={}){let i=D._tickersOnPause[e];if(!i){D._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?D._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:D._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?D._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:D._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete D._tickersOnPause[t];});}isTickerPaused(e,t){let i=D._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?D._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):D._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=D._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Qn)?A.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(n=>{if(typeof n=="object"&&"ticker"in n){let s=Wt.getInstance(n.ticker,n.args,n.duration,n.priority);s&&s.onEndOfTicker([t],e,n.args);}}));}else {let i=D._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===er){A.error(`The alias ${er} is reserved`);return}return t.label=e,D.app.stage.addChild(t)}getLayer(e){return D.app.stage.getChildByLabel(e)}removeLayer(e){D.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return D.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return D.removeHtmlLayer(e)}getHtmlLayer(e){return D.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]=KE(t));}),{tickers:se(D.currentTickersWithoutCreatedBySteps),tickersSteps:se(D._currentTickersSequence),elements:se(e),stage:se(ea(this.gameLayer)),elementAliasesOrder:se(D.childrenAliasesOrder),tickersOnPause:se(D._tickersOnPause),tickersToCompleteOnStepEnd:se(D._tickersToCompleteOnStepEnd)}}async restore(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,n=e.elementAliasesOrder,s=n.filter(a=>i[a]).map(a=>z_(i[a])),o=await Promise.all(s);this.clear(),o.forEach((a,u)=>{let l=n[u];this.add(l,a),D.childrenAliasesOrder.push(l);});}else {A.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?di(this.gameLayer,e.stage,{ignoreScale:!0}):A.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([n,s])=>{let o=s.canvasElementAliases,a=Wt.getInstance(s.id,s.args,s.duration,s.priority);if(a){let u=this.addTicker(o,a);u&&(t[n]=u);}else A.error(`Ticker ${s.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([n,s])=>{D._currentTickersSequence[n]=s,Object.keys(s).forEach(o=>{this.runTickersSequence(n,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(n=>{let s=i[n];"tickerIdsExcluded"in s&&s.tickerIdsExcluded&&(i[n].tickerIdsExcluded=s.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in s&&s.tickerIdsIncluded&&(i[n].tickerIdsIncluded=s.tickerIdsIncluded.map(o=>t[o]||o));}),D._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,n=i.tikersIds.map(o=>({id:t[o.id]||o.id})),s=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));D._tickersToCompleteOnStepEnd={tikersIds:n,stepAlias:s};}}catch(t){A.error("Error importing data",t);}}};var xd=class{constructor(){this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}id="event_id_not_set"};var _d=class{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")}pixivnId="canvas_element_id_not_set"};Ee();Ee();function rs(r){return (r instanceof we||r instanceof Ve)&&r.haveEmptyTexture?false:!(r instanceof Pe&&r.texture?.label=="EMPTY")}function is(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=i1(r[e],t):t.type==="exponential"&&(r[e]=n1(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=i1(r[e].x,t),r[e].y=i1(r[e].y,t)):t.type==="exponential"&&(r[e].x=n1(r[e].x,t),r[e].y=n1(r[e].y,t))));}function i1(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 n1(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 Kk=5,_i=class extends zt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,n){t.speed===void 0&&(t.duration===void 0?t.speed=Kk:t.speed=600/(t.duration*60));let{type:s="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);s==="hide"&&l<0&&(l=0),s==="show"&&l>1&&(l=1),i.filter(c=>{let h=R.find(c);return !(!h||o&&!rs(h))}).forEach(c=>{let h=R.find(c);if(h&&h instanceof re){if(s==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:s==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),s==="show"&&h.alpha>=l){this.onEndOfTicker(c,n,t);return}else if(s==="hide"&&h.alpha<=l){this.onEndOfTicker(c,n,t);return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){A.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,n,t,{editAlpha:false});return}}}),a&&is(t,"speed",a);}onEndOfTicker(e,t,i,n={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(s=>{let o=R.find(s);if(o&&n.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}};Wt.add(_i);Ee();var s1={};vi(s1,{createExportableElement:()=>se});var Zk=10;function Qk(r,e){let t=se(r.destination);if(t.type==="align"){let i,n;e instanceof Pe&&(i=e.anchor.x,n=e.anchor.y);let s=it(e.pivot,e.angle),o=it(e.scale,e.angle);t.x=Hi("width",t.x,mi(e),s.x,o.x<0,i),t.y=Hi("height",t.y,gi(e),s.y,o.y<0,n);}return t.type==="percentage"&&(t.x=Vi("width",t.x),t.y=Vi("height",t.y)),t}var rr=class extends zt{fn(e,t,i,n){t.speed===void 0&&(t.speed=Zk);let{speed:s,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=R.find(u);return !(!l||o&&!rs(l))}).forEach(u=>{let l=R.find(u);if(l&&l instanceof re){let c=Qk(t,l),h=c.x-l.x,d=c.y-l.y,f=h>0?1:-1,m=d>0?1:-1,_,b;if(typeof s=="number"){let x=this.speedConvert(s);h===0||d===0?_=b=x:(_=Math.abs(h/(h+d))*x,b=Math.abs(d/(h+d))*x);}else _=this.speedConvert(s.x),b=this.speedConvert(s.y);if(_>0){l.x+=f*_*e.deltaTime;let x=c.x-l.x;(f<0&&x>0||f>0&&x<0)&&(l.x=c.x);}if(b>0){l.y+=m*b*e.deltaTime;let x=c.y-l.y;(m<0&&x>0||m>0&&x<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.onEndOfTicker(u,n,t);return}else if(_<1e-5&&b<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){A.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,n,t,{editPosition:false});return}}}),a&&is(t,"speed",a);}onEndOfTicker(e,t,i,n={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(s=>{let o=R.find(s);if(o){let a=i.destination;n.editPosition&&(o instanceof we||o instanceof Ve?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};Wt.add(rr);Ee();var Jk=1,Rl=class extends zt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,n){t.speed===void 0&&(t.speed=Jk);let{clockwise:s=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=R.find(l);return !(!c||t.startOnlyIfHaveTexture&&!rs(c))}).forEach(l=>{let c=R.find(l);if(c&&c instanceof re&&(s?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(s&&c.angle>=a?(c.angle=a,this.onEndOfTicker(l,n,t)):!s&&c.angle<=a&&(c.angle=a,this.onEndOfTicker(l,n,t))),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){A.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,n,t,{editRotation:false});return}}),o&&is(t,"speed",o);}onEndOfTicker(e,t,i,n={editRotation:true}){let{limit:s}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=R.find(o);a&&n.editRotation&&s!==void 0&&(a.angle=s);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};Wt.add(Rl);Ee();var eF=10,zi=class extends zt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,n){t.speed===void 0&&(t.speed=eF);let{speed:s,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof s=="number"?(l=this.speedConvert(s),c=this.speedConvert(s)):(l=this.speedConvert(s.x),c=this.speedConvert(s.y));let h=this.getLimit(t);i.filter(d=>{let f=R.find(d);return !(!f||a&&!rs(f))}).forEach(d=>{let f=R.find(d);if(f&&f instanceof re){if(o==="zoom"&&(f.scale.x<h.x||f.scale.y<h.y)?(f.scale.x+=l*e.deltaTime,f.scale.y+=c*e.deltaTime):o==="unzoom"&&(f.scale.x>h.x||f.scale.y>h.y)&&(f.scale.x-=l*e.deltaTime,f.scale.y-=c*e.deltaTime),o==="zoom"){if(f.scale.x>h.x&&(f.scale.x=h.x),f.scale.y>h.y&&(f.scale.y=h.y),f.scale.x>=h.x&&f.scale.y>=h.y){this.onEndOfTicker(d,n,t);return}}else if(o==="unzoom"&&(f.scale.x<h.x&&(f.scale.x=h.x),f.scale.y<h.y&&(f.scale.y=h.y),f.scale.x<=h.x&&f.scale.y<=h.y)){this.onEndOfTicker(d,n,t);return}if((l<1e-5&&c<1e-5||l<1e-5&&f.scale.y==h.y||c<1e-5&&f.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){A.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(d,n,t,{editScale:false});return}}}),u&&is(t,"speed",u);}speedConvert(e){return e/600}onEndOfTicker(e,t,i,n={editScale:true}){let{isZoomInOut:s}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=R.find(o);if(a){if(n.editScale){let u=this.getLimit(i);a.scale.x=u.x,a.scale.y=u.y;}if(s){let{pivot:u,position:l}=s;a.pivot=u.x,a.position=l;}}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="zoom",limit:i}=e,n=t==="zoom"?1/0:0,s=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(n=i,s=i):(n=i.x,s=i.y)),{x:n,y:s}}};Wt.add(zi);async function FR(r,e={},t){let i=R.find(r);if(!i){A.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let n={x:i.position.x,y:i.position.y},s=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){A.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),d=Math.ceil(c/2),f=[];for(let b=0;b<h;b++){let x={x:n.x,y:n.y},y=l*(b+1)/h;u==="horizontal"?b%2!==0?x.x=n.x+y:x.x=n.x-y:b%2!==0?x.y=n.y+y:x.y=n.y-y,f.push(new rr({destination:x,speed:s,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let m=h%2===0;for(let b=d;b>0;b--){let x={x:n.x,y:n.y},y=l*(b+1)/(d-1);u==="horizontal"?b%2===0&&!m||b%2!==0&&m?x.x=n.x-y:x.x=n.x+y:b%2===0&&!m||b%2!==0&&m?x.y=n.y-y:x.y=n.y+y,f.push(new rr({destination:x,speed:s,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}f.push(new rr({destination:n,speed:s,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let _=R.addTickersSequence(r,f);_&&(R.completeTickerOnStepEnd({id:_,alias:r}),R.pauseTicker(r,{tickerIdsExcluded:[_]}));}function bd(r,e,t){let i=new Ve(t,e);return R.add(r,i),i}async function GR(r,e,t){let i=new Ve(t,e);return await i.load(),R.add(r,i),i}Ee();function yd(r,e,t){if(!e)if(exports.Assets.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 R.add(r,i),i}async function UR(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=qr(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,n)=>i?(r[n].texture=i,r[n]):(r[n].load(),r[n])))}async function LR(r,e,t){if(!e)if(exports.Assets.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(),R.add(r,i),i}Ee();function vd(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Gt(t,e);return R.add(r,i),i}async function NR(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=qr(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,n)=>i?(r[n].texture=i,r[n]):(r[n].load(),r[n])))}async function HR(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Gt(t,e);return await i.load(),R.add(r,i),i}function Td(r,e){if(typeof e=="string")return fd(e)?vd(r,e):yd(r,e);if(Array.isArray(e))return bd(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return fd(e.value)?vd(r,e.value,e.options):yd(r,e.value,e.options);if(Array.isArray(e.value))return bd(r,e.value,e.options)}return R.add(r,e),e}async function o1(r,e,t={},i){let{mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:s=[]}=t,o=[];e||(e=r),typeof s=="string"&&(s=[s]);let a;if(R.find(r)&&(a=r+"_temp_disolve",R.editAlias(r,a)),e=Td(r,e),a&&R.copyCanvasElementProperty(a,r),a&&R.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=Sd(a,t,i);c&&(o.push(...c),R.pauseTicker(a,{tickerIdsIncluded:c}),s.push(a));}let u=new _i({...t,type:"show",tickerAliasToResume:s,startOnlyIfHaveTexture:true},void 0,i),l=R.addTicker(r,u);if(l&&(n&&R.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof we||e instanceof Ve)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function Sd(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:n=[]}=e;typeof r=="string"&&(r=[r]),typeof n=="string"&&(n=[n]),n.push(...r);let s=new _i({...e,type:"hide",aliasToRemoveAfter:n,startOnlyIfHaveTexture:true},void 0,t),o=R.addTicker(r,s);if(o)return i&&R.completeTickerOnStepEnd({id:o}),[o]}async function VR(r,e,t={},i){let{mustBeCompletedBeforeNextStep:n=true,aliasToRemoveAfter:s=[]}=t,o=[];if(e||(e=r),typeof s=="string"&&(s=[s]),!R.find(r))return o1(r,e,t,i);let a=r+"_temp_fade";R.editAlias(r,a),s.push(a),e=Td(r,e),a&&R.copyCanvasElementProperty(a,r),a&&R.transferTickers(a,r,"duplicate"),e.alpha=0;let u=Sd(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new _i({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:s},void 0,i),c=R.addTicker(r,l);if(c&&(n&&R.completeTickerOnStepEnd({id:c}),o.push(c),R.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof we||e instanceof Ve)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function zR(r,e={},t){return Sd(r,e,t)}async function WR(r,e,t={},i){let{direction:n="right",mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;R.find(r)&&(c=r+"_temp_movein",R.editAlias(r,c)),e=Td(r,e),c&&R.copyCanvasElementProperty(c,r),c&&R.transferTickers(c,r,"move");let h;e instanceof we||e instanceof Ve?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d;switch(c&&(u?(d=W_(c,t,i),d&&(l.push(...d),o.push(c))):a.push(c)),(e instanceof we||e instanceof Ve)&&e.haveEmptyTexture&&await e.load(),c&&R.pauseTicker(c,{tickerIdsIncluded:d}),n){case "up":e.y=R.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=R.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let f=new rr({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),m=R.addTicker(r,f);if(m&&(R.pauseTicker(r,{tickerIdsExcluded:[m]}),s&&R.completeTickerOnStepEnd({id:m}),l.push(m)),l.length>0)return l}function W_(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:n=true,aliasToRemoveAfter:s=[]}=e;typeof s=="string"&&(s=[s]),s.push(r);let o=R.find(r);if(!o){A.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=R.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=R.canvasWidth+o.width;break}let u=new rr({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:s},void 0,t),l=R.addTicker(r,u);if(l)return R.pauseTicker(r,{tickerIdsExcluded:[l]}),n&&R.completeTickerOnStepEnd({id:l}),[l]}async function XR(r,e,t={},i){let{direction:n="right",mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=R.find(r);c&&(l=r+"_temp_zoom",R.editAlias(r,l)),e=Td(r,e),l&&R.copyCanvasElementProperty(l,r),l&&R.transferTickers(l,r,"move"),n=="up"?(e.pivot.y=R.canvasHeight-e.y,e.pivot.x=R.canvasWidth/2-e.x,e.y=R.canvasHeight,e.x=R.canvasWidth/2):n=="down"?(e.pivot.y=0-e.y,e.pivot.x=R.canvasWidth/2-e.x,e.y=0,e.x=R.canvasWidth/2):n=="left"?(e.pivot.x=R.canvasWidth-e.x,e.pivot.y=R.canvasHeight/2-e.y,e.x=R.canvasWidth,e.y=R.canvasHeight/2):n=="right"&&(e.pivot.x=0-e.x,e.pivot.y=R.canvasHeight/2-e.y,e.x=0,e.y=R.canvasHeight/2),e.pivot=QE(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=a1(l,t,i);m&&(u.push(...m),o.push(l));}else a.push(l);R.pauseTicker(l);}o.push(r);let d=new zi({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),f=R.addTicker(r,d);if(f&&(R.pauseTicker(r,{tickerIdsExcluded:[f]}),s&&R.completeTickerOnStepEnd({id:f}),u.push(f)),(e instanceof we||e instanceof Ve)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function a1(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:n=true,aliasToRemoveAfter:s=[]}=e;typeof s=="string"&&(s=[s]),s.push(r);let o=R.find(r);if(!o){A.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=R.canvasHeight-o.y,o.pivot.x=R.canvasWidth/2-o.x,o.y=R.canvasHeight,o.x=R.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=R.canvasWidth/2-o.x,o.y=0,o.x=R.canvasWidth/2):i=="left"?(o.pivot.x=R.canvasWidth-o.x,o.pivot.y=R.canvasHeight/2-o.y,o.x=R.canvasWidth,o.y=R.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=R.canvasHeight/2-o.y,o.x=0,o.y=R.canvasHeight/2),o.pivot=QE(o.pivot,o.angle),o.scale.set(1);let a=new zi({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:s},void 0,t),u=R.addTicker(r,a);if(u)return R.pauseTicker(r,{tickerIdsExcluded:[u]}),n&&R.completeTickerOnStepEnd({id:u}),[u]}async function YR(r,e,t={},i){let{direction:n="right",mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;R.find(r)&&(u=r+"_temp_push",R.editAlias(r,u)),e=Td(r,e),u&&R.copyCanvasElementProperty(u,r),u&&R.transferTickers(u,r,"move");let l;if((e instanceof we||e instanceof Ve)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},n=="up"?e.y=-R.canvasHeight+e.y:n=="down"?e.y=R.canvasHeight+e.y:n=="left"?e.x=-R.canvasWidth+e.x:n=="right"&&(e.x=R.canvasWidth+e.x),u){let d=u1(u,{...t,direction:n=="up"?"down":n=="down"?"up":n=="left"?"right":"left"},i);d&&a.push(...d);}o.push(r);let c=new rr({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=R.addTicker(r,c);if(h&&(R.pauseTicker(r,{tickerIdsExcluded:[h]}),s&&R.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof we||e instanceof Ve)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function u1(r,e={direction:"right"},t){return W_(r,e,t)}var R=new gd;tr.init({getScreen:()=>R.screen});var c1={};vi(c1,{CharacterBaseModel:()=>Cd,CharacterStoredClass:()=>ra,RegisteredCharacters:()=>KR,getAllCharacters:()=>qR,getCharacterById:()=>$R,saveCharacter:()=>jR});var H=class r{static init(e){r._getStepCounter=e.getStepCounter,r._setStepCounter=e.setStepCounter,r._getCurrentGameStepState=e.getCurrentGameStepState,r._restoreGameStepState=e.restoreGameStepState,r._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(r._onGoNextEnd=e.onGoNextEnd),r._getVariable=e.getVariable,r._setVariable=e.setVariable,r._removeVariable=e.removeVariable,r._getFlag=e.getFlag,r._setFlag=e.setFlag,e.onLabelClosing&&(r._onLabelClosing=e.onLabelClosing),r._addHistoryItem=e.addHistoryItem,r._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,r._getCharacter=e.getCharacter;}static _getStepCounter=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return r._getStepCounter()}static set stepCounter(e){r._setStepCounter(e);}static _getCurrentGameStepState=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return r._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return r._restoreGameStepState}static _getOpenedLabels=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return r._getOpenedLabels()}static _onGoNextEnd=async()=>{};static get onGoNextEnd(){return r._onGoNextEnd}static _getVariable=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return r._getVariable}static _setVariable=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return r._setVariable}static _removeVariable=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return r._removeVariable}static _getFlag=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return r._getFlag}static _setFlag=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return r._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return r._onLabelClosing}static _addHistoryItem=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return r._addHistoryItem}static _getCurrentStepsRunningNumber=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentStepsRunningNumber(){return r._getCurrentStepsRunningNumber()}static _getCharacter=()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")};static get getCharacter(){return r._getCharacter}static onEnd;static onError};var J=class r{static storage=new lt({cacheSize:20});static startingStorage=[];static flags=Array();static tempStorage=new Map;static tempStorageDeadlines=new Map;constructor(){}static clearOldTempVariables(e){r.tempStorageDeadlines.forEach((t,i)=>{t>e&&(r.tempStorage.delete(i),r.tempStorageDeadlines.delete(i),r.storage.cache.delete(i));});}static setVariable(e,t){let i=r.tempStorage.has(e);t==null?(r.storage.map.delete(e),!i&&r.storage.cache.delete(e)):(r.storage.map.set(e,t),!i&&r.storage.cache.set(e,t));}static getVariable(e){let t=r.storage.cache.get(e);return t===void 0&&(t=r.tempStorage.get(e)),t===void 0&&(t=r.storage.map.get(e)),se(t)}static removeVariable(e){r.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let i=this.flags.indexOf(e);i>-1&&this.flags.splice(i,1);}}static getFlag(e){return this.flags.includes(e)}};var Ed=class{get storage(){return J.storage.map}get cache(){return J.storage.cache}get flags(){return J.flags}get tempStorage(){return J.tempStorage}get tempStorageDeadlines(){return J.tempStorageDeadlines}set startingStorage(e){let t=[];Object.entries(e).forEach(([i,n])=>{t.push({key:i,value:n});}),J.startingStorage=t;}setVariable(e,t){return J.setVariable(e,t)}getVariable(e){return J.getVariable(e)}removeVariable(e){return J.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else J.tempStorage.set(e,t),J.storage.cache.set(e,t),J.tempStorageDeadlines.has(e)||J.tempStorageDeadlines.set(e,H.openedLabels);}removeTempVariable(e){J.tempStorage.has(e)&&(J.tempStorage.delete(e),J.tempStorageDeadlines.delete(e),J.storage.cache.delete(e));}setFlag(e,t){return J.setFlag(e,t)}getFlag(e){return J.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),J.flags=[],J.tempStorage.clear(),J.tempStorageDeadlines.clear(),J.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(n=>{e.push({key:n,value:this.storage.get(n)});});let t=[];[...J.tempStorage.keys()].forEach(n=>{t.push({key:n,value:J.tempStorage.get(n)});});let i=[];return [...J.tempStorageDeadlines.keys()].forEach(n=>{i.push({key:n,value:J.tempStorageDeadlines.get(n)});}),se({base:e,temp:t,tempDeadlines:i,flags:J.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let i=t.value;Object.entries(i).forEach(([n,s])=>{J.tempStorage.set(n,s);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([n,s])=>{J.tempStorageDeadlines.set(n,s);});}else t.key==="___flags___"?t.value.forEach(n=>{J.flags.push(n);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{J.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{J.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([n,s])=>{J.tempStorage.set(n,s);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([n,s])=>{J.tempStorageDeadlines.set(n,s);}):t==="___flags___"?i.forEach(n=>{J.flags.push(n);}):this.storage.set(t,i);})):A.warn("No storage data found");}catch(t){A.error("Error importing data",t);}}};var Ml=class{constructor(e,t){this.categoryId=e,this._id=t;}_id;get id(){return this._id}categoryId;setStorageProperty(e,t){let i=J.getVariable(this.categoryId);i||(i={}),i.hasOwnProperty(this.id)||(i[this.id]={}),t==null?i[this.id].hasOwnProperty(e)&&delete i[this.id][e]:i[this.id]={...i[this.id],[e]:t},Object.keys(i[this.id]).length===0&&delete i[this.id],J.setVariable(this.categoryId,i);}getStorageProperty(e,t=this.id){let i=J.getVariable(this.categoryId);if(i&&i.hasOwnProperty(t)&&i[t].hasOwnProperty(e))return i[t][e]}};var Rr=new Ed;var rF="@",ra=class extends Ml{sourceId;constructor(e,t=""){super(ie.CHARACTER_CATEGORY_KEY,e+(t?rF+t:"")),this.sourceId=e;}getStorageProperty(e){let t=super.getStorageProperty(e);return t===void 0&&(t=super.getStorageProperty(e,this.sourceId)),t}};var Cd=class extends ra{constructor(e,t){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion),this.defaultName=t.name,this.defaultSurname=t.surname,this.defaultAge=t.age,this._icon=t.icon,this._color=t.color;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}defaultSurname;get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}defaultAge;get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}_icon;get icon(){return this._icon}_color;get color(){return this._color}};var ia=new lt({cacheSize:10});function jR(r){return Ad.add(r)}function $R(r){return Ad.get(r)}function qR(){return Ad.values()}var Ad;(n=>{function r(s){try{let o=ia.get(s);if(!o){A.warn(`Character "${s}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return o}catch(o){A.error(`Error while getting Character "${s}"`,o);return}}n.get=r;function e(s){if(Array.isArray(s)){s.forEach(o=>e(o));return}ia.get(s.id)&&A.info(`Character id "${s.id}" already exists, it will be overwritten`),ia.set(s.id,s);}n.add=e;function t(){return Array.from(ia.values())}n.values=t;function i(s){return ia.has(s)}n.has=i;})(Ad||={});var KR=Ad;var eM=$i(QR());function JR(r,e){let t=se(r);return e.length>1&&"type"in e[0]&&(e=e.reverse()),e.forEach(i=>{"type"in i?iF(t,i):nF(t,i);}),t}function iF(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,n)=>{if(e.path&&n===e.path.length-1)switch(e.type){case "CHANGE":case "REMOVE":t[i]=e.oldValue;break;case "CREATE":Array.isArray(t)&&typeof i=="number"?t.splice(i,1):delete t[i];break}else t=t[i];}):A.warn("No path found, skipping diff",e);}function nF(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,n)=>{if(e.path&&n===e.path.length-1){if(e.kind==="E"||e.kind==="D")t[i]=e.lhs;else if(e.kind==="N")Number.isInteger(i)?Array.isArray(t)&&t.splice(i,1):typeof i=="string"&&delete t[i];else if(e.kind==="A"){let s=e.index;e.item.kind==="N"?t[i].splice(s,1):e.item.kind==="E"||e.item.kind==="D"?t[i][s]=e.item.lhs:e.item.kind==="A"?A.warn("Nested array found, skipping diff",e):A.warn("No array found, skipping diff",e);}}else t=t[i];}):A.warn("No path found, skipping diff",e);}var j=class r{static _diffHistory=new lt({cacheSize:5});static _stepsInfoHistory=new lt({cacheSize:5});static _narrationHistory=new lt({cacheSize:50});static stepLimitSaved=20;static goBackRunning=false;static _originalStepData=void 0;static get originalStepData(){return r._originalStepData?se(r._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:void 0},labelIndex:-1,openedLabels:[]}}static set originalStepData(e){r._originalStepData=se(e);}};var Pd=class{get stepsInfoMap(){return j._stepsInfoHistory}get diffMap(){return j._diffHistory}get narrationMap(){return j._narrationHistory}get size(){return j._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return j._stepsInfoHistory.keys()}get(e){let t=j._narrationHistory.get(e);if(!(t&&Object.keys(t).length===1&&t.stepIndex!==void 0))return t}delete(e){j._stepsInfoHistory.delete(e),j._diffHistory.delete(e),j._narrationHistory.delete(e);}internalRestoreOldGameState(e,t){if(e<=0||this.size==0)return t;let i=this.lastKey;if(typeof i!="number")return A.error("You can't go back, there is no step to go back"),t;let n=j._diffHistory.get(i);if(n)try{let s=JR(t,n);return H.stepCounter=i,this.delete(i),this.internalRestoreOldGameState(e-1,s)}catch(s){return A.error("Error applying diff",s),t}else return A.error("You can't go back, there is no step to go back"),t}async goBack(e,t=1){if(t<=0){A.warn("The parameter steps must be greater than 0");return}if(j._diffHistory.size<1){A.warn("You can't go back, there is no step to go back");return}if(j.goBackRunning){A.warn("Go back is already running");return}j.goBackRunning=true;try{let i=se(this.internalRestoreOldGameState(t,j.originalStepData));i?await H.restoreGameStepState(i,e):A.error("Error going back"),j.goBackRunning=!1;}catch(i){A.error("Error going back",i),j.goBackRunning=false;}}add(e,t={}){let i=j.originalStepData,{ignoreSameStep:n}=t,s=H.currentGameStepState;if(!n&&this.isSameStep(i,s))return;let o=this.lastKey;(async()=>{try{let u,l;if(typeof o=="number"&&(u=j._stepsInfoHistory.get(o),l=j._narrationHistory.get(o)),j._stepsInfoHistory.set(e.index,e),e.index!==0){let d=(0,eM.diff)(i,s);d?j._diffHistory.set(e.index,d):A.warn("It was not possible to create the difference between the two steps");}let c={},h=this.itemMapper({step:e},c);if(j._narrationHistory.set(e.index,h),u&&l&&typeof o=="number"){let d=this.itemMapper({...c,step:u},{});j._narrationHistory.set(o,d);}}catch(u){A.error("Error adding history step",u);}})(),j.originalStepData=s;}itemMapper(e,t){let{step:i,choiceIndexMade:n,inputValue:s,removeDialogue:o}=e,a=i.dialogue||i.dialoge;t&&i.isGlued&&(t.removeDialogue=true),o&&(a=void 0);let u=i.choices;if(t&&i.currentLabel&&i.choiceIndexMade!==void 0&&(t.choiceIndexMade=i.choiceIndexMade),i.inputValue&&t&&(t.inputValue=i.inputValue),a||u||s){let l=u?.map((c,h)=>{let d=false;return c.oneTime&&i.alreadyMadeChoices&&i.alreadyMadeChoices.includes(h)&&(d=true),{text:c.text,type:c.type,isResponse:false,hidden:d}});if(l){if(l.every(c=>c.hidden)){let c=l.find(h=>h.hidden===false);c&&(c.hidden=false);}n!==void 0&&(l[n].isResponse=true);}return {dialogue:a?{...a,character:a.character?H.getCharacter(a.character)||a.character:void 0}:void 0,playerMadeChoice:typeof n=="number",choices:l,stepIndex:i.index,inputValue:s}}return {stepIndex:i.index}}get narrativeHistory(){let e=[];return Array.from(this.keys()).sort((i,n)=>i-n).forEach(i=>{let n=this.get(i);n&&e.push(n);}),e}get currentLabelHistory(){let e=[],t=Array.from(this.keys()).sort((l,c)=>c-l);if(t.length===0)return e;let i=t[0];if(typeof i!="number")return e;let n=j._stepsInfoHistory.get(i);if(!n)return e;let s=n.currentLabel,o=n.index,a=n.labelStepIndex||-1,u=n.openedLabelsNumber||-1;return t.every(l=>{let c=this.get(l);if(c){let h=j._stepsInfoHistory.get(l);if(!h||!(h.currentLabel===s&&h.index<=o&&(h.labelStepIndex||-1)<=a)||(h.openedLabelsNumber||-1)<u)return true;if(e.push(c),h.labelStepIndex===0)return false}return o=l,true}),e.reverse()}removeNarrativeHistory(e){if(e){let t=Array.from(this.keys()).sort((i,n)=>i-n);t=t.slice(0,e),t.forEach(i=>{j._narrationHistory.delete(i),j._stepsInfoHistory.delete(i),j._diffHistory.delete(i);});}else j._stepsInfoHistory.clear(),j._diffHistory.clear(),j._narrationHistory.clear();}get canGoBack(){let e=this.lastKey;return typeof e!="number"?false:j._diffHistory.has(e)}blockGoBack(){H.currentStepsRunningNumber===0&&j._diffHistory.clear();}isSameStep(e,t){if(e.openedLabels.length===t.openedLabels.length)try{let i=JSON.stringify(e.openedLabels),n=JSON.stringify(t.openedLabels);if(i===n&&e.path===t.path&&e.labelIndex===t.labelIndex)return !0}catch(i){return A.error("Error comparing opened labels",i),true}return false}clear(){j._stepsInfoHistory.clear(),j._diffHistory.clear(),j._narrationHistory.clear(),j._originalStepData=void 0;}get stepLimitSaved(){return j.stepLimitSaved}set stepLimitSaved(e){j.stepLimitSaved=e;}export(){let e=Array.from(this.keys()).sort((i,n)=>i-n);e.length>this.stepLimitSaved&&(e=e.slice(e.length-this.stepLimitSaved));let t=[];return e.forEach(i=>{let n=j._stepsInfoHistory.get(i);if(n){let s=j._diffHistory.get(i);t.push({...n,diff:s});}}),{stepsHistory:se(t),originalStepData:se(j._originalStepData)}}restoreNarrativeHistory(){let e=Array.from(this.keys()).sort((i,n)=>i-n),t={};e.forEach(i=>{let n=j._stepsInfoHistory.get(i);if(n){let s={...t};t={};let o=this.itemMapper({step:n,choiceIndexMade:s.choiceIndexMade,inputValue:s.inputValue,removeDialogue:s.removeDialogue},t);o&&j._narrationHistory.set(i,o);}});}async restore(e){this.clear();try{e.hasOwnProperty("stepsHistory")?(e.stepsHistory.forEach(i=>{i.diff&&j._diffHistory.set(i.index,i.diff);let n={...i,diff:void 0};j._stepsInfoHistory.set(i.index,n);}),this.restoreNarrativeHistory()):A.warn("Could not import stepsHistory data, so will be ignored"),e.hasOwnProperty("originalStepData")?j._originalStepData=e.originalStepData:A.warn("Could not import originalStepData data, so will be ignored");}catch(t){A.error("Error importing data",t);}}};var ns=new Pd;var tM={};var p1={};vi(p1,{ChoiceMenuOption:()=>sa,ChoiceMenuOptionClose:()=>aa,Close:()=>oa,Label:()=>Wi,LabelAbstract:()=>na,NarrationManagerStatic:()=>L,RegisteredLabels:()=>ir,narration:()=>Xi,newChoiceOption:()=>nM,newCloseChoiceOption:()=>sM,newLabel:()=>f1});var wd=new lt({cacheSize:10}),rM;(n=>{function r(s){let o=wd.get(s);if(!o){A.error(`Label "${s}" not found`);return}return o}n.get=r;function e(s){if(Array.isArray(s)){s.forEach(o=>e(o));return}wd.has(s.id)&&A.info(`Label "${s.id}" already exists, it will be overwritten`),wd.set(s.id,s);}n.add=e;function t(){return Array.from(wd.values())}n.values=t;function i(s){return wd.has(s)}n.has=i;})(rM||={});var ir=rM;var iM=$i(XE());var na=class{constructor(e,t){this._id=e,this._onStepStart=t?.onStepStart,this._onLoadingLabel=t?.onLoadingLabel,this._onStepEnd=t?.onStepEnd;}_id;get id(){return this._id}_onStepStart;get onStepStart(){return async(e,t)=>{if(this._onLoadingLabel&&e===0&&await this._onLoadingLabel(e,t),this._onStepStart)return await this._onStepStart(e,t)}}_onLoadingLabel;get onLoadingLabel(){return this._onLoadingLabel}_onStepEnd;get onStepEnd(){return this._onStepEnd}};var Wi=class extends na{get stepCount(){return this.steps.length}getStepById(e){return this.steps[e]}constructor(e,t,i){super(e,i),this._steps=t;}_steps;get steps(){return typeof this._steps=="function"?this._steps():this._steps}getStepSha(e){if(e<0||e>=this.steps.length)return A.warn("stepSha not found, setting to ERROR"),"error";try{let t=this.steps[e];return (0,iM.default)(t.toString().toLocaleLowerCase()).toString()}catch(t){return A.warn("stepSha not found, setting to ERROR",t),"error"}}};var aF="__close-label-id__";function d1(){return new Wi(aF,[],{})}var sa=class{text;_label;get label(){let e=this._label;if(typeof e=="string"){let t=ir.get(e);t?e=t:(A.error(`Label ${e} not found, so it will be closed`),e=d1());}return e}type;oneTime;onlyHaveNoChoice;autoSelect;props={};devProps={};constructor(e,t,i,n){let{type:s="call",oneTime:o=false,onlyHaveNoChoice:a=false,autoSelect:u=false,...l}=n||{};this.text=e,this._label=t,this.type=s,this.oneTime=o,this.onlyHaveNoChoice=a,this.autoSelect=u,this.devProps=l,this.props=i;}};function nM(r,e,t,i){let n=typeof e=="string"?e:e.id;return {...i,label:n,props:t,text:r,type:i?.type||"call"}}var oa="close";var aa=class{text;closeCurrentLabel;type=oa;oneTime;onlyHaveNoChoice;autoSelect;props={};devProps={};constructor(e,t){let{closeCurrentLabel:i=false,oneTime:n=false,onlyHaveNoChoice:s=false,autoSelect:o=false,...a}=t||{};this.text=e,this.closeCurrentLabel=i,this.oneTime=n,this.onlyHaveNoChoice=s,this.autoSelect=o,this.devProps=a;}};function sM(r,e){return {...e,type:oa,text:r}}var L=class r{constructor(){}static stepsRunning=0;static goNextRequests=0;static choiceMadeTemp=void 0;static lastHistoryStep=null;static get allOpenedLabels(){return H.getVariable(ie.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(e){H.setVariable(ie.OPENED_LABELS_COUNTER_KEY,e);}static getCurrentStepTimesCounterData(e=""){let t=r.currentLabelStepIndex;if(t===null)return A.error("currentLabelStepIndex is null"),null;let i=`${t}${e}`,n=r.currentLabelId,s=r._currentLabel;if(!n||t===null||!s)return A.error("currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let o=s.getStepSha(t)||"error",a=H.getVariable(ie.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[n]||(a[n]={}),(!a[n][i]||a[n][i].stepSha1!=o)&&(a[n][i]={stepSha1:o}),a[n][i]}static setCurrentStepTimesCounterData(e="",t){let i=r.currentLabelStepIndex,n=i+e,s=r.currentLabelId;if(!s||i===null){A.error("currentLabelId or currentLabelStepIndex is null");return}let o=H.getVariable(ie.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[s]||(o[s]={}),o[s][n]=t,H.setVariable(ie.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static getCurrentStepTimesCounter(e=""){let t=r._stepCounter,i=r.getCurrentStepTimesCounterData(e);if(!i)return A.error("getCurrentStepTimesCounter obj is null"),0;let n=i.stepCounters||i.lastStepIndexs||[];return n.find(o=>o===t)||(n.push(t),delete i.lastStepIndexs,i.stepCounters=n,r.setCurrentStepTimesCounterData(e,i)),n.length}static getRandomNumber(e,t,i={}){let n=i.nestedId||"";if(i.onceOnly||false){let o=r.getCurrentStepTimesCounterData(n);if(!o)return;let a=o.usedRandomNumbers||{},u=Array.from({length:t-e+1},(h,d)=>d+e).filter(h=>!a[`${e}-${t}`]?.includes(h));if(u.length===0)return;let l=Math.floor(Math.random()*u.length),c=u[l];return a[`${e}-${t}`]||(a[`${e}-${t}`]=[]),a[`${e}-${t}`].push(c),o.usedRandomNumbers=a,r.setCurrentStepTimesCounterData(n,o),c}return Math.floor(Math.random()*(t-e+1))+e}static resetCurrentStepTimesCounter(e=""){let t=r.currentLabelStepIndex,i=t+e,n=r.currentLabelId;if(!n||t===null){A.error("currentLabelId or currentLabelStepIndex is null");return}let s=H.getVariable(ie.CURRENT_STEP_TIMES_COUNTER_KEY)||{};s[n]||(s[n]={}),s[n][i]={stepCounters:[],stepSha1:""},H.setVariable(ie.CURRENT_STEP_TIMES_COUNTER_KEY,s);}static get allChoicesMade(){return H.getVariable(ie.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(e){H.setVariable(ie.ALL_CHOICES_MADE_KEY,e);}static _stepCounter=0;static increaseStepCounter(){r._stepCounter++;}static _openedLabels=[];static get openedLabels(){return se(r._openedLabels)}static set openedLabels(e){r._openedLabels=se(e);}static _originalOpenedLabels=[];static get originalOpenedLabels(){return se(r._originalOpenedLabels)}static set originalOpenedLabels(e){r._originalOpenedLabels=se(e);}static get _currentLabel(){if(r.currentLabelId)return ir.get(r.currentLabelId)}static get currentLabelId(){if(r._openedLabels.length>0)return r._openedLabels[r._openedLabels.length-1].label}static get currentLabelStepIndex(){return r._openedLabels.length>0?r._openedLabels[r._openedLabels.length-1].currentStepIndex:null}static addLabelHistory(e,t){let i=r.allOpenedLabels,n=r.allOpenedLabels[e]?.biggestStep||0,s=r.allOpenedLabels[e]?.openCount||0;(!n||n<t)&&(i[e]={biggestStep:t,openCount:s},r.allOpenedLabels=i);}static addChoicesMade(e,t,i,n){let s=r.allChoicesMade,o=s.findIndex(a=>a.labelId===e&&a.stepIndex===t&&a.choiceIndex===n&&a.stepSha1===i);o<0?s.push({labelId:e,stepIndex:t,choiceIndex:n,stepSha1:i,madeTimes:1}):s[o].madeTimes++,r.allChoicesMade=s;}static pushNewLabel(e){if(!ir.get(e))throw new Error(`[Pixi\u2019VN] Label ${e} not found`);r._openedLabels.push({label:e,currentStepIndex:0});let i=r.allOpenedLabels,n=r.allOpenedLabels[e]?.biggestStep||0,s=r.allOpenedLabels[e]?.openCount||0;i[e]={biggestStep:n,openCount:s+1},r.allOpenedLabels=i;}static increaseCurrentStepIndex(){if(r._openedLabels.length>0){let e=r._openedLabels[r._openedLabels.length-1];r._openedLabels[r._openedLabels.length-1]={...e,currentStepIndex:e.currentStepIndex+1};}}static _onStepStart;static set onStepStart(e){r._onStepStart=e;}static get onStepStart(){return async(e,t)=>{let i=[];return r.onLoadingLabel&&e===0&&i.push(r.onLoadingLabel(e,t)),r._onStepStart&&i.push(r._onStepStart(e,t)),await Promise.all(i)}}static onLoadingLabel;static onStepEnd};var Bd=class{get currentStepTimesCounter(){return L.getCurrentStepTimesCounter()}set currentStepTimesCounter(e){L.resetCurrentStepTimesCounter();}getRandomNumber(e,t,i={}){return L.getRandomNumber(e,t,i)}get stepCounter(){return L._stepCounter}get openedLabels(){return L.openedLabels}get currentLabel(){return L._currentLabel}addStepHistory(e,t={}){let{choiceMade:i,ignoreSameStep:n}=t,s,o,a,u=H.getVariable(ie.LAST_STEP_GLUED)===this.stepCounter;H.getVariable(ie.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(s=H.getVariable(ie.CURRENT_DIALOGUE_MEMORY_KEY)),H.getVariable(ie.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(o=H.getVariable(ie.CURRENT_MENU_OPTIONS_MEMORY_KEY)),H.getVariable(ie.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(a=H.getVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY));let l=L.openedLabels,c={currentLabel:L.currentLabelId,dialogue:s,choices:o,stepSha1:e,index:this.stepCounter,labelStepIndex:L.currentLabelStepIndex,choiceIndexMade:i,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices,isGlued:u,openedLabelsNumber:l.length};L.originalOpenedLabels=l,H.addHistoryItem(c,{ignoreSameStep:n}),L.lastHistoryStep=c,L.increaseStepCounter();}closeCurrentLabel(){if(!L.currentLabelId){A.warn("No label to close");return}if(!this.currentLabel){A.error("currentLabel not found");return}let e=L.openedLabels;e.pop(),L.openedLabels=e,H.onLabelClosing(this.openedLabels.length);}closeAllLabels(){for(;L.openedLabels.length>0;)this.closeCurrentLabel(),H.onLabelClosing(this.openedLabels.length);}isLabelAlreadyCompleted(e){let t;typeof e=="string"?t=e:t=e.id;let n=L.allOpenedLabels[t]?.biggestStep||0;if(n){let s=ir.get(t);if(s)return s.stepCount<=n}return false}get alreadyCurrentStepMadeChoicesObj(){let e=L.currentLabelStepIndex,t=this.currentLabel;if(e===null||!t)return;let i=t.getStepSha(e);return i||(A.warn("stepSha not found, setting to ERROR"),i="error"),L.allChoicesMade.filter(n=>n.labelId===t?.id&&n.stepIndex===e&&n.stepSha1===i)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(e=>e.choiceIndex)}get isCurrentStepAlreadyOpened(){let e=L.currentLabelId;if(e){let t=L.allOpenedLabels[e]?.openCount||0;if(L.currentLabelStepIndex&&t>=L.currentLabelStepIndex)return true}return false}getTimesLabelOpened(e){return L.allOpenedLabels[e]?.openCount||0}getTimesChoiceMade(e){return this.alreadyCurrentStepMadeChoicesObj?.find(t=>t.choiceIndex===e)?.madeTimes||0}addCurrentStepToHistory(){this.addStepHistory("dev",{ignoreSameStep:true});}getCanGoNext(e){let t=e?.showWarn||false,i=this.choiceMenuOptions;return i&&i.length>0?(t&&A.warn("The player must make a choice"),false):this.isRequiredInput?(t&&A.warn("The player must enter a value"),false):true}get canGoNext(){return L.stepsRunning!==0?false:this.getCanGoNext()}async onStepRun(e,t){let i=[];return e.onStepStart&&i.push(e.onStepStart(t,e)),L.onStepStart&&i.push(L.onStepStart(t,e)),await Promise.all(i)}async onStepEnd(e,t){let i=[];return e.onStepEnd&&i.push(e.onStepEnd(t,e)),L.onStepEnd&&i.push(L.onStepEnd(t,e)),await Promise.all(i)}async goNext(e,t={}){let{runNow:i=false}=t;if(!(!i&&!this.getCanGoNext({showWarn:true}))){if(!i&&L.stepsRunning!==0){L.goNextRequests++;return}try{this.currentLabel&&await this.onStepEnd(this.currentLabel,L.currentLabelStepIndex||0);}catch(n){A.error("Error running onStepEnd",n);}return L.stepsRunning===0&&await H.onGoNextEnd(),L.increaseCurrentStepIndex(),await this.runCurrentStep(e,t)}}async runCurrentStep(e,t={}){let{choiceMade:i}=t;if(L.currentLabelId){let n=L.currentLabelStepIndex;if(n===null){A.error("currentLabelStepIndex is null");return}let s=L._currentLabel;if(!s){A.error("currentLabel not found");return}if(s.stepCount>n){try{await this.onStepRun(s,n);}catch(u){A.error("Error running onStepStart",u),this.onStepError&&this.onStepError(u,e);return}let o=s.getStepById(n);if(!o){A.error("step not found");return}let a=s.getStepSha(n);a||(A.warn("stepSha not found, setting to ERROR"),a="error");try{L.stepsRunning++;let u=await o(e,{labelId:s.id}),l=this.choiceMenuOptions;if(l?.length===1&&l[0].autoSelect){let h=l[0];u=await this.selectChoice(h,e);}let c=L.lastHistoryStep;if(i!==void 0&&c){let h=c.stepSha1;h||(A.warn("stepSha not found, setting to ERROR"),h="error"),L.addChoicesMade(c.currentLabel||"error",typeof c.labelStepIndex=="number"?c.labelStepIndex:-1,c.stepSha1||"error",i),L.choiceMadeTemp=i;}return L.stepsRunning--,L.stepsRunning===0&&(L.addLabelHistory(s.id,n),this.addStepHistory(a,{...t,choiceMade:L.choiceMadeTemp}),L.choiceMadeTemp=void 0,L.goNextRequests>0)?(L.goNextRequests--,await this.goNext(e)):u}catch(u){L.stepsRunning>0&&L.stepsRunning--,A.error("Error running step",u),this.onStepError&&this.onStepError(u,e);return}}else {if(this.openedLabels.length>1)return this.closeCurrentLabel(),await this.goNext(e,t);if(this.openedLabels.length===1)return L.openedLabels=[],this.onGameEnd?await this.onGameEnd(e,{labelId:"end"}):void 0}}else if(this.openedLabels.length===0){if(L.openedLabels=L.originalOpenedLabels,this.onGameEnd)return await this.onGameEnd(e,{labelId:"end"});A.error("The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");return}else A.error("currentLabelId not found");}async callLabel(e,t,i){let{choiceMade:n}=i||{},s;typeof e=="string"?s=e:s=e.id;try{let o=ir.get(s);if(!o)throw new Error(`[Pixi\u2019VN] Label ${s} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,L.currentLabelStepIndex||0);}catch(a){A.error("Error running onStepEnd",a);}L.pushNewLabel(o.id);}catch(o){A.error("Error calling label",o);return}return await this.runCurrentStep(t,{choiceMade:n})}async jumpLabel(e,t,i){this.openedLabels.length>0&&this.closeCurrentLabel();let{choiceMade:n}=i||{},s;typeof e=="string"?s=e:s=e.id;try{let o=ir.get(s);if(!o)throw new Error(`[Pixi\u2019VN] Label ${s} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,L.currentLabelStepIndex||0);}catch(a){A.error("Error running onStepEnd",a);}L.pushNewLabel(o.id);}catch(o){A.error("Error jumping label",o);return}return await this.runCurrentStep(t,{choiceMade:n})}async selectChoice(e,t){this.choiceMenuOptions=void 0;let i=e.type;switch(i){case "call":return await this.callLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "jump":return await this.jumpLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "close":return await this.closeChoiceMenu(e,{...e.props,...t});default:throw A.error(`Type ${i} not found`),new Error(`[Pixi\u2019VN] Type ${i} not found`)}}async closeChoiceMenu(e,t){if(e.type!=="close")throw A.error("For closeChoiceMenu, the type must be close"),new Error("[Pixi\u2019VN] For closeChoiceMenu, the type must be close");let i;return typeof e.choiceIndex=="number"&&(i=e.choiceIndex),e.closeCurrentLabel&&this.closeCurrentLabel(),this.goNext(t,{choiceMade:i})}get onGameEnd(){return H.onEnd}set onGameEnd(e){H.onEnd=e;}get onStepError(){let e=H.onError;return e?(t,i)=>e("step",t,i):void 0}set onStepError(e){H.onError=(t,i,n)=>e(i,n);}get dialogue(){let e=H.getVariable(ie.CURRENT_DIALOGUE_MEMORY_KEY);if(e)return {...e,character:e.character?H.getCharacter(e.character)||e.character:void 0}}set dialogue(e){if(!e){H.setVariable(ie.CURRENT_DIALOGUE_MEMORY_KEY,void 0);return}if((typeof e=="string"||Array.isArray(e))&&(e={text:e}),this.dialogGlue){let t=H.getVariable(ie.CURRENT_DIALOGUE_MEMORY_KEY);if(t){let i=[];Array.isArray(t.text)?i=[...t.text]:i=[t.text],Array.isArray(e.text)?i=[...i,...e.text]:i=[...i,e.text],e.text=i,e.character=e.character||t.character;}H.setVariable(ie.LAST_STEP_GLUED,this.stepCounter),this.dialogGlue=false;}try{H.setVariable(ie.CURRENT_DIALOGUE_MEMORY_KEY,se({...e,character:typeof e.character=="string"?e.character:e.character?.id})),H.setVariable(ie.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw A.error("DialogueInterface cannot contain functions or classes"),t}}get choiceMenuOptions(){let e=H.getVariable(ie.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(e){let t=[],i=e.map((s,o)=>({...s,choiceIndex:o})),n=this.alreadyCurrentStepMadeChoices;if(i=i.filter((s,o)=>s.oneTime&&n&&n.includes(o)?false:s.onlyHaveNoChoice?(t.push(s),false):true),i.length>0)return i;if(t.length>0)return [t[0]]}}set choiceMenuOptions(e){if(!e||e.length===0){H.setVariable(ie.CURRENT_MENU_OPTIONS_MEMORY_KEY,void 0);return}let t=e.map(i=>i instanceof aa?{...i.devProps,text:i.text,type:oa,closeCurrentLabel:i.closeCurrentLabel,oneTime:i.oneTime,onlyHaveNoChoice:i.onlyHaveNoChoice,autoSelect:i.autoSelect,props:i.props}:i instanceof sa?{...i.devProps,type:i.type,text:i.text,label:i.label.id,autoSelect:i.autoSelect,oneTime:i.oneTime,onlyHaveNoChoice:i.onlyHaveNoChoice,props:i.props}:i);try{H.setVariable(ie.CURRENT_MENU_OPTIONS_MEMORY_KEY,se(t)),H.setVariable(ie.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(i){throw A.error("ChoiceInterface cannot contain functions or classes"),i}}get dialogGlue(){return H.getFlag(ie.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(e){H.setFlag(ie.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,e);}get inputValue(){return H.getVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(e){this.removeInputRequest(),H.setVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY,e),H.setVariable(ie.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}get isRequiredInput(){return H.getVariable(ie.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return H.getVariable(ie.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(e,t){e.isRequired=true,H.setVariable(ie.CURRENT_INPUT_INFO_MEMORY_KEY,e),t!==void 0?H.setVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY,t):H.removeVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){H.removeVariable(ie.CURRENT_INPUT_INFO_MEMORY_KEY),H.removeVariable(ie.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){L.openedLabels=[],L._stepCounter=0;}export(){return {openedLabels:se(L.openedLabels),stepCounter:this.stepCounter}}async onLoadingLabel(e){let t=this.openedLabels.map(async i=>{let n=[],s=ir.get(i.label);return s&&(s.onLoadingLabel&&n.push(s.onLoadingLabel(e,s)),L.onLoadingLabel&&n.push(L.onLoadingLabel(e,s))),await Promise.all(n)});return await Promise.all(t)}async restore(e,t){this.clear();try{L.lastHistoryStep=t,e.hasOwnProperty("openedLabels")?(L.openedLabels=e.openedLabels,L.originalOpenedLabels=L.openedLabels):A.warn("Could not import openedLabels data, so will be ignored"),e.hasOwnProperty("stepCounter")?L._stepCounter=e.stepCounter:e.hasOwnProperty("lastStepIndex")?L._stepCounter=e.lastStepIndex:A.warn("Could not import stepCounter data, so will be ignored");try{await this.onLoadingLabel(L.currentLabelStepIndex||0);}catch(i){A.error("Error running onLoadingLabel",i);}}catch(i){A.error("Error importing data",i);}}};function f1(r,e,t){let i=new Wi(r,e,t);return ir.add(i),i}var Xi=new Bd;var g1={};vi(g1,{Sound:()=>ss,SoundManagerStatic:()=>te,sound:()=>os});var te=class{constructor(){}static soundAliasesOrder=[];static soundsPlaying={};static sounds={}};var ss=class r extends cr{alias;pause(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let e=te.soundsPlaying[this.alias];if(!e)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return te.soundsPlaying[this.alias]={...e,paused:true},super.pause()}resume(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let e=te.soundsPlaying[this.alias];if(!e)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return te.soundsPlaying[this.alias]={options:e.options,stepIndex:H.stepCounter,paused:false},super.resume()}destroy(){return this.alias&&delete te.soundsPlaying[this.alias],super.destroy()}stop(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return delete te.soundsPlaying[this.alias],super.stop()}play(e){if(typeof e=="string"&&(this.alias=e),!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return te.soundsPlaying[this.alias]={stepIndex:H.stepCounter,options:e,paused:false},super.play(e)}static from(e){let t=cr.from(e);return new r(t.media,t.options)}};function Rd(r){let e=[];for(let t of r)t.type==="TelephoneFilter"?e.push(new ke.TelephoneFilter):t.type==="StreamFilter"?e.push(new ke.StreamFilter):t.type==="StereoFilter"?e.push(new ke.StereoFilter(t.pan)):t.type==="ReverbFilter"?e.push(new ke.ReverbFilter(t.seconds,t.decay,t.reverse)):t.type==="MonoFilter"?e.push(new ke.MonoFilter):t.type==="EqualizerFilter"?e.push(new ke.EqualizerFilter(t.f32,t.f64,t.f125,t.f250,t.f500,t.f1k,t.f2k,t.f4k,t.f8k,t.f16k)):t.type==="DistortionFilter"?e.push(new ke.DistortionFilter(t.amount)):A.error("Unknown sound filter type");return e}function m1(r){if(!r)return;let e=[];for(let t of r)t instanceof ke.TelephoneFilter?e.push({type:"TelephoneFilter"}):t instanceof ke.StreamFilter?e.push({type:"StreamFilter"}):t instanceof ke.StereoFilter?e.push({type:"StereoFilter",pan:t.pan}):t instanceof ke.ReverbFilter?e.push({type:"ReverbFilter",seconds:t.seconds,decay:t.decay,reverse:t.reverse}):t instanceof ke.MonoFilter?e.push({type:"MonoFilter"}):t instanceof ke.EqualizerFilter?e.push({type:"EqualizerFilter",f32:t.f32,f64:t.f64,f125:t.f125,f250:t.f250,f500:t.f500,f1k:t.f1k,f2k:t.f2k,f4k:t.f4k,f8k:t.f8k,f16k:t.f16k}):t instanceof ke.DistortionFilter?e.push({type:"DistortionFilter",amount:t.amount}):A.error("Unknown sound filter type");return e}var Md=class extends vl{constructor(){super();}get context(){return be.context}get filtersAll(){return be.filtersAll}set filtersAll(e){be.filtersAll=e.filter(t=>!(t instanceof ke.Filter));}get supported(){return be.supported}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}add(e,t){if(typeof e=="object")throw new Error("[Pixi\u2019VN] The method add(map: SoundSourceMap, globalOptions?: Options) is deprecated. Use add(alias: string, options: Options | string | ArrayBuffer | AudioBuffer | HTMLAudioElement | Sound): Sound; instead.");this.exists(e)&&this.remove(e),t instanceof cr&&(t=t.options);let i;if(t instanceof ss)i=t;else {let n=this.getOptions(t||{});i=ss.from(n);}return i.alias=e,!te.soundAliasesOrder.includes(e)&&te.soundAliasesOrder.push(e),te.sounds[e]=i,be.add(e,i),i}get useLegacy(){return be.useLegacy}set useLegacy(e){be.useLegacy=e;}get disableAutoPause(){return be.disableAutoPause}set disableAutoPause(e){be.disableAutoPause=e;}remove(e){return te.soundAliasesOrder=te.soundAliasesOrder.filter(t=>t!==e),delete te.soundsPlaying[e],delete te.sounds[e],be.remove(e)}get volumeAll(){return be.volumeAll}set volumeAll(e){be.volumeAll=e;}get speedAll(){return be.speedAll}set speedAll(e){be.speedAll=e;}togglePauseAll(){return be.togglePauseAll()}pauseAll(){return be.pauseAll()}resumeAll(){return be.resumeAll()}toggleMuteAll(){return be.toggleMuteAll()}muteAll(){return be.muteAll()}unmuteAll(){return be.unmuteAll()}removeAll(){return te.soundAliasesOrder=[],te.soundsPlaying={},te.sounds={},be.removeAll()}stopAll(){for(let e in te.sounds)te.sounds[e].stop();return te.soundsPlaying={},be.stopAll()}exists(e,t){return be.exists(e,t)||e in te.sounds}isPlaying(){return be.isPlaying()}find(e){let t=te.sounds[e];return t||(t=be.find(e),t&&(te.sounds[e]=t),t)}play(e,t){if(!this.exists(e))throw new Error("[Pixi\u2019VN] The alias is not found in the sound library.");return te.soundsPlaying[e]={stepIndex:H.stepCounter,options:t,paused:false},be.play(e,t)}stop(e){return delete te.soundsPlaying[e],be.stop(e)}pause(e){let t=te.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return te.soundsPlaying[e]={...t,paused:true},be.pause(e)}resume(e){let t=te.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return te.soundsPlaying[e]={options:t.options,stepIndex:H.stepCounter,paused:false},be.resume(e)}volume(e,t){return be.volume(e,t)}speed(e,t){return be.speed(e,t)}duration(e){return be.duration(e)}close(){return be.close()}clear(){this.stopAll();}export(){let e={};for(let t in te.soundsPlaying){let i=te.soundsPlaying[t],n=this.find(t);n&&(e[t]={...i,sound:{options:{...n.options,autoPlay:n.autoPlay,loop:n.loop,preload:n.preload,singleInstance:n.singleInstance,url:n.options.url,volume:n.options.volume},filters:m1(n.media.filters)}});}return {soundsPlaying:se(e),soundAliasesOrder:se(te.soundAliasesOrder),filters:se(m1(this.filtersAll))}}removeOldSoundAndExport(){return this.export()}restore(e){let t=H.stepCounter-1;this.clear();try{if(e.hasOwnProperty("soundAliasesOrder"))te.soundAliasesOrder=e.soundAliasesOrder;else {A.error("The data does not have the properties soundAliasesOrder");return}if(e.hasOwnProperty("filters")){let i=e.filters;i&&(this.filtersAll=Rd(i));}if(e.hasOwnProperty("playInStepIndex")){let i=e.playInStepIndex;i&&(te.soundsPlaying=i);}if(e.hasOwnProperty("sounds")){let i=e.sounds;for(let n in i){let s=i[n],o=!1,a=this.add(n,{...s.options,autoPlay:!1});if(n in te.soundsPlaying){let u=te.soundsPlaying[n];(s.options.loop||u.options&&typeof u.options=="object"&&u.options.loop||u.stepIndex===t)&&(o=!0),s.filters&&(a.filters=Rd(s.filters)),o&&a.play();}}}if(e.hasOwnProperty("soundsPlaying")){let i=e.soundsPlaying;for(let n in i){let s=i[n];te.soundsPlaying[n]={paused:s.paused,stepIndex:s.stepIndex,options:s.options};let o=i[n].sound,a=!1,u;if(this.exists(n)?(u=this.find(n),o.options.url=u.options.url,o.options.volume=u.options.volume,u.options=o.options,u.autoPlay=!1,u.filters=o.filters?Rd(o.filters):[]):u=this.add(n,{...o.options,autoPlay:!1}),n in te.soundsPlaying){let l=te.soundsPlaying[n];(o.options.loop||l.options&&typeof l.options=="object"&&l.options.loop||l.stepIndex===t)&&(a=!0),o.filters&&(u.filters=Rd(o.filters)),a&&u.play();}}}else {A.error("The data does not have the properties soundsPlaying");return}}catch(i){A.error("Error importing data",i);}}};var os=new Md;Ee();function oM(){console.info(`
3311
3311
  _______ _ _ _ ____ ____ ____ _____
3312
3312
  |_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|
3313
3313
  | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | |