@drincs/pixi-vn 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/index.cjs +1 -1
- package/dist/canvas/index.mjs +1 -1
- package/dist/canvas/tickers/index.cjs +1 -1
- package/dist/canvas/tickers/index.mjs +1 -1
- package/dist/index.cjs +11 -11
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +11 -11
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ Deprecated since v${r}`):(i=i.split(`
|
|
|
3
3
|
`).splice(t).join(`
|
|
4
4
|
`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}
|
|
5
5
|
Deprecated since v${r}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}
|
|
6
|
-
Deprecated since v${r}`),console.warn(i))),x3[e]=true;}var x3,Y,Fm,Pe=p(()=>{x3={},Y="8.0.0",Fm="8.3.4";});function U(...r){Nv!==_3&&(Nv++,Nv===_3?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r));}var Nv,_3,Ae=p(()=>{Nv=0,_3=500;});var Ss,Gm=p(()=>{Ss=class{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t);}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e;}get(e){let t;return this._index>0?t=this._pool[--this._index]:t=new this._classType,t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e;}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0;}};});var Vh,He,Xi=p(()=>{Gm();Vh=class{constructor(){this._poolsByClass=new Map;}prepopulate(e,t){this.getPool(e).prepopulate(t);}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e);}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new Ss(e)),this._poolsByClass.get(e)}stats(){let e={};return this._poolsByClass.forEach(t=>{let i=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[i]={free:t.totalFree,used:t.totalUsed,size:t.totalSize};}),e}},He=new Vh;});var Um,Vv=p(()=>{Pe();Um={get isCachedAsTexture(){return !!this.renderGroup?.isCachedAsTexture},cacheAsTexture(r){typeof r=="boolean"&&r===false?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(r===true?{}:r));},updateCacheTexture(){this.renderGroup?.updateCacheTexture();},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(r){G("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r);}};});function Zu(r,e,t){let i=r.length,s;if(e>=i||t===0)return;t=e+t>i?i-e:t;let n=i-t;for(s=e;s<n;++s)r[s]=r[s+t];r.length=n;}var Lm=p(()=>{});var Nm,Hv=p(()=>{Lm();Pe();Nm={allowChildren:true,removeChildren(r=0,e){let t=e??this.children.length,i=t-r,s=[];if(i>0&&i<=t){for(let o=t-1;o>=r;o--){let a=this.children[o];a&&(s.push(a),a.parent=null);}Zu(this.children,r,t);let n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(s);for(let o=0;o<s.length;++o){let a=s[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,o),s[o].emit("removed",this);}return s.length>0&&this._didViewChangeTick++,s}else if(i===0&&this.children.length===0)return s;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(r){let e=this.getChildAt(r);return this.removeChild(e)},getChildAt(r){if(r<0||r>=this.children.length)throw new Error(`getChildAt: Index (${r}) does not exist.`);return this.children[r]},setChildIndex(r,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(r),this.addChildAt(r,e);},getChildIndex(r){let e=this.children.indexOf(r);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(r,e){this.allowChildren||G(Y,"addChildAt: Only Containers will be allowed to add children in v8.0.0");let{children:t}=this;if(e<0||e>t.length)throw new Error(`${r}addChildAt: The index ${e} supplied is out of bounds ${t.length}`);if(r.parent){let s=r.parent.children.indexOf(r);if(r.parent===this&&s===e)return r;s!==-1&&r.parent.children.splice(s,1);}e===t.length?t.push(r):t.splice(e,0,r),r.parent=this,r.didChange=true,r._updateFlags=15;let i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(r),this.sortableChildren&&(this.sortDirty=true),this.emit("childAdded",r,this,e),r.emit("added",this),r},swapChildren(r,e){if(r===e)return;let t=this.getChildIndex(r),i=this.getChildIndex(e);this.children[t]=e,this.children[i]=r;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true),this._didContainerChangeTick++;},removeFromParent(){this.parent?.removeChild(this);},reparentChild(...r){return r.length===1?this.reparentChildAt(r[0],this.children.length):(r.forEach(e=>this.reparentChildAt(e,this.children.length)),r[0])},reparentChildAt(r,e){if(r.parent===this)return this.setChildIndex(r,e),r;let t=r.worldTransform.clone();r.removeFromParent(),this.addChildAt(r,e);let i=this.worldTransform.clone();return i.invert(),t.prepend(i),r.setFromMatrix(t),r},replaceChild(r,e){r.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(r)),e.setFromMatrix(r.localTransform),e.updateLocalTransform(),this.removeChild(r);}};});var Vm,zv=p(()=>{Vm={collectRenderables(r,e,t){this.parentRenderLayer&&this.parentRenderLayer!==t||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(r,e,t):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,r):this.collectRenderablesWithEffects(r,e,t));},collectRenderablesSimple(r,e,t){let i=this.children,s=i.length;for(let n=0;n<s;n++)i[n].collectRenderables(r,e,t);},collectRenderablesWithEffects(r,e,t){let{renderPipes:i}=e;for(let s=0;s<this.effects.length;s++){let n=this.effects[s];i[n.pipe].push(n,this,r);}this.collectRenderablesSimple(r,e,t);for(let s=this.effects.length-1;s>=0;s--){let n=this.effects[s];i[n.pipe].pop(n,this,r);}}};});var pi,Hh=p(()=>{pi=class{constructor(){this.pipe="filter",this.priority=1;}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null;}};});var zh,Qu,Wv=p(()=>{P();Xi();zh=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=false;}init(){this._initialized||(this._initialized=true,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e});}));}add(e){this._tests.push(e);}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){let i=this._tests[t];if(i.test(e))return He.get(i.maskClass,e)}return e}returnMaskEffect(e){He.return(e);}},Qu=new zh;V.handleByList(b.MaskEffect,Qu._effectClasses);});var Hm,Xv=p(()=>{Hh();Wv();Hm={_maskEffect:null,_maskOptions:{inverse:false},_filterEffect:null,effects:[],_markStructureAsChanged(){let r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=true);},addEffect(r){this.effects.indexOf(r)===-1&&(this.effects.push(r),this.effects.sort((t,i)=>t.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple());},removeEffect(r){let e=this.effects.indexOf(r);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple());},set mask(r){let e=this._maskEffect;e?.mask!==r&&(e&&(this.removeEffect(e),Qu.returnMaskEffect(e),this._maskEffect=null),r!=null&&(this._maskEffect=Qu.getMaskEffect(r),this.addEffect(this._maskEffect)));},get mask(){return this._maskEffect?.mask},setMask(r){this._maskOptions={...this._maskOptions,...r},r.mask&&(this.mask=r.mask),this._markStructureAsChanged();},set filters(r){!Array.isArray(r)&&r&&(r=[r]);let e=this._filterEffect||(this._filterEffect=new pi);r=r;let t=r?.length>0,i=e.filters?.length>0,s=t!==i;r=Array.isArray(r)?r.slice(0):r,e.filters=Object.freeze(r),s&&(t?this.addEffect(e):(this.removeEffect(e),e.filters=r??null));},get filters(){return this._filterEffect?.filters},set filterArea(r){this._filterEffect||(this._filterEffect=new pi),this._filterEffect.filterArea=r;},get filterArea(){return this._filterEffect?.filterArea}};});var zm,Yv=p(()=>{Pe();zm={label:null,get name(){return G(Y,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){G(Y,"Container.name property has been removed, use Container.label instead"),this.label=r;},getChildByName(r,e=false){return this.getChildByLabel(r,e)},getChildByLabel(r,e=false){let t=this.children;for(let i=0;i<t.length;i++){let s=t[i];if(s.label===r||r instanceof RegExp&&r.test(s.label))return s}if(e)for(let i=0;i<t.length;i++){let n=t[i].getChildByLabel(r,true);if(n)return n}return null},getChildrenByLabel(r,e=false,t=[]){let i=this.children;for(let s=0;s<i.length;s++){let n=i[s];(n.label===r||r instanceof RegExp&&r.test(n.label))&&t.push(n);}if(e)for(let s=0;s<i.length;s++)i[s].getChildrenByLabel(r,true,t);return t}};});var Wm,re,xt=p(()=>{_r();Wm=[new ge,new ge,new ge,new ge],re=class r{constructor(e=0,t=0,i=0,s=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(s);}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new r(0,0,0,0)}clone(){return new r(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?false:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,i,s=.5){let{width:n,height:o}=this;if(n<=0||o<=0)return false;let a=this.x,u=this.y,l=i*(1-s),c=i-l,h=a-l,d=a+n+l,f=u-l,m=u+o+l,_=a+c,x=a+n-c,g=u+c,y=u+o-c;return e>=h&&e<=d&&t>=f&&t<=m&&!(e>_&&e<x&&t>g&&t<y)}intersects(e,t){if(!t){let D=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=D)return false;let L=this.y<e.y?e.y:this.y;return (this.bottom>e.bottom?e.bottom:this.bottom)>L}let i=this.left,s=this.right,n=this.top,o=this.bottom;if(s<=i||o<=n)return false;let a=Wm[0].set(e.left,e.top),u=Wm[1].set(e.left,e.bottom),l=Wm[2].set(e.right,e.top),c=Wm[3].set(e.right,e.bottom);if(l.x<=a.x||u.y<=a.y)return false;let h=Math.sign(t.a*t.d-t.b*t.c);if(h===0||(t.apply(a,a),t.apply(u,u),t.apply(l,l),t.apply(c,c),Math.max(a.x,u.x,l.x,c.x)<=i||Math.min(a.x,u.x,l.x,c.x)>=s||Math.max(a.y,u.y,l.y,c.y)<=n||Math.min(a.y,u.y,l.y,c.y)>=o))return false;let d=h*(u.y-a.y),f=h*(a.x-u.x),m=d*i+f*n,_=d*s+f*n,x=d*i+f*o,g=d*s+f*o;if(Math.max(m,_,x,g)<=d*a.x+f*a.y||Math.min(m,_,x,g)>=d*c.x+f*c.y)return false;let y=h*(a.y-l.y),v=h*(l.x-a.x),S=y*i+v*n,C=y*s+v*n,A=y*i+v*o,M=y*s+v*o;return !(Math.max(S,C,A,M)<=y*a.x+v*a.y||Math.min(S,C,A,M)>=y*c.x+v*c.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){let t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),s=Math.max(this.y,e.y),n=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=s,this.height=Math.max(n-s,0),this}ceil(e=1,t=.001){let i=Math.ceil((this.x+this.width-t)*e)/e,s=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=s-this.y,this}scale(e,t=e){return this.x*=e,this.y*=t,this.width*=e,this.height*=t,this}enlarge(e){let t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),s=Math.min(this.y,e.y),n=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=s,this.height=n-s,this}getBounds(e){return e||(e=new r),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return false;let t=e.x,i=e.y,s=e.x+e.width,n=e.y+e.height;return t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height&&s>=this.x&&s<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(e,t,i,s){return this.x=e,this.y=t,this.width=i,this.height=s,this}toString(){return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};});var b3,Me,Xt=p(()=>{Te();xt();b3=new O,Me=class r{constructor(e=1/0,t=1/0,i=-1/0,s=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=b3,this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new re);let e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=b3,this}set(e,t,i,s){this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}addFrame(e,t,i,s,n){n||(n=this.matrix);let o=n.a,a=n.b,u=n.c,l=n.d,c=n.tx,h=n.ty,d=this.minX,f=this.minY,m=this.maxX,_=this.maxY,x=o*e+u*t+c,g=a*e+l*t+h;x<d&&(d=x),g<f&&(f=g),x>m&&(m=x),g>_&&(_=g),x=o*i+u*t+c,g=a*i+l*t+h,x<d&&(d=x),g<f&&(f=g),x>m&&(m=x),g>_&&(_=g),x=o*e+u*s+c,g=a*e+l*s+h,x<d&&(d=x),g<f&&(f=g),x>m&&(m=x),g>_&&(_=g),x=o*i+u*s+c,g=a*i+l*s+h,x<d&&(d=x),g<f&&(f=g),x>m&&(m=x),g>_&&(_=g),this.minX=d,this.minY=f,this.maxX=m,this.maxY=_;}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t);}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t);}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY;}applyMatrix(e){let t=this.minX,i=this.minY,s=this.maxX,n=this.maxY,{a:o,b:a,c:u,d:l,tx:c,ty:h}=e,d=o*t+u*i+c,f=a*t+l*i+h;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=o*s+u*i+c,f=a*s+l*i+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*t+u*n+c,f=a*t+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*s+u*n+c,f=a*s+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY;}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,i,s){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<i&&(this.minY=i),this.maxY>s&&(this.maxY=s),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new r(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){let t=this.maxX-this.minX;this.minX=e,this.maxX=e+t;}get y(){return this.minY}set y(e){let t=this.maxY-this.minY;this.minY=e,this.maxY=e+t;}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e;}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e;}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,t,i,s){let n=this.minX,o=this.minY,a=this.maxX,u=this.maxY;s||(s=this.matrix);let l=s.a,c=s.b,h=s.c,d=s.d,f=s.tx,m=s.ty;for(let _=t;_<i;_+=2){let x=e[_],g=e[_+1],y=l*x+h*g+f,v=c*x+d*g+m;n=y<n?y:n,o=v<o?v:o,a=y>a?y:a,u=v>u?v:u;}this.minX=n,this.minY=o,this.maxX=a,this.maxY=u;}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}};});var pt,dr,rn=p(()=>{Te();Gm();Xt();pt=new Ss(O),dr=new Ss(Me);});var VG,Xm,jv=p(()=>{Te();Xt();rn();VG=new O,Xm={getFastGlobalBounds(r,e){e||(e=new Me),e.clear(),this._getGlobalBoundsRecursive(!!r,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);let t=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(t.worldTransform),e},_getGlobalBoundsRecursive(r,e,t){let i=e;if(r&&this.parentRenderLayer&&this.parentRenderLayer!==t||this.localDisplayStatus!==7||!this.measurable)return;let s=!!this.effects.length;if((this.renderGroup||s)&&(i=dr.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else {if(this.renderPipeId){let o=this.bounds;i.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform);}let n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(r,i,t);}if(s){let n=false,o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(n||(n=true,i.applyMatrix(o.worldTransform)),this.effects[a].addBounds(i,true));n&&i.applyMatrix(o.worldTransform.copyTo(VG).invert()),e.addBounds(i),dr.return(i);}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),dr.return(i));}};});function Yi(r,e,t){t.clear();let i,s;return r.parent?e?i=r.parent.worldTransform:(s=pt.get().identity(),i=Ju(r,s)):i=O.IDENTITY,y3(r,t,i,e),s&&pt.return(s),t.isValid||t.set(0,0,0,0),t}function y3(r,e,t,i){if(!r.visible||!r.measurable)return;let s;i?s=r.worldTransform:(r.updateLocalTransform(),s=pt.get(),s.appendFrom(r.localTransform,t));let n=e,o=!!r.effects.length;if(o&&(e=dr.get().clear()),r.boundsArea)e.addRect(r.boundsArea,s);else {r.bounds&&(e.matrix=s,e.addBounds(r.bounds));for(let a=0;a<r.children.length;a++)y3(r.children[a],e,s,i);}if(o){for(let a=0;a<r.effects.length;a++)r.effects[a].addBounds?.(e);n.addBounds(e,O.IDENTITY),dr.return(e);}i||pt.return(s);}function Ju(r,e){let t=r.parent;return t&&(Ju(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}var ko=p(()=>{Te();rn();});function el(r,e){if(r===16777215||!e)return e;if(e===16777215||!r)return r;let t=r>>16&255,i=r>>8&255,s=r&255,n=e>>16&255,o=e>>8&255,a=e&255,u=t*n/255|0,l=i*o/255|0,c=s*a/255|0;return (u<<16)+(l<<8)+c}var Ym=p(()=>{});function sn(r,e){return r===v3?e:e===v3?r:el(r,e)}var v3,jm=p(()=>{Ym();v3=16777215;});function Es(r){return ((r&255)<<16)+(r&65280)+(r>>16&255)}var $m,qm=p(()=>{Te();ko();rn();jm();$m={getGlobalAlpha(r){if(r)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,t=this.parent;for(;t;)e*=t.alpha,t=t.parent;return e},getGlobalTransform(r=new O,e){if(e)return r.copyFrom(this.worldTransform);this.updateLocalTransform();let t=Ju(this,pt.get().identity());return r.appendFrom(this.localTransform,t),pt.return(t),r},getGlobalTint(r){if(r)return this.renderGroup?Es(this.renderGroup.worldColor):this.parentRenderGroup?Es(sn(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=sn(e,t.localColor),t=t.parent;return Es(e)}};});function nn(r,e,t){return e.clear(),t||(t=O.IDENTITY),T3(r,e,t,r,true),e.isValid||e.set(0,0,0,0),e}function T3(r,e,t,i,s){let n;if(s)n=pt.get(),n=t.copyTo(n);else {if(!r.visible||!r.measurable)return;r.updateLocalTransform();let u=r.localTransform;n=pt.get(),n.appendFrom(u,t);}let o=e,a=!!r.effects.length;if(a&&(e=dr.get().clear()),r.boundsArea)e.addRect(r.boundsArea,n);else {r.renderPipeId&&(e.matrix=n,e.addBounds(r.bounds));let u=r.children;for(let l=0;l<u.length;l++)T3(u[l],e,n,i,false);}if(a){for(let u=0;u<r.effects.length;u++)r.effects[u].addLocalBounds?.(e,i);o.addBounds(e,O.IDENTITY),dr.return(e);}pt.return(n);}var Wh=p(()=>{Te();rn();});function Xh(r,e){let t=r.children;for(let i=0;i<t.length;i++){let s=t[i],n=s.uid,o=(s._didViewChangeTick&65535)<<16|s._didContainerChangeTick&65535,a=e.index;(e.data[a]!==n||e.data[a+1]!==o)&&(e.data[e.index]=n,e.data[e.index+1]=o,e.didChange=true),e.index=a+2,s.children.length&&Xh(s,e);}return e.didChange}var $v=p(()=>{});var HG,Km,qv=p(()=>{Te();Xt();ko();Wh();$v();HG=new O,Km={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(r,e){let t=Math.sign(this.scale.x)||1;e!==0?this.scale.x=r/e*t:this.scale.x=t;},_setHeight(r,e){let t=Math.sign(this.scale.y)||1;e!==0?this.scale.y=r/e*t:this.scale.y=t;},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:false,localBounds:new Me});let r=this._localBoundsCacheData;return r.index=1,r.didChange=false,r.data[0]!==this._didViewChangeTick&&(r.didChange=true,r.data[0]=this._didViewChangeTick),Xh(this,r),r.didChange&&nn(this,r.localBounds,HG),r.localBounds},getBounds(r,e){return Yi(this,r,e||new Me)}};});var Zm,Kv=p(()=>{Zm={_onRender:null,set onRender(r){let e=this.renderGroup||this.parentRenderGroup;if(!r){this._onRender&&e?.removeOnRender(this),this._onRender=null;return}this._onRender||e?.addOnRender(this),this._onRender=r;},get onRender(){return this._onRender}};});function zG(r,e){return r._zIndex-e._zIndex}var Qm,Zv=p(()=>{Qm={_zIndex:0,sortDirty:false,sortableChildren:false,get zIndex(){return this._zIndex},set zIndex(r){this._zIndex!==r&&(this._zIndex=r,this.depthOfChildModified());},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=true,this.parent.sortDirty=true),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true);},sortChildren(){this.sortDirty&&(this.sortDirty=false,this.children.sort(zG));}};});var Jm,Qv=p(()=>{_r();rn();Jm={getGlobalPosition(r=new ge,e=false){return this.parent?this.parent.toGlobal(this._position,r,e):(r.x=this._position.x,r.y=this._position.y),r},toGlobal(r,e,t=false){let i=this.getGlobalTransform(pt.get(),t);return e=i.apply(r,e),pt.return(i),e},toLocal(r,e,t,i){e&&(r=e.toGlobal(r,t,i));let s=this.getGlobalTransform(pt.get(),i);return t=s.applyInverse(r,t),pt.return(s),t}};});var on,eg=p(()=>{Pt();on=class{constructor(){this.uid=de("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0;}reset(){this.instructionSize=0;}add(e){this.instructions[this.instructionSize++]=e;}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"]);}};});function mi(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Yh(r){return !(r&r-1)&&!!r}function S3(r){let e=(r>65535?1:0)<<4;r>>>=e;let t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}var tl=p(()=>{});function Ot(r){let e={};for(let t in r)r[t]!==void 0&&(e[t]=r[t]);return e}var an=p(()=>{});function WG(r){let e=E3[r];return e===void 0&&(E3[r]=de("resource")),e}var E3,A3,mt,ji=p(()=>{Wt();Pt();Pe();E3=Object.create(null);A3=class C3 extends ve{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=false,e={...C3.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1;}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e;}get addressMode(){return this.addressModeU}set wrapMode(e){G(Y,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e;}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e;}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear");}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null;}_generateResourceId(){let e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=WG(e),this._resourceId}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners();}};A3.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};mt=A3;});var w3,xe,Mt=p(()=>{Wt();tl();an();Pt();ji();w3=class P3 extends ve{constructor(e={}){super(),this.options=e,this.uid=de("textureSource"),this._resourceType="textureSource",this._resourceId=de("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=false,this.format="rgba8unorm",this.dimension="2d",this.antialias=false,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...P3.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new mt(Ot(e)),this.destroyed=false,this._refreshPOT();}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange());}set maxAnisotropy(e){this._style.maxAnisotropy=e;}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e;}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e;}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e;}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e;}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e;}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e;}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e;}_onStyleChange(){this.emit("styleChange",this);}update(){if(this.resource){let e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this);}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners();}unload(){this._resourceId=de("resource"),this.emit("change",this),this.emit("unload",this);}get resourceWidth(){let{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){let{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e);}resize(e,t,i){i||(i=this._resolution),e||(e=this.width),t||(t=this.height);let s=Math.round(e*i),n=Math.round(t*i);return this.width=s/i,this.height=n/i,this._resolution=i,this.pixelWidth===s&&this.pixelHeight===n?false:(this._refreshPOT(),this.pixelWidth=s,this.pixelHeight=n,this.emit("resize",this),this._resourceId=de("resource"),this.emit("change",this),true)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this);}set wrapMode(e){this._style.wrapMode=e;}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e;}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Yh(this.pixelWidth)&&Yh(this.pixelHeight);}static test(e){throw new Error("Unimplemented")}};w3.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:false,sampleCount:1,antialias:false,autoGarbageCollect:false};xe=w3;});function XG(){for(let r=0;r<16;r++){let e=[];Jv.push(e);for(let t=0;t<16;t++){let i=tg(Oo[r]*Oo[t]+Go[r]*Fo[t]),s=tg(Fo[r]*Oo[t]+Uo[r]*Fo[t]),n=tg(Oo[r]*Go[t]+Go[r]*Uo[t]),o=tg(Fo[r]*Go[t]+Uo[r]*Uo[t]);for(let a=0;a<16;a++)if(Oo[a]===i&&Fo[a]===s&&Go[a]===n&&Uo[a]===o){e.push(a);break}}}for(let r=0;r<16;r++){let e=new O;e.set(Oo[r],Fo[r],Go[r],Uo[r],0,0),M3.push(e);}}var Oo,Fo,Go,Uo,Jv,M3,tg,le,jh=p(()=>{Te();Oo=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Fo=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Go=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Uo=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Jv=[],M3=[],tg=Math.sign;XG();le={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:r=>Oo[r],uY:r=>Fo[r],vX:r=>Go[r],vY:r=>Uo[r],inv:r=>r&8?r&15:-r&7,add:(r,e)=>Jv[r][e],sub:(r,e)=>Jv[r][le.inv(e)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,e)=>Math.abs(r)*2<=Math.abs(e)?e>=0?le.S:le.N:Math.abs(e)*2<=Math.abs(r)?r>0?le.E:le.W:e>0?r>0?le.SE:le.SW:r>0?le.NE:le.NW,matrixAppendRotationInv:(r,e,t=0,i=0)=>{let s=M3[le.inv(e)];s.tx=t,s.ty=i,r.append(s);},transformRectCoords:(r,e,t,i)=>{let{x:s,y:n,width:o,height:a}=r,{x:u,y:l,width:c,height:h}=e;return t===le.E?(i.set(s+u,n+l,o,a),i):t===le.S?i.set(c-n-a+u,s+l,a,o):t===le.W?i.set(c-s-o+u,h-n-a+l,o,a):t===le.N?i.set(n+u,h-s-o+l,a,o):i.set(s+u,n+l,o,a)}};});var $h,eT=p(()=>{$h=()=>{};});var As,rg=p(()=>{P();Mt();As=class extends xe{constructor(e){let t=e.resource||new Float32Array(e.width*e.height*4),i=e.format;i||(t instanceof Float32Array?i="rgba32float":t instanceof Int32Array||t instanceof Uint32Array?i="rgba32uint":t instanceof Int16Array||t instanceof Uint16Array?i="rgba16uint":(i="bgra8unorm")),super({...e,resource:t,format:i}),this.uploadMethodId="buffer";}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}};As.extension=b.TextureSource;});var R3,un,ig=p(()=>{Te();R3=new O,un=class{constructor(e,t){this.mapCoord=new O,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof t>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=t,this.isSimple=false,this.texture=e;}get texture(){return this._texture}set texture(e){this.texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update());}multiplyUvs(e,t){t===void 0&&(t=e);let i=this.mapCoord;for(let s=0;s<e.length;s+=2){let n=e[s],o=e[s+1];t[s]=n*i.a+o*i.c+i.tx,t[s+1]=n*i.b+o*i.d+i.ty;}return t}update(){let e=this._texture;this._updateID++;let t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);let i=e.orig,s=e.trim;s&&(R3.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(R3));let n=e.source,o=this.uClampFrame,a=this.clampMargin/n._resolution,u=this.clampOffset/n._resolution;return o[0]=(e.frame.x+a+u)/n.width,o[1]=(e.frame.y+a+u)/n.height,o[2]=(e.frame.x+e.frame.width-a+u)/n.width,o[3]=(e.frame.y+e.frame.height-a+u)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=e.frame.width===n.width&&e.frame.height===n.height&&e.rotate===0,true}};});var B,Se=p(()=>{Wt();jh();xt();Pt();Pe();eT();rg();Mt();ig();B=class extends ve{constructor({source:e,label:t,frame:i,orig:s,trim:n,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=de("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new re,this.noFrame=false,this.dynamic=false,this.isTexture=true,this.label=t,this.source=e?.source??new xe,this.noFrame=!i,i)this.frame.copyFrom(i);else {let{width:c,height:h}=this._source;this.frame.width=c,this.frame.height=h;}this.orig=s||this.frame,this.trim=n,this.rotate=u??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=false,this.dynamic=l||false,this.updateUvs();}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this);}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new un(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:e,frame:t}=this,{width:i,height:s}=this._source,n=t.x/i,o=t.y/s,a=t.width/i,u=t.height/s,l=this.rotate;if(l){let c=a/2,h=u/2,d=n+c,f=o+h;l=le.add(l,le.NW),e.x0=d+c*le.uX(l),e.y0=f+h*le.uY(l),l=le.add(l,2),e.x1=d+c*le.uX(l),e.y1=f+h*le.uY(l),l=le.add(l,2),e.x2=d+c*le.uX(l),e.y2=f+h*le.uY(l),l=le.add(l,2),e.x3=d+c*le.uX(l),e.y3=f+h*le.uY(l);}else e.x0=n,e.y0=o,e.x1=n+a,e.y1=o,e.x2=n+a,e.y2=o+u,e.x3=n,e.y3=o+u;}destroy(e=false){this._source&&e&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=true,this.emit("destroy",this),this.removeAllListeners();}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this);}get baseTexture(){return G(Y,"Texture.baseTexture is now Texture.source"),this._source}};B.EMPTY=new B({label:"EMPTY",source:new xe({label:"EMPTY"})});B.EMPTY.destroy=$h;B.WHITE=new B({source:new As({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});B.WHITE.destroy=$h;});var YG,qh,Oe,gi=p(()=>{tl();Mt();Se();ji();YG=0,qh=class{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=false,this.textureStyle=new mt(this.textureOptions);}createTexture(e,t,i){let s=new xe({...this.textureOptions,width:e,height:t,resolution:1,antialias:i,autoGarbageCollect:false});return new B({source:s,label:`texturePool_${YG++}`})}getOptimalTexture(e,t,i=1,s){let n=Math.ceil(e*i-1e-6),o=Math.ceil(t*i-1e-6);n=mi(n),o=mi(o);let a=(n<<17)+(o<<1)+(s?1:0);this._texturePool[a]||(this._texturePool[a]=[]);let u=this._texturePool[a].pop();return u||(u=this.createTexture(n,o,s)),u.source._resolution=i,u.source.width=n/i,u.source.height=o/i,u.source.pixelWidth=n,u.source.pixelHeight=o,u.frame.x=0,u.frame.y=0,u.frame.width=e,u.frame.height=t,u.updateUvs(),this._poolKeyHash[u.uid]=a,u}getSameSizeTexture(e,t=false){let i=e.source;return this.getOptimalTexture(e.width,e.height,i._resolution,t)}returnTexture(e,t=false){let i=this._poolKeyHash[e.uid];t&&(e.source.style=this.textureStyle),this._texturePool[i].push(e);}clear(e){if(e=e!==false,e)for(let t in this._texturePool){let i=this._texturePool[t];if(i)for(let s=0;s<i.length;s++)i[s].destroy(true);}this._texturePool={};}},Oe=new qh;});var rl,tT=p(()=>{Te();eg();gi();rl=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=false,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new O,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=true,this.instructionSet=new on,this._onRenderContainers=[],this.textureNeedsUpdate=true,this.isCachedAsTexture=false,this._matrixDirty=7;}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=true;let t=e.children;for(let i=0;i<t.length;i++){let s=t[i];s._updateFlags=15,this.addChild(s);}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=true,this.textureNeedsUpdate=true;}disableCacheAsTexture(){this.isCachedAsTexture=false,this.texture&&(Oe.returnTexture(this.texture,true),this.texture=null);}updateCacheTexture(){this.textureNeedsUpdate=true;}reset(){this.renderGroupChildren.length=0;for(let e in this.childrenToUpdate){let t=this.childrenToUpdate[e];t.list.fill(null),t.index=0;}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=true,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture();}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e);}_removeRenderGroupChild(e){let t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null;}addChild(e){if(this.structureDidChange=true,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=true,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);let t=e.children;for(let i=0;i<t.length;i++)this.addChild(t[i]);}removeChild(e){if(this.structureDidChange=true,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}let t=e.children;for(let i=0;i<t.length;i++)this.removeChild(t[i]);}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t]);}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||(t=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),t.list[t.index++]=e;}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=false);}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e;}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e);}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1);}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e);}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null;}getChildren(e=[]){let t=this.root.children;for(let i=0;i<t.length;i++)this._getChildren(t[i],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;let i=e.children;for(let s=0;s<i.length;s++)this._getChildren(i[s],t);return t}invalidateMatrices(){this._matrixDirty=7;}get inverseWorldTransform(){return (this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new O),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return (this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new O),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;let e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new O),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};});function Lo(r,e,t={}){for(let i in e)!t[i]&&e[i]!==void 0&&(r[i]=e[i]);}var sg=p(()=>{});var rT,ng,iT,og,No,il,ln,B3,J,Yt=p(()=>{Wt();vt();Uv();P();Te();Om();tn();Pt();Pe();Ae();Xi();Vv();Hv();zv();Xv();Yv();jv();qm();qv();Kv();Zv();Qv();tT();sg();rT=new ke(null),ng=new ke(null),iT=new ke(null,1,1),og=new ke(null),No=1,il=2,ln=4,B3=8,J=class r extends ve{constructor(e={}){super(),this.uid=de("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=false,this.didViewUpdate=false,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=true,this.measurable=true,this.isSimple=true,this.updateTick=-1,this.localTransform=new O,this.relativeGroupTransform=new O,this.groupTransform=this.relativeGroupTransform,this.destroyed=false,this._position=new ke(this,0,0),this._scale=iT,this._pivot=ng,this._origin=og,this._skew=rT,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Lo(this,e,{children:true,parent:true,effects:true}),e.children?.forEach(t=>this.addChild(t)),e.parent?.addChild(this);}static mixin(e){G("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),V.mixin(r,e);}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095;}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||G(Y,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let s=0;s<e.length;s++)this.addChild(e[s]);return e[0]}let t=e[0],i=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),i&&(i.structureDidChange=true),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=true),t.parent=this,t.didChange=true,t._updateFlags=15,i&&i.addChild(t),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let s=0;s<e.length;s++)this.removeChild(e[s]);return e[0]}let t=e[0],i=this.children.indexOf(t);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit("childRemoved",t,this,i),t.emit("removed",this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=true,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this));}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup());}get isRenderGroup(){return !!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=He.get(rl,this),this.groupTransform=O.IDENTITY,e?.addChild(this),this._updateIsSimple();}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),He.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple();}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0;}get worldTransform(){return this._worldTransform||(this._worldTransform=new O),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e;}get y(){return this._position.y}set y(e){this._position.y=e;}get position(){return this._position}set position(e){this._position.copyFrom(e);}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew));}get angle(){return this.rotation*Dm}set angle(e){this.rotation=e*km;}get pivot(){return this._pivot===ng&&(this._pivot=new ke(this,0,0)),this._pivot}set pivot(e){this._pivot===ng&&(this._pivot=new ke(this,0,0),this._origin!==og&&U("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e);}get skew(){return this._skew===rT&&(this._skew=new ke(this,0,0)),this._skew}set skew(e){this._skew===rT&&(this._skew=new ke(this,0,0)),this._skew.copyFrom(e);}get scale(){return this._scale===iT&&(this._scale=new ke(this,1,1)),this._scale}set scale(e){this._scale===iT&&(this._scale=new ke(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e);}get origin(){return this._origin===og&&(this._origin=new ke(this,0,0)),this._origin}set origin(e){this._origin===og&&(this._origin=new ke(this,0,0),this._pivot!==ng&&U("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.copyFrom(e);}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){let t=this.getLocalBounds().width;this._setWidth(e,t);}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){let t=this.getLocalBounds().height;this._setHeight(e,t);}getSize(e){e||(e={});let t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){let i=this.getLocalBounds();typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,i.width),t!==void 0&&this._setHeight(t,i.height);}_updateSkew(){let e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x);}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this);}updateLocalTransform(){let e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;let t=this.localTransform,i=this._scale,s=this._pivot,n=this._origin,o=this._position,a=i._x,u=i._y,l=s._x,c=s._y,h=-n._x,d=-n._y;t.a=this._cx*a,t.b=this._sx*a,t.c=this._cy*u,t.d=this._sy*u,t.tx=o._x-(l*t.a+c*t.c)+(h*t.a+d*t.c)-h,t.ty=o._y-(l*t.b+c*t.d)+(h*t.b+d*t.d)-d;}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=No,this._onUpdate());}get alpha(){return this.localAlpha}set tint(e){let i=te.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=No,this._onUpdate());}get tint(){return Es(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=il,this.localBlendMode=e,this._onUpdate());}get blendMode(){return this.localBlendMode}get visible(){return !!(this.localDisplayStatus&2)}set visible(e){let t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=ln,this.localDisplayStatus^=2,this._onUpdate());}get culled(){return !(this.localDisplayStatus&4)}set culled(e){let t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=ln,this.localDisplayStatus^=4,this._onUpdate());}get renderable(){return !!(this.localDisplayStatus&1)}set renderable(e){let t=e?1:0;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=ln,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._onUpdate());}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=false){if(this.destroyed)return;this.destroyed=true;let t;if(this.children.length&&(t=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e?.children)&&t)for(let s=0;s<t.length;++s)t[s].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null;}};V.mixin(J,Nm,Xm,Jm,Zm,Km,Hm,zm,Qm,Bm,Um,$m,Vm);});var Ft,cn=p(()=>{Ft=(r=>(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(Ft||{});});var hn,sT=p(()=>{hn=class{constructor(e,t=null,i=0,s=false){this.next=null,this.previous=null,this._destroyed=false,this._fn=e,this._context=t,this.priority=i,this._once=s;}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));let t=this.next;return this._once&&this.destroy(true),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this;}destroy(e=false){this._destroyed=true,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}};});var I3,_e,Cs=p(()=>{cn();sT();I3=class Br{constructor(){this.autoStart=false,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=false,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=false,this._lastFrame=-1,this._head=new hn(null,null,1/0),this.deltaMS=1/Br.targetFPMS,this.elapsedMS=1/Br.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)));};}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick));}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null);}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start();}add(e,t,i=Ft.NORMAL){return this._addListener(new hn(e,t,i))}addOnce(e,t,i=Ft.NORMAL){return this._addListener(new hn(e,t,i,true))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else {for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next;}e.previous||e.connect(i);}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=true,this._requestIfNeeded());}stop(){this.started&&(this.started=false,this._cancelIfNeeded());}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(true);this._head.destroy(),this._head=null;}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){let n=e-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=e-n%this._minElapsedMS;}this.deltaMS=t,this.deltaTime=this.deltaMS*Br.targetFPMS;let i=this._head,s=i.next;for(;s;)s=s.emit(this);i.next||this._cancelIfNeeded();}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e;}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){let t=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,t)/1e3,Br.targetFPMS);this._maxElapsedMS=1/i;}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else {let t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3);}}static get shared(){if(!Br._shared){let e=Br._shared=new Br;e.autoStart=true,e._protected=true;}return Br._shared}static get system(){if(!Br._system){let e=Br._system=new Br;e.autoStart=true,e._protected=true;}return Br._system}};I3.targetFPMS=.06;_e=I3;});var dn,ag=p(()=>{cn();Cs();dn=class{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=false,this.updateTranslation=()=>{if(!this._canvas)return;let t=this._canvas.getBoundingClientRect(),i=this._canvas.width,s=this._canvas.height,n=t.width/i*this._renderer.resolution,o=t.height/s*this._renderer.resolution,a=t.left,u=t.top,l=`translate(${a}px, ${u}px) scale(${n}, ${o})`;l!==this._lastTransform&&(this._domElement.style.transform=l,this._lastTransform=l);},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver());}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation());}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(let t of e){if(t.target!==this._canvas)continue;let i=this.canvas.width,s=this.canvas.height,n=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/s*this._renderer.resolution;(this._lastScaleX!==n||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=n,this._lastScaleY=o);}}),this._observer.observe(this._canvas)):this._tickerAttached||_e.shared.add(this.updateTranslation,this,Ft.HIGH);}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&_e.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=false,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null;}};});var $i,Kh=p(()=>{_r();$i=class r{constructor(e){this.bubbles=true,this.cancelBubble=true,this.cancelable=false,this.composed=false,this.defaultPrevented=false,this.eventPhase=r.prototype.NONE,this.propagationStopped=false,this.propagationImmediatelyStopped=false,this.layer=new ge,this.page=new ge,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e;}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,s,n){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=true;}stopImmediatePropagation(){this.propagationImmediatelyStopped=true;}stopPropagation(){this.propagationStopped=true;}};});function jG(r){return function(e){return e.test(r)}}function Zh(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var s=jG(t),n={apple:{phone:s(nT)&&!s(ws),ipod:s(D3),tablet:!s(nT)&&(s(k3)||z3(e))&&!s(ws),universal:s(O3),device:(s(nT)||s(D3)||s(k3)||s(O3)||z3(e))&&!s(ws)},amazon:{phone:s(sl),tablet:!s(sl)&&s(ug),device:s(sl)||s(ug)},android:{phone:!s(ws)&&s(sl)||!s(ws)&&s(oT),tablet:!s(ws)&&!s(sl)&&!s(oT)&&(s(ug)||s(F3)),device:!s(ws)&&(s(sl)||s(ug)||s(oT)||s(F3))||s(/\bokhttp\b/i)},windows:{phone:s(ws),tablet:s(G3),device:s(ws)||s(G3)},other:{blackberry:s(U3),blackberry10:s(L3),opera:s(N3),firefox:s(H3),chrome:s(V3),device:s(U3)||s(L3)||s(N3)||s(H3)||s(V3)},any:false,phone:false,tablet:false};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}var nT,D3,k3,O3,oT,F3,sl,ug,ws,G3,U3,L3,N3,V3,H3,z3,aT=p(()=>{nT=/iPhone/i,D3=/iPod/i,k3=/iPad/i,O3=/\biOS-universal(?:.+)Mac\b/i,oT=/\bAndroid(?:.+)Mobile\b/i,F3=/Android/i,sl=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,ug=/Silk/i,ws=/Windows Phone/i,G3=/\bWindows(?:.+)ARM\b/i,U3=/BlackBerry/i,L3=/BB10/i,N3=/Opera Mini/i,V3=/\b(CriOS|Chrome)(?:.+)Mobile/i,H3=/Mobile(?:.+)Firefox\b/i,z3=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};});var W3=p(()=>{aT();aT();});var $G,lg,uT=p(()=>{W3();$G=Zh.default??Zh,lg=$G(globalThis.navigator);});var qG,X3,KG,ZG,Y3,j3,QG,JG,eU,lT,cg,cT=p(()=>{ag();Kh();P();uT();Lm();qG=9,X3=100,KG=0,ZG=0,Y3=2,j3=1,QG=-1e3,JG=-1e3,eU=2,lT=class $3{constructor(e,t=lg){this._mobileInfo=t,this.debug=false,this._activateOnTab=true,this._deactivateOnMouseMove=true,this._isActive=false,this._isMobileAccessibility=false,this._div=null,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e;}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){let e=document.createElement("button");e.style.width=`${j3}px`,e.style.height=`${j3}px`,e.style.position="absolute",e.style.top=`${QG}px`,e.style.left=`${JG}px`,e.style.zIndex=eU.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=true,this._activate(),this._destroyTouchHook();}),document.body.appendChild(e),this._hookDiv=e;}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null);}_activate(){if(this._isActive)return;this._isActive=true,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${KG}px`,this._div.style.left=`${ZG}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=Y3.toString(),this._canvasObserver=new dn({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._deactivateOnMouseMove&&(this._onMouseMove=this._onMouseMove.bind(this),globalThis.document.addEventListener("mousemove",this._onMouseMove,true));let e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else {let t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup());});t.observe(document.body,{childList:true,subtree:true});}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered);}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=false,globalThis.document.removeEventListener("mousemove",this._onMouseMove,true),this._activateOnTab&&globalThis.addEventListener("keydown",this._onKeyDown,false),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv&&e._accessibleDiv.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=false;this._pool.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e);}),this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pool=[],this._children=[];}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i]);}init(e){let i={accessibilityOptions:{...$3.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault?this._activate():this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._renderer.runners.postrender.remove(this);}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i));}for(let i=this._children.length-1;i>=0;i--){let s=this._children[i];t.has(i)||(s._accessibleDiv&&s._accessibleDiv.parentNode&&(s._accessibleDiv.parentNode.removeChild(s._accessibleDiv),this._pool.push(s._accessibleDiv),s._accessibleDiv=null),s._accessibleActive=false,Zu(this._children,i,1));}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i<this._children.length;i++){let s=this._children[i];if(!s._accessibleActive||!s._accessibleDiv)continue;let n=s._accessibleDiv,o=s.hitArea||s.getBounds().rectangle;if(s.hitArea){let a=s.worldTransform;n.style.left=`${a.tx+o.x*a.a}px`,n.style.top=`${a.ty+o.y*a.d}px`,n.style.width=`${o.width*a.a}px`,n.style.height=`${o.height*a.d}px`;}else this._capHitArea(o),n.style.left=`${o.x}px`,n.style.top=`${o.y}px`,n.style.width=`${o.width}px`,n.style.height=`${o.height}px`;}this._renderId++;}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`;}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y);}_addChild(e){let t=this._pool.pop();t||(e.accessibleType==="button"?t=document.createElement("button"):(t=document.createElement(e.accessibleType),t.style.cssText=`
|
|
6
|
+
Deprecated since v${r}`),console.warn(i))),x3[e]=true;}var x3,Y,Fm,Pe=p(()=>{x3={},Y="8.0.0",Fm="8.3.4";});function U(...r){Nv!==_3&&(Nv++,Nv===_3?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r));}var Nv,_3,Ae=p(()=>{Nv=0,_3=500;});var Ss,Gm=p(()=>{Ss=class{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t);}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e;}get(e){let t;return this._index>0?t=this._pool[--this._index]:t=new this._classType,t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e;}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0;}};});var Vh,He,Xi=p(()=>{Gm();Vh=class{constructor(){this._poolsByClass=new Map;}prepopulate(e,t){this.getPool(e).prepopulate(t);}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e);}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new Ss(e)),this._poolsByClass.get(e)}stats(){let e={};return this._poolsByClass.forEach(t=>{let i=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[i]={free:t.totalFree,used:t.totalUsed,size:t.totalSize};}),e}},He=new Vh;});var Um,Vv=p(()=>{Pe();Um={get isCachedAsTexture(){return !!this.renderGroup?.isCachedAsTexture},cacheAsTexture(r){typeof r=="boolean"&&r===false?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(r===true?{}:r));},updateCacheTexture(){this.renderGroup?.updateCacheTexture();},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(r){G("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r);}};});function Zu(r,e,t){let i=r.length,s;if(e>=i||t===0)return;t=e+t>i?i-e:t;let n=i-t;for(s=e;s<n;++s)r[s]=r[s+t];r.length=n;}var Lm=p(()=>{});var Nm,Hv=p(()=>{Lm();Pe();Nm={allowChildren:true,removeChildren(r=0,e){let t=e??this.children.length,i=t-r,s=[];if(i>0&&i<=t){for(let o=t-1;o>=r;o--){let a=this.children[o];a&&(s.push(a),a.parent=null);}Zu(this.children,r,t);let n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(s);for(let o=0;o<s.length;++o){let a=s[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,o),s[o].emit("removed",this);}return s.length>0&&this._didViewChangeTick++,s}else if(i===0&&this.children.length===0)return s;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(r){let e=this.getChildAt(r);return this.removeChild(e)},getChildAt(r){if(r<0||r>=this.children.length)throw new Error(`getChildAt: Index (${r}) does not exist.`);return this.children[r]},setChildIndex(r,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(r),this.addChildAt(r,e);},getChildIndex(r){let e=this.children.indexOf(r);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(r,e){this.allowChildren||G(Y,"addChildAt: Only Containers will be allowed to add children in v8.0.0");let{children:t}=this;if(e<0||e>t.length)throw new Error(`${r}addChildAt: The index ${e} supplied is out of bounds ${t.length}`);if(r.parent){let s=r.parent.children.indexOf(r);if(r.parent===this&&s===e)return r;s!==-1&&r.parent.children.splice(s,1);}e===t.length?t.push(r):t.splice(e,0,r),r.parent=this,r.didChange=true,r._updateFlags=15;let i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(r),this.sortableChildren&&(this.sortDirty=true),this.emit("childAdded",r,this,e),r.emit("added",this),r},swapChildren(r,e){if(r===e)return;let t=this.getChildIndex(r),i=this.getChildIndex(e);this.children[t]=e,this.children[i]=r;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true),this._didContainerChangeTick++;},removeFromParent(){this.parent?.removeChild(this);},reparentChild(...r){return r.length===1?this.reparentChildAt(r[0],this.children.length):(r.forEach(e=>this.reparentChildAt(e,this.children.length)),r[0])},reparentChildAt(r,e){if(r.parent===this)return this.setChildIndex(r,e),r;let t=r.worldTransform.clone();r.removeFromParent(),this.addChildAt(r,e);let i=this.worldTransform.clone();return i.invert(),t.prepend(i),r.setFromMatrix(t),r},replaceChild(r,e){r.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(r)),e.setFromMatrix(r.localTransform),e.updateLocalTransform(),this.removeChild(r);}};});var Vm,zv=p(()=>{Vm={collectRenderables(r,e,t){this.parentRenderLayer&&this.parentRenderLayer!==t||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(r,e,t):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,r):this.collectRenderablesWithEffects(r,e,t));},collectRenderablesSimple(r,e,t){let i=this.children,s=i.length;for(let n=0;n<s;n++)i[n].collectRenderables(r,e,t);},collectRenderablesWithEffects(r,e,t){let{renderPipes:i}=e;for(let s=0;s<this.effects.length;s++){let n=this.effects[s];i[n.pipe].push(n,this,r);}this.collectRenderablesSimple(r,e,t);for(let s=this.effects.length-1;s>=0;s--){let n=this.effects[s];i[n.pipe].pop(n,this,r);}}};});var pi,Hh=p(()=>{pi=class{constructor(){this.pipe="filter",this.priority=1;}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null;}};});var zh,Qu,Wv=p(()=>{P();Xi();zh=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=false;}init(){this._initialized||(this._initialized=true,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e});}));}add(e){this._tests.push(e);}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){let i=this._tests[t];if(i.test(e))return He.get(i.maskClass,e)}return e}returnMaskEffect(e){He.return(e);}},Qu=new zh;V.handleByList(b.MaskEffect,Qu._effectClasses);});var Hm,Xv=p(()=>{Hh();Wv();Hm={_maskEffect:null,_maskOptions:{inverse:false},_filterEffect:null,effects:[],_markStructureAsChanged(){let r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=true);},addEffect(r){this.effects.indexOf(r)===-1&&(this.effects.push(r),this.effects.sort((t,i)=>t.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple());},removeEffect(r){let e=this.effects.indexOf(r);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple());},set mask(r){let e=this._maskEffect;e?.mask!==r&&(e&&(this.removeEffect(e),Qu.returnMaskEffect(e),this._maskEffect=null),r!=null&&(this._maskEffect=Qu.getMaskEffect(r),this.addEffect(this._maskEffect)));},get mask(){return this._maskEffect?.mask},setMask(r){this._maskOptions={...this._maskOptions,...r},r.mask&&(this.mask=r.mask),this._markStructureAsChanged();},set filters(r){!Array.isArray(r)&&r&&(r=[r]);let e=this._filterEffect||(this._filterEffect=new pi);r=r;let t=r?.length>0,i=e.filters?.length>0,s=t!==i;r=Array.isArray(r)?r.slice(0):r,e.filters=Object.freeze(r),s&&(t?this.addEffect(e):(this.removeEffect(e),e.filters=r??null));},get filters(){return this._filterEffect?.filters},set filterArea(r){this._filterEffect||(this._filterEffect=new pi),this._filterEffect.filterArea=r;},get filterArea(){return this._filterEffect?.filterArea}};});var zm,Yv=p(()=>{Pe();zm={label:null,get name(){return G(Y,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){G(Y,"Container.name property has been removed, use Container.label instead"),this.label=r;},getChildByName(r,e=false){return this.getChildByLabel(r,e)},getChildByLabel(r,e=false){let t=this.children;for(let i=0;i<t.length;i++){let s=t[i];if(s.label===r||r instanceof RegExp&&r.test(s.label))return s}if(e)for(let i=0;i<t.length;i++){let n=t[i].getChildByLabel(r,true);if(n)return n}return null},getChildrenByLabel(r,e=false,t=[]){let i=this.children;for(let s=0;s<i.length;s++){let n=i[s];(n.label===r||r instanceof RegExp&&r.test(n.label))&&t.push(n);}if(e)for(let s=0;s<i.length;s++)i[s].getChildrenByLabel(r,true,t);return t}};});var Wm,re,xt=p(()=>{_r();Wm=[new ge,new ge,new ge,new ge],re=class r{constructor(e=0,t=0,i=0,s=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(s);}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new r(0,0,0,0)}clone(){return new r(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?false:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,i,s=.5){let{width:n,height:o}=this;if(n<=0||o<=0)return false;let a=this.x,u=this.y,l=i*(1-s),c=i-l,h=a-l,d=a+n+l,f=u-l,m=u+o+l,_=a+c,x=a+n-c,g=u+c,y=u+o-c;return e>=h&&e<=d&&t>=f&&t<=m&&!(e>_&&e<x&&t>g&&t<y)}intersects(e,t){if(!t){let D=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=D)return false;let L=this.y<e.y?e.y:this.y;return (this.bottom>e.bottom?e.bottom:this.bottom)>L}let i=this.left,s=this.right,n=this.top,o=this.bottom;if(s<=i||o<=n)return false;let a=Wm[0].set(e.left,e.top),u=Wm[1].set(e.left,e.bottom),l=Wm[2].set(e.right,e.top),c=Wm[3].set(e.right,e.bottom);if(l.x<=a.x||u.y<=a.y)return false;let h=Math.sign(t.a*t.d-t.b*t.c);if(h===0||(t.apply(a,a),t.apply(u,u),t.apply(l,l),t.apply(c,c),Math.max(a.x,u.x,l.x,c.x)<=i||Math.min(a.x,u.x,l.x,c.x)>=s||Math.max(a.y,u.y,l.y,c.y)<=n||Math.min(a.y,u.y,l.y,c.y)>=o))return false;let d=h*(u.y-a.y),f=h*(a.x-u.x),m=d*i+f*n,_=d*s+f*n,x=d*i+f*o,g=d*s+f*o;if(Math.max(m,_,x,g)<=d*a.x+f*a.y||Math.min(m,_,x,g)>=d*c.x+f*c.y)return false;let y=h*(a.y-l.y),v=h*(l.x-a.x),S=y*i+v*n,C=y*s+v*n,E=y*i+v*o,M=y*s+v*o;return !(Math.max(S,C,E,M)<=y*a.x+v*a.y||Math.min(S,C,E,M)>=y*c.x+v*c.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){let t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),s=Math.max(this.y,e.y),n=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=s,this.height=Math.max(n-s,0),this}ceil(e=1,t=.001){let i=Math.ceil((this.x+this.width-t)*e)/e,s=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=s-this.y,this}scale(e,t=e){return this.x*=e,this.y*=t,this.width*=e,this.height*=t,this}enlarge(e){let t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),s=Math.min(this.y,e.y),n=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=s,this.height=n-s,this}getBounds(e){return e||(e=new r),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return false;let t=e.x,i=e.y,s=e.x+e.width,n=e.y+e.height;return t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height&&s>=this.x&&s<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(e,t,i,s){return this.x=e,this.y=t,this.width=i,this.height=s,this}toString(){return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};});var b3,Me,Xt=p(()=>{Te();xt();b3=new O,Me=class r{constructor(e=1/0,t=1/0,i=-1/0,s=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=b3,this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new re);let e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=b3,this}set(e,t,i,s){this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}addFrame(e,t,i,s,n){n||(n=this.matrix);let o=n.a,a=n.b,u=n.c,l=n.d,c=n.tx,h=n.ty,d=this.minX,f=this.minY,m=this.maxX,_=this.maxY,x=o*e+u*t+c,g=a*e+l*t+h;x<d&&(d=x),g<f&&(f=g),x>m&&(m=x),g>_&&(_=g),x=o*i+u*t+c,g=a*i+l*t+h,x<d&&(d=x),g<f&&(f=g),x>m&&(m=x),g>_&&(_=g),x=o*e+u*s+c,g=a*e+l*s+h,x<d&&(d=x),g<f&&(f=g),x>m&&(m=x),g>_&&(_=g),x=o*i+u*s+c,g=a*i+l*s+h,x<d&&(d=x),g<f&&(f=g),x>m&&(m=x),g>_&&(_=g),this.minX=d,this.minY=f,this.maxX=m,this.maxY=_;}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t);}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t);}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY;}applyMatrix(e){let t=this.minX,i=this.minY,s=this.maxX,n=this.maxY,{a:o,b:a,c:u,d:l,tx:c,ty:h}=e,d=o*t+u*i+c,f=a*t+l*i+h;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=o*s+u*i+c,f=a*s+l*i+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*t+u*n+c,f=a*t+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*s+u*n+c,f=a*s+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY;}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,i,s){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<i&&(this.minY=i),this.maxY>s&&(this.maxY=s),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new r(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){let t=this.maxX-this.minX;this.minX=e,this.maxX=e+t;}get y(){return this.minY}set y(e){let t=this.maxY-this.minY;this.minY=e,this.maxY=e+t;}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e;}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e;}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,t,i,s){let n=this.minX,o=this.minY,a=this.maxX,u=this.maxY;s||(s=this.matrix);let l=s.a,c=s.b,h=s.c,d=s.d,f=s.tx,m=s.ty;for(let _=t;_<i;_+=2){let x=e[_],g=e[_+1],y=l*x+h*g+f,v=c*x+d*g+m;n=y<n?y:n,o=v<o?v:o,a=y>a?y:a,u=v>u?v:u;}this.minX=n,this.minY=o,this.maxX=a,this.maxY=u;}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}};});var pt,dr,rn=p(()=>{Te();Gm();Xt();pt=new Ss(O),dr=new Ss(Me);});var VG,Xm,jv=p(()=>{Te();Xt();rn();VG=new O,Xm={getFastGlobalBounds(r,e){e||(e=new Me),e.clear(),this._getGlobalBoundsRecursive(!!r,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);let t=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(t.worldTransform),e},_getGlobalBoundsRecursive(r,e,t){let i=e;if(r&&this.parentRenderLayer&&this.parentRenderLayer!==t||this.localDisplayStatus!==7||!this.measurable)return;let s=!!this.effects.length;if((this.renderGroup||s)&&(i=dr.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else {if(this.renderPipeId){let o=this.bounds;i.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform);}let n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(r,i,t);}if(s){let n=false,o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(n||(n=true,i.applyMatrix(o.worldTransform)),this.effects[a].addBounds(i,true));n&&i.applyMatrix(o.worldTransform.copyTo(VG).invert()),e.addBounds(i),dr.return(i);}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),dr.return(i));}};});function Yi(r,e,t){t.clear();let i,s;return r.parent?e?i=r.parent.worldTransform:(s=pt.get().identity(),i=Ju(r,s)):i=O.IDENTITY,y3(r,t,i,e),s&&pt.return(s),t.isValid||t.set(0,0,0,0),t}function y3(r,e,t,i){if(!r.visible||!r.measurable)return;let s;i?s=r.worldTransform:(r.updateLocalTransform(),s=pt.get(),s.appendFrom(r.localTransform,t));let n=e,o=!!r.effects.length;if(o&&(e=dr.get().clear()),r.boundsArea)e.addRect(r.boundsArea,s);else {r.bounds&&(e.matrix=s,e.addBounds(r.bounds));for(let a=0;a<r.children.length;a++)y3(r.children[a],e,s,i);}if(o){for(let a=0;a<r.effects.length;a++)r.effects[a].addBounds?.(e);n.addBounds(e,O.IDENTITY),dr.return(e);}i||pt.return(s);}function Ju(r,e){let t=r.parent;return t&&(Ju(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}var ko=p(()=>{Te();rn();});function el(r,e){if(r===16777215||!e)return e;if(e===16777215||!r)return r;let t=r>>16&255,i=r>>8&255,s=r&255,n=e>>16&255,o=e>>8&255,a=e&255,u=t*n/255|0,l=i*o/255|0,c=s*a/255|0;return (u<<16)+(l<<8)+c}var Ym=p(()=>{});function sn(r,e){return r===v3?e:e===v3?r:el(r,e)}var v3,jm=p(()=>{Ym();v3=16777215;});function Es(r){return ((r&255)<<16)+(r&65280)+(r>>16&255)}var $m,qm=p(()=>{Te();ko();rn();jm();$m={getGlobalAlpha(r){if(r)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,t=this.parent;for(;t;)e*=t.alpha,t=t.parent;return e},getGlobalTransform(r=new O,e){if(e)return r.copyFrom(this.worldTransform);this.updateLocalTransform();let t=Ju(this,pt.get().identity());return r.appendFrom(this.localTransform,t),pt.return(t),r},getGlobalTint(r){if(r)return this.renderGroup?Es(this.renderGroup.worldColor):this.parentRenderGroup?Es(sn(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=sn(e,t.localColor),t=t.parent;return Es(e)}};});function nn(r,e,t){return e.clear(),t||(t=O.IDENTITY),T3(r,e,t,r,true),e.isValid||e.set(0,0,0,0),e}function T3(r,e,t,i,s){let n;if(s)n=pt.get(),n=t.copyTo(n);else {if(!r.visible||!r.measurable)return;r.updateLocalTransform();let u=r.localTransform;n=pt.get(),n.appendFrom(u,t);}let o=e,a=!!r.effects.length;if(a&&(e=dr.get().clear()),r.boundsArea)e.addRect(r.boundsArea,n);else {r.renderPipeId&&(e.matrix=n,e.addBounds(r.bounds));let u=r.children;for(let l=0;l<u.length;l++)T3(u[l],e,n,i,false);}if(a){for(let u=0;u<r.effects.length;u++)r.effects[u].addLocalBounds?.(e,i);o.addBounds(e,O.IDENTITY),dr.return(e);}pt.return(n);}var Wh=p(()=>{Te();rn();});function Xh(r,e){let t=r.children;for(let i=0;i<t.length;i++){let s=t[i],n=s.uid,o=(s._didViewChangeTick&65535)<<16|s._didContainerChangeTick&65535,a=e.index;(e.data[a]!==n||e.data[a+1]!==o)&&(e.data[e.index]=n,e.data[e.index+1]=o,e.didChange=true),e.index=a+2,s.children.length&&Xh(s,e);}return e.didChange}var $v=p(()=>{});var HG,Km,qv=p(()=>{Te();Xt();ko();Wh();$v();HG=new O,Km={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(r,e){let t=Math.sign(this.scale.x)||1;e!==0?this.scale.x=r/e*t:this.scale.x=t;},_setHeight(r,e){let t=Math.sign(this.scale.y)||1;e!==0?this.scale.y=r/e*t:this.scale.y=t;},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:false,localBounds:new Me});let r=this._localBoundsCacheData;return r.index=1,r.didChange=false,r.data[0]!==this._didViewChangeTick&&(r.didChange=true,r.data[0]=this._didViewChangeTick),Xh(this,r),r.didChange&&nn(this,r.localBounds,HG),r.localBounds},getBounds(r,e){return Yi(this,r,e||new Me)}};});var Zm,Kv=p(()=>{Zm={_onRender:null,set onRender(r){let e=this.renderGroup||this.parentRenderGroup;if(!r){this._onRender&&e?.removeOnRender(this),this._onRender=null;return}this._onRender||e?.addOnRender(this),this._onRender=r;},get onRender(){return this._onRender}};});function zG(r,e){return r._zIndex-e._zIndex}var Qm,Zv=p(()=>{Qm={_zIndex:0,sortDirty:false,sortableChildren:false,get zIndex(){return this._zIndex},set zIndex(r){this._zIndex!==r&&(this._zIndex=r,this.depthOfChildModified());},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=true,this.parent.sortDirty=true),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true);},sortChildren(){this.sortDirty&&(this.sortDirty=false,this.children.sort(zG));}};});var Jm,Qv=p(()=>{_r();rn();Jm={getGlobalPosition(r=new ge,e=false){return this.parent?this.parent.toGlobal(this._position,r,e):(r.x=this._position.x,r.y=this._position.y),r},toGlobal(r,e,t=false){let i=this.getGlobalTransform(pt.get(),t);return e=i.apply(r,e),pt.return(i),e},toLocal(r,e,t,i){e&&(r=e.toGlobal(r,t,i));let s=this.getGlobalTransform(pt.get(),i);return t=s.applyInverse(r,t),pt.return(s),t}};});var on,eg=p(()=>{Pt();on=class{constructor(){this.uid=de("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0;}reset(){this.instructionSize=0;}add(e){this.instructions[this.instructionSize++]=e;}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"]);}};});function mi(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Yh(r){return !(r&r-1)&&!!r}function S3(r){let e=(r>65535?1:0)<<4;r>>>=e;let t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}var tl=p(()=>{});function Ot(r){let e={};for(let t in r)r[t]!==void 0&&(e[t]=r[t]);return e}var an=p(()=>{});function WG(r){let e=E3[r];return e===void 0&&(E3[r]=de("resource")),e}var E3,A3,mt,ji=p(()=>{Wt();Pt();Pe();E3=Object.create(null);A3=class C3 extends ve{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=false,e={...C3.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1;}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e;}get addressMode(){return this.addressModeU}set wrapMode(e){G(Y,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e;}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e;}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear");}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null;}_generateResourceId(){let e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=WG(e),this._resourceId}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners();}};A3.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};mt=A3;});var w3,xe,Mt=p(()=>{Wt();tl();an();Pt();ji();w3=class P3 extends ve{constructor(e={}){super(),this.options=e,this.uid=de("textureSource"),this._resourceType="textureSource",this._resourceId=de("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=false,this.format="rgba8unorm",this.dimension="2d",this.antialias=false,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...P3.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new mt(Ot(e)),this.destroyed=false,this._refreshPOT();}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange());}set maxAnisotropy(e){this._style.maxAnisotropy=e;}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e;}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e;}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e;}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e;}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e;}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e;}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e;}_onStyleChange(){this.emit("styleChange",this);}update(){if(this.resource){let e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this);}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners();}unload(){this._resourceId=de("resource"),this.emit("change",this),this.emit("unload",this);}get resourceWidth(){let{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){let{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e);}resize(e,t,i){i||(i=this._resolution),e||(e=this.width),t||(t=this.height);let s=Math.round(e*i),n=Math.round(t*i);return this.width=s/i,this.height=n/i,this._resolution=i,this.pixelWidth===s&&this.pixelHeight===n?false:(this._refreshPOT(),this.pixelWidth=s,this.pixelHeight=n,this.emit("resize",this),this._resourceId=de("resource"),this.emit("change",this),true)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this);}set wrapMode(e){this._style.wrapMode=e;}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e;}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Yh(this.pixelWidth)&&Yh(this.pixelHeight);}static test(e){throw new Error("Unimplemented")}};w3.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:false,sampleCount:1,antialias:false,autoGarbageCollect:false};xe=w3;});function XG(){for(let r=0;r<16;r++){let e=[];Jv.push(e);for(let t=0;t<16;t++){let i=tg(Oo[r]*Oo[t]+Go[r]*Fo[t]),s=tg(Fo[r]*Oo[t]+Uo[r]*Fo[t]),n=tg(Oo[r]*Go[t]+Go[r]*Uo[t]),o=tg(Fo[r]*Go[t]+Uo[r]*Uo[t]);for(let a=0;a<16;a++)if(Oo[a]===i&&Fo[a]===s&&Go[a]===n&&Uo[a]===o){e.push(a);break}}}for(let r=0;r<16;r++){let e=new O;e.set(Oo[r],Fo[r],Go[r],Uo[r],0,0),M3.push(e);}}var Oo,Fo,Go,Uo,Jv,M3,tg,le,jh=p(()=>{Te();Oo=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Fo=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Go=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Uo=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Jv=[],M3=[],tg=Math.sign;XG();le={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:r=>Oo[r],uY:r=>Fo[r],vX:r=>Go[r],vY:r=>Uo[r],inv:r=>r&8?r&15:-r&7,add:(r,e)=>Jv[r][e],sub:(r,e)=>Jv[r][le.inv(e)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,e)=>Math.abs(r)*2<=Math.abs(e)?e>=0?le.S:le.N:Math.abs(e)*2<=Math.abs(r)?r>0?le.E:le.W:e>0?r>0?le.SE:le.SW:r>0?le.NE:le.NW,matrixAppendRotationInv:(r,e,t=0,i=0)=>{let s=M3[le.inv(e)];s.tx=t,s.ty=i,r.append(s);},transformRectCoords:(r,e,t,i)=>{let{x:s,y:n,width:o,height:a}=r,{x:u,y:l,width:c,height:h}=e;return t===le.E?(i.set(s+u,n+l,o,a),i):t===le.S?i.set(c-n-a+u,s+l,a,o):t===le.W?i.set(c-s-o+u,h-n-a+l,o,a):t===le.N?i.set(n+u,h-s-o+l,a,o):i.set(s+u,n+l,o,a)}};});var $h,eT=p(()=>{$h=()=>{};});var As,rg=p(()=>{P();Mt();As=class extends xe{constructor(e){let t=e.resource||new Float32Array(e.width*e.height*4),i=e.format;i||(t instanceof Float32Array?i="rgba32float":t instanceof Int32Array||t instanceof Uint32Array?i="rgba32uint":t instanceof Int16Array||t instanceof Uint16Array?i="rgba16uint":(i="bgra8unorm")),super({...e,resource:t,format:i}),this.uploadMethodId="buffer";}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}};As.extension=b.TextureSource;});var R3,un,ig=p(()=>{Te();R3=new O,un=class{constructor(e,t){this.mapCoord=new O,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof t>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=t,this.isSimple=false,this.texture=e;}get texture(){return this._texture}set texture(e){this.texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update());}multiplyUvs(e,t){t===void 0&&(t=e);let i=this.mapCoord;for(let s=0;s<e.length;s+=2){let n=e[s],o=e[s+1];t[s]=n*i.a+o*i.c+i.tx,t[s+1]=n*i.b+o*i.d+i.ty;}return t}update(){let e=this._texture;this._updateID++;let t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);let i=e.orig,s=e.trim;s&&(R3.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(R3));let n=e.source,o=this.uClampFrame,a=this.clampMargin/n._resolution,u=this.clampOffset/n._resolution;return o[0]=(e.frame.x+a+u)/n.width,o[1]=(e.frame.y+a+u)/n.height,o[2]=(e.frame.x+e.frame.width-a+u)/n.width,o[3]=(e.frame.y+e.frame.height-a+u)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=e.frame.width===n.width&&e.frame.height===n.height&&e.rotate===0,true}};});var B,Se=p(()=>{Wt();jh();xt();Pt();Pe();eT();rg();Mt();ig();B=class extends ve{constructor({source:e,label:t,frame:i,orig:s,trim:n,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=de("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new re,this.noFrame=false,this.dynamic=false,this.isTexture=true,this.label=t,this.source=e?.source??new xe,this.noFrame=!i,i)this.frame.copyFrom(i);else {let{width:c,height:h}=this._source;this.frame.width=c,this.frame.height=h;}this.orig=s||this.frame,this.trim=n,this.rotate=u??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=false,this.dynamic=l||false,this.updateUvs();}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this);}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new un(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:e,frame:t}=this,{width:i,height:s}=this._source,n=t.x/i,o=t.y/s,a=t.width/i,u=t.height/s,l=this.rotate;if(l){let c=a/2,h=u/2,d=n+c,f=o+h;l=le.add(l,le.NW),e.x0=d+c*le.uX(l),e.y0=f+h*le.uY(l),l=le.add(l,2),e.x1=d+c*le.uX(l),e.y1=f+h*le.uY(l),l=le.add(l,2),e.x2=d+c*le.uX(l),e.y2=f+h*le.uY(l),l=le.add(l,2),e.x3=d+c*le.uX(l),e.y3=f+h*le.uY(l);}else e.x0=n,e.y0=o,e.x1=n+a,e.y1=o,e.x2=n+a,e.y2=o+u,e.x3=n,e.y3=o+u;}destroy(e=false){this._source&&e&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=true,this.emit("destroy",this),this.removeAllListeners();}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this);}get baseTexture(){return G(Y,"Texture.baseTexture is now Texture.source"),this._source}};B.EMPTY=new B({label:"EMPTY",source:new xe({label:"EMPTY"})});B.EMPTY.destroy=$h;B.WHITE=new B({source:new As({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});B.WHITE.destroy=$h;});var YG,qh,Oe,gi=p(()=>{tl();Mt();Se();ji();YG=0,qh=class{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=false,this.textureStyle=new mt(this.textureOptions);}createTexture(e,t,i){let s=new xe({...this.textureOptions,width:e,height:t,resolution:1,antialias:i,autoGarbageCollect:false});return new B({source:s,label:`texturePool_${YG++}`})}getOptimalTexture(e,t,i=1,s){let n=Math.ceil(e*i-1e-6),o=Math.ceil(t*i-1e-6);n=mi(n),o=mi(o);let a=(n<<17)+(o<<1)+(s?1:0);this._texturePool[a]||(this._texturePool[a]=[]);let u=this._texturePool[a].pop();return u||(u=this.createTexture(n,o,s)),u.source._resolution=i,u.source.width=n/i,u.source.height=o/i,u.source.pixelWidth=n,u.source.pixelHeight=o,u.frame.x=0,u.frame.y=0,u.frame.width=e,u.frame.height=t,u.updateUvs(),this._poolKeyHash[u.uid]=a,u}getSameSizeTexture(e,t=false){let i=e.source;return this.getOptimalTexture(e.width,e.height,i._resolution,t)}returnTexture(e,t=false){let i=this._poolKeyHash[e.uid];t&&(e.source.style=this.textureStyle),this._texturePool[i].push(e);}clear(e){if(e=e!==false,e)for(let t in this._texturePool){let i=this._texturePool[t];if(i)for(let s=0;s<i.length;s++)i[s].destroy(true);}this._texturePool={};}},Oe=new qh;});var rl,tT=p(()=>{Te();eg();gi();rl=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=false,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new O,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=true,this.instructionSet=new on,this._onRenderContainers=[],this.textureNeedsUpdate=true,this.isCachedAsTexture=false,this._matrixDirty=7;}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=true;let t=e.children;for(let i=0;i<t.length;i++){let s=t[i];s._updateFlags=15,this.addChild(s);}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=true,this.textureNeedsUpdate=true;}disableCacheAsTexture(){this.isCachedAsTexture=false,this.texture&&(Oe.returnTexture(this.texture,true),this.texture=null);}updateCacheTexture(){this.textureNeedsUpdate=true;}reset(){this.renderGroupChildren.length=0;for(let e in this.childrenToUpdate){let t=this.childrenToUpdate[e];t.list.fill(null),t.index=0;}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=true,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture();}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e);}_removeRenderGroupChild(e){let t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null;}addChild(e){if(this.structureDidChange=true,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=true,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);let t=e.children;for(let i=0;i<t.length;i++)this.addChild(t[i]);}removeChild(e){if(this.structureDidChange=true,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}let t=e.children;for(let i=0;i<t.length;i++)this.removeChild(t[i]);}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t]);}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||(t=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),t.list[t.index++]=e;}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=false);}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e;}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e);}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1);}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e);}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null;}getChildren(e=[]){let t=this.root.children;for(let i=0;i<t.length;i++)this._getChildren(t[i],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;let i=e.children;for(let s=0;s<i.length;s++)this._getChildren(i[s],t);return t}invalidateMatrices(){this._matrixDirty=7;}get inverseWorldTransform(){return (this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new O),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return (this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new O),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;let e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new O),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};});function Lo(r,e,t={}){for(let i in e)!t[i]&&e[i]!==void 0&&(r[i]=e[i]);}var sg=p(()=>{});var rT,ng,iT,og,No,il,ln,B3,J,Yt=p(()=>{Wt();vt();Uv();P();Te();Om();tn();Pt();Pe();Ae();Xi();Vv();Hv();zv();Xv();Yv();jv();qm();qv();Kv();Zv();Qv();tT();sg();rT=new ke(null),ng=new ke(null),iT=new ke(null,1,1),og=new ke(null),No=1,il=2,ln=4,B3=8,J=class r extends ve{constructor(e={}){super(),this.uid=de("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=false,this.didViewUpdate=false,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=true,this.measurable=true,this.isSimple=true,this.updateTick=-1,this.localTransform=new O,this.relativeGroupTransform=new O,this.groupTransform=this.relativeGroupTransform,this.destroyed=false,this._position=new ke(this,0,0),this._scale=iT,this._pivot=ng,this._origin=og,this._skew=rT,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Lo(this,e,{children:true,parent:true,effects:true}),e.children?.forEach(t=>this.addChild(t)),e.parent?.addChild(this);}static mixin(e){G("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),V.mixin(r,e);}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095;}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||G(Y,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let s=0;s<e.length;s++)this.addChild(e[s]);return e[0]}let t=e[0],i=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),i&&(i.structureDidChange=true),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=true),t.parent=this,t.didChange=true,t._updateFlags=15,i&&i.addChild(t),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let s=0;s<e.length;s++)this.removeChild(e[s]);return e[0]}let t=e[0],i=this.children.indexOf(t);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit("childRemoved",t,this,i),t.emit("removed",this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=true,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this));}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup());}get isRenderGroup(){return !!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=He.get(rl,this),this.groupTransform=O.IDENTITY,e?.addChild(this),this._updateIsSimple();}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),He.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple();}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0;}get worldTransform(){return this._worldTransform||(this._worldTransform=new O),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e;}get y(){return this._position.y}set y(e){this._position.y=e;}get position(){return this._position}set position(e){this._position.copyFrom(e);}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew));}get angle(){return this.rotation*Dm}set angle(e){this.rotation=e*km;}get pivot(){return this._pivot===ng&&(this._pivot=new ke(this,0,0)),this._pivot}set pivot(e){this._pivot===ng&&(this._pivot=new ke(this,0,0),this._origin!==og&&U("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e);}get skew(){return this._skew===rT&&(this._skew=new ke(this,0,0)),this._skew}set skew(e){this._skew===rT&&(this._skew=new ke(this,0,0)),this._skew.copyFrom(e);}get scale(){return this._scale===iT&&(this._scale=new ke(this,1,1)),this._scale}set scale(e){this._scale===iT&&(this._scale=new ke(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e);}get origin(){return this._origin===og&&(this._origin=new ke(this,0,0)),this._origin}set origin(e){this._origin===og&&(this._origin=new ke(this,0,0),this._pivot!==ng&&U("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.copyFrom(e);}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){let t=this.getLocalBounds().width;this._setWidth(e,t);}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){let t=this.getLocalBounds().height;this._setHeight(e,t);}getSize(e){e||(e={});let t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){let i=this.getLocalBounds();typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,i.width),t!==void 0&&this._setHeight(t,i.height);}_updateSkew(){let e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x);}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this);}updateLocalTransform(){let e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;let t=this.localTransform,i=this._scale,s=this._pivot,n=this._origin,o=this._position,a=i._x,u=i._y,l=s._x,c=s._y,h=-n._x,d=-n._y;t.a=this._cx*a,t.b=this._sx*a,t.c=this._cy*u,t.d=this._sy*u,t.tx=o._x-(l*t.a+c*t.c)+(h*t.a+d*t.c)-h,t.ty=o._y-(l*t.b+c*t.d)+(h*t.b+d*t.d)-d;}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=No,this._onUpdate());}get alpha(){return this.localAlpha}set tint(e){let i=te.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=No,this._onUpdate());}get tint(){return Es(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=il,this.localBlendMode=e,this._onUpdate());}get blendMode(){return this.localBlendMode}get visible(){return !!(this.localDisplayStatus&2)}set visible(e){let t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=ln,this.localDisplayStatus^=2,this._onUpdate());}get culled(){return !(this.localDisplayStatus&4)}set culled(e){let t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=ln,this.localDisplayStatus^=4,this._onUpdate());}get renderable(){return !!(this.localDisplayStatus&1)}set renderable(e){let t=e?1:0;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=ln,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._onUpdate());}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=false){if(this.destroyed)return;this.destroyed=true;let t;if(this.children.length&&(t=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e?.children)&&t)for(let s=0;s<t.length;++s)t[s].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null;}};V.mixin(J,Nm,Xm,Jm,Zm,Km,Hm,zm,Qm,Bm,Um,$m,Vm);});var Ft,cn=p(()=>{Ft=(r=>(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(Ft||{});});var hn,sT=p(()=>{hn=class{constructor(e,t=null,i=0,s=false){this.next=null,this.previous=null,this._destroyed=false,this._fn=e,this._context=t,this.priority=i,this._once=s;}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));let t=this.next;return this._once&&this.destroy(true),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this;}destroy(e=false){this._destroyed=true,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}};});var I3,_e,Cs=p(()=>{cn();sT();I3=class Br{constructor(){this.autoStart=false,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=false,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=false,this._lastFrame=-1,this._head=new hn(null,null,1/0),this.deltaMS=1/Br.targetFPMS,this.elapsedMS=1/Br.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)));};}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick));}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null);}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start();}add(e,t,i=Ft.NORMAL){return this._addListener(new hn(e,t,i))}addOnce(e,t,i=Ft.NORMAL){return this._addListener(new hn(e,t,i,true))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else {for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next;}e.previous||e.connect(i);}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=true,this._requestIfNeeded());}stop(){this.started&&(this.started=false,this._cancelIfNeeded());}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(true);this._head.destroy(),this._head=null;}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){let n=e-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=e-n%this._minElapsedMS;}this.deltaMS=t,this.deltaTime=this.deltaMS*Br.targetFPMS;let i=this._head,s=i.next;for(;s;)s=s.emit(this);i.next||this._cancelIfNeeded();}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e;}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){let t=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,t)/1e3,Br.targetFPMS);this._maxElapsedMS=1/i;}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else {let t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3);}}static get shared(){if(!Br._shared){let e=Br._shared=new Br;e.autoStart=true,e._protected=true;}return Br._shared}static get system(){if(!Br._system){let e=Br._system=new Br;e.autoStart=true,e._protected=true;}return Br._system}};I3.targetFPMS=.06;_e=I3;});var dn,ag=p(()=>{cn();Cs();dn=class{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=false,this.updateTranslation=()=>{if(!this._canvas)return;let t=this._canvas.getBoundingClientRect(),i=this._canvas.width,s=this._canvas.height,n=t.width/i*this._renderer.resolution,o=t.height/s*this._renderer.resolution,a=t.left,u=t.top,l=`translate(${a}px, ${u}px) scale(${n}, ${o})`;l!==this._lastTransform&&(this._domElement.style.transform=l,this._lastTransform=l);},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver());}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation());}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(let t of e){if(t.target!==this._canvas)continue;let i=this.canvas.width,s=this.canvas.height,n=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/s*this._renderer.resolution;(this._lastScaleX!==n||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=n,this._lastScaleY=o);}}),this._observer.observe(this._canvas)):this._tickerAttached||_e.shared.add(this.updateTranslation,this,Ft.HIGH);}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&_e.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=false,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null;}};});var $i,Kh=p(()=>{_r();$i=class r{constructor(e){this.bubbles=true,this.cancelBubble=true,this.cancelable=false,this.composed=false,this.defaultPrevented=false,this.eventPhase=r.prototype.NONE,this.propagationStopped=false,this.propagationImmediatelyStopped=false,this.layer=new ge,this.page=new ge,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e;}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,s,n){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=true;}stopImmediatePropagation(){this.propagationImmediatelyStopped=true;}stopPropagation(){this.propagationStopped=true;}};});function jG(r){return function(e){return e.test(r)}}function Zh(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var s=jG(t),n={apple:{phone:s(nT)&&!s(ws),ipod:s(D3),tablet:!s(nT)&&(s(k3)||z3(e))&&!s(ws),universal:s(O3),device:(s(nT)||s(D3)||s(k3)||s(O3)||z3(e))&&!s(ws)},amazon:{phone:s(sl),tablet:!s(sl)&&s(ug),device:s(sl)||s(ug)},android:{phone:!s(ws)&&s(sl)||!s(ws)&&s(oT),tablet:!s(ws)&&!s(sl)&&!s(oT)&&(s(ug)||s(F3)),device:!s(ws)&&(s(sl)||s(ug)||s(oT)||s(F3))||s(/\bokhttp\b/i)},windows:{phone:s(ws),tablet:s(G3),device:s(ws)||s(G3)},other:{blackberry:s(U3),blackberry10:s(L3),opera:s(N3),firefox:s(H3),chrome:s(V3),device:s(U3)||s(L3)||s(N3)||s(H3)||s(V3)},any:false,phone:false,tablet:false};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}var nT,D3,k3,O3,oT,F3,sl,ug,ws,G3,U3,L3,N3,V3,H3,z3,aT=p(()=>{nT=/iPhone/i,D3=/iPod/i,k3=/iPad/i,O3=/\biOS-universal(?:.+)Mac\b/i,oT=/\bAndroid(?:.+)Mobile\b/i,F3=/Android/i,sl=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,ug=/Silk/i,ws=/Windows Phone/i,G3=/\bWindows(?:.+)ARM\b/i,U3=/BlackBerry/i,L3=/BB10/i,N3=/Opera Mini/i,V3=/\b(CriOS|Chrome)(?:.+)Mobile/i,H3=/Mobile(?:.+)Firefox\b/i,z3=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};});var W3=p(()=>{aT();aT();});var $G,lg,uT=p(()=>{W3();$G=Zh.default??Zh,lg=$G(globalThis.navigator);});var qG,X3,KG,ZG,Y3,j3,QG,JG,eU,lT,cg,cT=p(()=>{ag();Kh();P();uT();Lm();qG=9,X3=100,KG=0,ZG=0,Y3=2,j3=1,QG=-1e3,JG=-1e3,eU=2,lT=class $3{constructor(e,t=lg){this._mobileInfo=t,this.debug=false,this._activateOnTab=true,this._deactivateOnMouseMove=true,this._isActive=false,this._isMobileAccessibility=false,this._div=null,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e;}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){let e=document.createElement("button");e.style.width=`${j3}px`,e.style.height=`${j3}px`,e.style.position="absolute",e.style.top=`${QG}px`,e.style.left=`${JG}px`,e.style.zIndex=eU.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=true,this._activate(),this._destroyTouchHook();}),document.body.appendChild(e),this._hookDiv=e;}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null);}_activate(){if(this._isActive)return;this._isActive=true,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${KG}px`,this._div.style.left=`${ZG}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=Y3.toString(),this._canvasObserver=new dn({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._deactivateOnMouseMove&&(this._onMouseMove=this._onMouseMove.bind(this),globalThis.document.addEventListener("mousemove",this._onMouseMove,true));let e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else {let t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup());});t.observe(document.body,{childList:true,subtree:true});}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered);}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=false,globalThis.document.removeEventListener("mousemove",this._onMouseMove,true),this._activateOnTab&&globalThis.addEventListener("keydown",this._onKeyDown,false),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv&&e._accessibleDiv.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=false;this._pool.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e);}),this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pool=[],this._children=[];}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i]);}init(e){let i={accessibilityOptions:{...$3.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault?this._activate():this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._renderer.runners.postrender.remove(this);}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i));}for(let i=this._children.length-1;i>=0;i--){let s=this._children[i];t.has(i)||(s._accessibleDiv&&s._accessibleDiv.parentNode&&(s._accessibleDiv.parentNode.removeChild(s._accessibleDiv),this._pool.push(s._accessibleDiv),s._accessibleDiv=null),s._accessibleActive=false,Zu(this._children,i,1));}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let i=0;i<this._children.length;i++){let s=this._children[i];if(!s._accessibleActive||!s._accessibleDiv)continue;let n=s._accessibleDiv,o=s.hitArea||s.getBounds().rectangle;if(s.hitArea){let a=s.worldTransform;n.style.left=`${a.tx+o.x*a.a}px`,n.style.top=`${a.ty+o.y*a.d}px`,n.style.width=`${o.width*a.a}px`,n.style.height=`${o.height*a.d}px`;}else this._capHitArea(o),n.style.left=`${o.x}px`,n.style.top=`${o.y}px`,n.style.width=`${o.width}px`,n.style.height=`${o.height}px`;}this._renderId++;}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`;}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y);}_addChild(e){let t=this._pool.pop();t||(e.accessibleType==="button"?t=document.createElement("button"):(t=document.createElement(e.accessibleType),t.style.cssText=`
|
|
7
7
|
color: transparent;
|
|
8
8
|
pointer-events: none;
|
|
9
9
|
padding: 0;
|
|
@@ -257,7 +257,7 @@ ${s.join(`
|
|
|
257
257
|
{
|
|
258
258
|
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
259
259
|
}
|
|
260
|
-
`}};});var pd,ix,xS=p(()=>{pd=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],ix=pd.reduce((r,e)=>(r[e]=true,r),{});});function sx(r,e){switch(r){case "f32":return 0;case "vec2<f32>":return new Float32Array(2*e);case "vec3<f32>":return new Float32Array(3*e);case "vec4<f32>":return new Float32Array(4*e);case "mat2x2<f32>":return new Float32Array([1,0,0,1]);case "mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case "mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var _S=p(()=>{});var yM,be,_t=p(()=>{Pt();gl();xS();_S();yM=class vM{constructor(e,t){this._touched=0,this.uid=de("uniform"),this._resourceType="uniformGroup",this._resourceId=de("resource"),this.isUniformGroup=true,this._dirtyId=0,this.destroyed=false,t={...vM.defaultOptions,...t},this.uniformStructures=e;let i={};for(let s in e){let n=e[s];if(n.name=s,n.size=n.size??1,!ix[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${pd.join(", ")}`);n.value??(n.value=sx(n.type,n.size)),i[s]=n.value;}this.uniforms=i,this._dirtyId=1,this.ubo=t.ubo,this.isStatic=t.isStatic,this._signature=vi(Object.keys(i).map(s=>`${s}-${e[s].type}`).join("-"),"uniform-group");}update(){this._dirtyId++;}};yM.defaultOptions={ubo:false,isStatic:false};be=yM;});function Pn(r){let e=TM[r];if(e)return e;let t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=i;return e=TM[r]=new be({uTextures:{value:t,type:"i32",size:r}},{isStatic:true}),e}var TM,md=p(()=>{_t();TM={};});var qe,kr=p(()=>{qe=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.BOTH=3]="BOTH",r))(qe||{});});var it,ei=p(()=>{Wt();Pt();br();Rs();Dr();kr();_t();it=class r extends ve{constructor(e){super(),this.uid=de("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:t,glProgram:i,groups:s,resources:n,compatibleRenderers:o,groupMap:a}=e;this.gpuProgram=t,this.glProgram=i,o===void 0&&(o=0,t&&(o|=qe.WEBGPU),i&&(o|=qe.WEBGL)),this.compatibleRenderers=o;let u={};if(!n&&!s&&(n={}),n&&s)throw new Error("[Shader] Cannot have both resources and groups");if(!t&&s&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!t&&s&&a)for(let l in a)for(let c in a[l]){let h=a[l][c];u[h]={group:l,binding:c,name:h};}else if(t&&s&&!a){let l=t.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,u[c.name]=c;});}else if(n){s={},a={},t&&t.structsAndGroups.groups.forEach(h=>{a[h.group]=a[h.group]||{},a[h.group][h.binding]=h.name,u[h.name]=h;});let l=0;for(let c in n)u[c]||(s[99]||(s[99]=new Tt,this._ownedBindGroups.push(s[99])),u[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(let c in n){let h=c,d=n[c];!d.source&&!d._resourceType&&(d=new be(d));let f=u[h];f&&(s[f.group]||(s[f.group]=new Tt,this._ownedBindGroups.push(s[f.group])),s[f.group].setResource(d,f.binding));}}this.groups=s,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(s,u);}addResource(e,t,i){var s,n;(s=this._uniformBindMap)[t]||(s[t]={}),(n=this._uniformBindMap[t])[i]||(n[i]=e),this.groups[t]||(this.groups[t]=new Tt,this._ownedBindGroups.push(this.groups[t]));}_buildResourceAccessor(e,t){let i={};for(let s in t){let n=t[s];Object.defineProperty(i,n.name,{get(){return e[n.group].getResource(n.binding)},set(o){e[n.group].setResource(o,n.binding);}});}return i}destroy(e=false){this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(t=>{t.destroy();}),this._ownedBindGroups=null,this.resources=null,this.groups=null;}static from(e){let{gpu:t,gl:i,...s}=e,n,o;return t&&(n=$e.from(t)),i&&(o=je.from(i)),new r({gpuProgram:n,glProgram:o,...s})}};});var yl,bS=p(()=>{Is();_l();bl();Ds();md();ei();yl=class extends it{constructor(e){let t=Zr({name:"batch",bits:[An,wn(e),Jr]}),i=Kr({name:"batch",bits:[En,Cn(e),Qr]});super({glProgram:t,gpuProgram:i,resources:{batchSamplers:Pn(e)}});}};});var yS,SM,Zo,nx=p(()=>{P();LT();HT();bS();yS=null,SM=class EM extends Og{constructor(e){super(e),this.geometry=new ml,this.name=EM.extension.name,this.vertexSize=6,yS??(yS=new yl(e.maxTextures)),this.shader=yS;}packAttributes(e,t,i,s,n){let o=n<<16|e.roundPixels&65535,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,f=a.ty,{positions:m,uvs:_}=e,x=e.color,g=e.attributeOffset,y=g+e.attributeSize;for(let v=g;v<y;v++){let S=v*2,C=m[S],A=m[S+1];t[s++]=u*C+c*A+d,t[s++]=h*A+l*C+f,t[s++]=_[S],t[s++]=_[S+1],i[s++]=x,i[s++]=o;}}packQuadAttributes(e,t,i,s,n){let o=e.texture,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,f=a.ty,m=e.bounds,_=m.maxX,x=m.minX,g=m.maxY,y=m.minY,v=o.uvs,S=e.color,C=n<<16|e.roundPixels&65535;t[s+0]=u*x+c*y+d,t[s+1]=h*y+l*x+f,t[s+2]=v.x0,t[s+3]=v.y0,i[s+4]=S,i[s+5]=C,t[s+6]=u*_+c*y+d,t[s+7]=h*y+l*_+f,t[s+8]=v.x1,t[s+9]=v.y1,i[s+10]=S,i[s+11]=C,t[s+12]=u*_+c*g+d,t[s+13]=h*g+l*_+f,t[s+14]=v.x2,t[s+15]=v.y2,i[s+16]=S,i[s+17]=C,t[s+18]=u*x+c*g+d,t[s+19]=h*g+l*x+f,t[s+20]=v.x3,t[s+21]=v.y3,i[s+22]=S,i[s+23]=C;}};SM.extension={type:[b.Batcher],name:"default"};Zo=SM;});function ox(r,e,t,i,s,n,o,a=null){let u=0;t*=e,s*=n;let l=a.a,c=a.b,h=a.c,d=a.d,f=a.tx,m=a.ty;for(;u<o;){let _=r[t],x=r[t+1];i[s]=l*_+h*x+f,i[s+1]=c*_+d*x+m,s+=n,t+=e,u++;}}function ax(r,e,t,i){let s=0;for(e*=t;s<i;)r[e]=0,r[e+1]=0,e+=t,s++;}var vS=p(()=>{});function gd(r,e,t,i,s){let n=e.a,o=e.b,a=e.c,u=e.d,l=e.tx,c=e.ty;t||(t=0),i||(i=2),s||(s=r.length/i-t);let h=t*i;for(let d=0;d<s;d++){let f=r[h],m=r[h+1];r[h]=n*f+a*m+l,r[h+1]=o*f+u*m+c,h+=i;}}var TS=p(()=>{});var wU,ks,ux=p(()=>{Te();Ym();wU=new O,ks=class{constructor(){this.packAsQuad=false,this.batcherName="default",this.topology="triangle-list",this.applyTransform=true,this.roundPixels=0,this._batcher=null,this._batch=null;}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,i=this.renderable;return i?el(t,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||wU}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology;}reset(){this.applyTransform=true,this.renderable=null,this.topology="triangle-list";}};});var Mn,lx,cx,SS=p(()=>{P();Mn={extension:{type:b.ShapeBuilder,name:"circle"},build(r,e){let t,i,s,n,o,a;if(r.type==="circle"){let S=r;if(o=a=S.radius,o<=0)return false;t=S.x,i=S.y,s=n=0;}else if(r.type==="ellipse"){let S=r;if(o=S.halfWidth,a=S.halfHeight,o<=0||a<=0)return false;t=S.x,i=S.y,s=n=0;}else {let S=r,C=S.width/2,A=S.height/2;t=S.x+C,i=S.y+A,o=a=Math.max(0,Math.min(S.radius,Math.min(C,A))),s=C-o,n=A-a;}if(s<0||n<0)return false;let u=Math.ceil(2.3*Math.sqrt(o+a)),l=u*8+(s?4:0)+(n?4:0);if(l===0)return false;if(u===0)return e[0]=e[6]=t+s,e[1]=e[3]=i+n,e[2]=e[4]=t-s,e[5]=e[7]=i-n,true;let c=0,h=u*4+(s?2:0)+2,d=h,f=l,m=s+o,_=n,x=t+m,g=t-m,y=i+_;if(e[c++]=x,e[c++]=y,e[--h]=y,e[--h]=g,n){let S=i-_;e[d++]=g,e[d++]=S,e[--f]=S,e[--f]=x;}for(let S=1;S<u;S++){let C=Math.PI/2*(S/u),A=s+Math.cos(C)*o,M=n+Math.sin(C)*a,D=t+A,R=t-A,L=i+M,F=i-M;e[c++]=D,e[c++]=L,e[--h]=L,e[--h]=R,e[d++]=R,e[d++]=F,e[--f]=F,e[--f]=D;}m=s,_=n+a,x=t+m,g=t-m,y=i+_;let v=i-_;return e[c++]=x,e[c++]=y,e[--f]=v,e[--f]=x,s&&(e[c++]=g,e[c++]=y,e[--f]=v,e[--f]=g),true},triangulate(r,e,t,i,s,n){if(r.length===0)return;let o=0,a=0;for(let c=0;c<r.length;c+=2)o+=r[c],a+=r[c+1];o/=r.length/2,a/=r.length/2;let u=i;e[u*t]=o,e[u*t+1]=a;let l=u++;for(let c=0;c<r.length;c+=2)e[u*t]=r[c],e[u*t+1]=r[c+1],c>0&&(s[n++]=u,s[n++]=l,s[n++]=u-1),u++;s[n++]=l+1,s[n++]=l,s[n++]=u-1;}},lx={...Mn,extension:{...Mn.extension,name:"ellipse"}},cx={...Mn,extension:{...Mn.extension,name:"roundedRectangle"}};});var hx,dx,AM=p(()=>{hx=1e-4,dx=1e-4;});function fx(r){let e=r.length;if(e<6)return 1;let t=0;for(let i=0,s=r[e-2],n=r[e-1];i<e;i+=2){let o=r[i],a=r[i+1];t+=(o-s)*(a+n),s=o,n=a;}return t<0?-1:1}var ES=p(()=>{});function CM(r,e,t,i,s,n,o,a){let u=r-t*s,l=e-i*s,c=r+t*n,h=e+i*n,d,f;o?(d=i,f=-t):(d=-i,f=t);let m=u+d,_=l+f,x=c+d,g=h+f;return a.push(m,_),a.push(x,g),2}function Qo(r,e,t,i,s,n,o,a){let u=t-r,l=i-e,c=Math.atan2(u,l),h=Math.atan2(s-r,n-e);a&&c<h?c+=Math.PI*2:!a&&c>h&&(h+=Math.PI*2);let d=c,f=h-c,m=Math.abs(f),_=Math.sqrt(u*u+l*l),x=(15*m*Math.sqrt(_)/Math.PI>>0)+1,g=f/x;if(d+=g,a){o.push(r,e),o.push(t,i);for(let y=1,v=d;y<x;y++,v+=g)o.push(r,e),o.push(r+Math.sin(v)*_,e+Math.cos(v)*_);o.push(r,e),o.push(s,n);}else {o.push(t,i),o.push(r,e);for(let y=1,v=d;y<x;y++,v+=g)o.push(r+Math.sin(v)*_,e+Math.cos(v)*_),o.push(r,e);o.push(s,n),o.push(r,e);}return x*2}function px(r,e,t,i,s,n){let o=1e-4;if(r.length===0)return;let a=e,u=a.alignment;if(e.alignment!==.5){let Le=fx(r);t&&(Le*=-1),u=(u-.5)*Le+.5;}let l=new ge(r[0],r[1]),c=new ge(r[r.length-2],r[r.length-1]),h=i,d=Math.abs(l.x-c.x)<o&&Math.abs(l.y-c.y)<o;if(h){r=r.slice(),d&&(r.pop(),r.pop(),c.set(r[r.length-2],r[r.length-1]));let Le=(l.x+c.x)*.5,di=(c.y+l.y)*.5;r.unshift(Le,di),r.push(Le,di);}let f=s,m=r.length/2,_=r.length,x=f.length/2,g=a.width/2,y=g*g,v=a.miterLimit*a.miterLimit,S=r[0],C=r[1],A=r[2],M=r[3],D=0,R=0,L=-(C-M),F=S-A,se=0,ye=0,ft=Math.sqrt(L*L+F*F);L/=ft,F/=ft,L*=g,F*=g;let ys=u,X=(1-ys)*2,q=ys*2;h||(a.cap==="round"?_+=Qo(S-L*(X-q)*.5,C-F*(X-q)*.5,S-L*X,C-F*X,S+L*q,C+F*q,f,true)+2:a.cap==="square"&&(_+=CM(S,C,L,F,X,q,true,f))),f.push(S-L*X,C-F*X),f.push(S+L*q,C+F*q);for(let Le=1;Le<m-1;++Le){S=r[(Le-1)*2],C=r[(Le-1)*2+1],A=r[Le*2],M=r[Le*2+1],D=r[(Le+1)*2],R=r[(Le+1)*2+1],L=-(C-M),F=S-A,ft=Math.sqrt(L*L+F*F),L/=ft,F/=ft,L*=g,F*=g,se=-(M-R),ye=A-D,ft=Math.sqrt(se*se+ye*ye),se/=ft,ye/=ft,se*=g,ye*=g;let di=A-S,Zs=C-M,Qs=A-D,Js=R-M,Oh=di*Qs+Zs*Js,Vi=Zs*Qs-Js*di,Hi=Vi<0;if(Math.abs(Vi)<.001*Math.abs(Oh)){f.push(A-L*X,M-F*X),f.push(A+L*q,M+F*q),Oh>=0&&(a.join==="round"?_+=Qo(A,M,A-L*X,M-F*X,A-se*X,M-ye*X,f,false)+4:_+=2,f.push(A-se*q,M-ye*q),f.push(A+se*X,M+ye*X));continue}let Mo=(-L+S)*(-F+M)-(-L+A)*(-F+C),en=(-se+D)*(-ye+M)-(-se+A)*(-ye+R),zi=(di*en-Qs*Mo)/Vi,Cm=(Js*Mo-Zs*en)/Vi,Pv=(zi-A)*(zi-A)+(Cm-M)*(Cm-M),Ro=A+(zi-A)*X,Bo=M+(Cm-M)*X,Io=A-(zi-A)*q,Do=M-(Cm-M)*q,vG=Math.min(di*di+Zs*Zs,Qs*Qs+Js*Js),ZP=Hi?X:q,TG=vG+ZP*ZP*y;Pv<=TG?a.join==="bevel"||Pv/y>v?(Hi?(f.push(Ro,Bo),f.push(A+L*q,M+F*q),f.push(Ro,Bo),f.push(A+se*q,M+ye*q)):(f.push(A-L*X,M-F*X),f.push(Io,Do),f.push(A-se*X,M-ye*X),f.push(Io,Do)),_+=2):a.join==="round"?Hi?(f.push(Ro,Bo),f.push(A+L*q,M+F*q),_+=Qo(A,M,A+L*q,M+F*q,A+se*q,M+ye*q,f,true)+4,f.push(Ro,Bo),f.push(A+se*q,M+ye*q)):(f.push(A-L*X,M-F*X),f.push(Io,Do),_+=Qo(A,M,A-L*X,M-F*X,A-se*X,M-ye*X,f,false)+4,f.push(A-se*X,M-ye*X),f.push(Io,Do)):(f.push(Ro,Bo),f.push(Io,Do)):(f.push(A-L*X,M-F*X),f.push(A+L*q,M+F*q),a.join==="round"?Hi?_+=Qo(A,M,A+L*q,M+F*q,A+se*q,M+ye*q,f,true)+2:_+=Qo(A,M,A-L*X,M-F*X,A-se*X,M-ye*X,f,false)+2:a.join==="miter"&&Pv/y<=v&&(Hi?(f.push(Io,Do),f.push(Io,Do)):(f.push(Ro,Bo),f.push(Ro,Bo)),_+=2),f.push(A-se*X,M-ye*X),f.push(A+se*q,M+ye*q),_+=2);}S=r[(m-2)*2],C=r[(m-2)*2+1],A=r[(m-1)*2],M=r[(m-1)*2+1],L=-(C-M),F=S-A,ft=Math.sqrt(L*L+F*F),L/=ft,F/=ft,L*=g,F*=g,f.push(A-L*X,M-F*X),f.push(A+L*q,M+F*q),h||(a.cap==="round"?_+=Qo(A-L*(X-q)*.5,M-F*(X-q)*.5,A-L*X,M-F*X,A+L*q,M+F*q,f,false)+2:a.cap==="square"&&(_+=CM(A,M,L,F,X,q,false,f)));let Rr=1e-4*1e-4;for(let Le=x;Le<_+x-2;++Le)S=f[Le*2],C=f[Le*2+1],A=f[(Le+1)*2],M=f[(Le+1)*2+1],D=f[(Le+2)*2],R=f[(Le+2)*2+1],!(Math.abs(S*(M-R)+A*(R-C)+D*(C-M))<Rr)&&n.push(Le,Le+1,Le+2);}var AS=p(()=>{_r();ES();});function mx(r,e,t,i){let s=1e-4;if(r.length===0)return;let n=r[0],o=r[1],a=r[r.length-2],u=r[r.length-1],l=e||Math.abs(n-a)<s&&Math.abs(o-u)<s,c=t,h=r.length/2,d=c.length/2;for(let f=0;f<h;f++)c.push(r[f*2]),c.push(r[f*2+1]);for(let f=0;f<h-1;f++)i.push(d+f,d+f+1);l&&i.push(d+h-1,d);}var CS=p(()=>{});function _x(r,e,t=2){let i=e&&e.length,s=i?e[0]*t:r.length,n=PM(r,0,s,t,true),o=[];if(!n||n.next===n.prev)return o;let a,u,l;if(i&&(n=IU(r,e,n,t)),r.length>80*t){a=r[0],u=r[1];let c=a,h=u;for(let d=t;d<s;d+=t){let f=r[d],m=r[d+1];f<a&&(a=f),m<u&&(u=m),f>c&&(c=f),m>h&&(h=m);}l=Math.max(c-a,h-u),l=l!==0?32767/l:0;}return _d(n,o,t,a,u,l,0),o}function PM(r,e,t,i,s){let n;if(s===zU(r,e,t,i)>0)for(let o=e;o<t;o+=i)n=wM(o/i|0,r[o],r[o+1],n);else for(let o=t-i;o>=e;o-=i)n=wM(o/i|0,r[o],r[o+1],n);return n&&vl(n,n.next)&&(yd(n),n=n.next),n}function Jo(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=false,!t.steiner&&(vl(t,t.next)||ct(t.prev,t,t.next)===0)){if(yd(t),t=e=t.prev,t===t.next)break;i=true;}else t=t.next;while(i||t!==e);return e}function _d(r,e,t,i,s,n,o){if(!r)return;!o&&n&&GU(r,i,s,n);let a=r;for(;r.prev!==r.next;){let u=r.prev,l=r.next;if(n?MU(r,i,s,n):PU(r)){e.push(u.i,r.i,l.i),yd(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=RU(Jo(r),e),_d(r,e,t,i,s,n,2)):o===2&&BU(r,e,t,i,s,n):_d(Jo(r),e,t,i,s,n,1);break}}}function PU(r){let e=r.prev,t=r,i=r.next;if(ct(e,t,i)>=0)return false;let s=e.x,n=t.x,o=i.x,a=e.y,u=t.y,l=i.y,c=Math.min(s,n,o),h=Math.min(a,u,l),d=Math.max(s,n,o),f=Math.max(a,u,l),m=i.next;for(;m!==e;){if(m.x>=c&&m.x<=d&&m.y>=h&&m.y<=f&&xd(s,a,n,u,o,l,m.x,m.y)&&ct(m.prev,m,m.next)>=0)return false;m=m.next;}return true}function MU(r,e,t,i){let s=r.prev,n=r,o=r.next;if(ct(s,n,o)>=0)return false;let a=s.x,u=n.x,l=o.x,c=s.y,h=n.y,d=o.y,f=Math.min(a,u,l),m=Math.min(c,h,d),_=Math.max(a,u,l),x=Math.max(c,h,d),g=wS(f,m,e,t,i),y=wS(_,x,e,t,i),v=r.prevZ,S=r.nextZ;for(;v&&v.z>=g&&S&&S.z<=y;){if(v.x>=f&&v.x<=_&&v.y>=m&&v.y<=x&&v!==s&&v!==o&&xd(a,c,u,h,l,d,v.x,v.y)&&ct(v.prev,v,v.next)>=0||(v=v.prevZ,S.x>=f&&S.x<=_&&S.y>=m&&S.y<=x&&S!==s&&S!==o&&xd(a,c,u,h,l,d,S.x,S.y)&&ct(S.prev,S,S.next)>=0))return false;S=S.nextZ;}for(;v&&v.z>=g;){if(v.x>=f&&v.x<=_&&v.y>=m&&v.y<=x&&v!==s&&v!==o&&xd(a,c,u,h,l,d,v.x,v.y)&&ct(v.prev,v,v.next)>=0)return false;v=v.prevZ;}for(;S&&S.z<=y;){if(S.x>=f&&S.x<=_&&S.y>=m&&S.y<=x&&S!==s&&S!==o&&xd(a,c,u,h,l,d,S.x,S.y)&&ct(S.prev,S,S.next)>=0)return false;S=S.nextZ;}return true}function RU(r,e){let t=r;do{let i=t.prev,s=t.next.next;!vl(i,s)&&RM(i,t,t.next,s)&&bd(i,s)&&bd(s,i)&&(e.push(i.i,t.i,s.i),yd(t),yd(t.next),t=r=s),t=t.next;}while(t!==r);return Jo(t)}function BU(r,e,t,i,s,n){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&NU(o,a)){let u=BM(o,a);o=Jo(o,o.next),u=Jo(u,u.next),_d(o,e,t,i,s,n,0),_d(u,e,t,i,s,n,0);return}a=a.next;}o=o.next;}while(o!==r)}function IU(r,e,t,i){let s=[];for(let n=0,o=e.length;n<o;n++){let a=e[n]*i,u=n<o-1?e[n+1]*i:r.length,l=PM(r,a,u,i,false);l===l.next&&(l.steiner=true),s.push(LU(l));}s.sort(DU);for(let n=0;n<s.length;n++)t=kU(s[n],t);return t}function DU(r,e){let t=r.x-e.x;if(t===0&&(t=r.y-e.y,t===0)){let i=(r.next.y-r.y)/(r.next.x-r.x),s=(e.next.y-e.y)/(e.next.x-e.x);t=i-s;}return t}function kU(r,e){let t=OU(r,e);if(!t)return e;let i=BM(t,r);return Jo(i,i.next),Jo(t,t.next)}function OU(r,e){let t=e,i=r.x,s=r.y,n=-1/0,o;if(vl(r,t))return t;do{if(vl(r,t.next))return t.next;if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){let h=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=i&&h>n&&(n=h,o=t.x<t.next.x?t:t.next,h===i))return o}t=t.next;}while(t!==e);if(!o)return null;let a=o,u=o.x,l=o.y,c=1/0;t=o;do{if(i>=t.x&&t.x>=u&&i!==t.x&&MM(s<l?i:n,s,u,l,s<l?n:i,s,t.x,t.y)){let h=Math.abs(s-t.y)/(i-t.x);bd(t,r)&&(h<c||h===c&&(t.x>o.x||t.x===o.x&&FU(o,t)))&&(o=t,c=h);}t=t.next;}while(t!==a);return o}function FU(r,e){return ct(r.prev,r,e.prev)<0&&ct(e.next,r,r.next)<0}function GU(r,e,t,i){let s=r;do s.z===0&&(s.z=wS(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==r);s.prevZ.nextZ=null,s.prevZ=null,UU(s);}function UU(r){let e,t=1;do{let i=r,s;r=null;let n=null;for(e=0;i;){e++;let o=i,a=0;for(let l=0;l<t&&(a++,o=o.nextZ,!!o);l++);let u=t;for(;a>0||u>0&&o;)a!==0&&(u===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,u--),n?n.nextZ=s:r=s,s.prevZ=n,n=s;i=o;}n.nextZ=null,t*=2;}while(e>1);return r}function wS(r,e,t,i,s){return r=(r-t)*s|0,e=(e-i)*s|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function LU(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function MM(r,e,t,i,s,n,o,a){return (s-o)*(e-a)>=(r-o)*(n-a)&&(r-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(n-a)>=(s-o)*(i-a)}function xd(r,e,t,i,s,n,o,a){return !(r===o&&e===a)&&MM(r,e,t,i,s,n,o,a)}function NU(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!VU(r,e)&&(bd(r,e)&&bd(e,r)&&HU(r,e)&&(ct(r.prev,r,e.prev)||ct(r,e.prev,e))||vl(r,e)&&ct(r.prev,r,r.next)>0&&ct(e.prev,e,e.next)>0)}function ct(r,e,t){return (e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function vl(r,e){return r.x===e.x&&r.y===e.y}function RM(r,e,t,i){let s=xx(ct(r,e,t)),n=xx(ct(r,e,i)),o=xx(ct(t,i,r)),a=xx(ct(t,i,e));return !!(s!==n&&o!==a||s===0&&gx(r,t,e)||n===0&&gx(r,i,e)||o===0&&gx(t,r,i)||a===0&&gx(t,e,i))}function gx(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function xx(r){return r>0?1:r<0?-1:0}function VU(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&RM(t,t.next,r,e))return true;t=t.next;}while(t!==r);return false}function bd(r,e){return ct(r.prev,r,r.next)<0?ct(r,e,r.next)>=0&&ct(r,r.prev,e)>=0:ct(r,e,r.prev)<0||ct(r,r.next,e)<0}function HU(r,e){let t=r,i=false,s=(r.x+e.x)/2,n=(r.y+e.y)/2;do t.y>n!=t.next.y>n&&t.next.y!==t.y&&s<(t.next.x-t.x)*(n-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function BM(r,e){let t=PS(r.i,r.x,r.y),i=PS(e.i,e.x,e.y),s=r.next,n=e.prev;return r.next=e,e.prev=r,t.next=s,s.prev=t,i.next=t,t.prev=i,n.next=i,i.prev=n,i}function wM(r,e,t,i){let s=PS(r,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function yd(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ);}function PS(r,e,t){return {i:r,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:false}}function zU(r,e,t,i){let s=0;for(let n=e,o=t-i;n<t;n+=i)s+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return s}var IM=p(()=>{});var bx,MS=p(()=>{IM();Wt();bx=_x.default||_x;});function Tl(r,e,t,i,s,n,o){let a=bx(r,e,2);if(!a)return;for(let l=0;l<a.length;l+=3)n[o++]=a[l]+s,n[o++]=a[l+1]+s,n[o++]=a[l+2]+s;let u=s*i;for(let l=0;l<r.length;l+=2)t[u]=r[l],t[u+1]=r[l+1],u+=i;}var yx=p(()=>{MS();});var WU,vx,RS=p(()=>{P();yx();WU=[],vx={extension:{type:b.ShapeBuilder,name:"polygon"},build(r,e){for(let t=0;t<r.points.length;t++)e[t]=r.points[t];return true},triangulate(r,e,t,i,s,n){Tl(r,WU,e,t,i,s,n);}};});var Tx,BS=p(()=>{P();Tx={extension:{type:b.ShapeBuilder,name:"rectangle"},build(r,e){let t=r,i=t.x,s=t.y,n=t.width,o=t.height;return n>0&&o>0?(e[0]=i,e[1]=s,e[2]=i+n,e[3]=s,e[4]=i+n,e[5]=s+o,e[6]=i,e[7]=s+o,true):false},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[6],e[i+o+1]=r[7],o+=t,e[i+o]=r[4],e[i+o+1]=r[5],o+=t;let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2,s[n++]=a+1,s[n++]=a+3,s[n++]=a+2;}};});var Sx,IS=p(()=>{P();Sx={extension:{type:b.ShapeBuilder,name:"triangle"},build(r,e){return e[0]=r.x,e[1]=r.y,e[2]=r.x2,e[3]=r.y2,e[4]=r.x3,e[5]=r.y3,true},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[4],e[i+o+1]=r[5];let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2;}};});function kM(r,e){for(let t=0;t<e.length;t++){let i=e[t];r.addColorStop(i.offset,i.color);}}function OM(r,e){let t=H.get().createCanvas(r,e),i=t.getContext("2d");return {canvas:t,context:i}}function XU(r){let e=r[0]??{};return (typeof e=="number"||r[1])&&(G("8.5.2","use options object instead"),e={type:"linear",start:{x:r[0],y:r[1]},end:{x:r[2],y:r[3]},textureSpace:r[4],textureSize:r[5]??tr.defaultLinearOptions.textureSize}),e}var DM,kS,tr,ea=p(()=>{vt();Be();Te();qo();Se();Pt();Pe();an();DM=[{offset:0,color:"white"},{offset:1,color:"black"}],kS=class DS{constructor(...e){this.uid=de("fillGradient"),this.type="linear",this.colorStops=[];let t=XU(e);t={...t.type==="radial"?DS.defaultRadialOptions:DS.defaultLinearOptions,...Ot(t)},this._textureSize=t.textureSize,this._wrapMode=t.wrapMode,t.type==="radial"?(this.center=t.center,this.outerCenter=t.outerCenter??this.center,this.innerRadius=t.innerRadius,this.outerRadius=t.outerRadius,this.scale=t.scale,this.rotation=t.rotation):(this.start=t.start,this.end=t.end),this.textureSpace=t.textureSpace,this.type=t.type,t.colorStops.forEach(s=>{this.addColorStop(s.offset,s.color);});}addColorStop(e,t){return this.colorStops.push({offset:e,color:te.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:i,y:s}=this.end,n=i-e,o=s-t,a=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){let x=e;e=i,i=x,n*=-1;}if(o<0){let x=t;t=s,s=x,o*=-1;}}let u=this.colorStops.length?this.colorStops:DM,l=this._textureSize,{canvas:c,context:h}=OM(l,1),d=a?h.createLinearGradient(this._textureSize,0,0,0):h.createLinearGradient(0,0,this._textureSize,0);kM(d,u),h.fillStyle=d,h.fillRect(0,0,l,1),this.texture=new B({source:new Qt({resource:c,addressMode:this._wrapMode})});let f=Math.sqrt(n*n+o*o),m=Math.atan2(o,n),_=new O;_.scale(f/l,1),_.rotate(m),_.translate(e,t),this.textureSpace==="local"&&_.scale(l,l),this.transform=_;}buildGradient(){this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient();}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:DM,t=this._textureSize,{canvas:i,context:s}=OM(t,t),{x:n,y:o}=this.center,{x:a,y:u}=this.outerCenter,l=this.innerRadius,c=this.outerRadius,h=a-c,d=u-c,f=t/(c*2),m=(n-h)*f,_=(o-d)*f,x=s.createRadialGradient(m,_,l*f,(a-h)*f,(u-d)*f,c*f);kM(x,e),s.fillStyle=e[e.length-1].color,s.fillRect(0,0,t,t),s.fillStyle=x,s.translate(m,_),s.rotate(this.rotation),s.scale(1,this.scale),s.translate(-m,-_),s.fillRect(0,0,t,t),this.texture=new B({source:new Qt({resource:i,addressMode:this._wrapMode})});let g=new O;g.scale(1/f,1/f),g.translate(h,d),this.textureSpace==="local"&&g.scale(t,t),this.transform=g;}get styleKey(){return this.uid}destroy(){this.texture?.destroy(true),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null;}};kS.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};kS.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};tr=kS;});function Ex(r,e,t,i){let s=e.matrix?r.copyFrom(e.matrix).invert():r.identity();if(e.textureSpace==="local"){let o=t.getBounds(jU);e.width&&o.pad(e.width);let{x:a,y:u}=o,l=1/o.width,c=1/o.height,h=-a*l,d=-u*c,f=s.a,m=s.b,_=s.c,x=s.d;s.a*=l,s.b*=l,s.c*=c,s.d*=c,s.tx=h*f+d*_+s.tx,s.ty=h*m+d*x+s.ty;}else s.translate(e.texture.frame.x,e.texture.frame.y),s.scale(1/e.texture.source.width,1/e.texture.source.height);let n=e.texture.source.style;return !(e.fill instanceof tr)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),i&&s.append(YU.copyFrom(i).invert()),s}var YU,jU,OS=p(()=>{Te();xt();ea();YU=new O,jU=new re;});function Ax(r,e){let{geometryData:t,batches:i}=e;i.length=0,t.indices.length=0,t.vertices.length=0,t.uvs.length=0;for(let s=0;s<r.instructions.length;s++){let n=r.instructions[s];if(n.action==="texture")KU(n.data,i,t);else if(n.action==="fill"||n.action==="stroke"){let o=n.action==="stroke",a=n.data.path.shapePath,u=n.data.style,l=n.data.hole;o&&l&&FM(l.shapePath,u,true,i,t),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),FM(a,u,o,i,t);}}}function KU(r,e,t){let i=[],s=Sl.rectangle,n=$U;n.x=r.dx,n.y=r.dy,n.width=r.dw,n.height=r.dh;let o=r.transform;if(!s.build(n,i))return;let{vertices:a,uvs:u,indices:l}=t,c=l.length,h=a.length/2;o&&gd(i,o),s.triangulate(i,a,2,h,l,c);let d=r.image,f=d.uvs;u.push(f.x0,f.y0,f.x1,f.y1,f.x3,f.y3,f.x2,f.y2);let m=He.get(ks);m.indexOffset=c,m.indexSize=l.length-c,m.attributeOffset=h,m.attributeSize=a.length/2-h,m.baseColor=r.style,m.alpha=r.alpha,m.texture=d,m.geometryData=t,e.push(m);}function FM(r,e,t,i,s){let{vertices:n,uvs:o,indices:a}=s;r.shapePrimitives.forEach(({shape:u,transform:l,holes:c})=>{let h=[],d=Sl[u.type];if(!d.build(u,h))return;let f=a.length,m=n.length/2,_="triangle-list";if(l&&gd(h,l),t){let v=u.closePath??true,S=e;S.pixelLine?(mx(h,v,n,a),_="line-list"):px(h,S,false,v,n,a);}else if(c){let v=[],S=h.slice();ZU(c).forEach(A=>{v.push(S.length/2),S.push(...A);}),Tl(S,v,n,2,m,a,f);}else d.triangulate(h,n,2,m,a,f);let x=o.length/2,g=e.texture;if(g!==B.WHITE){let v=Ex(qU,e,u,l);ox(n,2,m,o,x,2,n.length/2-m,v);}else ax(o,x,2,n.length/2-m);let y=He.get(ks);y.indexOffset=f,y.indexSize=a.length-f,y.attributeOffset=m,y.attributeSize=n.length/2-m,y.baseColor=e.color,y.alpha=e.alpha,y.texture=g,y.geometryData=s,y.topology=_,i.push(y);});}function ZU(r){let e=[];for(let t=0;t<r.length;t++){let i=r[t].shape,s=[];Sl[i.type].build(i,s)&&e.push(s);}return e}var Sl,$U,qU,FS=p(()=>{P();Te();xt();vS();TS();Se();Xi();ux();SS();AS();CS();RS();BS();IS();OS();yx();Sl={};V.handleByMap(b.ShapeBuilder,Sl);V.add(Tx,vx,Sx,Mn,lx,cx);$U=new re,qU=new O;});var vd,Td,US,Rn,Sd=p(()=>{P();od();nx();eg();Pe();Xi();FS();vd=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]};}},Td=class{constructor(){this.instructions=new on;}init(e){this.batcher=new Zo({maxTextures:e}),this.instructions.reset();}get geometry(){return G(Fm,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}},US=class GS{constructor(e){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuContextHash"),e.renderableGC.addManagedHash(this,"_graphicsDataContextHash");}init(e){GS.defaultOptions.bezierSmoothness=e?.bezierSmoothness??GS.defaultOptions.bezierSmoothness;}getContextRenderData(e){return this._graphicsDataContextHash[e.uid]||this._initContextRenderData(e)}updateGpuContext(e){let t=this._gpuContextHash[e.uid]||this._initContext(e);if(e.dirty){t?this._cleanGraphicsContextData(e):t=this._initContext(e),Ax(e,t);let i=e.batchMode;e.customShader||i==="no-batch"?t.isBatchable=false:i==="auto"?t.isBatchable=t.geometryData.vertices.length<400:t.isBatchable=true,e.dirty=false;}return t}getGpuContext(e){return this._gpuContextHash[e.uid]||this._initContext(e)}_initContextRenderData(e){let t=He.get(Td,{maxTextures:this._renderer.limits.maxBatchableTextures}),{batches:i,geometryData:s}=this._gpuContextHash[e.uid],n=s.vertices.length,o=s.indices.length;for(let c=0;c<i.length;c++)i[c].applyTransform=false;let a=t.batcher;a.ensureAttributeBuffer(n),a.ensureIndexBuffer(o),a.begin();for(let c=0;c<i.length;c++){let h=i[c];a.add(h);}a.finish(t.instructions);let u=a.geometry;u.indexBuffer.setDataWithSize(a.indexBuffer,a.indexSize,true),u.buffers[0].setDataWithSize(a.attributeBuffer.float32View,a.attributeSize,true);let l=a.batches;for(let c=0;c<l.length;c++){let h=l[c];h.bindGroup=_n(h.textures.textures,h.textures.count,this._renderer.limits.maxBatchableTextures);}return this._graphicsDataContextHash[e.uid]=t,t}_initContext(e){let t=new vd;return t.context=e,this._gpuContextHash[e.uid]=t,e.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]}onGraphicsContextDestroy(e){this._cleanGraphicsContextData(e),e.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]=null;}_cleanGraphicsContextData(e){let t=this._gpuContextHash[e.uid];t.isBatchable||this._graphicsDataContextHash[e.uid]&&(He.return(this.getContextRenderData(e)),this._graphicsDataContextHash[e.uid]=null),t.batches&&t.batches.forEach(i=>{He.return(i);});}destroy(){for(let e in this._gpuContextHash)this._gpuContextHash[e]&&this.onGraphicsContextDestroy(this._gpuContextHash[e].context);}};US.extension={type:[b.WebGLSystem,b.WebGPUSystem,b.CanvasSystem],name:"graphicsContext"};US.defaultOptions={bezierSmoothness:.5};Rn=US;});var QU,LS,NS,VS,HS,zS,WS,XS,Ze,Or=p(()=>{QU={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},LS=0,NS=1,VS=2,HS=3,zS=4,WS=5,XS=class GM{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=true,this.depthMask=true;}get blend(){return !!(this.data&1<<LS)}set blend(e){!!(this.data&1<<LS)!==e&&(this.data^=1<<LS);}get offsets(){return !!(this.data&1<<NS)}set offsets(e){!!(this.data&1<<NS)!==e&&(this.data^=1<<NS);}set cullMode(e){if(e==="none"){this.culling=false;return}this.culling=true,this.clockwiseFrontFace=e==="front";}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return !!(this.data&1<<VS)}set culling(e){!!(this.data&1<<VS)!==e&&(this.data^=1<<VS);}get depthTest(){return !!(this.data&1<<HS)}set depthTest(e){!!(this.data&1<<HS)!==e&&(this.data^=1<<HS);}get depthMask(){return !!(this.data&1<<WS)}set depthMask(e){!!(this.data&1<<WS)!==e&&(this.data^=1<<WS);}get clockwiseFrontFace(){return !!(this.data&1<<zS)}set clockwiseFrontFace(e){!!(this.data&1<<zS)!==e&&(this.data^=1<<zS);}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=QU[e]||0;}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e;}toString(){return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let e=new GM;return e.depthTest=false,e.blend=true,e}};XS.default2d=XS.for2d();Ze=XS;});function UM(r,e,t,i){t[i++]=(r>>16&255)/255,t[i++]=(r>>8&255)/255,t[i++]=(r&255)/255,t[i++]=e;}function ti(r,e,t){let i=(r>>24&255)/255;e[t++]=(r&255)/255*i,e[t++]=(r>>8&255)/255*i,e[t++]=(r>>16&255)/255*i,e[t++]=i;}var ta=p(()=>{});var Ed,ra,YS=p(()=>{P();Or();Xi();ta();ux();Ed=class{constructor(){this.batches=[],this.batched=false;}destroy(){this.batches.forEach(e=>{He.return(e);}),this.batches.length=0;}},ra=class{constructor(e,t){this.state=Ze.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this);}contextChange(){this._adaptor.contextChange(this.renderer);}validateRenderable(e){let t=e.context,i=!!e._gpuData,s=this.renderer.graphicsContext.updateGpuContext(t);return !!(s.isBatchable||i!==s.isBatchable)}addRenderable(e,t){let i=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),i.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e));}updateRenderable(e){let i=this._getGpuDataForRenderable(e).batches;for(let s=0;s<i.length;s++){let n=i[s];n._batcher.updateElement(n);}}execute(e){if(!e.isRenderable)return;let t=this.renderer,i=e.context;if(!t.graphicsContext.getGpuContext(i).batches.length)return;let n=i.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;let o=n.resources.localUniforms.uniforms;o.uTransformMatrix=e.groupTransform,o.uRound=t._roundPixels|e._roundPixels,ti(e.groupColorAlpha,o.uColor,0),this._adaptor.execute(this,e);}_rebuild(e){let t=this._getGpuDataForRenderable(e),i=this.renderer.graphicsContext.updateGpuContext(e.context);t.destroy(),i.isBatchable&&this._updateBatchesForRenderable(e,t);}_addToBatcher(e,t){let i=this.renderer.renderPipes.batch,s=this._getGpuDataForRenderable(e).batches;for(let n=0;n<s.length;n++){let o=s[n];i.addToBatch(o,t);}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){let t=new Ed;return e._gpuData[this.renderer.uid]=t,t}_updateBatchesForRenderable(e,t){let i=e.context,s=this.renderer.graphicsContext.getGpuContext(i),n=this.renderer._roundPixels|e._roundPixels;t.batches=s.batches.map(o=>{let a=He.get(ks);return o.copyTo(a),a.renderable=e,a.roundPixels=n,a});}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;}};ra.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"graphics"};});var jS=p(()=>{P();Sd();YS();V.add(ra);V.add(Rn);});var Zi,Ad=p(()=>{Zi=class{constructor(){this.batcherName="default",this.packAsQuad=false,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1;}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(e){this._topology=e;}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1;}setTexture(e){this.texture!==e&&(this.texture=e,this._textureMatrixUpdateId=-1);}get uvs(){let t=this.geometry.getBuffer("aUV"),i=t.data,s=i,n=this.texture.textureMatrix;return n.isSimple||(s=this._transformedUvs,(this._textureMatrixUpdateId!==n._updateID||this._uvUpdateId!==t._updateID)&&((!s||s.length<i.length)&&(s=this._transformedUvs=new Float32Array(i.length)),this._textureMatrixUpdateId=n._updateID,this._uvUpdateId=t._updateID,n.multiplyUvs(i,s))),s}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}};});var El,ia,$S=p(()=>{P();Te();Rs();_t();cl();ta();Ad();El=class{destroy(){}},ia=class{constructor(e,t){this.localUniforms=new be({uTransformMatrix:{value:new O,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new Tt({0:this.localUniforms}),this.renderer=e,this._adaptor=t,this._adaptor.init();}validateRenderable(e){let t=this._getMeshData(e),i=t.batched,s=e.batched;if(t.batched=s,i!==s)return true;if(s){let n=e._geometry;if(n.indices.length!==t.indexSize||n.positions.length!==t.vertexSize)return t.indexSize=n.indices.length,t.vertexSize=n.positions.length,true;let o=this._getBatchableMesh(e);return o.texture.uid!==e._texture.uid&&(o._textureMatrixUpdateId=-1),!o._batcher.checkAndUpdateTexture(o,e._texture)}return false}addRenderable(e,t){let i=this.renderer.renderPipes.batch,s=this._getMeshData(e);if(e.didViewUpdate&&(s.indexSize=e._geometry.indices?.length,s.vertexSize=e._geometry.positions?.length),s.batched){let n=this._getBatchableMesh(e);n.setTexture(e._texture),n.geometry=e._geometry,i.addToBatch(n,t);}else i.break(t),t.add(e);}updateRenderable(e){if(e.batched){let t=this._getBatchableMesh(e);t.setTexture(e._texture),t.geometry=e._geometry,t._batcher.updateElement(t);}}execute(e){if(!e.isRenderable)return;e.state.blendMode=yi(e.groupBlendMode,e.texture._source);let t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),ti(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e);}_getMeshData(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new El),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:0,vertexSize:0},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new El),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){let t=new Zi;return t.renderable=e,t.setTexture(e._texture),t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,e._gpuData[this.renderer.uid].batchableMesh=t,t}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null;}};ia.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"mesh"};});var qS=p(()=>{P();$S();V.add(ia);});var Al,KS=p(()=>{Al=class{execute(e,t){let i=e.state,s=e.renderer,n=t.shader||e.defaultShader;n.resources.uTexture=t.texture._source,n.resources.uniforms=e.localUniforms;let o=s.gl,a=e.getBuffers(t);s.shader.bind(n),s.state.set(i),s.geometry.bind(a.geometry,n.glProgram);let l=a.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;o.drawElements(o.TRIANGLES,t.particleChildren.length*6,l,0);}};});function Cd(r,e=null){let t=r*6;if(t>65535?e||(e=new Uint32Array(t)):e||(e=new Uint16Array(t)),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let i=0,s=0;i<t;i+=6,s+=4)e[i+0]=s+0,e[i+1]=s+1,e[i+2]=s+2,e[i+3]=s+0,e[i+4]=s+2,e[i+5]=s+3;return e}var ZS=p(()=>{});function Cx(r){return {dynamicUpdate:LM(r,true),staticUpdate:LM(r,false)}}function LM(r,e){let t=[];t.push(`
|
|
260
|
+
`}};});var pd,ix,xS=p(()=>{pd=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],ix=pd.reduce((r,e)=>(r[e]=true,r),{});});function sx(r,e){switch(r){case "f32":return 0;case "vec2<f32>":return new Float32Array(2*e);case "vec3<f32>":return new Float32Array(3*e);case "vec4<f32>":return new Float32Array(4*e);case "mat2x2<f32>":return new Float32Array([1,0,0,1]);case "mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case "mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var _S=p(()=>{});var yM,be,_t=p(()=>{Pt();gl();xS();_S();yM=class vM{constructor(e,t){this._touched=0,this.uid=de("uniform"),this._resourceType="uniformGroup",this._resourceId=de("resource"),this.isUniformGroup=true,this._dirtyId=0,this.destroyed=false,t={...vM.defaultOptions,...t},this.uniformStructures=e;let i={};for(let s in e){let n=e[s];if(n.name=s,n.size=n.size??1,!ix[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${pd.join(", ")}`);n.value??(n.value=sx(n.type,n.size)),i[s]=n.value;}this.uniforms=i,this._dirtyId=1,this.ubo=t.ubo,this.isStatic=t.isStatic,this._signature=vi(Object.keys(i).map(s=>`${s}-${e[s].type}`).join("-"),"uniform-group");}update(){this._dirtyId++;}};yM.defaultOptions={ubo:false,isStatic:false};be=yM;});function Pn(r){let e=TM[r];if(e)return e;let t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=i;return e=TM[r]=new be({uTextures:{value:t,type:"i32",size:r}},{isStatic:true}),e}var TM,md=p(()=>{_t();TM={};});var qe,kr=p(()=>{qe=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.BOTH=3]="BOTH",r))(qe||{});});var it,ei=p(()=>{Wt();Pt();br();Rs();Dr();kr();_t();it=class r extends ve{constructor(e){super(),this.uid=de("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:t,glProgram:i,groups:s,resources:n,compatibleRenderers:o,groupMap:a}=e;this.gpuProgram=t,this.glProgram=i,o===void 0&&(o=0,t&&(o|=qe.WEBGPU),i&&(o|=qe.WEBGL)),this.compatibleRenderers=o;let u={};if(!n&&!s&&(n={}),n&&s)throw new Error("[Shader] Cannot have both resources and groups");if(!t&&s&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!t&&s&&a)for(let l in a)for(let c in a[l]){let h=a[l][c];u[h]={group:l,binding:c,name:h};}else if(t&&s&&!a){let l=t.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,u[c.name]=c;});}else if(n){s={},a={},t&&t.structsAndGroups.groups.forEach(h=>{a[h.group]=a[h.group]||{},a[h.group][h.binding]=h.name,u[h.name]=h;});let l=0;for(let c in n)u[c]||(s[99]||(s[99]=new Tt,this._ownedBindGroups.push(s[99])),u[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(let c in n){let h=c,d=n[c];!d.source&&!d._resourceType&&(d=new be(d));let f=u[h];f&&(s[f.group]||(s[f.group]=new Tt,this._ownedBindGroups.push(s[f.group])),s[f.group].setResource(d,f.binding));}}this.groups=s,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(s,u);}addResource(e,t,i){var s,n;(s=this._uniformBindMap)[t]||(s[t]={}),(n=this._uniformBindMap[t])[i]||(n[i]=e),this.groups[t]||(this.groups[t]=new Tt,this._ownedBindGroups.push(this.groups[t]));}_buildResourceAccessor(e,t){let i={};for(let s in t){let n=t[s];Object.defineProperty(i,n.name,{get(){return e[n.group].getResource(n.binding)},set(o){e[n.group].setResource(o,n.binding);}});}return i}destroy(e=false){this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(t=>{t.destroy();}),this._ownedBindGroups=null,this.resources=null,this.groups=null;}static from(e){let{gpu:t,gl:i,...s}=e,n,o;return t&&(n=$e.from(t)),i&&(o=je.from(i)),new r({gpuProgram:n,glProgram:o,...s})}};});var yl,bS=p(()=>{Is();_l();bl();Ds();md();ei();yl=class extends it{constructor(e){let t=Zr({name:"batch",bits:[An,wn(e),Jr]}),i=Kr({name:"batch",bits:[En,Cn(e),Qr]});super({glProgram:t,gpuProgram:i,resources:{batchSamplers:Pn(e)}});}};});var yS,SM,Zo,nx=p(()=>{P();LT();HT();bS();yS=null,SM=class EM extends Og{constructor(e){super(e),this.geometry=new ml,this.name=EM.extension.name,this.vertexSize=6,yS??(yS=new yl(e.maxTextures)),this.shader=yS;}packAttributes(e,t,i,s,n){let o=n<<16|e.roundPixels&65535,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,f=a.ty,{positions:m,uvs:_}=e,x=e.color,g=e.attributeOffset,y=g+e.attributeSize;for(let v=g;v<y;v++){let S=v*2,C=m[S],E=m[S+1];t[s++]=u*C+c*E+d,t[s++]=h*E+l*C+f,t[s++]=_[S],t[s++]=_[S+1],i[s++]=x,i[s++]=o;}}packQuadAttributes(e,t,i,s,n){let o=e.texture,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,f=a.ty,m=e.bounds,_=m.maxX,x=m.minX,g=m.maxY,y=m.minY,v=o.uvs,S=e.color,C=n<<16|e.roundPixels&65535;t[s+0]=u*x+c*y+d,t[s+1]=h*y+l*x+f,t[s+2]=v.x0,t[s+3]=v.y0,i[s+4]=S,i[s+5]=C,t[s+6]=u*_+c*y+d,t[s+7]=h*y+l*_+f,t[s+8]=v.x1,t[s+9]=v.y1,i[s+10]=S,i[s+11]=C,t[s+12]=u*_+c*g+d,t[s+13]=h*g+l*_+f,t[s+14]=v.x2,t[s+15]=v.y2,i[s+16]=S,i[s+17]=C,t[s+18]=u*x+c*g+d,t[s+19]=h*g+l*x+f,t[s+20]=v.x3,t[s+21]=v.y3,i[s+22]=S,i[s+23]=C;}};SM.extension={type:[b.Batcher],name:"default"};Zo=SM;});function ox(r,e,t,i,s,n,o,a=null){let u=0;t*=e,s*=n;let l=a.a,c=a.b,h=a.c,d=a.d,f=a.tx,m=a.ty;for(;u<o;){let _=r[t],x=r[t+1];i[s]=l*_+h*x+f,i[s+1]=c*_+d*x+m,s+=n,t+=e,u++;}}function ax(r,e,t,i){let s=0;for(e*=t;s<i;)r[e]=0,r[e+1]=0,e+=t,s++;}var vS=p(()=>{});function gd(r,e,t,i,s){let n=e.a,o=e.b,a=e.c,u=e.d,l=e.tx,c=e.ty;t||(t=0),i||(i=2),s||(s=r.length/i-t);let h=t*i;for(let d=0;d<s;d++){let f=r[h],m=r[h+1];r[h]=n*f+a*m+l,r[h+1]=o*f+u*m+c,h+=i;}}var TS=p(()=>{});var wU,ks,ux=p(()=>{Te();Ym();wU=new O,ks=class{constructor(){this.packAsQuad=false,this.batcherName="default",this.topology="triangle-list",this.applyTransform=true,this.roundPixels=0,this._batcher=null,this._batch=null;}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,i=this.renderable;return i?el(t,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||wU}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology;}reset(){this.applyTransform=true,this.renderable=null,this.topology="triangle-list";}};});var Mn,lx,cx,SS=p(()=>{P();Mn={extension:{type:b.ShapeBuilder,name:"circle"},build(r,e){let t,i,s,n,o,a;if(r.type==="circle"){let S=r;if(o=a=S.radius,o<=0)return false;t=S.x,i=S.y,s=n=0;}else if(r.type==="ellipse"){let S=r;if(o=S.halfWidth,a=S.halfHeight,o<=0||a<=0)return false;t=S.x,i=S.y,s=n=0;}else {let S=r,C=S.width/2,E=S.height/2;t=S.x+C,i=S.y+E,o=a=Math.max(0,Math.min(S.radius,Math.min(C,E))),s=C-o,n=E-a;}if(s<0||n<0)return false;let u=Math.ceil(2.3*Math.sqrt(o+a)),l=u*8+(s?4:0)+(n?4:0);if(l===0)return false;if(u===0)return e[0]=e[6]=t+s,e[1]=e[3]=i+n,e[2]=e[4]=t-s,e[5]=e[7]=i-n,true;let c=0,h=u*4+(s?2:0)+2,d=h,f=l,m=s+o,_=n,x=t+m,g=t-m,y=i+_;if(e[c++]=x,e[c++]=y,e[--h]=y,e[--h]=g,n){let S=i-_;e[d++]=g,e[d++]=S,e[--f]=S,e[--f]=x;}for(let S=1;S<u;S++){let C=Math.PI/2*(S/u),E=s+Math.cos(C)*o,M=n+Math.sin(C)*a,D=t+E,R=t-E,L=i+M,F=i-M;e[c++]=D,e[c++]=L,e[--h]=L,e[--h]=R,e[d++]=R,e[d++]=F,e[--f]=F,e[--f]=D;}m=s,_=n+a,x=t+m,g=t-m,y=i+_;let v=i-_;return e[c++]=x,e[c++]=y,e[--f]=v,e[--f]=x,s&&(e[c++]=g,e[c++]=y,e[--f]=v,e[--f]=g),true},triangulate(r,e,t,i,s,n){if(r.length===0)return;let o=0,a=0;for(let c=0;c<r.length;c+=2)o+=r[c],a+=r[c+1];o/=r.length/2,a/=r.length/2;let u=i;e[u*t]=o,e[u*t+1]=a;let l=u++;for(let c=0;c<r.length;c+=2)e[u*t]=r[c],e[u*t+1]=r[c+1],c>0&&(s[n++]=u,s[n++]=l,s[n++]=u-1),u++;s[n++]=l+1,s[n++]=l,s[n++]=u-1;}},lx={...Mn,extension:{...Mn.extension,name:"ellipse"}},cx={...Mn,extension:{...Mn.extension,name:"roundedRectangle"}};});var hx,dx,AM=p(()=>{hx=1e-4,dx=1e-4;});function fx(r){let e=r.length;if(e<6)return 1;let t=0;for(let i=0,s=r[e-2],n=r[e-1];i<e;i+=2){let o=r[i],a=r[i+1];t+=(o-s)*(a+n),s=o,n=a;}return t<0?-1:1}var ES=p(()=>{});function CM(r,e,t,i,s,n,o,a){let u=r-t*s,l=e-i*s,c=r+t*n,h=e+i*n,d,f;o?(d=i,f=-t):(d=-i,f=t);let m=u+d,_=l+f,x=c+d,g=h+f;return a.push(m,_),a.push(x,g),2}function Qo(r,e,t,i,s,n,o,a){let u=t-r,l=i-e,c=Math.atan2(u,l),h=Math.atan2(s-r,n-e);a&&c<h?c+=Math.PI*2:!a&&c>h&&(h+=Math.PI*2);let d=c,f=h-c,m=Math.abs(f),_=Math.sqrt(u*u+l*l),x=(15*m*Math.sqrt(_)/Math.PI>>0)+1,g=f/x;if(d+=g,a){o.push(r,e),o.push(t,i);for(let y=1,v=d;y<x;y++,v+=g)o.push(r,e),o.push(r+Math.sin(v)*_,e+Math.cos(v)*_);o.push(r,e),o.push(s,n);}else {o.push(t,i),o.push(r,e);for(let y=1,v=d;y<x;y++,v+=g)o.push(r+Math.sin(v)*_,e+Math.cos(v)*_),o.push(r,e);o.push(s,n),o.push(r,e);}return x*2}function px(r,e,t,i,s,n){let o=1e-4;if(r.length===0)return;let a=e,u=a.alignment;if(e.alignment!==.5){let Le=fx(r);t&&(Le*=-1),u=(u-.5)*Le+.5;}let l=new ge(r[0],r[1]),c=new ge(r[r.length-2],r[r.length-1]),h=i,d=Math.abs(l.x-c.x)<o&&Math.abs(l.y-c.y)<o;if(h){r=r.slice(),d&&(r.pop(),r.pop(),c.set(r[r.length-2],r[r.length-1]));let Le=(l.x+c.x)*.5,di=(c.y+l.y)*.5;r.unshift(Le,di),r.push(Le,di);}let f=s,m=r.length/2,_=r.length,x=f.length/2,g=a.width/2,y=g*g,v=a.miterLimit*a.miterLimit,S=r[0],C=r[1],E=r[2],M=r[3],D=0,R=0,L=-(C-M),F=S-E,se=0,ye=0,ft=Math.sqrt(L*L+F*F);L/=ft,F/=ft,L*=g,F*=g;let ys=u,X=(1-ys)*2,q=ys*2;h||(a.cap==="round"?_+=Qo(S-L*(X-q)*.5,C-F*(X-q)*.5,S-L*X,C-F*X,S+L*q,C+F*q,f,true)+2:a.cap==="square"&&(_+=CM(S,C,L,F,X,q,true,f))),f.push(S-L*X,C-F*X),f.push(S+L*q,C+F*q);for(let Le=1;Le<m-1;++Le){S=r[(Le-1)*2],C=r[(Le-1)*2+1],E=r[Le*2],M=r[Le*2+1],D=r[(Le+1)*2],R=r[(Le+1)*2+1],L=-(C-M),F=S-E,ft=Math.sqrt(L*L+F*F),L/=ft,F/=ft,L*=g,F*=g,se=-(M-R),ye=E-D,ft=Math.sqrt(se*se+ye*ye),se/=ft,ye/=ft,se*=g,ye*=g;let di=E-S,Zs=C-M,Qs=E-D,Js=R-M,Oh=di*Qs+Zs*Js,Vi=Zs*Qs-Js*di,Hi=Vi<0;if(Math.abs(Vi)<.001*Math.abs(Oh)){f.push(E-L*X,M-F*X),f.push(E+L*q,M+F*q),Oh>=0&&(a.join==="round"?_+=Qo(E,M,E-L*X,M-F*X,E-se*X,M-ye*X,f,false)+4:_+=2,f.push(E-se*q,M-ye*q),f.push(E+se*X,M+ye*X));continue}let Mo=(-L+S)*(-F+M)-(-L+E)*(-F+C),en=(-se+D)*(-ye+M)-(-se+E)*(-ye+R),zi=(di*en-Qs*Mo)/Vi,Cm=(Js*Mo-Zs*en)/Vi,Pv=(zi-E)*(zi-E)+(Cm-M)*(Cm-M),Ro=E+(zi-E)*X,Bo=M+(Cm-M)*X,Io=E-(zi-E)*q,Do=M-(Cm-M)*q,vG=Math.min(di*di+Zs*Zs,Qs*Qs+Js*Js),ZP=Hi?X:q,TG=vG+ZP*ZP*y;Pv<=TG?a.join==="bevel"||Pv/y>v?(Hi?(f.push(Ro,Bo),f.push(E+L*q,M+F*q),f.push(Ro,Bo),f.push(E+se*q,M+ye*q)):(f.push(E-L*X,M-F*X),f.push(Io,Do),f.push(E-se*X,M-ye*X),f.push(Io,Do)),_+=2):a.join==="round"?Hi?(f.push(Ro,Bo),f.push(E+L*q,M+F*q),_+=Qo(E,M,E+L*q,M+F*q,E+se*q,M+ye*q,f,true)+4,f.push(Ro,Bo),f.push(E+se*q,M+ye*q)):(f.push(E-L*X,M-F*X),f.push(Io,Do),_+=Qo(E,M,E-L*X,M-F*X,E-se*X,M-ye*X,f,false)+4,f.push(E-se*X,M-ye*X),f.push(Io,Do)):(f.push(Ro,Bo),f.push(Io,Do)):(f.push(E-L*X,M-F*X),f.push(E+L*q,M+F*q),a.join==="round"?Hi?_+=Qo(E,M,E+L*q,M+F*q,E+se*q,M+ye*q,f,true)+2:_+=Qo(E,M,E-L*X,M-F*X,E-se*X,M-ye*X,f,false)+2:a.join==="miter"&&Pv/y<=v&&(Hi?(f.push(Io,Do),f.push(Io,Do)):(f.push(Ro,Bo),f.push(Ro,Bo)),_+=2),f.push(E-se*X,M-ye*X),f.push(E+se*q,M+ye*q),_+=2);}S=r[(m-2)*2],C=r[(m-2)*2+1],E=r[(m-1)*2],M=r[(m-1)*2+1],L=-(C-M),F=S-E,ft=Math.sqrt(L*L+F*F),L/=ft,F/=ft,L*=g,F*=g,f.push(E-L*X,M-F*X),f.push(E+L*q,M+F*q),h||(a.cap==="round"?_+=Qo(E-L*(X-q)*.5,M-F*(X-q)*.5,E-L*X,M-F*X,E+L*q,M+F*q,f,false)+2:a.cap==="square"&&(_+=CM(E,M,L,F,X,q,false,f)));let Rr=1e-4*1e-4;for(let Le=x;Le<_+x-2;++Le)S=f[Le*2],C=f[Le*2+1],E=f[(Le+1)*2],M=f[(Le+1)*2+1],D=f[(Le+2)*2],R=f[(Le+2)*2+1],!(Math.abs(S*(M-R)+E*(R-C)+D*(C-M))<Rr)&&n.push(Le,Le+1,Le+2);}var AS=p(()=>{_r();ES();});function mx(r,e,t,i){let s=1e-4;if(r.length===0)return;let n=r[0],o=r[1],a=r[r.length-2],u=r[r.length-1],l=e||Math.abs(n-a)<s&&Math.abs(o-u)<s,c=t,h=r.length/2,d=c.length/2;for(let f=0;f<h;f++)c.push(r[f*2]),c.push(r[f*2+1]);for(let f=0;f<h-1;f++)i.push(d+f,d+f+1);l&&i.push(d+h-1,d);}var CS=p(()=>{});function _x(r,e,t=2){let i=e&&e.length,s=i?e[0]*t:r.length,n=PM(r,0,s,t,true),o=[];if(!n||n.next===n.prev)return o;let a,u,l;if(i&&(n=IU(r,e,n,t)),r.length>80*t){a=r[0],u=r[1];let c=a,h=u;for(let d=t;d<s;d+=t){let f=r[d],m=r[d+1];f<a&&(a=f),m<u&&(u=m),f>c&&(c=f),m>h&&(h=m);}l=Math.max(c-a,h-u),l=l!==0?32767/l:0;}return _d(n,o,t,a,u,l,0),o}function PM(r,e,t,i,s){let n;if(s===zU(r,e,t,i)>0)for(let o=e;o<t;o+=i)n=wM(o/i|0,r[o],r[o+1],n);else for(let o=t-i;o>=e;o-=i)n=wM(o/i|0,r[o],r[o+1],n);return n&&vl(n,n.next)&&(yd(n),n=n.next),n}function Jo(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=false,!t.steiner&&(vl(t,t.next)||ct(t.prev,t,t.next)===0)){if(yd(t),t=e=t.prev,t===t.next)break;i=true;}else t=t.next;while(i||t!==e);return e}function _d(r,e,t,i,s,n,o){if(!r)return;!o&&n&&GU(r,i,s,n);let a=r;for(;r.prev!==r.next;){let u=r.prev,l=r.next;if(n?MU(r,i,s,n):PU(r)){e.push(u.i,r.i,l.i),yd(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=RU(Jo(r),e),_d(r,e,t,i,s,n,2)):o===2&&BU(r,e,t,i,s,n):_d(Jo(r),e,t,i,s,n,1);break}}}function PU(r){let e=r.prev,t=r,i=r.next;if(ct(e,t,i)>=0)return false;let s=e.x,n=t.x,o=i.x,a=e.y,u=t.y,l=i.y,c=Math.min(s,n,o),h=Math.min(a,u,l),d=Math.max(s,n,o),f=Math.max(a,u,l),m=i.next;for(;m!==e;){if(m.x>=c&&m.x<=d&&m.y>=h&&m.y<=f&&xd(s,a,n,u,o,l,m.x,m.y)&&ct(m.prev,m,m.next)>=0)return false;m=m.next;}return true}function MU(r,e,t,i){let s=r.prev,n=r,o=r.next;if(ct(s,n,o)>=0)return false;let a=s.x,u=n.x,l=o.x,c=s.y,h=n.y,d=o.y,f=Math.min(a,u,l),m=Math.min(c,h,d),_=Math.max(a,u,l),x=Math.max(c,h,d),g=wS(f,m,e,t,i),y=wS(_,x,e,t,i),v=r.prevZ,S=r.nextZ;for(;v&&v.z>=g&&S&&S.z<=y;){if(v.x>=f&&v.x<=_&&v.y>=m&&v.y<=x&&v!==s&&v!==o&&xd(a,c,u,h,l,d,v.x,v.y)&&ct(v.prev,v,v.next)>=0||(v=v.prevZ,S.x>=f&&S.x<=_&&S.y>=m&&S.y<=x&&S!==s&&S!==o&&xd(a,c,u,h,l,d,S.x,S.y)&&ct(S.prev,S,S.next)>=0))return false;S=S.nextZ;}for(;v&&v.z>=g;){if(v.x>=f&&v.x<=_&&v.y>=m&&v.y<=x&&v!==s&&v!==o&&xd(a,c,u,h,l,d,v.x,v.y)&&ct(v.prev,v,v.next)>=0)return false;v=v.prevZ;}for(;S&&S.z<=y;){if(S.x>=f&&S.x<=_&&S.y>=m&&S.y<=x&&S!==s&&S!==o&&xd(a,c,u,h,l,d,S.x,S.y)&&ct(S.prev,S,S.next)>=0)return false;S=S.nextZ;}return true}function RU(r,e){let t=r;do{let i=t.prev,s=t.next.next;!vl(i,s)&&RM(i,t,t.next,s)&&bd(i,s)&&bd(s,i)&&(e.push(i.i,t.i,s.i),yd(t),yd(t.next),t=r=s),t=t.next;}while(t!==r);return Jo(t)}function BU(r,e,t,i,s,n){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&NU(o,a)){let u=BM(o,a);o=Jo(o,o.next),u=Jo(u,u.next),_d(o,e,t,i,s,n,0),_d(u,e,t,i,s,n,0);return}a=a.next;}o=o.next;}while(o!==r)}function IU(r,e,t,i){let s=[];for(let n=0,o=e.length;n<o;n++){let a=e[n]*i,u=n<o-1?e[n+1]*i:r.length,l=PM(r,a,u,i,false);l===l.next&&(l.steiner=true),s.push(LU(l));}s.sort(DU);for(let n=0;n<s.length;n++)t=kU(s[n],t);return t}function DU(r,e){let t=r.x-e.x;if(t===0&&(t=r.y-e.y,t===0)){let i=(r.next.y-r.y)/(r.next.x-r.x),s=(e.next.y-e.y)/(e.next.x-e.x);t=i-s;}return t}function kU(r,e){let t=OU(r,e);if(!t)return e;let i=BM(t,r);return Jo(i,i.next),Jo(t,t.next)}function OU(r,e){let t=e,i=r.x,s=r.y,n=-1/0,o;if(vl(r,t))return t;do{if(vl(r,t.next))return t.next;if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){let h=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=i&&h>n&&(n=h,o=t.x<t.next.x?t:t.next,h===i))return o}t=t.next;}while(t!==e);if(!o)return null;let a=o,u=o.x,l=o.y,c=1/0;t=o;do{if(i>=t.x&&t.x>=u&&i!==t.x&&MM(s<l?i:n,s,u,l,s<l?n:i,s,t.x,t.y)){let h=Math.abs(s-t.y)/(i-t.x);bd(t,r)&&(h<c||h===c&&(t.x>o.x||t.x===o.x&&FU(o,t)))&&(o=t,c=h);}t=t.next;}while(t!==a);return o}function FU(r,e){return ct(r.prev,r,e.prev)<0&&ct(e.next,r,r.next)<0}function GU(r,e,t,i){let s=r;do s.z===0&&(s.z=wS(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==r);s.prevZ.nextZ=null,s.prevZ=null,UU(s);}function UU(r){let e,t=1;do{let i=r,s;r=null;let n=null;for(e=0;i;){e++;let o=i,a=0;for(let l=0;l<t&&(a++,o=o.nextZ,!!o);l++);let u=t;for(;a>0||u>0&&o;)a!==0&&(u===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,u--),n?n.nextZ=s:r=s,s.prevZ=n,n=s;i=o;}n.nextZ=null,t*=2;}while(e>1);return r}function wS(r,e,t,i,s){return r=(r-t)*s|0,e=(e-i)*s|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function LU(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function MM(r,e,t,i,s,n,o,a){return (s-o)*(e-a)>=(r-o)*(n-a)&&(r-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(n-a)>=(s-o)*(i-a)}function xd(r,e,t,i,s,n,o,a){return !(r===o&&e===a)&&MM(r,e,t,i,s,n,o,a)}function NU(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!VU(r,e)&&(bd(r,e)&&bd(e,r)&&HU(r,e)&&(ct(r.prev,r,e.prev)||ct(r,e.prev,e))||vl(r,e)&&ct(r.prev,r,r.next)>0&&ct(e.prev,e,e.next)>0)}function ct(r,e,t){return (e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function vl(r,e){return r.x===e.x&&r.y===e.y}function RM(r,e,t,i){let s=xx(ct(r,e,t)),n=xx(ct(r,e,i)),o=xx(ct(t,i,r)),a=xx(ct(t,i,e));return !!(s!==n&&o!==a||s===0&&gx(r,t,e)||n===0&&gx(r,i,e)||o===0&&gx(t,r,i)||a===0&&gx(t,e,i))}function gx(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function xx(r){return r>0?1:r<0?-1:0}function VU(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&RM(t,t.next,r,e))return true;t=t.next;}while(t!==r);return false}function bd(r,e){return ct(r.prev,r,r.next)<0?ct(r,e,r.next)>=0&&ct(r,r.prev,e)>=0:ct(r,e,r.prev)<0||ct(r,r.next,e)<0}function HU(r,e){let t=r,i=false,s=(r.x+e.x)/2,n=(r.y+e.y)/2;do t.y>n!=t.next.y>n&&t.next.y!==t.y&&s<(t.next.x-t.x)*(n-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function BM(r,e){let t=PS(r.i,r.x,r.y),i=PS(e.i,e.x,e.y),s=r.next,n=e.prev;return r.next=e,e.prev=r,t.next=s,s.prev=t,i.next=t,t.prev=i,n.next=i,i.prev=n,i}function wM(r,e,t,i){let s=PS(r,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function yd(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ);}function PS(r,e,t){return {i:r,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:false}}function zU(r,e,t,i){let s=0;for(let n=e,o=t-i;n<t;n+=i)s+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return s}var IM=p(()=>{});var bx,MS=p(()=>{IM();Wt();bx=_x.default||_x;});function Tl(r,e,t,i,s,n,o){let a=bx(r,e,2);if(!a)return;for(let l=0;l<a.length;l+=3)n[o++]=a[l]+s,n[o++]=a[l+1]+s,n[o++]=a[l+2]+s;let u=s*i;for(let l=0;l<r.length;l+=2)t[u]=r[l],t[u+1]=r[l+1],u+=i;}var yx=p(()=>{MS();});var WU,vx,RS=p(()=>{P();yx();WU=[],vx={extension:{type:b.ShapeBuilder,name:"polygon"},build(r,e){for(let t=0;t<r.points.length;t++)e[t]=r.points[t];return true},triangulate(r,e,t,i,s,n){Tl(r,WU,e,t,i,s,n);}};});var Tx,BS=p(()=>{P();Tx={extension:{type:b.ShapeBuilder,name:"rectangle"},build(r,e){let t=r,i=t.x,s=t.y,n=t.width,o=t.height;return n>0&&o>0?(e[0]=i,e[1]=s,e[2]=i+n,e[3]=s,e[4]=i+n,e[5]=s+o,e[6]=i,e[7]=s+o,true):false},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[6],e[i+o+1]=r[7],o+=t,e[i+o]=r[4],e[i+o+1]=r[5],o+=t;let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2,s[n++]=a+1,s[n++]=a+3,s[n++]=a+2;}};});var Sx,IS=p(()=>{P();Sx={extension:{type:b.ShapeBuilder,name:"triangle"},build(r,e){return e[0]=r.x,e[1]=r.y,e[2]=r.x2,e[3]=r.y2,e[4]=r.x3,e[5]=r.y3,true},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[4],e[i+o+1]=r[5];let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2;}};});function kM(r,e){for(let t=0;t<e.length;t++){let i=e[t];r.addColorStop(i.offset,i.color);}}function OM(r,e){let t=H.get().createCanvas(r,e),i=t.getContext("2d");return {canvas:t,context:i}}function XU(r){let e=r[0]??{};return (typeof e=="number"||r[1])&&(G("8.5.2","use options object instead"),e={type:"linear",start:{x:r[0],y:r[1]},end:{x:r[2],y:r[3]},textureSpace:r[4],textureSize:r[5]??tr.defaultLinearOptions.textureSize}),e}var DM,kS,tr,ea=p(()=>{vt();Be();Te();qo();Se();Pt();Pe();an();DM=[{offset:0,color:"white"},{offset:1,color:"black"}],kS=class DS{constructor(...e){this.uid=de("fillGradient"),this.type="linear",this.colorStops=[];let t=XU(e);t={...t.type==="radial"?DS.defaultRadialOptions:DS.defaultLinearOptions,...Ot(t)},this._textureSize=t.textureSize,this._wrapMode=t.wrapMode,t.type==="radial"?(this.center=t.center,this.outerCenter=t.outerCenter??this.center,this.innerRadius=t.innerRadius,this.outerRadius=t.outerRadius,this.scale=t.scale,this.rotation=t.rotation):(this.start=t.start,this.end=t.end),this.textureSpace=t.textureSpace,this.type=t.type,t.colorStops.forEach(s=>{this.addColorStop(s.offset,s.color);});}addColorStop(e,t){return this.colorStops.push({offset:e,color:te.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:i,y:s}=this.end,n=i-e,o=s-t,a=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){let x=e;e=i,i=x,n*=-1;}if(o<0){let x=t;t=s,s=x,o*=-1;}}let u=this.colorStops.length?this.colorStops:DM,l=this._textureSize,{canvas:c,context:h}=OM(l,1),d=a?h.createLinearGradient(this._textureSize,0,0,0):h.createLinearGradient(0,0,this._textureSize,0);kM(d,u),h.fillStyle=d,h.fillRect(0,0,l,1),this.texture=new B({source:new Qt({resource:c,addressMode:this._wrapMode})});let f=Math.sqrt(n*n+o*o),m=Math.atan2(o,n),_=new O;_.scale(f/l,1),_.rotate(m),_.translate(e,t),this.textureSpace==="local"&&_.scale(l,l),this.transform=_;}buildGradient(){this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient();}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:DM,t=this._textureSize,{canvas:i,context:s}=OM(t,t),{x:n,y:o}=this.center,{x:a,y:u}=this.outerCenter,l=this.innerRadius,c=this.outerRadius,h=a-c,d=u-c,f=t/(c*2),m=(n-h)*f,_=(o-d)*f,x=s.createRadialGradient(m,_,l*f,(a-h)*f,(u-d)*f,c*f);kM(x,e),s.fillStyle=e[e.length-1].color,s.fillRect(0,0,t,t),s.fillStyle=x,s.translate(m,_),s.rotate(this.rotation),s.scale(1,this.scale),s.translate(-m,-_),s.fillRect(0,0,t,t),this.texture=new B({source:new Qt({resource:i,addressMode:this._wrapMode})});let g=new O;g.scale(1/f,1/f),g.translate(h,d),this.textureSpace==="local"&&g.scale(t,t),this.transform=g;}get styleKey(){return this.uid}destroy(){this.texture?.destroy(true),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null;}};kS.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};kS.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};tr=kS;});function Ex(r,e,t,i){let s=e.matrix?r.copyFrom(e.matrix).invert():r.identity();if(e.textureSpace==="local"){let o=t.getBounds(jU);e.width&&o.pad(e.width);let{x:a,y:u}=o,l=1/o.width,c=1/o.height,h=-a*l,d=-u*c,f=s.a,m=s.b,_=s.c,x=s.d;s.a*=l,s.b*=l,s.c*=c,s.d*=c,s.tx=h*f+d*_+s.tx,s.ty=h*m+d*x+s.ty;}else s.translate(e.texture.frame.x,e.texture.frame.y),s.scale(1/e.texture.source.width,1/e.texture.source.height);let n=e.texture.source.style;return !(e.fill instanceof tr)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),i&&s.append(YU.copyFrom(i).invert()),s}var YU,jU,OS=p(()=>{Te();xt();ea();YU=new O,jU=new re;});function Ax(r,e){let{geometryData:t,batches:i}=e;i.length=0,t.indices.length=0,t.vertices.length=0,t.uvs.length=0;for(let s=0;s<r.instructions.length;s++){let n=r.instructions[s];if(n.action==="texture")KU(n.data,i,t);else if(n.action==="fill"||n.action==="stroke"){let o=n.action==="stroke",a=n.data.path.shapePath,u=n.data.style,l=n.data.hole;o&&l&&FM(l.shapePath,u,true,i,t),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),FM(a,u,o,i,t);}}}function KU(r,e,t){let i=[],s=Sl.rectangle,n=$U;n.x=r.dx,n.y=r.dy,n.width=r.dw,n.height=r.dh;let o=r.transform;if(!s.build(n,i))return;let{vertices:a,uvs:u,indices:l}=t,c=l.length,h=a.length/2;o&&gd(i,o),s.triangulate(i,a,2,h,l,c);let d=r.image,f=d.uvs;u.push(f.x0,f.y0,f.x1,f.y1,f.x3,f.y3,f.x2,f.y2);let m=He.get(ks);m.indexOffset=c,m.indexSize=l.length-c,m.attributeOffset=h,m.attributeSize=a.length/2-h,m.baseColor=r.style,m.alpha=r.alpha,m.texture=d,m.geometryData=t,e.push(m);}function FM(r,e,t,i,s){let{vertices:n,uvs:o,indices:a}=s;r.shapePrimitives.forEach(({shape:u,transform:l,holes:c})=>{let h=[],d=Sl[u.type];if(!d.build(u,h))return;let f=a.length,m=n.length/2,_="triangle-list";if(l&&gd(h,l),t){let v=u.closePath??true,S=e;S.pixelLine?(mx(h,v,n,a),_="line-list"):px(h,S,false,v,n,a);}else if(c){let v=[],S=h.slice();ZU(c).forEach(E=>{v.push(S.length/2),S.push(...E);}),Tl(S,v,n,2,m,a,f);}else d.triangulate(h,n,2,m,a,f);let x=o.length/2,g=e.texture;if(g!==B.WHITE){let v=Ex(qU,e,u,l);ox(n,2,m,o,x,2,n.length/2-m,v);}else ax(o,x,2,n.length/2-m);let y=He.get(ks);y.indexOffset=f,y.indexSize=a.length-f,y.attributeOffset=m,y.attributeSize=n.length/2-m,y.baseColor=e.color,y.alpha=e.alpha,y.texture=g,y.geometryData=s,y.topology=_,i.push(y);});}function ZU(r){let e=[];for(let t=0;t<r.length;t++){let i=r[t].shape,s=[];Sl[i.type].build(i,s)&&e.push(s);}return e}var Sl,$U,qU,FS=p(()=>{P();Te();xt();vS();TS();Se();Xi();ux();SS();AS();CS();RS();BS();IS();OS();yx();Sl={};V.handleByMap(b.ShapeBuilder,Sl);V.add(Tx,vx,Sx,Mn,lx,cx);$U=new re,qU=new O;});var vd,Td,US,Rn,Sd=p(()=>{P();od();nx();eg();Pe();Xi();FS();vd=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]};}},Td=class{constructor(){this.instructions=new on;}init(e){this.batcher=new Zo({maxTextures:e}),this.instructions.reset();}get geometry(){return G(Fm,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}},US=class GS{constructor(e){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuContextHash"),e.renderableGC.addManagedHash(this,"_graphicsDataContextHash");}init(e){GS.defaultOptions.bezierSmoothness=e?.bezierSmoothness??GS.defaultOptions.bezierSmoothness;}getContextRenderData(e){return this._graphicsDataContextHash[e.uid]||this._initContextRenderData(e)}updateGpuContext(e){let t=this._gpuContextHash[e.uid]||this._initContext(e);if(e.dirty){t?this._cleanGraphicsContextData(e):t=this._initContext(e),Ax(e,t);let i=e.batchMode;e.customShader||i==="no-batch"?t.isBatchable=false:i==="auto"?t.isBatchable=t.geometryData.vertices.length<400:t.isBatchable=true,e.dirty=false;}return t}getGpuContext(e){return this._gpuContextHash[e.uid]||this._initContext(e)}_initContextRenderData(e){let t=He.get(Td,{maxTextures:this._renderer.limits.maxBatchableTextures}),{batches:i,geometryData:s}=this._gpuContextHash[e.uid],n=s.vertices.length,o=s.indices.length;for(let c=0;c<i.length;c++)i[c].applyTransform=false;let a=t.batcher;a.ensureAttributeBuffer(n),a.ensureIndexBuffer(o),a.begin();for(let c=0;c<i.length;c++){let h=i[c];a.add(h);}a.finish(t.instructions);let u=a.geometry;u.indexBuffer.setDataWithSize(a.indexBuffer,a.indexSize,true),u.buffers[0].setDataWithSize(a.attributeBuffer.float32View,a.attributeSize,true);let l=a.batches;for(let c=0;c<l.length;c++){let h=l[c];h.bindGroup=_n(h.textures.textures,h.textures.count,this._renderer.limits.maxBatchableTextures);}return this._graphicsDataContextHash[e.uid]=t,t}_initContext(e){let t=new vd;return t.context=e,this._gpuContextHash[e.uid]=t,e.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]}onGraphicsContextDestroy(e){this._cleanGraphicsContextData(e),e.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]=null;}_cleanGraphicsContextData(e){let t=this._gpuContextHash[e.uid];t.isBatchable||this._graphicsDataContextHash[e.uid]&&(He.return(this.getContextRenderData(e)),this._graphicsDataContextHash[e.uid]=null),t.batches&&t.batches.forEach(i=>{He.return(i);});}destroy(){for(let e in this._gpuContextHash)this._gpuContextHash[e]&&this.onGraphicsContextDestroy(this._gpuContextHash[e].context);}};US.extension={type:[b.WebGLSystem,b.WebGPUSystem,b.CanvasSystem],name:"graphicsContext"};US.defaultOptions={bezierSmoothness:.5};Rn=US;});var QU,LS,NS,VS,HS,zS,WS,XS,Ze,Or=p(()=>{QU={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},LS=0,NS=1,VS=2,HS=3,zS=4,WS=5,XS=class GM{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=true,this.depthMask=true;}get blend(){return !!(this.data&1<<LS)}set blend(e){!!(this.data&1<<LS)!==e&&(this.data^=1<<LS);}get offsets(){return !!(this.data&1<<NS)}set offsets(e){!!(this.data&1<<NS)!==e&&(this.data^=1<<NS);}set cullMode(e){if(e==="none"){this.culling=false;return}this.culling=true,this.clockwiseFrontFace=e==="front";}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return !!(this.data&1<<VS)}set culling(e){!!(this.data&1<<VS)!==e&&(this.data^=1<<VS);}get depthTest(){return !!(this.data&1<<HS)}set depthTest(e){!!(this.data&1<<HS)!==e&&(this.data^=1<<HS);}get depthMask(){return !!(this.data&1<<WS)}set depthMask(e){!!(this.data&1<<WS)!==e&&(this.data^=1<<WS);}get clockwiseFrontFace(){return !!(this.data&1<<zS)}set clockwiseFrontFace(e){!!(this.data&1<<zS)!==e&&(this.data^=1<<zS);}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=QU[e]||0;}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e;}toString(){return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let e=new GM;return e.depthTest=false,e.blend=true,e}};XS.default2d=XS.for2d();Ze=XS;});function UM(r,e,t,i){t[i++]=(r>>16&255)/255,t[i++]=(r>>8&255)/255,t[i++]=(r&255)/255,t[i++]=e;}function ti(r,e,t){let i=(r>>24&255)/255;e[t++]=(r&255)/255*i,e[t++]=(r>>8&255)/255*i,e[t++]=(r>>16&255)/255*i,e[t++]=i;}var ta=p(()=>{});var Ed,ra,YS=p(()=>{P();Or();Xi();ta();ux();Ed=class{constructor(){this.batches=[],this.batched=false;}destroy(){this.batches.forEach(e=>{He.return(e);}),this.batches.length=0;}},ra=class{constructor(e,t){this.state=Ze.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this);}contextChange(){this._adaptor.contextChange(this.renderer);}validateRenderable(e){let t=e.context,i=!!e._gpuData,s=this.renderer.graphicsContext.updateGpuContext(t);return !!(s.isBatchable||i!==s.isBatchable)}addRenderable(e,t){let i=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),i.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e));}updateRenderable(e){let i=this._getGpuDataForRenderable(e).batches;for(let s=0;s<i.length;s++){let n=i[s];n._batcher.updateElement(n);}}execute(e){if(!e.isRenderable)return;let t=this.renderer,i=e.context;if(!t.graphicsContext.getGpuContext(i).batches.length)return;let n=i.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;let o=n.resources.localUniforms.uniforms;o.uTransformMatrix=e.groupTransform,o.uRound=t._roundPixels|e._roundPixels,ti(e.groupColorAlpha,o.uColor,0),this._adaptor.execute(this,e);}_rebuild(e){let t=this._getGpuDataForRenderable(e),i=this.renderer.graphicsContext.updateGpuContext(e.context);t.destroy(),i.isBatchable&&this._updateBatchesForRenderable(e,t);}_addToBatcher(e,t){let i=this.renderer.renderPipes.batch,s=this._getGpuDataForRenderable(e).batches;for(let n=0;n<s.length;n++){let o=s[n];i.addToBatch(o,t);}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){let t=new Ed;return e._gpuData[this.renderer.uid]=t,t}_updateBatchesForRenderable(e,t){let i=e.context,s=this.renderer.graphicsContext.getGpuContext(i),n=this.renderer._roundPixels|e._roundPixels;t.batches=s.batches.map(o=>{let a=He.get(ks);return o.copyTo(a),a.renderable=e,a.roundPixels=n,a});}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;}};ra.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"graphics"};});var jS=p(()=>{P();Sd();YS();V.add(ra);V.add(Rn);});var Zi,Ad=p(()=>{Zi=class{constructor(){this.batcherName="default",this.packAsQuad=false,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1;}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(e){this._topology=e;}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1;}setTexture(e){this.texture!==e&&(this.texture=e,this._textureMatrixUpdateId=-1);}get uvs(){let t=this.geometry.getBuffer("aUV"),i=t.data,s=i,n=this.texture.textureMatrix;return n.isSimple||(s=this._transformedUvs,(this._textureMatrixUpdateId!==n._updateID||this._uvUpdateId!==t._updateID)&&((!s||s.length<i.length)&&(s=this._transformedUvs=new Float32Array(i.length)),this._textureMatrixUpdateId=n._updateID,this._uvUpdateId=t._updateID,n.multiplyUvs(i,s))),s}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}};});var El,ia,$S=p(()=>{P();Te();Rs();_t();cl();ta();Ad();El=class{destroy(){}},ia=class{constructor(e,t){this.localUniforms=new be({uTransformMatrix:{value:new O,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new Tt({0:this.localUniforms}),this.renderer=e,this._adaptor=t,this._adaptor.init();}validateRenderable(e){let t=this._getMeshData(e),i=t.batched,s=e.batched;if(t.batched=s,i!==s)return true;if(s){let n=e._geometry;if(n.indices.length!==t.indexSize||n.positions.length!==t.vertexSize)return t.indexSize=n.indices.length,t.vertexSize=n.positions.length,true;let o=this._getBatchableMesh(e);return o.texture.uid!==e._texture.uid&&(o._textureMatrixUpdateId=-1),!o._batcher.checkAndUpdateTexture(o,e._texture)}return false}addRenderable(e,t){let i=this.renderer.renderPipes.batch,s=this._getMeshData(e);if(e.didViewUpdate&&(s.indexSize=e._geometry.indices?.length,s.vertexSize=e._geometry.positions?.length),s.batched){let n=this._getBatchableMesh(e);n.setTexture(e._texture),n.geometry=e._geometry,i.addToBatch(n,t);}else i.break(t),t.add(e);}updateRenderable(e){if(e.batched){let t=this._getBatchableMesh(e);t.setTexture(e._texture),t.geometry=e._geometry,t._batcher.updateElement(t);}}execute(e){if(!e.isRenderable)return;e.state.blendMode=yi(e.groupBlendMode,e.texture._source);let t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),ti(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e);}_getMeshData(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new El),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:0,vertexSize:0},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new El),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){let t=new Zi;return t.renderable=e,t.setTexture(e._texture),t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,e._gpuData[this.renderer.uid].batchableMesh=t,t}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null;}};ia.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"mesh"};});var qS=p(()=>{P();$S();V.add(ia);});var Al,KS=p(()=>{Al=class{execute(e,t){let i=e.state,s=e.renderer,n=t.shader||e.defaultShader;n.resources.uTexture=t.texture._source,n.resources.uniforms=e.localUniforms;let o=s.gl,a=e.getBuffers(t);s.shader.bind(n),s.state.set(i),s.geometry.bind(a.geometry,n.glProgram);let l=a.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;o.drawElements(o.TRIANGLES,t.particleChildren.length*6,l,0);}};});function Cd(r,e=null){let t=r*6;if(t>65535?e||(e=new Uint32Array(t)):e||(e=new Uint16Array(t)),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let i=0,s=0;i<t;i+=6,s+=4)e[i+0]=s+0,e[i+1]=s+1,e[i+2]=s+2,e[i+3]=s+0,e[i+4]=s+2,e[i+5]=s+3;return e}var ZS=p(()=>{});function Cx(r){return {dynamicUpdate:LM(r,true),staticUpdate:LM(r,false)}}function LM(r,e){let t=[];t.push(`
|
|
261
261
|
|
|
262
262
|
var index = 0;
|
|
263
263
|
|
|
@@ -371,10 +371,10 @@ fn mainFragment(
|
|
|
371
371
|
var sample = textureSample(uTexture, uSampler, uv) * color;
|
|
372
372
|
|
|
373
373
|
return sample;
|
|
374
|
-
}`;});var wl,i2=p(()=>{vt();Te();br();Dr();ei();Se();ji();e2();t2();r2();wl=class extends it{constructor(){let e=je.from({vertex:Px,fragment:wx}),t=$e.from({fragment:{source:wd,entryPoint:"mainFragment"},vertex:{source:wd,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:B.WHITE.source,uSampler:new mt({}),uniforms:{uTranslationMatrix:{value:new O,type:"mat3x3<f32>"},uColor:{value:new te(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}});}};});var Bn,Mx=p(()=>{Te();_t();cl();Or();ta();JS();i2();Bn=class{constructor(e,t){this.state=Ze.for2d(),this.localUniforms=new be({uTranslationMatrix:{value:new O,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=e,this.adaptor=t,this.defaultShader=new wl,this.state=Ze.for2d();}validateRenderable(e){return false}addRenderable(e,t){this.renderer.renderPipes.batch.break(t),t.add(e);}getBuffers(e){return e._gpuData[this.renderer.uid]||this._initBuffer(e)}_initBuffer(e){return e._gpuData[this.renderer.uid]=new Cl({size:e.particleChildren.length,properties:e._properties}),e._gpuData[this.renderer.uid]}updateRenderable(e){}execute(e){let t=e.particleChildren;if(t.length===0)return;let i=this.renderer,s=this.getBuffers(e);e.texture||(e.texture=t[0].texture);let n=this.state;s.update(t,e._childrenDirty),e._childrenDirty=false,n.blendMode=yi(e.blendMode,e.texture._source);let o=this.localUniforms.uniforms,a=o.uTranslationMatrix;e.worldTransform.copyTo(a),a.prepend(i.globalUniforms.globalUniformData.projectionMatrix),o.uResolution=i.globalUniforms.globalUniformData.resolution,o.uRound=i._roundPixels|e._roundPixels,ti(e.groupColorAlpha,o.uColor,0),this.adaptor.execute(this,e);}destroy(){this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null);}};});var sa,s2=p(()=>{P();KS();Mx();sa=class extends Bn{constructor(e){super(e,new Al);}};sa.extension={type:[b.WebGLPipes],name:"particle"};});var Pl,n2=p(()=>{Pl=class{execute(e,t){let i=e.renderer,s=t.shader||e.defaultShader;s.groups[0]=i.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms,true),s.groups[1]=i.texture.getTextureBindGroup(t.texture);let n=e.state,o=e.getBuffers(t);i.encoder.draw({geometry:o.geometry,shader:t.shader||e.defaultShader,state:n,size:t.particleChildren.length*6});}};});var na,o2=p(()=>{P();n2();Mx();na=class extends Bn{constructor(e){super(e,new Pl);}};na.extension={type:[b.WebGPUPipes],name:"particle"};});var a2=p(()=>{P();s2();o2();V.add(sa);V.add(na);});function oa(r,e){let{texture:t,bounds:i}=r,s=e._style._getFinalPadding();ul(i,e._anchor,t);let n=e._anchor._x*s*2,o=e._anchor._y*s*2;i.minX-=s-n,i.minY-=s-o,i.maxX-=s-n,i.maxY-=s-o;}var Rx=p(()=>{Sg();});var ri,Ml=p(()=>{ri=class{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=true,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null;}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null;}destroy(){}};});var Rl,u2=p(()=>{Ml();Rl=class extends ri{constructor(e){super(),this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.canvasText.returnTexture(this.texture),this._renderer=null;}};});var aa,l2=p(()=>{P();Rx();u2();aa=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e),e._didTextUpdate=false),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}_updateGpuText(e){let t=this._getGpuText(e);t.texture&&this._renderer.canvasText.returnTexture(t.texture),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=this._renderer.canvasText.getTexture(e),oa(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Rl(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};aa.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"text"};});var NM,Ti,Pd=p(()=>{Te();Pt();NM={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},Ti=class{constructor(e,t){this.uid=de("fillPattern"),this.transform=new O,this._styleKey=null,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=NM[t].addressModeU,e.source.style.addressModeV=NM[t].addressModeV);}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._styleKey=null;}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}destroy(){this.texture.destroy(true),this.texture=null,this._styleKey=null;}};});var HM=Wi((X$,VM)=>{VM.exports=tL;var c2={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},eL=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function tL(r){var e=[];return r.replace(eL,function(t,i,s){var n=i.toLowerCase();for(s=iL(s),n=="m"&&s.length>2&&(e.push([i].concat(s.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(s.length==c2[n])return s.unshift(i),e.push(s);if(s.length<c2[n])throw new Error("malformed path data");e.push([i].concat(s.splice(0,c2[n])));}}),e}var rL=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function iL(r){var e=r.match(rL);return e?e.map(Number):[]}});function Bx(r,e){let t=(0, zM.default)(r),i=[],s=null,n=0,o=0;for(let a=0;a<t.length;a++){let u=t[a],l=u[0],c=u;switch(l){case "M":n=c[1],o=c[2],e.moveTo(n,o);break;case "m":n+=c[1],o+=c[2],e.moveTo(n,o);break;case "H":n=c[1],e.lineTo(n,o);break;case "h":n+=c[1],e.lineTo(n,o);break;case "V":o=c[1],e.lineTo(n,o);break;case "v":o+=c[1],e.lineTo(n,o);break;case "L":n=c[1],o=c[2],e.lineTo(n,o);break;case "l":n+=c[1],o+=c[2],e.lineTo(n,o);break;case "C":n=c[5],o=c[6],e.bezierCurveTo(c[1],c[2],c[3],c[4],n,o);break;case "c":e.bezierCurveTo(n+c[1],o+c[2],n+c[3],o+c[4],n+c[5],o+c[6]),n+=c[5],o+=c[6];break;case "S":n=c[3],o=c[4],e.bezierCurveToShort(c[1],c[2],n,o);break;case "s":e.bezierCurveToShort(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "Q":n=c[3],o=c[4],e.quadraticCurveTo(c[1],c[2],n,o);break;case "q":e.quadraticCurveTo(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "T":n=c[1],o=c[2],e.quadraticCurveToShort(n,o);break;case "t":n+=c[1],o+=c[2],e.quadraticCurveToShort(n,o);break;case "A":n=c[6],o=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "a":n+=c[6],o+=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "Z":case "z":e.closePath(),i.length>0&&(s=i.pop(),s?(n=s.startX,o=s.startY):(n=0,o=0)),s=null;break;default:U(`Unknown SVG path command: ${l}`);}l!=="Z"&&l!=="z"&&s===null&&(s={startX:n,startY:o},i.push(s));}return e}var zM,h2=p(()=>{zM=Fh(HM());Ae();});var Bl,d2=p(()=>{xt();Bl=class r{constructor(e=0,t=0,i=0){this.type="circle",this.x=e,this.y=t,this.radius=i;}clone(){return new r(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return false;let i=this.radius*this.radius,s=this.x-e,n=this.y-t;return s*=s,n*=n,s+n<=i}strokeContains(e,t,i,s=.5){if(this.radius===0)return false;let n=this.x-e,o=this.y-t,a=this.radius,u=(1-s)*i,l=Math.sqrt(n*n+o*o);return l<=a+u&&l>a-(i-u)}getBounds(e){return e||(e=new re),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}};});var Il,f2=p(()=>{xt();Il=class r{constructor(e=0,t=0,i=0,s=0){this.type="ellipse",this.x=e,this.y=t,this.halfWidth=i,this.halfHeight=s;}clone(){return new r(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return false;let i=(e-this.x)/this.halfWidth,s=(t-this.y)/this.halfHeight;return i*=i,s*=s,i+s<=1}strokeContains(e,t,i,s=.5){let{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return false;let a=i*(1-s),u=i-a,l=n-u,c=o-u,h=n+a,d=o+a,f=e-this.x,m=t-this.y,_=f*f/(l*l)+m*m/(c*c),x=f*f/(h*h)+m*m/(d*d);return _>1&&x<=1}getBounds(e){return e||(e=new re),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};});function In(r,e,t,i,s,n){let o=r-t,a=e-i,u=s-t,l=n-i,c=o*u+a*l,h=u*u+l*l,d=-1;h!==0&&(d=c/h);let f,m;d<0?(f=t,m=i):d>1?(f=s,m=n):(f=t+d*u,m=i+d*l);let _=r-f,x=e-m;return _*_+x*x}var Ix=p(()=>{});var sL,nL,Dn,p2=p(()=>{Pe();Ix();xt();Dn=class r{constructor(...e){this.type="polygon";let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){let i=[];for(let s=0,n=t.length;s<n;s++)i.push(t[s].x,t[s].y);t=i;}this.points=t,this.closePath=true;}isClockwise(){let e=0,t=this.points,i=t.length;for(let s=0;s<i;s+=2){let n=t[s],o=t[s+1],a=t[(s+2)%i],u=t[(s+3)%i];e+=(a-n)*(u+o);}return e<0}containsPolygon(e){let t=this.getBounds(sL),i=e.getBounds(nL);if(!t.containsRect(i))return false;let s=e.points;for(let n=0;n<s.length;n+=2){let o=s[n],a=s[n+1];if(!this.contains(o,a))return false}return true}clone(){let e=this.points.slice(),t=new r(e);return t.closePath=this.closePath,t}contains(e,t){let i=false,s=this.points.length/2;for(let n=0,o=s-1;n<s;o=n++){let a=this.points[n*2],u=this.points[n*2+1],l=this.points[o*2],c=this.points[o*2+1];u>t!=c>t&&e<(l-a)*((t-u)/(c-u))+a&&(i=!i);}return i}strokeContains(e,t,i,s=.5){let n=i*i,o=n*(1-s),a=n-o,{points:u}=this,l=u.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){let h=u[c],d=u[c+1],f=u[(c+2)%u.length],m=u[(c+3)%u.length],_=In(e,t,h,d,f,m),x=Math.sign((f-h)*(t-d)-(m-d)*(e-h));if(_<=(x<0?a:o))return true}return false}getBounds(e){e||(e=new re);let t=this.points,i=1/0,s=-1/0,n=1/0,o=-1/0;for(let a=0,u=t.length;a<u;a+=2){let l=t[a],c=t[a+1];i=l<i?l:i,s=l>s?l:s,n=c<n?c:n,o=c>o?c:o;}return e.x=i,e.width=s-i,e.y=n,e.height=o-n,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return G("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return G("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}};});var Dx,Dl,m2=p(()=>{xt();Dx=(r,e,t,i,s,n,o)=>{let a=r-t,u=e-i,l=Math.sqrt(a*a+u*u);return l>=s-n&&l<=s+o},Dl=class r{constructor(e=0,t=0,i=0,s=0,n=20){this.type="roundedRectangle",this.x=e,this.y=t,this.width=i,this.height=s,this.radius=n;}getBounds(e){return e||(e=new re),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new r(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return false;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return true;let s=e-(this.x+i),n=t-(this.y+i),o=i*i;if(s*s+n*n<=o||(s=e-(this.x+this.width-i),s*s+n*n<=o)||(n=t-(this.y+this.height-i),s*s+n*n<=o)||(s=e-(this.x+i),s*s+n*n<=o))return true}return false}strokeContains(e,t,i,s=.5){let{x:n,y:o,width:a,height:u,radius:l}=this,c=i*(1-s),h=i-c,d=n+l,f=o+l,m=a-l*2,_=u-l*2,x=n+a,g=o+u;return (e>=n-c&&e<=n+h||e>=x-h&&e<=x+c)&&t>=f&&t<=f+_||(t>=o-c&&t<=o+h||t>=g-h&&t<=g+c)&&e>=d&&e<=d+m?true:e<d&&t<f&&Dx(e,t,d,f,l,h,c)||e>x-l&&t<f&&Dx(e,t,x-l,f,l,h,c)||e>x-l&&t>g-l&&Dx(e,t,x-l,g-l,l,h,c)||e<d&&t>g-l&&Dx(e,t,d,g-l,l,h,c)}toString(){return `[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};});function Ol(r,e,t,i,s,n,o,a,u,l){let h=Math.min(.99,Math.max(0,l??Rn.defaultOptions.bezierSmoothness)),d=(aL-h)/1;return d*=d,uL(e,t,i,s,n,o,a,u,r,d),r}function uL(r,e,t,i,s,n,o,a,u,l){x2(r,e,t,i,s,n,o,a,u,l,0),u.push(o,a);}function x2(r,e,t,i,s,n,o,a,u,l,c){if(c>oL)return;let h=Math.PI,d=(r+t)/2,f=(e+i)/2,m=(t+s)/2,_=(i+n)/2,x=(s+o)/2,g=(n+a)/2,y=(d+m)/2,v=(f+_)/2,S=(m+x)/2,C=(_+g)/2,A=(y+S)/2,M=(v+C)/2;if(c>0){let D=o-r,R=a-e,L=Math.abs((t-o)*R-(i-a)*D),F=Math.abs((s-o)*R-(n-a)*D),se,ye;if(L>kx&&F>kx){if((L+F)*(L+F)<=l*(D*D+R*R)){if(kl<g2){u.push(A,M);return}let ft=Math.atan2(n-i,s-t);if(se=Math.abs(ft-Math.atan2(i-e,t-r)),ye=Math.abs(Math.atan2(a-n,o-s)-ft),se>=h&&(se=2*h-se),ye>=h&&(ye=2*h-ye),se+ye<kl){u.push(A,M);return}if(ua!==0){if(se>ua){u.push(t,i);return}if(ye>ua){u.push(s,n);return}}}}else if(L>kx){if(L*L<=l*(D*D+R*R)){if(kl<g2){u.push(A,M);return}if(se=Math.abs(Math.atan2(n-i,s-t)-Math.atan2(i-e,t-r)),se>=h&&(se=2*h-se),se<kl){u.push(t,i),u.push(s,n);return}if(ua!==0&&se>ua){u.push(t,i);return}}}else if(F>kx){if(F*F<=l*(D*D+R*R)){if(kl<g2){u.push(A,M);return}if(se=Math.abs(Math.atan2(a-n,o-s)-Math.atan2(n-i,s-t)),se>=h&&(se=2*h-se),se<kl){u.push(t,i),u.push(s,n);return}if(ua!==0&&se>ua){u.push(s,n);return}}}else if(D=A-(r+o)/2,R=M-(e+a)/2,D*D+R*R<=l){u.push(A,M);return}}x2(r,e,d,f,y,v,A,M,u,l,c+1),x2(A,M,S,C,x,g,o,a,u,l,c+1);}var oL,kx,aL,g2,kl,ua,Ox=p(()=>{Sd();oL=8,kx=11920929e-14,aL=1,g2=.01,kl=0,ua=0;});function Fx(r,e,t,i,s,n,o,a){let l=Math.min(.99,Math.max(0,a??Rn.defaultOptions.bezierSmoothness)),c=(hL-l)/1;return c*=c,fL(e,t,i,s,n,o,r,c),r}function fL(r,e,t,i,s,n,o,a){_2(o,r,e,t,i,s,n,a,0),o.push(s,n);}function _2(r,e,t,i,s,n,o,a,u){if(u>lL)return;let l=Math.PI,c=(e+i)/2,h=(t+s)/2,d=(i+n)/2,f=(s+o)/2,m=(c+d)/2,_=(h+f)/2,x=n-e,g=o-t,y=Math.abs((i-n)*g-(s-o)*x);if(y>cL){if(y*y<=a*(x*x+g*g)){if(WM<dL){r.push(m,_);return}let v=Math.abs(Math.atan2(o-s,n-i)-Math.atan2(s-t,i-e));if(v>=l&&(v=2*l-v),v<WM){r.push(m,_);return}}}else if(x=m-(e+n)/2,g=_-(t+o)/2,x*x+g*g<=a){r.push(m,_);return}_2(r,e,t,c,h,m,_,a,u+1),_2(r,m,_,d,f,n,o,a,u+1);}var lL,cL,hL,dL,WM,b2=p(()=>{Sd();lL=8,cL=11920929e-14,hL=1,dL=.01,WM=0;});function Fl(r,e,t,i,s,n,o,a){let u=Math.abs(s-n);(!o&&s>n||o&&n>s)&&(u=2*Math.PI-u),a||(a=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(u/Math.PI)))),a=Math.max(a,3);let l=u/a,c=s;l*=o?-1:1;for(let h=0;h<a+1;h++){let d=Math.cos(c),f=Math.sin(c),m=e+d*i,_=t+f*i;r.push(m,_),c+=l;}}var Gx=p(()=>{});function Ux(r,e,t,i,s,n){let o=r[r.length-2],u=r[r.length-1]-t,l=o-e,c=s-t,h=i-e,d=Math.abs(u*h-l*c);if(d<1e-8||n===0){(r[r.length-2]!==e||r[r.length-1]!==t)&&r.push(e,t);return}let f=u*u+l*l,m=c*c+h*h,_=u*c+l*h,x=n*Math.sqrt(f)/d,g=n*Math.sqrt(m)/d,y=x*_/f,v=g*_/m,S=x*h+g*l,C=x*c+g*u,A=l*(g+y),M=u*(g+y),D=h*(x+v),R=c*(x+v),L=Math.atan2(M-C,A-S),F=Math.atan2(R-C,D-S);Fl(r,S+e,C+t,n,L,F,l*c>h*u);}var y2=p(()=>{Gx();});function pL(r,e){let t=e===-1.5707963267948966?-0.551915024494:1.3333333333333333*Math.tan(e/4),i=e===1.5707963267948966?.551915024494:t,s=Math.cos(r),n=Math.sin(r),o=Math.cos(r+e),a=Math.sin(r+e);return [{x:s-n*i,y:n+s*i},{x:o+a*i,y:a-o*i},{x:o,y:a}]}function Lx(r,e,t,i,s,n,o,a=0,u=0,l=0){if(n===0||o===0)return;let c=Math.sin(a*Md/360),h=Math.cos(a*Md/360),d=h*(e-i)/2+c*(t-s)/2,f=-c*(e-i)/2+h*(t-s)/2;if(d===0&&f===0)return;n=Math.abs(n),o=Math.abs(o);let m=Math.pow(d,2)/Math.pow(n,2)+Math.pow(f,2)/Math.pow(o,2);m>1&&(n*=Math.sqrt(m),o*=Math.sqrt(m)),mL(e,t,i,s,n,o,u,l,c,h,d,f,v2);let{ang1:_,ang2:x}=v2,{centerX:g,centerY:y}=v2,v=Math.abs(x)/(Md/4);Math.abs(1-v)<1e-7&&(v=1);let S=Math.max(Math.ceil(v),1);x/=S;let C=r[r.length-2],A=r[r.length-1],M={x:0,y:0};for(let D=0;D<S;D++){let R=pL(_,x),{x:L,y:F}=T2(R[0],n,o,h,c,g,y,M),{x:se,y:ye}=T2(R[1],n,o,h,c,g,y,M),{x:ft,y:ys}=T2(R[2],n,o,h,c,g,y,M);Ol(r,C,A,L,F,se,ye,ft,ys),C=ft,A=ys,_+=x;}}var Md,v2,T2,XM,mL,S2=p(()=>{Ox();Md=Math.PI*2,v2={centerX:0,centerY:0,ang1:0,ang2:0},T2=({x:r,y:e},t,i,s,n,o,a,u)=>{r*=t,e*=i;let l=s*r-n*e,c=n*r+s*e;return u.x=l+o,u.y=c+a,u};XM=(r,e,t,i)=>{let s=r*i-e*t<0?-1:1,n=r*t+e*i;return n>1&&(n=1),n<-1&&(n=-1),s*Math.acos(n)},mL=(r,e,t,i,s,n,o,a,u,l,c,h,d)=>{let f=Math.pow(s,2),m=Math.pow(n,2),_=Math.pow(c,2),x=Math.pow(h,2),g=f*m-f*x-m*_;g<0&&(g=0),g/=f*x+m*_,g=Math.sqrt(g)*(o===a?-1:1);let y=g*s/n*h,v=g*-n/s*c,S=l*y-u*v+(r+t)/2,C=u*y+l*v+(e+i)/2,A=(c-y)/s,M=(h-v)/n,D=(-c-y)/s,R=(-h-v)/n,L=XM(1,0,A,M),F=XM(A,M,D,R);a===0&&F>0&&(F-=Md),a===1&&F<0&&(F+=Md),d.centerX=S,d.centerY=C,d.ang1=L,d.ang2=F;};});function Nx(r,e,t){let i=(o,a)=>{let u=a.x-o.x,l=a.y-o.y,c=Math.sqrt(u*u+l*l),h=u/c,d=l/c;return {len:c,nx:h,ny:d}},s=(o,a)=>{o===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y);},n=e[e.length-1];for(let o=0;o<e.length;o++){let a=e[o%e.length],u=a.radius??t;if(u<=0){s(o,a),n=a;continue}let l=e[(o+1)%e.length],c=i(a,n),h=i(a,l);if(c.len<1e-4||h.len<1e-4){s(o,a),n=a;continue}let d=Math.asin(c.nx*h.ny-c.ny*h.nx),f=1,m=false;c.nx*h.nx-c.ny*-h.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,f=-1,m=true):d>0&&(f=-1,m=true);let _=d/2,x,g=Math.abs(Math.cos(_)*u/Math.sin(_));g>Math.min(c.len/2,h.len/2)?(g=Math.min(c.len/2,h.len/2),x=Math.abs(g*Math.sin(_)/Math.cos(_))):x=u;let y=a.x+h.nx*g+-h.ny*x*f,v=a.y+h.ny*g+h.nx*x*f,S=Math.atan2(c.ny,c.nx)+Math.PI/2*f,C=Math.atan2(h.ny,h.nx)-Math.PI/2*f;o===0&&r.moveTo(y+Math.cos(S)*x,v+Math.sin(S)*x),r.arc(y,v,x,S,C,m),n=a;}}function Vx(r,e,t,i){let s=(a,u)=>Math.sqrt((a.x-u.x)**2+(a.y-u.y)**2),n=(a,u,l)=>({x:a.x+(u.x-a.x)*l,y:a.y+(u.y-a.y)*l}),o=e.length;for(let a=0;a<o;a++){let u=e[(a+1)%o],l=u.radius??t;if(l<=0){a===0?r.moveTo(u.x,u.y):r.lineTo(u.x,u.y);continue}let c=e[a],h=e[(a+2)%o],d=s(c,u),f;if(d<1e-4)f=u;else {let x=Math.min(d/2,l);f=n(u,c,x/d);}let m=s(h,u),_;if(m<1e-4)_=u;else {let x=Math.min(m/2,l);_=n(u,h,x/m);}a===0?r.moveTo(f.x,f.y):r.lineTo(f.x,f.y),r.quadraticCurveTo(u.x,u.y,_.x,_.y,i);}}var E2=p(()=>{});var gL,Gl,A2=p(()=>{d2();f2();p2();xt();m2();Xt();Ox();b2();Gx();y2();S2();E2();gL=new re,Gl=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new Me,this._graphicsPath2D=e,this.signed=e.checkForHoles;}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let i=this._currentPoly.points,s=i[i.length-2],n=i[i.length-1];return (s!==e||n!==t)&&i.push(e,t),this}arc(e,t,i,s,n,o){this._ensurePoly(false);let a=this._currentPoly.points;return Fl(a,e,t,i,s,n,o),this}arcTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly.points;return Ux(o,e,t,i,s,n),this}arcToSvg(e,t,i,s,n,o,a){let u=this._currentPoly.points;return Lx(u,this._currentPoly.lastX,this._currentPoly.lastY,o,a,e,t,i,s,n),this}bezierCurveTo(e,t,i,s,n,o,a){this._ensurePoly();let u=this._currentPoly;return Ol(this._currentPoly.points,u.lastX,u.lastY,e,t,i,s,n,o,a),this}quadraticCurveTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly;return Fx(this._currentPoly.points,o.lastX,o.lastY,e,t,i,s,n),this}closePath(){return this.endPoly(true),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(true),e.transform(t));let i=this.shapePrimitives,s=i.length;for(let n=0;n<e.instructions.length;n++){let o=e.instructions[n];this[o.action](...o.data);}if(e.checkForHoles&&i.length-s>1){let n=null;for(let o=s;o<i.length;o++){let a=i[o];if(a.shape.type==="polygon"){let u=a.shape,l=n?.shape;l&&l.containsPolygon(u)?(n.holes||(n.holes=[]),n.holes.push(a),i.copyWithin(o,o+1),i.length--,o--):n=a;}}}return this}finish(e=false){this.endPoly(e);}rect(e,t,i,s,n){return this.drawShape(new re(e,t,i,s),n),this}circle(e,t,i,s){return this.drawShape(new Bl(e,t,i),s),this}poly(e,t,i){let s=new Dn(e);return s.closePath=t,this.drawShape(s,i),this}regularPoly(e,t,i,s,n=0,o){s=Math.max(s|0,3);let a=-1*Math.PI/2+n,u=Math.PI*2/s,l=[];for(let c=0;c<s;c++){let h=a-c*u;l.push(e+i*Math.cos(h),t+i*Math.sin(h));}return this.poly(l,true,o),this}roundPoly(e,t,i,s,n,o=0,a){if(s=Math.max(s|0,3),n<=0)return this.regularPoly(e,t,i,s,o);let u=i*Math.sin(Math.PI/s)-.001;n=Math.min(n,u);let l=-1*Math.PI/2+o,c=Math.PI*2/s,h=(s-2)*Math.PI/s/2;for(let d=0;d<s;d++){let f=d*c+l,m=e+i*Math.cos(f),_=t+i*Math.sin(f),x=f+Math.PI+h,g=f-Math.PI-h,y=m+n*Math.cos(x),v=_+n*Math.sin(x),S=m+n*Math.cos(g),C=_+n*Math.sin(g);d===0?this.moveTo(y,v):this.lineTo(y,v),this.quadraticCurveTo(m,_,S,C,a);}return this.closePath()}roundShape(e,t,i=false,s){return e.length<3?this:(i?Vx(this,e,t,s):Nx(this,e,t),this.closePath())}filletRect(e,t,i,s,n){if(n===0)return this.rect(e,t,i,s);let o=Math.min(i,s)/2,a=Math.min(o,Math.max(-o,n)),u=e+i,l=t+s,c=a<0?-a:0,h=Math.abs(a);return this.moveTo(e,t+h).arcTo(e+c,t+c,e+h,t,h).lineTo(u-h,t).arcTo(u-c,t+c,u,t+h,h).lineTo(u,l-h).arcTo(u-c,l-c,e+i-h,l,h).lineTo(e+h,l).arcTo(e+c,l-c,e,l-h,h).closePath()}chamferRect(e,t,i,s,n,o){if(n<=0)return this.rect(e,t,i,s);let a=Math.min(n,Math.min(i,s)/2),u=e+i,l=t+s,c=[e+a,t,u-a,t,u,t+a,u,l-a,u-a,l,e+a,l,e,l-a,e,t+a];for(let h=c.length-1;h>=2;h-=2)c[h]===c[h-2]&&c[h-1]===c[h-3]&&c.splice(h-1,2);return this.poly(c,true,o)}ellipse(e,t,i,s,n){return this.drawShape(new Il(e,t,i,s),n),this}roundRect(e,t,i,s,n,o){return this.drawShape(new Dl(e,t,i,s,n),o),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let i=this._currentPoly;return i&&this.endPoly(),i=new Dn,i.points.push(e,t),this._currentPoly=i,this}endPoly(e=false){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=true){if(!this._currentPoly&&(this._currentPoly=new Dn,e)){let t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let i=t.shape.x,s=t.shape.y;if(t.transform&&!t.transform.isIdentity()){let n=t.transform,o=i;i=n.a*i+n.c*s+n.tx,s=n.b*o+n.d*s+n.ty;}this._currentPoly.points.push(i,s);}else this._currentPoly.points.push(0,0);}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];this[i.action](...i.data);}this.finish();}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let i=0;i<t.length;i++){let s=t[i],n=s.shape.getBounds(gL);s.transform?e.addRect(n,s.transform):e.addRect(n);}return e}};});function Rd(r,e){return r?r.prepend(e):e.clone()}var Qi,Hx=p(()=>{_r();Pt();Ae();h2();A2();Qi=class r{constructor(e,t=false){this.instructions=[],this.uid=de("graphicsPath"),this._dirty=true,this.checkForHoles=t,typeof e=="string"?Bx(e,this):this.instructions=e?.slice()??[];}get shapePath(){return this._shapePath||(this._shapePath=new Gl(this)),this._dirty&&(this._dirty=false,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,t]}),this._dirty=true,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=true,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=true,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=true,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=true,this}bezierCurveToShort(e,t,i,s,n){let o=this.instructions[this.instructions.length-1],a=this.getLastPoint(ge.shared),u=0,l=0;if(!o||o.action!=="bezierCurveTo")u=a.x,l=a.y;else {u=o.data[2],l=o.data[3];let c=a.x,h=a.y;u=c+(c-u),l=h+(h-l);}return this.instructions.push({action:"bezierCurveTo",data:[u,l,e,t,i,s,n]}),this._dirty=true,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=true,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=true,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=true,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=true,this}quadraticCurveToShort(e,t,i){let s=this.instructions[this.instructions.length-1],n=this.getLastPoint(ge.shared),o=0,a=0;if(!s||s.action!=="quadraticCurveTo")o=n.x,a=n.y;else {o=s.data[0],a=s.data[1];let u=n.x,l=n.y;o=u+(u-o),a=l+(l-a);}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,e,t,i]}),this._dirty=true,this}rect(e,t,i,s,n){return this.instructions.push({action:"rect",data:[e,t,i,s,n]}),this._dirty=true,this}circle(e,t,i,s){return this.instructions.push({action:"circle",data:[e,t,i,s]}),this._dirty=true,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=true,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=true,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=true,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=true,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=true,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=true,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=true,this}star(e,t,i,s,n,o,a){n||(n=s/2);let u=-1*Math.PI/2+o,l=i*2,c=Math.PI*2/l,h=[];for(let d=0;d<l;d++){let f=d%2?n:s,m=d*c+u;h.push(e+f*Math.cos(m),t+f*Math.sin(m));}return this.poly(h,true,a),this}clone(e=false){let t=new r;if(t.checkForHoles=this.checkForHoles,!e)t.instructions=this.instructions.slice();else for(let i=0;i<this.instructions.length;i++){let s=this.instructions[i];t.instructions.push({action:s.action,data:s.data.slice()});}return t}clear(){return this.instructions.length=0,this._dirty=true,this}transform(e){if(e.isIdentity())return this;let t=e.a,i=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,u=0,l=0,c=0,h=0,d=0,f=0,m=0,_=0;for(let x=0;x<this.instructions.length;x++){let g=this.instructions[x],y=g.data;switch(g.action){case "moveTo":case "lineTo":u=y[0],l=y[1],y[0]=t*u+s*l+o,y[1]=i*u+n*l+a;break;case "bezierCurveTo":c=y[0],h=y[1],d=y[2],f=y[3],u=y[4],l=y[5],y[0]=t*c+s*h+o,y[1]=i*c+n*h+a,y[2]=t*d+s*f+o,y[3]=i*d+n*f+a,y[4]=t*u+s*l+o,y[5]=i*u+n*l+a;break;case "quadraticCurveTo":c=y[0],h=y[1],u=y[2],l=y[3],y[0]=t*c+s*h+o,y[1]=i*c+n*h+a,y[2]=t*u+s*l+o,y[3]=i*u+n*l+a;break;case "arcToSvg":u=y[5],l=y[6],m=y[0],_=y[1],y[0]=t*m+s*_,y[1]=i*m+n*_,y[5]=t*u+s*l+o,y[6]=i*u+n*l+a;break;case "circle":y[4]=Rd(y[3],e);break;case "rect":y[4]=Rd(y[4],e);break;case "ellipse":y[8]=Rd(y[8],e);break;case "roundRect":y[5]=Rd(y[5],e);break;case "addPath":y[0].transform(e);break;case "poly":y[2]=Rd(y[2],e);break;default:U("unknown transform action",g.action);break}}return this._dirty=true,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,i=this.instructions[t];if(!i)return e.x=0,e.y=0,e;for(;i.action==="closePath";){if(t--,t<0)return e.x=0,e.y=0,e;i=this.instructions[t];}switch(i.action){case "moveTo":case "lineTo":e.x=i.data[0],e.y=i.data[1];break;case "quadraticCurveTo":e.x=i.data[2],e.y=i.data[3];break;case "bezierCurveTo":e.x=i.data[4],e.y=i.data[5];break;case "arc":case "arcToSvg":e.x=i.data[5],e.y=i.data[6];break;case "addPath":i.data[0].getLastPoint(e);break}return e}};});function Ke(r,e,t){let i=r.getAttribute(e);return i?Number(i):t}var zx=p(()=>{});function Wx(r,e){let t=r.querySelectorAll("defs");for(let i=0;i<t.length;i++){let s=t[i];for(let n=0;n<s.children.length;n++){let o=s.children[n];switch(o.nodeName.toLowerCase()){case "lineargradient":e.defs[o.id]=xL(o);break;case "radialgradient":e.defs[o.id]=_L();break;}}}}function xL(r){let e=Ke(r,"x1",0),t=Ke(r,"y1",0),i=Ke(r,"x2",1),s=Ke(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new tr(e,t,i,s,n==="objectBoundingBox"?"local":"global");for(let a=0;a<r.children.length;a++){let u=r.children[a],l=Ke(u,"offset",0),c=te.shared.setValue(u.getAttribute("stop-color")).toNumber();o.addColorStop(l,c);}return o}function _L(r){return U("[SVG Parser] Radial gradients are not yet supported"),new tr(0,0,1,0)}var C2=p(()=>{vt();Ae();ea();zx();});function Bd(r){let e=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}var w2=p(()=>{});function Id(r,e){let t=r.getAttribute("style"),i={},s={},n={strokeStyle:i,fillStyle:s,useFill:false,useStroke:false};for(let o in Xx){let a=r.getAttribute(o);a&&YM(e,n,o,a.trim());}if(t){let o=t.split(";");for(let a=0;a<o.length;a++){let u=o[a].trim(),[l,c]=u.split(":");Xx[l]&&YM(e,n,l,c.trim());}}return {strokeStyle:n.useStroke?i:null,fillStyle:n.useFill?s:null,useFill:n.useFill,useStroke:n.useStroke}}function YM(r,e,t,i){switch(t){case "stroke":if(i!=="none"){if(i.startsWith("url(")){let s=Bd(i);e.strokeStyle.fill=r.defs[s];}else e.strokeStyle.color=te.shared.setValue(i).toNumber();e.useStroke=true;}break;case "stroke-width":e.strokeStyle.width=Number(i);break;case "fill":if(i!=="none"){if(i.startsWith("url(")){let s=Bd(i);e.fillStyle.fill=r.defs[s];}else e.fillStyle.color=te.shared.setValue(i).toNumber();e.useFill=true;}break;case "fill-opacity":e.fillStyle.alpha=Number(i);break;case "stroke-opacity":e.strokeStyle.alpha=Number(i);break;case "opacity":e.fillStyle.alpha=Number(i),e.strokeStyle.alpha=Number(i);break}}var Xx,P2=p(()=>{vt();w2();Xx={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};});function Yx(r,e){if(typeof r=="string"){let o=document.createElement("div");o.innerHTML=r.trim(),r=o.querySelector("svg");}let t={context:e,defs:{},path:new Qi};Wx(r,t);let i=r.children,{fillStyle:s,strokeStyle:n}=Id(r,t);for(let o=0;o<i.length;o++){let a=i[o];a.nodeName.toLowerCase()!=="defs"&&jM(a,t,s,n);}return e}function jM(r,e,t,i){let s=r.children,{fillStyle:n,strokeStyle:o}=Id(r,e);n&&t?t={...t,...n}:n&&(t=n),o&&i?i={...i,...o}:o&&(i=o);let a=!t&&!i;a&&(t={color:0});let u,l,c,h,d,f,m,_,x,g,y,v,S,C,A,M,D;switch(r.nodeName.toLowerCase()){case "path":C=r.getAttribute("d"),r.getAttribute("fill-rule")==="evenodd"&&U("SVG Evenodd fill rule not supported, your svg may render incorrectly"),A=new Qi(C,true),e.context.path(A),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "circle":m=Ke(r,"cx",0),_=Ke(r,"cy",0),x=Ke(r,"r",0),e.context.ellipse(m,_,x,x),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "rect":u=Ke(r,"x",0),l=Ke(r,"y",0),M=Ke(r,"width",0),D=Ke(r,"height",0),g=Ke(r,"rx",0),y=Ke(r,"ry",0),g||y?e.context.roundRect(u,l,M,D,g||y):e.context.rect(u,l,M,D),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "ellipse":m=Ke(r,"cx",0),_=Ke(r,"cy",0),g=Ke(r,"rx",0),y=Ke(r,"ry",0),e.context.beginPath(),e.context.ellipse(m,_,g,y),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "line":c=Ke(r,"x1",0),h=Ke(r,"y1",0),d=Ke(r,"x2",0),f=Ke(r,"y2",0),e.context.beginPath(),e.context.moveTo(c,h),e.context.lineTo(d,f),i&&e.context.stroke(i);break;case "polygon":S=r.getAttribute("points"),v=S.match(/\d+/g).map(R=>parseInt(R,10)),e.context.poly(v,true),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "polyline":S=r.getAttribute("points"),v=S.match(/\d+/g).map(R=>parseInt(R,10)),e.context.poly(v,false),i&&e.context.stroke(i);break;case "g":case "svg":break;default:{U(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}a&&(t=null);for(let R=0;R<s.length;R++)jM(s[R],e,t,i);}var M2=p(()=>{Ae();Hx();C2();zx();P2();});function bL(r){return te.isColorLike(r)}function $M(r){return r instanceof Ti}function qM(r){return r instanceof tr}function yL(r){return r instanceof B}function vL(r,e,t){let i=te.shared.setValue(e??0);return r.color=i.toNumber(),r.alpha=i.alpha===1?t.alpha:i.alpha,r.texture=B.WHITE,{...t,...r}}function TL(r,e,t){return r.texture=e,{...t,...r}}function KM(r,e,t){return r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,{...t,...r}}function ZM(r,e,t){return e.buildGradient(),r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,r.textureSpace=e.textureSpace,{...t,...r}}function SL(r,e){let t={...e,...r},i=te.shared.setValue(t.color);return t.alpha*=i.alpha,t.color=i.toNumber(),t}function Si(r,e){if(r==null)return null;let t={},i=r;return bL(r)?vL(t,r,e):yL(r)?TL(t,r,e):$M(r)?KM(t,r,e):qM(r)?ZM(t,r,e):i.fill&&$M(i.fill)?KM(i,i.fill,e):i.fill&&qM(i.fill)?ZM(i,i.fill,e):SL(i,e)}function kn(r,e){let{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...u}=e,l=Si(r,u);return l?{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...l}:null}var jx=p(()=>{vt();Se();ea();Pd();});var EL,QM,R2,bt,la=p(()=>{Wt();vt();Te();_r();Se();Pt();Pe();Xt();Hx();M2();jx();EL=new ge,QM=new O,R2=class Ji extends ve{constructor(){super(...arguments),this.uid=de("graphicsContext"),this.dirty=true,this.batchMode="auto",this.instructions=[],this._activePath=new Qi,this._transform=new O,this._fillStyle={...Ji.defaultFillStyle},this._strokeStyle={...Ji.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new Me,this._boundsDirty=true;}clone(){let e=new Ji;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=true,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=Si(e,Ji.defaultFillStyle);}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=kn(e,Ji.defaultStrokeStyle);}setFillStyle(e){return this._fillStyle=Si(e,Ji.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=Si(e,Ji.defaultStrokeStyle),this}texture(e,t,i,s,n,o){return this.instructions.push({action:"texture",data:{image:e,dx:i||0,dy:s||0,dw:n||e.frame.width,dh:o||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t?te.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Qi,this}fill(e,t){let i,s=this.instructions[this.instructions.length-1];return this._tick===0&&s&&s.action==="stroke"?i=s.data.path:i=this._activePath.clone(),i?(e!=null&&(t!==void 0&&typeof e=="number"&&(G(Y,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:t}),this._fillStyle=Si(e,Ji.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(ge.shared);this._activePath.clear(),this._activePath.moveTo(e,t);}stroke(e){let t,i=this.instructions[this.instructions.length-1];return this._tick===0&&i&&i.action==="fill"?t=i.data.path:t=this._activePath.clone(),t?(e!=null&&(this._strokeStyle=kn(e,Ji.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:t}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],i=this._activePath.clone();if(t&&(t.action==="stroke"||t.action==="fill"))if(t.data.hole)t.data.hole.addPath(i);else {t.data.hole=i;break}}return this._initNextPathLocation(),this}arc(e,t,i,s,n,o){this._tick++;let a=this._transform;return this._activePath.arc(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,i,s,n,o),this}arcTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.arcTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}arcToSvg(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.arcToSvg(e,t,i,s,n,u.a*o+u.c*a+u.tx,u.b*o+u.d*a+u.ty),this}bezierCurveTo(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.bezierCurveTo(u.a*e+u.c*t+u.tx,u.b*e+u.d*t+u.ty,u.a*i+u.c*s+u.tx,u.b*i+u.d*s+u.ty,u.a*n+u.c*o+u.tx,u.b*n+u.d*o+u.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,i,s){return this._tick++,this._activePath.ellipse(e,t,i,s,this._transform.clone()),this}circle(e,t,i){return this._tick++,this._activePath.circle(e,t,i,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let i=this._transform;return this._activePath.lineTo(i.a*e+i.c*t+i.tx,i.b*e+i.d*t+i.ty),this}moveTo(e,t){this._tick++;let i=this._transform,s=this._activePath.instructions,n=i.a*e+i.c*t+i.tx,o=i.b*e+i.d*t+i.ty;return s.length===1&&s[0].action==="moveTo"?(s[0].data[0]=n,s[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.quadraticCurveTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}rect(e,t,i,s){return this._tick++,this._activePath.rect(e,t,i,s,this._transform.clone()),this}roundRect(e,t,i,s,n){return this._tick++,this._activePath.roundRect(e,t,i,s,n,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,i,s,n=0,o){return this._tick++,this._activePath.regularPoly(e,t,i,s,n,o),this}roundPoly(e,t,i,s,n,o){return this._tick++,this._activePath.roundPoly(e,t,i,s,n,o),this}roundShape(e,t,i,s){return this._tick++,this._activePath.roundShape(e,t,i,s),this}filletRect(e,t,i,s,n){return this._tick++,this._activePath.filletRect(e,t,i,s,n),this}chamferRect(e,t,i,s,n,o){return this._tick++,this._activePath.chamferRect(e,t,i,s,n,o),this}star(e,t,i,s,n=0,o=0){return this._tick++,this._activePath.star(e,t,i,s,n,o,this._transform.clone()),this}svg(e){return this._tick++,Yx(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,i,s,n,o){return e instanceof O?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,i,s,n,o),this)}transform(e,t,i,s,n,o){return e instanceof O?(this._transform.append(e),this):(QM.set(e,t,i,s,n,o),this._transform.append(QM),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=true,this._boundsDirty=true);}get bounds(){if(!this._boundsDirty)return this._bounds;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let i=this.instructions[t],s=i.action;if(s==="fill"){let n=i.data;e.addBounds(n.path.bounds);}else if(s==="texture"){let n=i.data;e.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform);}if(s==="stroke"){let n=i.data,o=n.style.alignment,a=n.style.width*(1-o),u=n.path.bounds;e.addFrame(u.minX-a,u.minY-a,u.maxX+a,u.maxY+a);}}return e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return false;let t=this.instructions,i=false;for(let s=0;s<t.length;s++){let n=t[s],o=n.data,a=o.path;if(!n.action||!a)continue;let u=o.style,l=a.shapePath.shapePrimitives;for(let c=0;c<l.length;c++){let h=l[c].shape;if(!u||!h)continue;let d=l[c].transform,f=d?d.applyInverse(e,EL):e;if(n.action==="fill")i=h.contains(f.x,f.y);else {let _=u;i=h.strokeContains(f.x,f.y,_.width,_.alignment);}let m=o.hole;if(m){let _=m.shapePath?.shapePrimitives;if(_)for(let x=0;x<_.length;x++)_[x].shape.contains(f.x,f.y)&&(i=false);}if(i)return true}}return i}destroy(e=false){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(i)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(i));}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null;}};R2.defaultFillStyle={color:16777215,alpha:1,texture:B.WHITE,matrix:null,fill:null,textureSpace:"local"};R2.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:B.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:false};bt=R2;});function $x(r){let e=[],t=0;for(let i=0;i<JM.length;i++){let s=`_${JM[i]}`;e[t++]=r[s];}return t=eR(r._fill,e,t),t=CL(r._stroke,e,t),t=wL(r.dropShadow,e,t),t=AL(r.filters,e,t),e.join("-")}function AL(r,e,t){if(!r)return t;for(let i of r)e[t++]=i.uid;return t}function eR(r,e,t){return r&&(e[t++]=r.color,e[t++]=r.alpha,e[t++]=r.fill?.styleKey),t}function CL(r,e,t){return r&&(t=eR(r,e,t),e[t++]=r.width,e[t++]=r.alignment,e[t++]=r.cap,e[t++]=r.join,e[t++]=r.miterLimit),t}function wL(r,e,t){return r&&(e[t++]=r.alpha,e[t++]=r.angle,e[t++]=r.blur,e[t++]=r.distance,e[t++]=te.shared.setValue(r.color).toNumber()),t}var JM,B2=p(()=>{vt();JM=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];});function PL(r){let e=r;if(typeof e.dropShadow=="boolean"&&e.dropShadow){let t=ht.defaultDropShadow;r.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance};}if(e.strokeThickness!==void 0){G(Y,"strokeThickness is now a part of stroke");let t=e.stroke,i={};if(te.isColorLike(t))i.color=t;else if(t instanceof tr||t instanceof Ti)i.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))i=t;else throw new Error("Invalid stroke value.");r.stroke={...i,width:e.strokeThickness};}if(Array.isArray(e.fillGradientStops)){if(G(Y,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||e.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&U("The number of fill colors must match the number of fill gradient stops.");let t=new tr({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),i=e.fillGradientStops.slice(),s=e.fill.map(n=>te.shared.setValue(n).toNumber());i.forEach((n,o)=>{t.addColorStop(n,s[o]);}),r.fill={fill:t};}}var I2,ht,Ei=p(()=>{Wt();vt();Pe();Ae();ea();Pd();la();jx();B2();I2=class Ul extends ve{constructor(e={}){super(),PL(e);let t={...Ul.defaultTextStyle,...e};for(let i in t){let s=i;this[s]=t[i];}this.update();}get align(){return this._align}set align(e){this._align=e,this.update();}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update();}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...Ul.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...Ul.defaultDropShadow}):null,this.update();}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update();}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update();}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e.toLowerCase(),this.update();}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update();}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update();}get leading(){return this._leading}set leading(e){this._leading=e,this.update();}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update();}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update();}get padding(){return this._padding}set padding(e){this._padding=e,this.update();}get filters(){return this._filters}set filters(e){this._filters=e,this.update();}get trim(){return this._trim}set trim(e){this._trim=e,this.update();}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update();}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update();}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update();}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update();}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...bt.defaultFillStyle,...e},()=>{this._fill=Si({...this._originalFill},bt.defaultFillStyle);})),this._fill=Si(e===0?"black":e,bt.defaultFillStyle),this.update());}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...bt.defaultStrokeStyle,...e},()=>{this._stroke=kn({...this._originalStroke},bt.defaultStrokeStyle);})),this._stroke=kn(e,bt.defaultStrokeStyle),this.update());}_generateKey(){return this._styleKey=$x(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this);}reset(){let e=Ul.defaultTextStyle;for(let t in e)this[t]=e[t];}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new Ul({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0})}_getFinalPadding(){let e=0;if(this._filters)for(let t=0;t<this._filters.length;t++)e+=this._filters[t].padding;return Math.max(this._padding,e)}destroy(e=false){if(this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(i),this._originalFill?.texture&&this._originalFill.texture.destroy(i),this._stroke?.texture&&this._stroke.texture.destroy(i),this._originalStroke?.texture&&this._originalStroke.texture.destroy(i);}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null;}_createProxy(e,t){return new Proxy(e,{set:(i,s,n)=>(i[s]=n,t?.(s,n),this.update(),true)})}_isFillStyle(e){return (e??null)!==null&&!(te.isColorLike(e)||e instanceof tr||e instanceof Ti)}};I2.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};I2.defaultTextStyle={align:"left",breakWords:false,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:false,whiteSpace:"pre",wordWrap:false,wordWrapWidth:100};ht=I2;});function Ll(r,e,t,i){let s=ML;s.minX=0,s.minY=0,s.maxX=r.width/i|0,s.maxY=r.height/i|0;let n=Oe.getOptimalTexture(s.width,s.height,i,false);return n.source.uploadMethodId="image",n.source.resource=r,n.source.alphaMode="premultiply-alpha-on-upload",n.frame.width=e/i,n.frame.height=t/i,n.source.emit("update",n.source),n.updateUvs(),n}var ML,qx=p(()=>{gi();Xt();ML=new Me;});var Dd,fr,ca=p(()=>{Be();tl();Dd=class{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=false;}_createCanvasAndContext(e,t){let i=H.get().createCanvas();i.width=e,i.height=t;let s=i.getContext("2d");return {canvas:i,context:s}}getOptimalCanvasAndContext(e,t,i=1){e=Math.ceil(e*i-1e-6),t=Math.ceil(t*i-1e-6),e=mi(e),t=mi(t);let s=(e<<17)+(t<<1);this._canvasPool[s]||(this._canvasPool[s]=[]);let n=this._canvasPool[s].pop();return n||(n=this._createCanvasAndContext(e,t)),n}returnCanvasAndContext(e){let t=e.canvas,{width:i,height:s}=t,n=(i<<17)+(s<<1);e.context.resetTransform(),e.context.clearRect(0,0,i,s),this._canvasPool[n].push(e);}clear(){this._canvasPool={};}},fr=new Dd;});function RL(r,e){ha||(ha=H.get().createCanvas(256,128),Os=ha.getContext("2d",{willReadFrequently:true}),Os.globalCompositeOperation="copy",Os.globalAlpha=1),(ha.width<r||ha.height<e)&&(ha.width=mi(r),ha.height=mi(e));}function tR(r,e,t){for(let i=0,s=4*t*e;i<e;++i,s+=4)if(r[s+3]!==0)return false;return true}function rR(r,e,t,i,s){let n=4*e;for(let o=i,a=i*n+4*t;o<=s;++o,a+=n)if(r[a+3]!==0)return false;return true}function Kx(...r){let e=r[0];e.canvas||(e={canvas:r[0],resolution:r[1]});let{canvas:t}=e,i=Math.min(e.resolution??1,1),s=e.width??t.width,n=e.height??t.height,o=e.output;if(RL(s,n),!Os)throw new TypeError("Failed to get canvas 2D context");Os.drawImage(t,0,0,s,n,0,0,s*i,n*i);let u=Os.getImageData(0,0,s,n).data,l=0,c=0,h=s-1,d=n-1;for(;c<n&&tR(u,s,c);)++c;if(c===n)return re.EMPTY;for(;tR(u,s,d);)--d;for(;rR(u,s,l,c,d);)++l;for(;rR(u,s,h,c,d);)--h;return ++h,++d,Os.globalCompositeOperation="source-over",Os.strokeRect(l,c,h-l,d-c),Os.globalCompositeOperation="copy",o??(o=new re),o.set(l/i,c/i,(h-l)/i,(d-c)/i),o}var ha,Os,D2=p(()=>{Be();tl();xt();ha=null,Os=null;});function Fs(r){let e=typeof r.fontSize=="number"?`${r.fontSize}px`:r.fontSize,t=r.fontFamily;Array.isArray(r.fontFamily)||(t=r.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let s=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(s)&&!BL.includes(s)&&(s=`"${s}"`),t[i]=s;}return `${r.fontStyle} ${r.fontVariant} ${r.fontWeight} ${e} ${t.join(",")}`}var BL,kd=p(()=>{BL=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];});var k2,es,st,Gs=p(()=>{Be();kd();k2={willReadFrequently:true},es=class Q{static get experimentalLetterSpacingSupported(){let e=Q._experimentalLetterSpacingSupported;if(e===void 0){let t=H.get().getCanvasRenderingContext2D().prototype;e=Q._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t;}return e}constructor(e,t,i,s,n,o,a,u,l){this.text=e,this.style=t,this.width=i,this.height=s,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=u,this.fontProperties=l;}static measureText(e=" ",t,i=Q._canvas,s=t.wordWrap){let n=Fs(t),o=Q.measureFont(n);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);let a=Q.__context;a.font=n;let l=(s?Q._wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),c=new Array(l.length),h=0;for(let g=0;g<l.length;g++){let y=Q._measureText(l[g],t.letterSpacing,a);c[g]=y,h=Math.max(h,y);}let d=t._stroke?.width||0,f=h+d;t.dropShadow&&(f+=t.dropShadow.distance);let m=t.lineHeight||o.fontSize,_=Math.max(m,o.fontSize+d)+(l.length-1)*(m+t.leading);return t.dropShadow&&(_+=t.dropShadow.distance),new Q(e,t,f,_,l,c,m+t.leading,h,o)}static _measureText(e,t,i){let s=false;Q.experimentalLetterSpacingSupported&&(Q.experimentalLetterSpacing?(i.letterSpacing=`${t}px`,i.textLetterSpacing=`${t}px`,s=true):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(e),o=n.width,a=-n.actualBoundingBoxLeft,l=n.actualBoundingBoxRight-a;if(o>0)if(s)o-=t,l-=t;else {let c=(Q.graphemeSegmenter(e).length-1)*t;o+=c,l+=c;}return Math.max(o,l)}static _wordWrap(e,t,i=Q._canvas){let s=i.getContext("2d",k2),n=0,o="",a="",u=Object.create(null),{letterSpacing:l,whiteSpace:c}=t,h=Q._collapseSpaces(c),d=Q._collapseNewlines(c),f=!h,m=t.wordWrapWidth+l,_=Q._tokenize(e);for(let x=0;x<_.length;x++){let g=_[x];if(Q._isNewline(g)){if(!d){a+=Q._addLine(o),f=!h,o="",n=0;continue}g=" ";}if(h){let v=Q.isBreakingSpace(g),S=Q.isBreakingSpace(o[o.length-1]);if(v&&S)continue}let y=Q._getFromCache(g,l,u,s);if(y>m)if(o!==""&&(a+=Q._addLine(o),o="",n=0),Q.canBreakWords(g,t.breakWords)){let v=Q.wordWrapSplit(g);for(let S=0;S<v.length;S++){let C=v[S],A=C,M=1;for(;v[S+M];){let R=v[S+M];if(!Q.canBreakChars(A,R,g,S,t.breakWords))C+=R;else break;A=R,M++;}S+=M-1;let D=Q._getFromCache(C,l,u,s);D+n>m&&(a+=Q._addLine(o),f=false,o="",n=0),o+=C,n+=D;}}else {o.length>0&&(a+=Q._addLine(o),o="",n=0);let v=x===_.length-1;a+=Q._addLine(g,!v),f=false,o="",n=0;}else y+n>m&&(f=false,a+=Q._addLine(o),o="",n=0),(o.length>0||!Q.isBreakingSpace(g)||f)&&(o+=g,n+=y);}return a+=Q._addLine(o,false),a}static _addLine(e,t=true){return e=Q._trimRight(e),e=t?`${e}
|
|
374
|
+
}`;});var wl,i2=p(()=>{vt();Te();br();Dr();ei();Se();ji();e2();t2();r2();wl=class extends it{constructor(){let e=je.from({vertex:Px,fragment:wx}),t=$e.from({fragment:{source:wd,entryPoint:"mainFragment"},vertex:{source:wd,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:B.WHITE.source,uSampler:new mt({}),uniforms:{uTranslationMatrix:{value:new O,type:"mat3x3<f32>"},uColor:{value:new te(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}});}};});var Bn,Mx=p(()=>{Te();_t();cl();Or();ta();JS();i2();Bn=class{constructor(e,t){this.state=Ze.for2d(),this.localUniforms=new be({uTranslationMatrix:{value:new O,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=e,this.adaptor=t,this.defaultShader=new wl,this.state=Ze.for2d();}validateRenderable(e){return false}addRenderable(e,t){this.renderer.renderPipes.batch.break(t),t.add(e);}getBuffers(e){return e._gpuData[this.renderer.uid]||this._initBuffer(e)}_initBuffer(e){return e._gpuData[this.renderer.uid]=new Cl({size:e.particleChildren.length,properties:e._properties}),e._gpuData[this.renderer.uid]}updateRenderable(e){}execute(e){let t=e.particleChildren;if(t.length===0)return;let i=this.renderer,s=this.getBuffers(e);e.texture||(e.texture=t[0].texture);let n=this.state;s.update(t,e._childrenDirty),e._childrenDirty=false,n.blendMode=yi(e.blendMode,e.texture._source);let o=this.localUniforms.uniforms,a=o.uTranslationMatrix;e.worldTransform.copyTo(a),a.prepend(i.globalUniforms.globalUniformData.projectionMatrix),o.uResolution=i.globalUniforms.globalUniformData.resolution,o.uRound=i._roundPixels|e._roundPixels,ti(e.groupColorAlpha,o.uColor,0),this.adaptor.execute(this,e);}destroy(){this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null);}};});var sa,s2=p(()=>{P();KS();Mx();sa=class extends Bn{constructor(e){super(e,new Al);}};sa.extension={type:[b.WebGLPipes],name:"particle"};});var Pl,n2=p(()=>{Pl=class{execute(e,t){let i=e.renderer,s=t.shader||e.defaultShader;s.groups[0]=i.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms,true),s.groups[1]=i.texture.getTextureBindGroup(t.texture);let n=e.state,o=e.getBuffers(t);i.encoder.draw({geometry:o.geometry,shader:t.shader||e.defaultShader,state:n,size:t.particleChildren.length*6});}};});var na,o2=p(()=>{P();n2();Mx();na=class extends Bn{constructor(e){super(e,new Pl);}};na.extension={type:[b.WebGPUPipes],name:"particle"};});var a2=p(()=>{P();s2();o2();V.add(sa);V.add(na);});function oa(r,e){let{texture:t,bounds:i}=r,s=e._style._getFinalPadding();ul(i,e._anchor,t);let n=e._anchor._x*s*2,o=e._anchor._y*s*2;i.minX-=s-n,i.minY-=s-o,i.maxX-=s-n,i.maxY-=s-o;}var Rx=p(()=>{Sg();});var ri,Ml=p(()=>{ri=class{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=true,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null;}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null;}destroy(){}};});var Rl,u2=p(()=>{Ml();Rl=class extends ri{constructor(e){super(),this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.canvasText.returnTexture(this.texture),this._renderer=null;}};});var aa,l2=p(()=>{P();Rx();u2();aa=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e),e._didTextUpdate=false),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}_updateGpuText(e){let t=this._getGpuText(e);t.texture&&this._renderer.canvasText.returnTexture(t.texture),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=this._renderer.canvasText.getTexture(e),oa(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Rl(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};aa.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"text"};});var NM,Ti,Pd=p(()=>{Te();Pt();NM={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},Ti=class{constructor(e,t){this.uid=de("fillPattern"),this.transform=new O,this._styleKey=null,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=NM[t].addressModeU,e.source.style.addressModeV=NM[t].addressModeV);}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._styleKey=null;}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}destroy(){this.texture.destroy(true),this.texture=null,this._styleKey=null;}};});var HM=Wi((X$,VM)=>{VM.exports=tL;var c2={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},eL=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function tL(r){var e=[];return r.replace(eL,function(t,i,s){var n=i.toLowerCase();for(s=iL(s),n=="m"&&s.length>2&&(e.push([i].concat(s.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(s.length==c2[n])return s.unshift(i),e.push(s);if(s.length<c2[n])throw new Error("malformed path data");e.push([i].concat(s.splice(0,c2[n])));}}),e}var rL=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function iL(r){var e=r.match(rL);return e?e.map(Number):[]}});function Bx(r,e){let t=(0, zM.default)(r),i=[],s=null,n=0,o=0;for(let a=0;a<t.length;a++){let u=t[a],l=u[0],c=u;switch(l){case "M":n=c[1],o=c[2],e.moveTo(n,o);break;case "m":n+=c[1],o+=c[2],e.moveTo(n,o);break;case "H":n=c[1],e.lineTo(n,o);break;case "h":n+=c[1],e.lineTo(n,o);break;case "V":o=c[1],e.lineTo(n,o);break;case "v":o+=c[1],e.lineTo(n,o);break;case "L":n=c[1],o=c[2],e.lineTo(n,o);break;case "l":n+=c[1],o+=c[2],e.lineTo(n,o);break;case "C":n=c[5],o=c[6],e.bezierCurveTo(c[1],c[2],c[3],c[4],n,o);break;case "c":e.bezierCurveTo(n+c[1],o+c[2],n+c[3],o+c[4],n+c[5],o+c[6]),n+=c[5],o+=c[6];break;case "S":n=c[3],o=c[4],e.bezierCurveToShort(c[1],c[2],n,o);break;case "s":e.bezierCurveToShort(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "Q":n=c[3],o=c[4],e.quadraticCurveTo(c[1],c[2],n,o);break;case "q":e.quadraticCurveTo(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "T":n=c[1],o=c[2],e.quadraticCurveToShort(n,o);break;case "t":n+=c[1],o+=c[2],e.quadraticCurveToShort(n,o);break;case "A":n=c[6],o=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "a":n+=c[6],o+=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "Z":case "z":e.closePath(),i.length>0&&(s=i.pop(),s?(n=s.startX,o=s.startY):(n=0,o=0)),s=null;break;default:U(`Unknown SVG path command: ${l}`);}l!=="Z"&&l!=="z"&&s===null&&(s={startX:n,startY:o},i.push(s));}return e}var zM,h2=p(()=>{zM=Fh(HM());Ae();});var Bl,d2=p(()=>{xt();Bl=class r{constructor(e=0,t=0,i=0){this.type="circle",this.x=e,this.y=t,this.radius=i;}clone(){return new r(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return false;let i=this.radius*this.radius,s=this.x-e,n=this.y-t;return s*=s,n*=n,s+n<=i}strokeContains(e,t,i,s=.5){if(this.radius===0)return false;let n=this.x-e,o=this.y-t,a=this.radius,u=(1-s)*i,l=Math.sqrt(n*n+o*o);return l<=a+u&&l>a-(i-u)}getBounds(e){return e||(e=new re),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}};});var Il,f2=p(()=>{xt();Il=class r{constructor(e=0,t=0,i=0,s=0){this.type="ellipse",this.x=e,this.y=t,this.halfWidth=i,this.halfHeight=s;}clone(){return new r(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return false;let i=(e-this.x)/this.halfWidth,s=(t-this.y)/this.halfHeight;return i*=i,s*=s,i+s<=1}strokeContains(e,t,i,s=.5){let{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return false;let a=i*(1-s),u=i-a,l=n-u,c=o-u,h=n+a,d=o+a,f=e-this.x,m=t-this.y,_=f*f/(l*l)+m*m/(c*c),x=f*f/(h*h)+m*m/(d*d);return _>1&&x<=1}getBounds(e){return e||(e=new re),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};});function In(r,e,t,i,s,n){let o=r-t,a=e-i,u=s-t,l=n-i,c=o*u+a*l,h=u*u+l*l,d=-1;h!==0&&(d=c/h);let f,m;d<0?(f=t,m=i):d>1?(f=s,m=n):(f=t+d*u,m=i+d*l);let _=r-f,x=e-m;return _*_+x*x}var Ix=p(()=>{});var sL,nL,Dn,p2=p(()=>{Pe();Ix();xt();Dn=class r{constructor(...e){this.type="polygon";let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){let i=[];for(let s=0,n=t.length;s<n;s++)i.push(t[s].x,t[s].y);t=i;}this.points=t,this.closePath=true;}isClockwise(){let e=0,t=this.points,i=t.length;for(let s=0;s<i;s+=2){let n=t[s],o=t[s+1],a=t[(s+2)%i],u=t[(s+3)%i];e+=(a-n)*(u+o);}return e<0}containsPolygon(e){let t=this.getBounds(sL),i=e.getBounds(nL);if(!t.containsRect(i))return false;let s=e.points;for(let n=0;n<s.length;n+=2){let o=s[n],a=s[n+1];if(!this.contains(o,a))return false}return true}clone(){let e=this.points.slice(),t=new r(e);return t.closePath=this.closePath,t}contains(e,t){let i=false,s=this.points.length/2;for(let n=0,o=s-1;n<s;o=n++){let a=this.points[n*2],u=this.points[n*2+1],l=this.points[o*2],c=this.points[o*2+1];u>t!=c>t&&e<(l-a)*((t-u)/(c-u))+a&&(i=!i);}return i}strokeContains(e,t,i,s=.5){let n=i*i,o=n*(1-s),a=n-o,{points:u}=this,l=u.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){let h=u[c],d=u[c+1],f=u[(c+2)%u.length],m=u[(c+3)%u.length],_=In(e,t,h,d,f,m),x=Math.sign((f-h)*(t-d)-(m-d)*(e-h));if(_<=(x<0?a:o))return true}return false}getBounds(e){e||(e=new re);let t=this.points,i=1/0,s=-1/0,n=1/0,o=-1/0;for(let a=0,u=t.length;a<u;a+=2){let l=t[a],c=t[a+1];i=l<i?l:i,s=l>s?l:s,n=c<n?c:n,o=c>o?c:o;}return e.x=i,e.width=s-i,e.y=n,e.height=o-n,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return G("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return G("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}};});var Dx,Dl,m2=p(()=>{xt();Dx=(r,e,t,i,s,n,o)=>{let a=r-t,u=e-i,l=Math.sqrt(a*a+u*u);return l>=s-n&&l<=s+o},Dl=class r{constructor(e=0,t=0,i=0,s=0,n=20){this.type="roundedRectangle",this.x=e,this.y=t,this.width=i,this.height=s,this.radius=n;}getBounds(e){return e||(e=new re),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new r(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return false;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return true;let s=e-(this.x+i),n=t-(this.y+i),o=i*i;if(s*s+n*n<=o||(s=e-(this.x+this.width-i),s*s+n*n<=o)||(n=t-(this.y+this.height-i),s*s+n*n<=o)||(s=e-(this.x+i),s*s+n*n<=o))return true}return false}strokeContains(e,t,i,s=.5){let{x:n,y:o,width:a,height:u,radius:l}=this,c=i*(1-s),h=i-c,d=n+l,f=o+l,m=a-l*2,_=u-l*2,x=n+a,g=o+u;return (e>=n-c&&e<=n+h||e>=x-h&&e<=x+c)&&t>=f&&t<=f+_||(t>=o-c&&t<=o+h||t>=g-h&&t<=g+c)&&e>=d&&e<=d+m?true:e<d&&t<f&&Dx(e,t,d,f,l,h,c)||e>x-l&&t<f&&Dx(e,t,x-l,f,l,h,c)||e>x-l&&t>g-l&&Dx(e,t,x-l,g-l,l,h,c)||e<d&&t>g-l&&Dx(e,t,d,g-l,l,h,c)}toString(){return `[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};});function Ol(r,e,t,i,s,n,o,a,u,l){let h=Math.min(.99,Math.max(0,l??Rn.defaultOptions.bezierSmoothness)),d=(aL-h)/1;return d*=d,uL(e,t,i,s,n,o,a,u,r,d),r}function uL(r,e,t,i,s,n,o,a,u,l){x2(r,e,t,i,s,n,o,a,u,l,0),u.push(o,a);}function x2(r,e,t,i,s,n,o,a,u,l,c){if(c>oL)return;let h=Math.PI,d=(r+t)/2,f=(e+i)/2,m=(t+s)/2,_=(i+n)/2,x=(s+o)/2,g=(n+a)/2,y=(d+m)/2,v=(f+_)/2,S=(m+x)/2,C=(_+g)/2,E=(y+S)/2,M=(v+C)/2;if(c>0){let D=o-r,R=a-e,L=Math.abs((t-o)*R-(i-a)*D),F=Math.abs((s-o)*R-(n-a)*D),se,ye;if(L>kx&&F>kx){if((L+F)*(L+F)<=l*(D*D+R*R)){if(kl<g2){u.push(E,M);return}let ft=Math.atan2(n-i,s-t);if(se=Math.abs(ft-Math.atan2(i-e,t-r)),ye=Math.abs(Math.atan2(a-n,o-s)-ft),se>=h&&(se=2*h-se),ye>=h&&(ye=2*h-ye),se+ye<kl){u.push(E,M);return}if(ua!==0){if(se>ua){u.push(t,i);return}if(ye>ua){u.push(s,n);return}}}}else if(L>kx){if(L*L<=l*(D*D+R*R)){if(kl<g2){u.push(E,M);return}if(se=Math.abs(Math.atan2(n-i,s-t)-Math.atan2(i-e,t-r)),se>=h&&(se=2*h-se),se<kl){u.push(t,i),u.push(s,n);return}if(ua!==0&&se>ua){u.push(t,i);return}}}else if(F>kx){if(F*F<=l*(D*D+R*R)){if(kl<g2){u.push(E,M);return}if(se=Math.abs(Math.atan2(a-n,o-s)-Math.atan2(n-i,s-t)),se>=h&&(se=2*h-se),se<kl){u.push(t,i),u.push(s,n);return}if(ua!==0&&se>ua){u.push(s,n);return}}}else if(D=E-(r+o)/2,R=M-(e+a)/2,D*D+R*R<=l){u.push(E,M);return}}x2(r,e,d,f,y,v,E,M,u,l,c+1),x2(E,M,S,C,x,g,o,a,u,l,c+1);}var oL,kx,aL,g2,kl,ua,Ox=p(()=>{Sd();oL=8,kx=11920929e-14,aL=1,g2=.01,kl=0,ua=0;});function Fx(r,e,t,i,s,n,o,a){let l=Math.min(.99,Math.max(0,a??Rn.defaultOptions.bezierSmoothness)),c=(hL-l)/1;return c*=c,fL(e,t,i,s,n,o,r,c),r}function fL(r,e,t,i,s,n,o,a){_2(o,r,e,t,i,s,n,a,0),o.push(s,n);}function _2(r,e,t,i,s,n,o,a,u){if(u>lL)return;let l=Math.PI,c=(e+i)/2,h=(t+s)/2,d=(i+n)/2,f=(s+o)/2,m=(c+d)/2,_=(h+f)/2,x=n-e,g=o-t,y=Math.abs((i-n)*g-(s-o)*x);if(y>cL){if(y*y<=a*(x*x+g*g)){if(WM<dL){r.push(m,_);return}let v=Math.abs(Math.atan2(o-s,n-i)-Math.atan2(s-t,i-e));if(v>=l&&(v=2*l-v),v<WM){r.push(m,_);return}}}else if(x=m-(e+n)/2,g=_-(t+o)/2,x*x+g*g<=a){r.push(m,_);return}_2(r,e,t,c,h,m,_,a,u+1),_2(r,m,_,d,f,n,o,a,u+1);}var lL,cL,hL,dL,WM,b2=p(()=>{Sd();lL=8,cL=11920929e-14,hL=1,dL=.01,WM=0;});function Fl(r,e,t,i,s,n,o,a){let u=Math.abs(s-n);(!o&&s>n||o&&n>s)&&(u=2*Math.PI-u),a||(a=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(u/Math.PI)))),a=Math.max(a,3);let l=u/a,c=s;l*=o?-1:1;for(let h=0;h<a+1;h++){let d=Math.cos(c),f=Math.sin(c),m=e+d*i,_=t+f*i;r.push(m,_),c+=l;}}var Gx=p(()=>{});function Ux(r,e,t,i,s,n){let o=r[r.length-2],u=r[r.length-1]-t,l=o-e,c=s-t,h=i-e,d=Math.abs(u*h-l*c);if(d<1e-8||n===0){(r[r.length-2]!==e||r[r.length-1]!==t)&&r.push(e,t);return}let f=u*u+l*l,m=c*c+h*h,_=u*c+l*h,x=n*Math.sqrt(f)/d,g=n*Math.sqrt(m)/d,y=x*_/f,v=g*_/m,S=x*h+g*l,C=x*c+g*u,E=l*(g+y),M=u*(g+y),D=h*(x+v),R=c*(x+v),L=Math.atan2(M-C,E-S),F=Math.atan2(R-C,D-S);Fl(r,S+e,C+t,n,L,F,l*c>h*u);}var y2=p(()=>{Gx();});function pL(r,e){let t=e===-1.5707963267948966?-0.551915024494:1.3333333333333333*Math.tan(e/4),i=e===1.5707963267948966?.551915024494:t,s=Math.cos(r),n=Math.sin(r),o=Math.cos(r+e),a=Math.sin(r+e);return [{x:s-n*i,y:n+s*i},{x:o+a*i,y:a-o*i},{x:o,y:a}]}function Lx(r,e,t,i,s,n,o,a=0,u=0,l=0){if(n===0||o===0)return;let c=Math.sin(a*Md/360),h=Math.cos(a*Md/360),d=h*(e-i)/2+c*(t-s)/2,f=-c*(e-i)/2+h*(t-s)/2;if(d===0&&f===0)return;n=Math.abs(n),o=Math.abs(o);let m=Math.pow(d,2)/Math.pow(n,2)+Math.pow(f,2)/Math.pow(o,2);m>1&&(n*=Math.sqrt(m),o*=Math.sqrt(m)),mL(e,t,i,s,n,o,u,l,c,h,d,f,v2);let{ang1:_,ang2:x}=v2,{centerX:g,centerY:y}=v2,v=Math.abs(x)/(Md/4);Math.abs(1-v)<1e-7&&(v=1);let S=Math.max(Math.ceil(v),1);x/=S;let C=r[r.length-2],E=r[r.length-1],M={x:0,y:0};for(let D=0;D<S;D++){let R=pL(_,x),{x:L,y:F}=T2(R[0],n,o,h,c,g,y,M),{x:se,y:ye}=T2(R[1],n,o,h,c,g,y,M),{x:ft,y:ys}=T2(R[2],n,o,h,c,g,y,M);Ol(r,C,E,L,F,se,ye,ft,ys),C=ft,E=ys,_+=x;}}var Md,v2,T2,XM,mL,S2=p(()=>{Ox();Md=Math.PI*2,v2={centerX:0,centerY:0,ang1:0,ang2:0},T2=({x:r,y:e},t,i,s,n,o,a,u)=>{r*=t,e*=i;let l=s*r-n*e,c=n*r+s*e;return u.x=l+o,u.y=c+a,u};XM=(r,e,t,i)=>{let s=r*i-e*t<0?-1:1,n=r*t+e*i;return n>1&&(n=1),n<-1&&(n=-1),s*Math.acos(n)},mL=(r,e,t,i,s,n,o,a,u,l,c,h,d)=>{let f=Math.pow(s,2),m=Math.pow(n,2),_=Math.pow(c,2),x=Math.pow(h,2),g=f*m-f*x-m*_;g<0&&(g=0),g/=f*x+m*_,g=Math.sqrt(g)*(o===a?-1:1);let y=g*s/n*h,v=g*-n/s*c,S=l*y-u*v+(r+t)/2,C=u*y+l*v+(e+i)/2,E=(c-y)/s,M=(h-v)/n,D=(-c-y)/s,R=(-h-v)/n,L=XM(1,0,E,M),F=XM(E,M,D,R);a===0&&F>0&&(F-=Md),a===1&&F<0&&(F+=Md),d.centerX=S,d.centerY=C,d.ang1=L,d.ang2=F;};});function Nx(r,e,t){let i=(o,a)=>{let u=a.x-o.x,l=a.y-o.y,c=Math.sqrt(u*u+l*l),h=u/c,d=l/c;return {len:c,nx:h,ny:d}},s=(o,a)=>{o===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y);},n=e[e.length-1];for(let o=0;o<e.length;o++){let a=e[o%e.length],u=a.radius??t;if(u<=0){s(o,a),n=a;continue}let l=e[(o+1)%e.length],c=i(a,n),h=i(a,l);if(c.len<1e-4||h.len<1e-4){s(o,a),n=a;continue}let d=Math.asin(c.nx*h.ny-c.ny*h.nx),f=1,m=false;c.nx*h.nx-c.ny*-h.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,f=-1,m=true):d>0&&(f=-1,m=true);let _=d/2,x,g=Math.abs(Math.cos(_)*u/Math.sin(_));g>Math.min(c.len/2,h.len/2)?(g=Math.min(c.len/2,h.len/2),x=Math.abs(g*Math.sin(_)/Math.cos(_))):x=u;let y=a.x+h.nx*g+-h.ny*x*f,v=a.y+h.ny*g+h.nx*x*f,S=Math.atan2(c.ny,c.nx)+Math.PI/2*f,C=Math.atan2(h.ny,h.nx)-Math.PI/2*f;o===0&&r.moveTo(y+Math.cos(S)*x,v+Math.sin(S)*x),r.arc(y,v,x,S,C,m),n=a;}}function Vx(r,e,t,i){let s=(a,u)=>Math.sqrt((a.x-u.x)**2+(a.y-u.y)**2),n=(a,u,l)=>({x:a.x+(u.x-a.x)*l,y:a.y+(u.y-a.y)*l}),o=e.length;for(let a=0;a<o;a++){let u=e[(a+1)%o],l=u.radius??t;if(l<=0){a===0?r.moveTo(u.x,u.y):r.lineTo(u.x,u.y);continue}let c=e[a],h=e[(a+2)%o],d=s(c,u),f;if(d<1e-4)f=u;else {let x=Math.min(d/2,l);f=n(u,c,x/d);}let m=s(h,u),_;if(m<1e-4)_=u;else {let x=Math.min(m/2,l);_=n(u,h,x/m);}a===0?r.moveTo(f.x,f.y):r.lineTo(f.x,f.y),r.quadraticCurveTo(u.x,u.y,_.x,_.y,i);}}var E2=p(()=>{});var gL,Gl,A2=p(()=>{d2();f2();p2();xt();m2();Xt();Ox();b2();Gx();y2();S2();E2();gL=new re,Gl=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new Me,this._graphicsPath2D=e,this.signed=e.checkForHoles;}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let i=this._currentPoly.points,s=i[i.length-2],n=i[i.length-1];return (s!==e||n!==t)&&i.push(e,t),this}arc(e,t,i,s,n,o){this._ensurePoly(false);let a=this._currentPoly.points;return Fl(a,e,t,i,s,n,o),this}arcTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly.points;return Ux(o,e,t,i,s,n),this}arcToSvg(e,t,i,s,n,o,a){let u=this._currentPoly.points;return Lx(u,this._currentPoly.lastX,this._currentPoly.lastY,o,a,e,t,i,s,n),this}bezierCurveTo(e,t,i,s,n,o,a){this._ensurePoly();let u=this._currentPoly;return Ol(this._currentPoly.points,u.lastX,u.lastY,e,t,i,s,n,o,a),this}quadraticCurveTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly;return Fx(this._currentPoly.points,o.lastX,o.lastY,e,t,i,s,n),this}closePath(){return this.endPoly(true),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(true),e.transform(t));let i=this.shapePrimitives,s=i.length;for(let n=0;n<e.instructions.length;n++){let o=e.instructions[n];this[o.action](...o.data);}if(e.checkForHoles&&i.length-s>1){let n=null;for(let o=s;o<i.length;o++){let a=i[o];if(a.shape.type==="polygon"){let u=a.shape,l=n?.shape;l&&l.containsPolygon(u)?(n.holes||(n.holes=[]),n.holes.push(a),i.copyWithin(o,o+1),i.length--,o--):n=a;}}}return this}finish(e=false){this.endPoly(e);}rect(e,t,i,s,n){return this.drawShape(new re(e,t,i,s),n),this}circle(e,t,i,s){return this.drawShape(new Bl(e,t,i),s),this}poly(e,t,i){let s=new Dn(e);return s.closePath=t,this.drawShape(s,i),this}regularPoly(e,t,i,s,n=0,o){s=Math.max(s|0,3);let a=-1*Math.PI/2+n,u=Math.PI*2/s,l=[];for(let c=0;c<s;c++){let h=a-c*u;l.push(e+i*Math.cos(h),t+i*Math.sin(h));}return this.poly(l,true,o),this}roundPoly(e,t,i,s,n,o=0,a){if(s=Math.max(s|0,3),n<=0)return this.regularPoly(e,t,i,s,o);let u=i*Math.sin(Math.PI/s)-.001;n=Math.min(n,u);let l=-1*Math.PI/2+o,c=Math.PI*2/s,h=(s-2)*Math.PI/s/2;for(let d=0;d<s;d++){let f=d*c+l,m=e+i*Math.cos(f),_=t+i*Math.sin(f),x=f+Math.PI+h,g=f-Math.PI-h,y=m+n*Math.cos(x),v=_+n*Math.sin(x),S=m+n*Math.cos(g),C=_+n*Math.sin(g);d===0?this.moveTo(y,v):this.lineTo(y,v),this.quadraticCurveTo(m,_,S,C,a);}return this.closePath()}roundShape(e,t,i=false,s){return e.length<3?this:(i?Vx(this,e,t,s):Nx(this,e,t),this.closePath())}filletRect(e,t,i,s,n){if(n===0)return this.rect(e,t,i,s);let o=Math.min(i,s)/2,a=Math.min(o,Math.max(-o,n)),u=e+i,l=t+s,c=a<0?-a:0,h=Math.abs(a);return this.moveTo(e,t+h).arcTo(e+c,t+c,e+h,t,h).lineTo(u-h,t).arcTo(u-c,t+c,u,t+h,h).lineTo(u,l-h).arcTo(u-c,l-c,e+i-h,l,h).lineTo(e+h,l).arcTo(e+c,l-c,e,l-h,h).closePath()}chamferRect(e,t,i,s,n,o){if(n<=0)return this.rect(e,t,i,s);let a=Math.min(n,Math.min(i,s)/2),u=e+i,l=t+s,c=[e+a,t,u-a,t,u,t+a,u,l-a,u-a,l,e+a,l,e,l-a,e,t+a];for(let h=c.length-1;h>=2;h-=2)c[h]===c[h-2]&&c[h-1]===c[h-3]&&c.splice(h-1,2);return this.poly(c,true,o)}ellipse(e,t,i,s,n){return this.drawShape(new Il(e,t,i,s),n),this}roundRect(e,t,i,s,n,o){return this.drawShape(new Dl(e,t,i,s,n),o),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let i=this._currentPoly;return i&&this.endPoly(),i=new Dn,i.points.push(e,t),this._currentPoly=i,this}endPoly(e=false){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=true){if(!this._currentPoly&&(this._currentPoly=new Dn,e)){let t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let i=t.shape.x,s=t.shape.y;if(t.transform&&!t.transform.isIdentity()){let n=t.transform,o=i;i=n.a*i+n.c*s+n.tx,s=n.b*o+n.d*s+n.ty;}this._currentPoly.points.push(i,s);}else this._currentPoly.points.push(0,0);}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];this[i.action](...i.data);}this.finish();}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let i=0;i<t.length;i++){let s=t[i],n=s.shape.getBounds(gL);s.transform?e.addRect(n,s.transform):e.addRect(n);}return e}};});function Rd(r,e){return r?r.prepend(e):e.clone()}var Qi,Hx=p(()=>{_r();Pt();Ae();h2();A2();Qi=class r{constructor(e,t=false){this.instructions=[],this.uid=de("graphicsPath"),this._dirty=true,this.checkForHoles=t,typeof e=="string"?Bx(e,this):this.instructions=e?.slice()??[];}get shapePath(){return this._shapePath||(this._shapePath=new Gl(this)),this._dirty&&(this._dirty=false,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,t]}),this._dirty=true,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=true,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=true,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=true,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=true,this}bezierCurveToShort(e,t,i,s,n){let o=this.instructions[this.instructions.length-1],a=this.getLastPoint(ge.shared),u=0,l=0;if(!o||o.action!=="bezierCurveTo")u=a.x,l=a.y;else {u=o.data[2],l=o.data[3];let c=a.x,h=a.y;u=c+(c-u),l=h+(h-l);}return this.instructions.push({action:"bezierCurveTo",data:[u,l,e,t,i,s,n]}),this._dirty=true,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=true,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=true,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=true,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=true,this}quadraticCurveToShort(e,t,i){let s=this.instructions[this.instructions.length-1],n=this.getLastPoint(ge.shared),o=0,a=0;if(!s||s.action!=="quadraticCurveTo")o=n.x,a=n.y;else {o=s.data[0],a=s.data[1];let u=n.x,l=n.y;o=u+(u-o),a=l+(l-a);}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,e,t,i]}),this._dirty=true,this}rect(e,t,i,s,n){return this.instructions.push({action:"rect",data:[e,t,i,s,n]}),this._dirty=true,this}circle(e,t,i,s){return this.instructions.push({action:"circle",data:[e,t,i,s]}),this._dirty=true,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=true,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=true,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=true,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=true,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=true,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=true,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=true,this}star(e,t,i,s,n,o,a){n||(n=s/2);let u=-1*Math.PI/2+o,l=i*2,c=Math.PI*2/l,h=[];for(let d=0;d<l;d++){let f=d%2?n:s,m=d*c+u;h.push(e+f*Math.cos(m),t+f*Math.sin(m));}return this.poly(h,true,a),this}clone(e=false){let t=new r;if(t.checkForHoles=this.checkForHoles,!e)t.instructions=this.instructions.slice();else for(let i=0;i<this.instructions.length;i++){let s=this.instructions[i];t.instructions.push({action:s.action,data:s.data.slice()});}return t}clear(){return this.instructions.length=0,this._dirty=true,this}transform(e){if(e.isIdentity())return this;let t=e.a,i=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,u=0,l=0,c=0,h=0,d=0,f=0,m=0,_=0;for(let x=0;x<this.instructions.length;x++){let g=this.instructions[x],y=g.data;switch(g.action){case "moveTo":case "lineTo":u=y[0],l=y[1],y[0]=t*u+s*l+o,y[1]=i*u+n*l+a;break;case "bezierCurveTo":c=y[0],h=y[1],d=y[2],f=y[3],u=y[4],l=y[5],y[0]=t*c+s*h+o,y[1]=i*c+n*h+a,y[2]=t*d+s*f+o,y[3]=i*d+n*f+a,y[4]=t*u+s*l+o,y[5]=i*u+n*l+a;break;case "quadraticCurveTo":c=y[0],h=y[1],u=y[2],l=y[3],y[0]=t*c+s*h+o,y[1]=i*c+n*h+a,y[2]=t*u+s*l+o,y[3]=i*u+n*l+a;break;case "arcToSvg":u=y[5],l=y[6],m=y[0],_=y[1],y[0]=t*m+s*_,y[1]=i*m+n*_,y[5]=t*u+s*l+o,y[6]=i*u+n*l+a;break;case "circle":y[4]=Rd(y[3],e);break;case "rect":y[4]=Rd(y[4],e);break;case "ellipse":y[8]=Rd(y[8],e);break;case "roundRect":y[5]=Rd(y[5],e);break;case "addPath":y[0].transform(e);break;case "poly":y[2]=Rd(y[2],e);break;default:U("unknown transform action",g.action);break}}return this._dirty=true,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,i=this.instructions[t];if(!i)return e.x=0,e.y=0,e;for(;i.action==="closePath";){if(t--,t<0)return e.x=0,e.y=0,e;i=this.instructions[t];}switch(i.action){case "moveTo":case "lineTo":e.x=i.data[0],e.y=i.data[1];break;case "quadraticCurveTo":e.x=i.data[2],e.y=i.data[3];break;case "bezierCurveTo":e.x=i.data[4],e.y=i.data[5];break;case "arc":case "arcToSvg":e.x=i.data[5],e.y=i.data[6];break;case "addPath":i.data[0].getLastPoint(e);break}return e}};});function Ke(r,e,t){let i=r.getAttribute(e);return i?Number(i):t}var zx=p(()=>{});function Wx(r,e){let t=r.querySelectorAll("defs");for(let i=0;i<t.length;i++){let s=t[i];for(let n=0;n<s.children.length;n++){let o=s.children[n];switch(o.nodeName.toLowerCase()){case "lineargradient":e.defs[o.id]=xL(o);break;case "radialgradient":e.defs[o.id]=_L();break;}}}}function xL(r){let e=Ke(r,"x1",0),t=Ke(r,"y1",0),i=Ke(r,"x2",1),s=Ke(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new tr(e,t,i,s,n==="objectBoundingBox"?"local":"global");for(let a=0;a<r.children.length;a++){let u=r.children[a],l=Ke(u,"offset",0),c=te.shared.setValue(u.getAttribute("stop-color")).toNumber();o.addColorStop(l,c);}return o}function _L(r){return U("[SVG Parser] Radial gradients are not yet supported"),new tr(0,0,1,0)}var C2=p(()=>{vt();Ae();ea();zx();});function Bd(r){let e=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}var w2=p(()=>{});function Id(r,e){let t=r.getAttribute("style"),i={},s={},n={strokeStyle:i,fillStyle:s,useFill:false,useStroke:false};for(let o in Xx){let a=r.getAttribute(o);a&&YM(e,n,o,a.trim());}if(t){let o=t.split(";");for(let a=0;a<o.length;a++){let u=o[a].trim(),[l,c]=u.split(":");Xx[l]&&YM(e,n,l,c.trim());}}return {strokeStyle:n.useStroke?i:null,fillStyle:n.useFill?s:null,useFill:n.useFill,useStroke:n.useStroke}}function YM(r,e,t,i){switch(t){case "stroke":if(i!=="none"){if(i.startsWith("url(")){let s=Bd(i);e.strokeStyle.fill=r.defs[s];}else e.strokeStyle.color=te.shared.setValue(i).toNumber();e.useStroke=true;}break;case "stroke-width":e.strokeStyle.width=Number(i);break;case "fill":if(i!=="none"){if(i.startsWith("url(")){let s=Bd(i);e.fillStyle.fill=r.defs[s];}else e.fillStyle.color=te.shared.setValue(i).toNumber();e.useFill=true;}break;case "fill-opacity":e.fillStyle.alpha=Number(i);break;case "stroke-opacity":e.strokeStyle.alpha=Number(i);break;case "opacity":e.fillStyle.alpha=Number(i),e.strokeStyle.alpha=Number(i);break}}var Xx,P2=p(()=>{vt();w2();Xx={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};});function Yx(r,e){if(typeof r=="string"){let o=document.createElement("div");o.innerHTML=r.trim(),r=o.querySelector("svg");}let t={context:e,defs:{},path:new Qi};Wx(r,t);let i=r.children,{fillStyle:s,strokeStyle:n}=Id(r,t);for(let o=0;o<i.length;o++){let a=i[o];a.nodeName.toLowerCase()!=="defs"&&jM(a,t,s,n);}return e}function jM(r,e,t,i){let s=r.children,{fillStyle:n,strokeStyle:o}=Id(r,e);n&&t?t={...t,...n}:n&&(t=n),o&&i?i={...i,...o}:o&&(i=o);let a=!t&&!i;a&&(t={color:0});let u,l,c,h,d,f,m,_,x,g,y,v,S,C,E,M,D;switch(r.nodeName.toLowerCase()){case "path":C=r.getAttribute("d"),r.getAttribute("fill-rule")==="evenodd"&&U("SVG Evenodd fill rule not supported, your svg may render incorrectly"),E=new Qi(C,true),e.context.path(E),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "circle":m=Ke(r,"cx",0),_=Ke(r,"cy",0),x=Ke(r,"r",0),e.context.ellipse(m,_,x,x),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "rect":u=Ke(r,"x",0),l=Ke(r,"y",0),M=Ke(r,"width",0),D=Ke(r,"height",0),g=Ke(r,"rx",0),y=Ke(r,"ry",0),g||y?e.context.roundRect(u,l,M,D,g||y):e.context.rect(u,l,M,D),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "ellipse":m=Ke(r,"cx",0),_=Ke(r,"cy",0),g=Ke(r,"rx",0),y=Ke(r,"ry",0),e.context.beginPath(),e.context.ellipse(m,_,g,y),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "line":c=Ke(r,"x1",0),h=Ke(r,"y1",0),d=Ke(r,"x2",0),f=Ke(r,"y2",0),e.context.beginPath(),e.context.moveTo(c,h),e.context.lineTo(d,f),i&&e.context.stroke(i);break;case "polygon":S=r.getAttribute("points"),v=S.match(/\d+/g).map(R=>parseInt(R,10)),e.context.poly(v,true),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "polyline":S=r.getAttribute("points"),v=S.match(/\d+/g).map(R=>parseInt(R,10)),e.context.poly(v,false),i&&e.context.stroke(i);break;case "g":case "svg":break;default:{U(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}a&&(t=null);for(let R=0;R<s.length;R++)jM(s[R],e,t,i);}var M2=p(()=>{Ae();Hx();C2();zx();P2();});function bL(r){return te.isColorLike(r)}function $M(r){return r instanceof Ti}function qM(r){return r instanceof tr}function yL(r){return r instanceof B}function vL(r,e,t){let i=te.shared.setValue(e??0);return r.color=i.toNumber(),r.alpha=i.alpha===1?t.alpha:i.alpha,r.texture=B.WHITE,{...t,...r}}function TL(r,e,t){return r.texture=e,{...t,...r}}function KM(r,e,t){return r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,{...t,...r}}function ZM(r,e,t){return e.buildGradient(),r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,r.textureSpace=e.textureSpace,{...t,...r}}function SL(r,e){let t={...e,...r},i=te.shared.setValue(t.color);return t.alpha*=i.alpha,t.color=i.toNumber(),t}function Si(r,e){if(r==null)return null;let t={},i=r;return bL(r)?vL(t,r,e):yL(r)?TL(t,r,e):$M(r)?KM(t,r,e):qM(r)?ZM(t,r,e):i.fill&&$M(i.fill)?KM(i,i.fill,e):i.fill&&qM(i.fill)?ZM(i,i.fill,e):SL(i,e)}function kn(r,e){let{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...u}=e,l=Si(r,u);return l?{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...l}:null}var jx=p(()=>{vt();Se();ea();Pd();});var EL,QM,R2,bt,la=p(()=>{Wt();vt();Te();_r();Se();Pt();Pe();Xt();Hx();M2();jx();EL=new ge,QM=new O,R2=class Ji extends ve{constructor(){super(...arguments),this.uid=de("graphicsContext"),this.dirty=true,this.batchMode="auto",this.instructions=[],this._activePath=new Qi,this._transform=new O,this._fillStyle={...Ji.defaultFillStyle},this._strokeStyle={...Ji.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new Me,this._boundsDirty=true;}clone(){let e=new Ji;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=true,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=Si(e,Ji.defaultFillStyle);}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=kn(e,Ji.defaultStrokeStyle);}setFillStyle(e){return this._fillStyle=Si(e,Ji.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=Si(e,Ji.defaultStrokeStyle),this}texture(e,t,i,s,n,o){return this.instructions.push({action:"texture",data:{image:e,dx:i||0,dy:s||0,dw:n||e.frame.width,dh:o||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t?te.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Qi,this}fill(e,t){let i,s=this.instructions[this.instructions.length-1];return this._tick===0&&s&&s.action==="stroke"?i=s.data.path:i=this._activePath.clone(),i?(e!=null&&(t!==void 0&&typeof e=="number"&&(G(Y,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:t}),this._fillStyle=Si(e,Ji.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(ge.shared);this._activePath.clear(),this._activePath.moveTo(e,t);}stroke(e){let t,i=this.instructions[this.instructions.length-1];return this._tick===0&&i&&i.action==="fill"?t=i.data.path:t=this._activePath.clone(),t?(e!=null&&(this._strokeStyle=kn(e,Ji.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:t}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],i=this._activePath.clone();if(t&&(t.action==="stroke"||t.action==="fill"))if(t.data.hole)t.data.hole.addPath(i);else {t.data.hole=i;break}}return this._initNextPathLocation(),this}arc(e,t,i,s,n,o){this._tick++;let a=this._transform;return this._activePath.arc(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,i,s,n,o),this}arcTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.arcTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}arcToSvg(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.arcToSvg(e,t,i,s,n,u.a*o+u.c*a+u.tx,u.b*o+u.d*a+u.ty),this}bezierCurveTo(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.bezierCurveTo(u.a*e+u.c*t+u.tx,u.b*e+u.d*t+u.ty,u.a*i+u.c*s+u.tx,u.b*i+u.d*s+u.ty,u.a*n+u.c*o+u.tx,u.b*n+u.d*o+u.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,i,s){return this._tick++,this._activePath.ellipse(e,t,i,s,this._transform.clone()),this}circle(e,t,i){return this._tick++,this._activePath.circle(e,t,i,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let i=this._transform;return this._activePath.lineTo(i.a*e+i.c*t+i.tx,i.b*e+i.d*t+i.ty),this}moveTo(e,t){this._tick++;let i=this._transform,s=this._activePath.instructions,n=i.a*e+i.c*t+i.tx,o=i.b*e+i.d*t+i.ty;return s.length===1&&s[0].action==="moveTo"?(s[0].data[0]=n,s[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.quadraticCurveTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}rect(e,t,i,s){return this._tick++,this._activePath.rect(e,t,i,s,this._transform.clone()),this}roundRect(e,t,i,s,n){return this._tick++,this._activePath.roundRect(e,t,i,s,n,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,i,s,n=0,o){return this._tick++,this._activePath.regularPoly(e,t,i,s,n,o),this}roundPoly(e,t,i,s,n,o){return this._tick++,this._activePath.roundPoly(e,t,i,s,n,o),this}roundShape(e,t,i,s){return this._tick++,this._activePath.roundShape(e,t,i,s),this}filletRect(e,t,i,s,n){return this._tick++,this._activePath.filletRect(e,t,i,s,n),this}chamferRect(e,t,i,s,n,o){return this._tick++,this._activePath.chamferRect(e,t,i,s,n,o),this}star(e,t,i,s,n=0,o=0){return this._tick++,this._activePath.star(e,t,i,s,n,o,this._transform.clone()),this}svg(e){return this._tick++,Yx(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,i,s,n,o){return e instanceof O?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,i,s,n,o),this)}transform(e,t,i,s,n,o){return e instanceof O?(this._transform.append(e),this):(QM.set(e,t,i,s,n,o),this._transform.append(QM),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=true,this._boundsDirty=true);}get bounds(){if(!this._boundsDirty)return this._bounds;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let i=this.instructions[t],s=i.action;if(s==="fill"){let n=i.data;e.addBounds(n.path.bounds);}else if(s==="texture"){let n=i.data;e.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform);}if(s==="stroke"){let n=i.data,o=n.style.alignment,a=n.style.width*(1-o),u=n.path.bounds;e.addFrame(u.minX-a,u.minY-a,u.maxX+a,u.maxY+a);}}return e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return false;let t=this.instructions,i=false;for(let s=0;s<t.length;s++){let n=t[s],o=n.data,a=o.path;if(!n.action||!a)continue;let u=o.style,l=a.shapePath.shapePrimitives;for(let c=0;c<l.length;c++){let h=l[c].shape;if(!u||!h)continue;let d=l[c].transform,f=d?d.applyInverse(e,EL):e;if(n.action==="fill")i=h.contains(f.x,f.y);else {let _=u;i=h.strokeContains(f.x,f.y,_.width,_.alignment);}let m=o.hole;if(m){let _=m.shapePath?.shapePrimitives;if(_)for(let x=0;x<_.length;x++)_[x].shape.contains(f.x,f.y)&&(i=false);}if(i)return true}}return i}destroy(e=false){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(i)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(i));}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null;}};R2.defaultFillStyle={color:16777215,alpha:1,texture:B.WHITE,matrix:null,fill:null,textureSpace:"local"};R2.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:B.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:false};bt=R2;});function $x(r){let e=[],t=0;for(let i=0;i<JM.length;i++){let s=`_${JM[i]}`;e[t++]=r[s];}return t=eR(r._fill,e,t),t=CL(r._stroke,e,t),t=wL(r.dropShadow,e,t),t=AL(r.filters,e,t),e.join("-")}function AL(r,e,t){if(!r)return t;for(let i of r)e[t++]=i.uid;return t}function eR(r,e,t){return r&&(e[t++]=r.color,e[t++]=r.alpha,e[t++]=r.fill?.styleKey),t}function CL(r,e,t){return r&&(t=eR(r,e,t),e[t++]=r.width,e[t++]=r.alignment,e[t++]=r.cap,e[t++]=r.join,e[t++]=r.miterLimit),t}function wL(r,e,t){return r&&(e[t++]=r.alpha,e[t++]=r.angle,e[t++]=r.blur,e[t++]=r.distance,e[t++]=te.shared.setValue(r.color).toNumber()),t}var JM,B2=p(()=>{vt();JM=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];});function PL(r){let e=r;if(typeof e.dropShadow=="boolean"&&e.dropShadow){let t=ht.defaultDropShadow;r.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance};}if(e.strokeThickness!==void 0){G(Y,"strokeThickness is now a part of stroke");let t=e.stroke,i={};if(te.isColorLike(t))i.color=t;else if(t instanceof tr||t instanceof Ti)i.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))i=t;else throw new Error("Invalid stroke value.");r.stroke={...i,width:e.strokeThickness};}if(Array.isArray(e.fillGradientStops)){if(G(Y,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||e.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&U("The number of fill colors must match the number of fill gradient stops.");let t=new tr({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),i=e.fillGradientStops.slice(),s=e.fill.map(n=>te.shared.setValue(n).toNumber());i.forEach((n,o)=>{t.addColorStop(n,s[o]);}),r.fill={fill:t};}}var I2,ht,Ei=p(()=>{Wt();vt();Pe();Ae();ea();Pd();la();jx();B2();I2=class Ul extends ve{constructor(e={}){super(),PL(e);let t={...Ul.defaultTextStyle,...e};for(let i in t){let s=i;this[s]=t[i];}this.update();}get align(){return this._align}set align(e){this._align=e,this.update();}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update();}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...Ul.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...Ul.defaultDropShadow}):null,this.update();}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update();}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update();}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e.toLowerCase(),this.update();}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update();}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update();}get leading(){return this._leading}set leading(e){this._leading=e,this.update();}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update();}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update();}get padding(){return this._padding}set padding(e){this._padding=e,this.update();}get filters(){return this._filters}set filters(e){this._filters=e,this.update();}get trim(){return this._trim}set trim(e){this._trim=e,this.update();}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update();}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update();}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update();}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update();}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...bt.defaultFillStyle,...e},()=>{this._fill=Si({...this._originalFill},bt.defaultFillStyle);})),this._fill=Si(e===0?"black":e,bt.defaultFillStyle),this.update());}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...bt.defaultStrokeStyle,...e},()=>{this._stroke=kn({...this._originalStroke},bt.defaultStrokeStyle);})),this._stroke=kn(e,bt.defaultStrokeStyle),this.update());}_generateKey(){return this._styleKey=$x(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this);}reset(){let e=Ul.defaultTextStyle;for(let t in e)this[t]=e[t];}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new Ul({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0})}_getFinalPadding(){let e=0;if(this._filters)for(let t=0;t<this._filters.length;t++)e+=this._filters[t].padding;return Math.max(this._padding,e)}destroy(e=false){if(this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(i),this._originalFill?.texture&&this._originalFill.texture.destroy(i),this._stroke?.texture&&this._stroke.texture.destroy(i),this._originalStroke?.texture&&this._originalStroke.texture.destroy(i);}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null;}_createProxy(e,t){return new Proxy(e,{set:(i,s,n)=>(i[s]=n,t?.(s,n),this.update(),true)})}_isFillStyle(e){return (e??null)!==null&&!(te.isColorLike(e)||e instanceof tr||e instanceof Ti)}};I2.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};I2.defaultTextStyle={align:"left",breakWords:false,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:false,whiteSpace:"pre",wordWrap:false,wordWrapWidth:100};ht=I2;});function Ll(r,e,t,i){let s=ML;s.minX=0,s.minY=0,s.maxX=r.width/i|0,s.maxY=r.height/i|0;let n=Oe.getOptimalTexture(s.width,s.height,i,false);return n.source.uploadMethodId="image",n.source.resource=r,n.source.alphaMode="premultiply-alpha-on-upload",n.frame.width=e/i,n.frame.height=t/i,n.source.emit("update",n.source),n.updateUvs(),n}var ML,qx=p(()=>{gi();Xt();ML=new Me;});var Dd,fr,ca=p(()=>{Be();tl();Dd=class{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=false;}_createCanvasAndContext(e,t){let i=H.get().createCanvas();i.width=e,i.height=t;let s=i.getContext("2d");return {canvas:i,context:s}}getOptimalCanvasAndContext(e,t,i=1){e=Math.ceil(e*i-1e-6),t=Math.ceil(t*i-1e-6),e=mi(e),t=mi(t);let s=(e<<17)+(t<<1);this._canvasPool[s]||(this._canvasPool[s]=[]);let n=this._canvasPool[s].pop();return n||(n=this._createCanvasAndContext(e,t)),n}returnCanvasAndContext(e){let t=e.canvas,{width:i,height:s}=t,n=(i<<17)+(s<<1);e.context.resetTransform(),e.context.clearRect(0,0,i,s),this._canvasPool[n].push(e);}clear(){this._canvasPool={};}},fr=new Dd;});function RL(r,e){ha||(ha=H.get().createCanvas(256,128),Os=ha.getContext("2d",{willReadFrequently:true}),Os.globalCompositeOperation="copy",Os.globalAlpha=1),(ha.width<r||ha.height<e)&&(ha.width=mi(r),ha.height=mi(e));}function tR(r,e,t){for(let i=0,s=4*t*e;i<e;++i,s+=4)if(r[s+3]!==0)return false;return true}function rR(r,e,t,i,s){let n=4*e;for(let o=i,a=i*n+4*t;o<=s;++o,a+=n)if(r[a+3]!==0)return false;return true}function Kx(...r){let e=r[0];e.canvas||(e={canvas:r[0],resolution:r[1]});let{canvas:t}=e,i=Math.min(e.resolution??1,1),s=e.width??t.width,n=e.height??t.height,o=e.output;if(RL(s,n),!Os)throw new TypeError("Failed to get canvas 2D context");Os.drawImage(t,0,0,s,n,0,0,s*i,n*i);let u=Os.getImageData(0,0,s,n).data,l=0,c=0,h=s-1,d=n-1;for(;c<n&&tR(u,s,c);)++c;if(c===n)return re.EMPTY;for(;tR(u,s,d);)--d;for(;rR(u,s,l,c,d);)++l;for(;rR(u,s,h,c,d);)--h;return ++h,++d,Os.globalCompositeOperation="source-over",Os.strokeRect(l,c,h-l,d-c),Os.globalCompositeOperation="copy",o??(o=new re),o.set(l/i,c/i,(h-l)/i,(d-c)/i),o}var ha,Os,D2=p(()=>{Be();tl();xt();ha=null,Os=null;});function Fs(r){let e=typeof r.fontSize=="number"?`${r.fontSize}px`:r.fontSize,t=r.fontFamily;Array.isArray(r.fontFamily)||(t=r.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let s=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(s)&&!BL.includes(s)&&(s=`"${s}"`),t[i]=s;}return `${r.fontStyle} ${r.fontVariant} ${r.fontWeight} ${e} ${t.join(",")}`}var BL,kd=p(()=>{BL=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];});var k2,es,st,Gs=p(()=>{Be();kd();k2={willReadFrequently:true},es=class Q{static get experimentalLetterSpacingSupported(){let e=Q._experimentalLetterSpacingSupported;if(e===void 0){let t=H.get().getCanvasRenderingContext2D().prototype;e=Q._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t;}return e}constructor(e,t,i,s,n,o,a,u,l){this.text=e,this.style=t,this.width=i,this.height=s,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=u,this.fontProperties=l;}static measureText(e=" ",t,i=Q._canvas,s=t.wordWrap){let n=Fs(t),o=Q.measureFont(n);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);let a=Q.__context;a.font=n;let l=(s?Q._wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),c=new Array(l.length),h=0;for(let g=0;g<l.length;g++){let y=Q._measureText(l[g],t.letterSpacing,a);c[g]=y,h=Math.max(h,y);}let d=t._stroke?.width||0,f=h+d;t.dropShadow&&(f+=t.dropShadow.distance);let m=t.lineHeight||o.fontSize,_=Math.max(m,o.fontSize+d)+(l.length-1)*(m+t.leading);return t.dropShadow&&(_+=t.dropShadow.distance),new Q(e,t,f,_,l,c,m+t.leading,h,o)}static _measureText(e,t,i){let s=false;Q.experimentalLetterSpacingSupported&&(Q.experimentalLetterSpacing?(i.letterSpacing=`${t}px`,i.textLetterSpacing=`${t}px`,s=true):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(e),o=n.width,a=-n.actualBoundingBoxLeft,l=n.actualBoundingBoxRight-a;if(o>0)if(s)o-=t,l-=t;else {let c=(Q.graphemeSegmenter(e).length-1)*t;o+=c,l+=c;}return Math.max(o,l)}static _wordWrap(e,t,i=Q._canvas){let s=i.getContext("2d",k2),n=0,o="",a="",u=Object.create(null),{letterSpacing:l,whiteSpace:c}=t,h=Q._collapseSpaces(c),d=Q._collapseNewlines(c),f=!h,m=t.wordWrapWidth+l,_=Q._tokenize(e);for(let x=0;x<_.length;x++){let g=_[x];if(Q._isNewline(g)){if(!d){a+=Q._addLine(o),f=!h,o="",n=0;continue}g=" ";}if(h){let v=Q.isBreakingSpace(g),S=Q.isBreakingSpace(o[o.length-1]);if(v&&S)continue}let y=Q._getFromCache(g,l,u,s);if(y>m)if(o!==""&&(a+=Q._addLine(o),o="",n=0),Q.canBreakWords(g,t.breakWords)){let v=Q.wordWrapSplit(g);for(let S=0;S<v.length;S++){let C=v[S],E=C,M=1;for(;v[S+M];){let R=v[S+M];if(!Q.canBreakChars(E,R,g,S,t.breakWords))C+=R;else break;E=R,M++;}S+=M-1;let D=Q._getFromCache(C,l,u,s);D+n>m&&(a+=Q._addLine(o),f=false,o="",n=0),o+=C,n+=D;}}else {o.length>0&&(a+=Q._addLine(o),o="",n=0);let v=x===_.length-1;a+=Q._addLine(g,!v),f=false,o="",n=0;}else y+n>m&&(f=false,a+=Q._addLine(o),o="",n=0),(o.length>0||!Q.isBreakingSpace(g)||f)&&(o+=g,n+=y);}return a+=Q._addLine(o,false),a}static _addLine(e,t=true){return e=Q._trimRight(e),e=t?`${e}
|
|
375
375
|
`:e,e}static _getFromCache(e,t,i,s){let n=i[e];return typeof n!="number"&&(n=Q._measureText(e,t,s)+t,i[e]=n),n}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return "";for(let t=e.length-1;t>=0;t--){let i=e[t];if(!Q.isBreakingSpace(i))break;e=e.slice(0,-1);}return e}static _isNewline(e){return typeof e!="string"?false:Q._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?false:Q._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){let t=[],i="";if(typeof e!="string")return t;for(let s=0;s<e.length;s++){let n=e[s],o=e[s+1];if(Q.isBreakingSpace(n,o)||Q._isNewline(n)){i!==""&&(t.push(i),i=""),n==="\r"&&o===`
|
|
376
376
|
`?(t.push(`\r
|
|
377
|
-
`),s++):t.push(n);continue}i+=n;}return i!==""&&t.push(i),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,i,s,n){return true}static wordWrapSplit(e){return Q.graphemeSegmenter(e)}static measureFont(e){if(Q._fonts[e])return Q._fonts[e];let t=Q._context;t.font=e;let i=t.measureText(Q.METRICS_STRING+Q.BASELINE_SYMBOL),s={ascent:i.actualBoundingBoxAscent,descent:i.actualBoundingBoxDescent,fontSize:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent};return Q._fonts[e]=s,s}static clearMetrics(e=""){e?delete Q._fonts[e]:Q._fonts={};}static get _canvas(){if(!Q.__canvas){let e;try{let t=new OffscreenCanvas(0,0);if(t.getContext("2d",k2)?.measureText)return Q.__canvas=t,t;e=H.get().createCanvas();}catch{e=H.get().createCanvas();}e.width=e.height=10,Q.__canvas=e;}return Q.__canvas}static get _context(){return Q.__context||(Q.__context=Q._canvas.getContext("2d",k2)),Q.__context}};es.METRICS_STRING="|\xC9q\xC5";es.BASELINE_SYMBOL="M";es.BASELINE_MULTIPLIER=1.4;es.HEIGHT_MULTIPLIER=2;es.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){let r=new Intl.Segmenter;return e=>{let t=r.segment(e),i=[],s=0;for(let n of t)i[s++]=n.segment;return i}}return r=>[...r]})();es.experimentalLetterSpacing=false;es._fonts={};es._newlines=[10,13];es._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];st=es;});function On(r,e,t,i=0){if(r.texture===B.WHITE&&!r.fill)return te.shared.setValue(r.color).setAlpha(r.alpha??1).toHexa();if(r.fill){if(r.fill instanceof Ti){let s=r.fill,n=e.createPattern(s.texture.source.resource,"repeat"),o=s.transform.copyTo(O.shared);return o.scale(s.texture.frame.width,s.texture.frame.height),n.setTransform(o),n}else if(r.fill instanceof tr){let s=r.fill,n=s.type==="linear",o=s.textureSpace==="local",a=1,u=1;o&&t&&(a=t.width+i,u=t.height+i);let l,c=false;if(n){let{start:h,end:d}=s;l=e.createLinearGradient(h.x*a,h.y*u,d.x*a,d.y*u),c=Math.abs(d.x-h.x)<Math.abs((d.y-h.y)*.1);}else {let{center:h,innerRadius:d,outerCenter:f,outerRadius:m}=s;l=e.createRadialGradient(h.x*a,h.y*u,d*a,f.x*a,f.y*u,m*a);}if(c&&o&&t){let h=t.lineHeight/u;for(let d=0;d<t.lines.length;d++){let f=(d*t.lineHeight+i/2)/u;s.colorStops.forEach(m=>{let _=f+m.offset*h;l.addColorStop(Math.floor(_*iR)/iR,te.shared.setValue(m.color).toHex());});}}else s.colorStops.forEach(h=>{l.addColorStop(h.offset,te.shared.setValue(h.color).toHex());});return l}}else {let s=e.createPattern(r.texture.source.resource,"repeat"),n=r.matrix.copyTo(O.shared);return n.scale(r.texture.frame.width,r.texture.frame.height),s.setTransform(n),s}return U("FillStyle not recognised",r),"red"}var iR,Zx=p(()=>{vt();Te();Se();Ae();ea();Pd();iR=1e5;});var sR,O2,Us,Qx=p(()=>{vt();xt();ca();D2();Gs();kd();Zx();sR=new re,O2=class{getCanvasAndContext(e){let{text:t,style:i,resolution:s=1}=e,n=i._getFinalPadding(),o=st.measureText(t||" ",i),a=Math.ceil(Math.ceil(Math.max(1,o.width)+n*2)*s),u=Math.ceil(Math.ceil(Math.max(1,o.height)+n*2)*s),l=fr.getOptimalCanvasAndContext(a,u);this._renderTextToCanvas(t,i,n,s,l);let c=i.trim?Kx({canvas:l.canvas,width:a,height:u,resolution:1,output:sR}):sR.set(0,0,a,u);return {canvasAndContext:l,frame:c}}returnCanvasAndContext(e){fr.returnCanvasAndContext(e);}_renderTextToCanvas(e,t,i,s,n){let{canvas:o,context:a}=n,u=Fs(t),l=st.measureText(e||" ",t),c=l.lines,h=l.lineHeight,d=l.lineWidths,f=l.maxLineWidth,m=l.fontProperties,_=o.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=t.textBaseline,t._stroke?.width){let v=t._stroke;a.lineWidth=v.width,a.miterLimit=v.miterLimit,a.lineJoin=v.join,a.lineCap=v.cap;}a.font=u;let x,g,y=t.dropShadow?2:1;for(let v=0;v<y;++v){let S=t.dropShadow&&v===0,C=S?Math.ceil(Math.max(1,_)+i*2):0,A=C*s;if(S){a.fillStyle="black",a.strokeStyle="black";let R=t.dropShadow,L=R.color,F=R.alpha;a.shadowColor=te.shared.setValue(L).setAlpha(F).toRgbaString();let se=R.blur*s,ye=R.distance*s;a.shadowBlur=se,a.shadowOffsetX=Math.cos(R.angle)*ye,a.shadowOffsetY=Math.sin(R.angle)*ye+A;}else {if(a.fillStyle=t._fill?On(t._fill,a,l,i*2):null,t._stroke?.width){let R=t._stroke.width*.5+i*2;a.strokeStyle=On(t._stroke,a,l,R);}a.shadowColor="black";}let M=(h-m.fontSize)/2;h-m.fontSize<0&&(M=0);let D=t._stroke?.width??0;for(let R=0;R<c.length;R++)x=D/2,g=D/2+R*h+m.ascent+M,t.align==="right"?x+=f-d[R]:t.align==="center"&&(x+=(f-d[R])/2),t._stroke?.width&&this._drawLetterSpacing(c[R],t,n,x+i,g+i-C,true),t._fill!==void 0&&this._drawLetterSpacing(c[R],t,n,x+i,g+i-C);}}_drawLetterSpacing(e,t,i,s,n,o=false){let{context:a}=i,u=t.letterSpacing,l=false;if(st.experimentalLetterSpacingSupported&&(st.experimentalLetterSpacing?(a.letterSpacing=`${u}px`,a.textLetterSpacing=`${u}px`,l=true):(a.letterSpacing="0px",a.textLetterSpacing="0px")),u===0||l){o?a.strokeText(e,s,n):a.fillText(e,s,n);return}let c=s,h=st.graphemeSegmenter(e),d=a.measureText(e).width,f=0;for(let m=0;m<h.length;++m){let _=h[m];o?a.strokeText(_,c,n):a.fillText(_,c,n);let x="";for(let g=m+1;g<h.length;++g)x+=h[g];f=a.measureText(x).width,c+=d-f+u,d=f;}}},Us=new O2;});var da,F2=p(()=>{P();gi();ji();Pe();Ei();qx();Qx();da=class{constructor(e){this._renderer=e;}getTexture(e,t,i,s){typeof e=="string"&&(G("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:i,resolution:t}),e.style instanceof ht||(e.style=new ht(e.style)),e.textureStyle instanceof mt||(e.textureStyle=new mt(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());let{text:n,style:o,textureStyle:a}=e,u=e.resolution??this._renderer.resolution,{frame:l,canvasAndContext:c}=Us.getCanvasAndContext({text:n,style:o,resolution:u}),h=Ll(c.canvas,l.width,l.height,u);if(a&&(h.source.style=a),o.trim&&(l.pad(o.padding),h.frame.copyFrom(l),h.frame.scale(1/u),h.updateUvs()),o.filters){let d=this._applyFilters(h,o.filters);return this.returnTexture(h),Us.returnCanvasAndContext(c),d}return this._renderer.texture.initSource(h._source),Us.returnCanvasAndContext(c),h}returnTexture(e){let t=e.source;t.resource=null,t.uploadMethodId="unknown",t.alphaMode="no-premultiply-alpha",Oe.returnTexture(e,true);}renderTextToCanvas(){G("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead");}_applyFilters(e,t){let i=this._renderer.renderTarget.renderTarget,s=this._renderer.filter.generateFilteredTexture({texture:e,filters:t});return this._renderer.renderTarget.bind(i,false),s}destroy(){this._renderer=null;}};da.extension={type:[b.WebGLSystem,b.WebGPUSystem,b.CanvasSystem],name:"canvasText"};});var G2=p(()=>{P();l2();F2();V.add(da);V.add(aa);});var Fn,Jx=p(()=>{Pe();_i();la();Fn=class r extends gt{constructor(e){e instanceof bt&&(e={context:e});let{context:t,roundPixels:i,...s}=e||{};super({label:"Graphics",...s}),this.renderPipeId="graphics",t?this._context=t:this._context=this._ownedContext=new bt,this._context.on("update",this.onViewUpdate,this),this.didViewUpdate=true,this.allowChildren=false,this.roundPixels=i??false;}set context(e){e!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=e,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate());}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(e){return this._context.containsPoint(e)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):(e===true||e?.context===true)&&this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e);}_callContextMethod(e,t){return this.context[e](...t),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e;}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e;}clone(e=false){return e?new r(this._context.clone()):(this._ownedContext=null,new r(this._context))}lineStyle(e,t,i){G(Y,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");let s={};return e&&(s.width=e),t&&(s.color=t),i&&(s.alpha=i),this.context.strokeStyle=s,this}beginFill(e,t){G(Y,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");let i={};return e!==void 0&&(i.color=e),t!==void 0&&(i.alpha=t),this.context.fillStyle=i,this}endFill(){G(Y,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();let e=this.context.strokeStyle;return (e.width!==bt.defaultStrokeStyle.width||e.color!==bt.defaultStrokeStyle.color||e.alpha!==bt.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return G(Y,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return G(Y,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return G(Y,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return G(Y,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return G(Y,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return G(Y,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}};});var e_,t_,U2=p(()=>{e_={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
377
|
+
`),s++):t.push(n);continue}i+=n;}return i!==""&&t.push(i),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,i,s,n){return true}static wordWrapSplit(e){return Q.graphemeSegmenter(e)}static measureFont(e){if(Q._fonts[e])return Q._fonts[e];let t=Q._context;t.font=e;let i=t.measureText(Q.METRICS_STRING+Q.BASELINE_SYMBOL),s={ascent:i.actualBoundingBoxAscent,descent:i.actualBoundingBoxDescent,fontSize:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent};return Q._fonts[e]=s,s}static clearMetrics(e=""){e?delete Q._fonts[e]:Q._fonts={};}static get _canvas(){if(!Q.__canvas){let e;try{let t=new OffscreenCanvas(0,0);if(t.getContext("2d",k2)?.measureText)return Q.__canvas=t,t;e=H.get().createCanvas();}catch{e=H.get().createCanvas();}e.width=e.height=10,Q.__canvas=e;}return Q.__canvas}static get _context(){return Q.__context||(Q.__context=Q._canvas.getContext("2d",k2)),Q.__context}};es.METRICS_STRING="|\xC9q\xC5";es.BASELINE_SYMBOL="M";es.BASELINE_MULTIPLIER=1.4;es.HEIGHT_MULTIPLIER=2;es.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){let r=new Intl.Segmenter;return e=>{let t=r.segment(e),i=[],s=0;for(let n of t)i[s++]=n.segment;return i}}return r=>[...r]})();es.experimentalLetterSpacing=false;es._fonts={};es._newlines=[10,13];es._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];st=es;});function On(r,e,t,i=0){if(r.texture===B.WHITE&&!r.fill)return te.shared.setValue(r.color).setAlpha(r.alpha??1).toHexa();if(r.fill){if(r.fill instanceof Ti){let s=r.fill,n=e.createPattern(s.texture.source.resource,"repeat"),o=s.transform.copyTo(O.shared);return o.scale(s.texture.frame.width,s.texture.frame.height),n.setTransform(o),n}else if(r.fill instanceof tr){let s=r.fill,n=s.type==="linear",o=s.textureSpace==="local",a=1,u=1;o&&t&&(a=t.width+i,u=t.height+i);let l,c=false;if(n){let{start:h,end:d}=s;l=e.createLinearGradient(h.x*a,h.y*u,d.x*a,d.y*u),c=Math.abs(d.x-h.x)<Math.abs((d.y-h.y)*.1);}else {let{center:h,innerRadius:d,outerCenter:f,outerRadius:m}=s;l=e.createRadialGradient(h.x*a,h.y*u,d*a,f.x*a,f.y*u,m*a);}if(c&&o&&t){let h=t.lineHeight/u;for(let d=0;d<t.lines.length;d++){let f=(d*t.lineHeight+i/2)/u;s.colorStops.forEach(m=>{let _=f+m.offset*h;l.addColorStop(Math.floor(_*iR)/iR,te.shared.setValue(m.color).toHex());});}}else s.colorStops.forEach(h=>{l.addColorStop(h.offset,te.shared.setValue(h.color).toHex());});return l}}else {let s=e.createPattern(r.texture.source.resource,"repeat"),n=r.matrix.copyTo(O.shared);return n.scale(r.texture.frame.width,r.texture.frame.height),s.setTransform(n),s}return U("FillStyle not recognised",r),"red"}var iR,Zx=p(()=>{vt();Te();Se();Ae();ea();Pd();iR=1e5;});var sR,O2,Us,Qx=p(()=>{vt();xt();ca();D2();Gs();kd();Zx();sR=new re,O2=class{getCanvasAndContext(e){let{text:t,style:i,resolution:s=1}=e,n=i._getFinalPadding(),o=st.measureText(t||" ",i),a=Math.ceil(Math.ceil(Math.max(1,o.width)+n*2)*s),u=Math.ceil(Math.ceil(Math.max(1,o.height)+n*2)*s),l=fr.getOptimalCanvasAndContext(a,u);this._renderTextToCanvas(t,i,n,s,l);let c=i.trim?Kx({canvas:l.canvas,width:a,height:u,resolution:1,output:sR}):sR.set(0,0,a,u);return {canvasAndContext:l,frame:c}}returnCanvasAndContext(e){fr.returnCanvasAndContext(e);}_renderTextToCanvas(e,t,i,s,n){let{canvas:o,context:a}=n,u=Fs(t),l=st.measureText(e||" ",t),c=l.lines,h=l.lineHeight,d=l.lineWidths,f=l.maxLineWidth,m=l.fontProperties,_=o.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=t.textBaseline,t._stroke?.width){let v=t._stroke;a.lineWidth=v.width,a.miterLimit=v.miterLimit,a.lineJoin=v.join,a.lineCap=v.cap;}a.font=u;let x,g,y=t.dropShadow?2:1;for(let v=0;v<y;++v){let S=t.dropShadow&&v===0,C=S?Math.ceil(Math.max(1,_)+i*2):0,E=C*s;if(S){a.fillStyle="black",a.strokeStyle="black";let R=t.dropShadow,L=R.color,F=R.alpha;a.shadowColor=te.shared.setValue(L).setAlpha(F).toRgbaString();let se=R.blur*s,ye=R.distance*s;a.shadowBlur=se,a.shadowOffsetX=Math.cos(R.angle)*ye,a.shadowOffsetY=Math.sin(R.angle)*ye+E;}else {if(a.fillStyle=t._fill?On(t._fill,a,l,i*2):null,t._stroke?.width){let R=t._stroke.width*.5+i*2;a.strokeStyle=On(t._stroke,a,l,R);}a.shadowColor="black";}let M=(h-m.fontSize)/2;h-m.fontSize<0&&(M=0);let D=t._stroke?.width??0;for(let R=0;R<c.length;R++)x=D/2,g=D/2+R*h+m.ascent+M,t.align==="right"?x+=f-d[R]:t.align==="center"&&(x+=(f-d[R])/2),t._stroke?.width&&this._drawLetterSpacing(c[R],t,n,x+i,g+i-C,true),t._fill!==void 0&&this._drawLetterSpacing(c[R],t,n,x+i,g+i-C);}}_drawLetterSpacing(e,t,i,s,n,o=false){let{context:a}=i,u=t.letterSpacing,l=false;if(st.experimentalLetterSpacingSupported&&(st.experimentalLetterSpacing?(a.letterSpacing=`${u}px`,a.textLetterSpacing=`${u}px`,l=true):(a.letterSpacing="0px",a.textLetterSpacing="0px")),u===0||l){o?a.strokeText(e,s,n):a.fillText(e,s,n);return}let c=s,h=st.graphemeSegmenter(e),d=a.measureText(e).width,f=0;for(let m=0;m<h.length;++m){let _=h[m];o?a.strokeText(_,c,n):a.fillText(_,c,n);let x="";for(let g=m+1;g<h.length;++g)x+=h[g];f=a.measureText(x).width,c+=d-f+u,d=f;}}},Us=new O2;});var da,F2=p(()=>{P();gi();ji();Pe();Ei();qx();Qx();da=class{constructor(e){this._renderer=e;}getTexture(e,t,i,s){typeof e=="string"&&(G("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:i,resolution:t}),e.style instanceof ht||(e.style=new ht(e.style)),e.textureStyle instanceof mt||(e.textureStyle=new mt(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());let{text:n,style:o,textureStyle:a}=e,u=e.resolution??this._renderer.resolution,{frame:l,canvasAndContext:c}=Us.getCanvasAndContext({text:n,style:o,resolution:u}),h=Ll(c.canvas,l.width,l.height,u);if(a&&(h.source.style=a),o.trim&&(l.pad(o.padding),h.frame.copyFrom(l),h.frame.scale(1/u),h.updateUvs()),o.filters){let d=this._applyFilters(h,o.filters);return this.returnTexture(h),Us.returnCanvasAndContext(c),d}return this._renderer.texture.initSource(h._source),Us.returnCanvasAndContext(c),h}returnTexture(e){let t=e.source;t.resource=null,t.uploadMethodId="unknown",t.alphaMode="no-premultiply-alpha",Oe.returnTexture(e,true);}renderTextToCanvas(){G("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead");}_applyFilters(e,t){let i=this._renderer.renderTarget.renderTarget,s=this._renderer.filter.generateFilteredTexture({texture:e,filters:t});return this._renderer.renderTarget.bind(i,false),s}destroy(){this._renderer=null;}};da.extension={type:[b.WebGLSystem,b.WebGPUSystem,b.CanvasSystem],name:"canvasText"};});var G2=p(()=>{P();l2();F2();V.add(da);V.add(aa);});var Fn,Jx=p(()=>{Pe();_i();la();Fn=class r extends gt{constructor(e){e instanceof bt&&(e={context:e});let{context:t,roundPixels:i,...s}=e||{};super({label:"Graphics",...s}),this.renderPipeId="graphics",t?this._context=t:this._context=this._ownedContext=new bt,this._context.on("update",this.onViewUpdate,this),this.didViewUpdate=true,this.allowChildren=false,this.roundPixels=i??false;}set context(e){e!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=e,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate());}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(e){return this._context.containsPoint(e)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):(e===true||e?.context===true)&&this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e);}_callContextMethod(e,t){return this.context[e](...t),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e;}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e;}clone(e=false){return e?new r(this._context.clone()):(this._ownedContext=null,new r(this._context))}lineStyle(e,t,i){G(Y,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");let s={};return e&&(s.width=e),t&&(s.color=t),i&&(s.alpha=i),this.context.strokeStyle=s,this}beginFill(e,t){G(Y,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");let i={};return e!==void 0&&(i.color=e),t!==void 0&&(i.alpha=t),this.context.fillStyle=i,this}endFill(){G(Y,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();let e=this.context.strokeStyle;return (e.width!==bt.defaultStrokeStyle.width||e.color!==bt.defaultStrokeStyle.color||e.alpha!==bt.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return G(Y,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return G(Y,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return G(Y,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return G(Y,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return G(Y,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return G(Y,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}};});var e_,t_,U2=p(()=>{e_={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
378
378
|
struct LocalUniforms {
|
|
379
379
|
uColor:vec4<f32>,
|
|
380
380
|
uTransformMatrix:mat3x3<f32>,
|
|
@@ -471,10 +471,10 @@ fn mainFragment(
|
|
|
471
471
|
|
|
472
472
|
return coverage;
|
|
473
473
|
}
|
|
474
|
-
`}};});var N2,V2,Nl,H2=p(()=>{Te();Is();_l();bl();Ds();md();ei();_t();U2();L2();Nl=class extends it{constructor(e){let t=new be({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new O,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});N2??(N2=Kr({name:"sdf-shader",bits:[En,Cn(e),e_,r_,Qr]})),V2??(V2=Zr({name:"sdf-shader",bits:[An,wn(e),t_,i_,Jr]})),super({glProgram:V2,gpuProgram:N2,resources:{localUniforms:t,batchSamplers:Pn(e)}});}};});var Gn,s_=p(()=>{Wt();Pe();Gn=class extends ve{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=true,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100;}get font(){return G(Y,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return G(Y,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return G(Y,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return G(Y,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return G(Y,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=false){this.emit("destroy",this),this.removeAllListeners();for(let t in this.chars)this.chars[t].texture?.destroy();this.chars=null,e&&(this.pages.forEach(t=>t.texture.destroy(true)),this.pages=null);}};});var nR,Od,z2=p(()=>{vt();xt();ca();qo();Se();ji();Pe();Gs();kd();Zx();Ei();s_();nR=class oR extends Gn{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=false;let t={...oR.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;let i=t.style.clone();t.overrideFill&&(i._fill.color=16777215,i._fill.alpha=1,i._fill.texture=B.WHITE,i._fill.fill=null),this.applyFillAsTint=t.overrideFill;let s=i.fontSize;i.fontSize=this.baseMeasurementFontSize;let n=Fs(i);t.overrideSize?i._stroke&&(i._stroke.width*=this.baseRenderedFontSize/s):i.fontSize=this.baseRenderedFontSize=s,this._style=i,this._skipKerning=t.skipKerning??false,this.resolution=t.resolution??1,this._padding=t.padding??4,t.textureStyle&&(this._textureStyle=t.textureStyle instanceof mt?t.textureStyle:new mt(t.textureStyle)),this.fontMetrics=st.measureFont(n),this.lineHeight=i.lineHeight||this.fontMetrics.fontSize||i.fontSize;}ensureCharacters(e){let t=st.graphemeSegmenter(e).filter(x=>!this._currentChars.includes(x)).filter((x,g,y)=>y.indexOf(x)===g);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let i;this._currentPageIndex===-1?i=this._nextPage():i=this.pages[this._currentPageIndex];let{canvas:s,context:n}=i.canvasAndContext,o=i.texture.source,a=this._style,u=this._currentX,l=this._currentY,c=this._currentMaxCharHeight,h=this.baseRenderedFontSize/this.baseMeasurementFontSize,d=this._padding*h,f=false,m=s.width/this.resolution,_=s.height/this.resolution;for(let x=0;x<t.length;x++){let g=t[x],y=st.measureText(g,a,s,false);y.lineHeight=y.height;let v=y.width*h,S=Math.ceil((a.fontStyle==="italic"?2:1)*v),C=y.height*h,
|
|
475
|
-
`&&g!=="\r"&&g!==" "&&g!==" "&&(f=true,c=Math.ceil(Math.max(M,c))),u+
|
|
474
|
+
`}};});var N2,V2,Nl,H2=p(()=>{Te();Is();_l();bl();Ds();md();ei();_t();U2();L2();Nl=class extends it{constructor(e){let t=new be({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new O,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});N2??(N2=Kr({name:"sdf-shader",bits:[En,Cn(e),e_,r_,Qr]})),V2??(V2=Zr({name:"sdf-shader",bits:[An,wn(e),t_,i_,Jr]})),super({glProgram:V2,gpuProgram:N2,resources:{localUniforms:t,batchSamplers:Pn(e)}});}};});var Gn,s_=p(()=>{Wt();Pe();Gn=class extends ve{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=true,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100;}get font(){return G(Y,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return G(Y,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return G(Y,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return G(Y,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return G(Y,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=false){this.emit("destroy",this),this.removeAllListeners();for(let t in this.chars)this.chars[t].texture?.destroy();this.chars=null,e&&(this.pages.forEach(t=>t.texture.destroy(true)),this.pages=null);}};});var nR,Od,z2=p(()=>{vt();xt();ca();qo();Se();ji();Pe();Gs();kd();Zx();Ei();s_();nR=class oR extends Gn{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=false;let t={...oR.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;let i=t.style.clone();t.overrideFill&&(i._fill.color=16777215,i._fill.alpha=1,i._fill.texture=B.WHITE,i._fill.fill=null),this.applyFillAsTint=t.overrideFill;let s=i.fontSize;i.fontSize=this.baseMeasurementFontSize;let n=Fs(i);t.overrideSize?i._stroke&&(i._stroke.width*=this.baseRenderedFontSize/s):i.fontSize=this.baseRenderedFontSize=s,this._style=i,this._skipKerning=t.skipKerning??false,this.resolution=t.resolution??1,this._padding=t.padding??4,t.textureStyle&&(this._textureStyle=t.textureStyle instanceof mt?t.textureStyle:new mt(t.textureStyle)),this.fontMetrics=st.measureFont(n),this.lineHeight=i.lineHeight||this.fontMetrics.fontSize||i.fontSize;}ensureCharacters(e){let t=st.graphemeSegmenter(e).filter(x=>!this._currentChars.includes(x)).filter((x,g,y)=>y.indexOf(x)===g);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let i;this._currentPageIndex===-1?i=this._nextPage():i=this.pages[this._currentPageIndex];let{canvas:s,context:n}=i.canvasAndContext,o=i.texture.source,a=this._style,u=this._currentX,l=this._currentY,c=this._currentMaxCharHeight,h=this.baseRenderedFontSize/this.baseMeasurementFontSize,d=this._padding*h,f=false,m=s.width/this.resolution,_=s.height/this.resolution;for(let x=0;x<t.length;x++){let g=t[x],y=st.measureText(g,a,s,false);y.lineHeight=y.height;let v=y.width*h,S=Math.ceil((a.fontStyle==="italic"?2:1)*v),C=y.height*h,E=S+d*2,M=C+d*2;if(f=false,g!==`
|
|
475
|
+
`&&g!=="\r"&&g!==" "&&g!==" "&&(f=true,c=Math.ceil(Math.max(M,c))),u+E>m&&(l+=c,c=M,u=0,l+c>_)){o.update();let R=this._nextPage();s=R.canvasAndContext.canvas,n=R.canvasAndContext.context,o=R.texture.source,u=0,l=0,c=0;}let D=v/h-(a.dropShadow?.distance??0)-(a._stroke?.width??0);if(this.chars[g]={id:g.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:D,kerning:{}},f){this._drawGlyph(n,y,u+d,l+d,h,a);let R=o.width*h,L=o.height*h,F=new re(u/R*o.width,l/L*o.height,E/R*o.width,M/L*o.height);this.chars[g].texture=new B({source:o,frame:F}),u+=Math.ceil(E);}}o.update(),this._currentX=u,this._currentY=l,this._currentMaxCharHeight=c,this._skipKerning&&this._applyKerning(t,n);}get pageTextures(){return G(Y,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){let i=this._measureCache;for(let s=0;s<e.length;s++){let n=e[s];for(let o=0;o<this._currentChars.length;o++){let a=this._currentChars[o],u=i[n];u||(u=i[n]=t.measureText(n).width);let l=i[a];l||(l=i[a]=t.measureText(a).width);let c=t.measureText(n+a).width,h=c-(u+l);h&&(this.chars[n].kerning[a]=h),c=t.measureText(n+a).width,h=c-(u+l),h&&(this.chars[a].kerning[n]=h);}}}_nextPage(){this._currentPageIndex++;let e=this.resolution,t=fr.getOptimalCanvasAndContext(this._textureSize,this._textureSize,e);this._setupContext(t.context,this._style,e);let i=e*(this.baseRenderedFontSize/this.baseMeasurementFontSize),s=new B({source:new Qt({resource:t.canvas,resolution:i,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})});this._textureStyle&&(s.source.style=this._textureStyle);let n={canvasAndContext:t,texture:s};return this.pages[this._currentPageIndex]=n,n}_setupContext(e,t,i){t.fontSize=this.baseRenderedFontSize,e.scale(i,i),e.font=Fs(t),t.fontSize=this.baseMeasurementFontSize,e.textBaseline=t.textBaseline;let s=t._stroke,n=s?.width??0;if(s&&(e.lineWidth=n,e.lineJoin=s.join,e.miterLimit=s.miterLimit,e.strokeStyle=On(s,e)),t._fill&&(e.fillStyle=On(t._fill,e)),t.dropShadow){let o=t.dropShadow,a=te.shared.setValue(o.color).toArray(),u=o.blur*i,l=o.distance*i;e.shadowColor=`rgba(${a[0]*255},${a[1]*255},${a[2]*255},${o.alpha})`,e.shadowBlur=u,e.shadowOffsetX=Math.cos(o.angle)*l,e.shadowOffsetY=Math.sin(o.angle)*l;}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;}_drawGlyph(e,t,i,s,n,o){let a=t.text,u=t.fontProperties,c=(o._stroke?.width??0)*n,h=i+c/2,d=s-c/2,f=u.descent*n,m=t.lineHeight*n,_=false;o.stroke&&c&&(_=true,e.strokeText(a,h,d+m-f));let{shadowBlur:x,shadowOffsetX:g,shadowOffsetY:y}=e;o._fill&&(_&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.fillText(a,h,d+m-f)),_&&(e.shadowBlur=x,e.shadowOffsetX=g,e.shadowOffsetY=y);}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){let{canvasAndContext:t,texture:i}=this.pages[e];fr.returnCanvasAndContext(t),i.destroy(true);}this.pages=null;}};nR.defaultOptions={textureSize:512,style:new ht,mipmap:true};Od=nR;});function Un(r,e,t,i){let s={width:0,height:0,offsetY:0,scale:e.fontSize/t.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};s.offsetY=t.baseLineOffset;let n=s.lines[0],o=null,a=true,u={width:0,start:0,index:0,positions:[],chars:[]},l=t.baseMeasurementFontSize/e.fontSize,c=e.letterSpacing*l,h=e.wordWrapWidth*l,d=e.lineHeight?e.lineHeight*l:t.lineHeight,f=e.wordWrap&&e.breakWords,m=g=>{let y=n.width;for(let v=0;v<u.index;v++){let S=g.positions[v];n.chars.push(g.chars[v]),n.charPositions.push(S+y);}n.width+=g.width,a=false,u.width=0,u.index=0,u.chars.length=0;},_=()=>{let g=n.chars.length-1;if(i){let y=n.chars[g];for(;y===" ";)n.width-=t.chars[y].xAdvance,y=n.chars[--g];}s.width=Math.max(s.width,n.width),n={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},a=true,s.lines.push(n),s.height+=d;},x=g=>g-c>h;for(let g=0;g<r.length+1;g++){let y,v=g===r.length;v||(y=r[g]);let S=t.chars[y]||t.chars[" "];if(/(?:\s)/.test(y)||y==="\r"||y===`
|
|
476
476
|
`||v){if(!a&&e.wordWrap&&x(n.width+u.width)?(_(),m(u),v||n.charPositions.push(0)):(u.start=n.width,m(u),v||n.charPositions.push(0)),y==="\r"||y===`
|
|
477
|
-
`)n.width!==0&&_();else if(!v){let D=S.xAdvance+(S.kerning[o]||0)+c;n.width+=D,n.spaceWidth=D,n.spacesIndex.push(n.charPositions.length),n.chars.push(y);}}else {let M=S.kerning[o]||0,D=S.xAdvance+M+c;f&&x(n.width+u.width+D)&&(m(u),_()),u.positions[u.index++]=u.width+M,u.chars.push(y),u.width+=D;}o=y;}return _(),e.align==="center"?IL(s):e.align==="right"?DL(s):e.align==="justify"&&kL(s),s}function IL(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width/2-t.width/2;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function DL(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width-t.width;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function kL(r){let e=r.width;for(let t=0;t<r.lines.length;t++){let i=r.lines[t],s=0,n=i.spacesIndex[s++],o=0,a=i.spacesIndex.length,l=(e-i.width)/a;for(let c=0;c<i.charPositions.length;c++)c===n&&(n=i.spacesIndex[s++],o+=l),i.charPositions[c]+=o;}}var Fd=p(()=>{});function n_(r){if(r==="")return [];typeof r=="string"&&(r=[r]);let e=[];for(let t=0,i=r.length;t<i;t++){let s=r[t];if(Array.isArray(s)){if(s.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${s.length}.`);if(s[0].length===0||s[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");let n=s[0].charCodeAt(0),o=s[1].charCodeAt(0);if(o<n)throw new Error("[BitmapFont]: Invalid character range.");for(let a=n,u=o;a<=u;a++)e.push(String.fromCharCode(a));}else e.push(...Array.from(s));}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}var W2=p(()=>{});var o_,X2,Ai,Vl=p(()=>{qi();Pe();Ae();Gs();Ei();z2();Fd();W2();o_=0,X2=class{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:false,textureStyle:null};}getFont(e,t){let i=`${t.fontFamily}-bitmap`,s=true;if(t._fill.fill&&!t._stroke)i+=t._fill.fill.styleKey,s=false;else if(t._stroke||t.dropShadow){let o=t.styleKey;o=o.substring(0,o.lastIndexOf("-")),i=`${o}-bitmap`,s=false;}if(!Ee.has(i)){let o=Object.create(t);o.lineHeight=0;let a=new Od({style:o,overrideFill:s,overrideSize:true,...this.defaultOptions});o_++,o_>50&&U("BitmapText",`You have dynamically created ${o_} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),a.once("destroy",()=>{o_--,Ee.remove(i);}),Ee.set(i,a);}let n=Ee.get(i);return n.ensureCharacters?.(e),n}getLayout(e,t,i=true){let s=this.getFont(e,t),n=st.graphemeSegmenter(e);return Un(n,t,s,i)}measureText(e,t,i=true){return this.getLayout(e,t,i)}install(...e){let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},G(Y,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));let i=t?.name;if(!i)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};let s=t.style,n=s instanceof ht?s:new ht(s),o=t.dynamicFill??this._canUseTintForStyle(n),a=new Od({style:n,overrideFill:o,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:false,textureStyle:t.textureStyle}),u=n_(t.chars);return a.ensureCharacters(u.join("")),Ee.set(`${i}-bitmap`,a),a.once("destroy",()=>Ee.remove(`${i}-bitmap`)),a}uninstall(e){let t=`${e}-bitmap`,i=Ee.get(t);i&&i.destroy();}_canUseTintForStyle(e){return !e._stroke&&(!e.dropShadow||e.dropShadow.color===0)&&!e._fill.fill&&e._fill.color===16777215}},Ai=new X2;});function aR(r,e){e.groupTransform=r.groupTransform,e.groupColorAlpha=r.groupColorAlpha,e.groupColor=r.groupColor,e.groupBlendMode=r.groupBlendMode,e.globalDisplayStatus=r.globalDisplayStatus,e.groupTransform=r.groupTransform,e.localDisplayStatus=r.localDisplayStatus,e.groupAlpha=r.groupAlpha,e._roundPixels=r._roundPixels;}var Gd,fa,Y2=p(()=>{qi();P();Jx();Gs();H2();Vl();Fd();Gd=class extends Fn{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy();}},fa=class{constructor(e){this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBitmapText");}validateRenderable(e){let t=this._getGpuBitmapText(e);return this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){let i=this._getGpuBitmapText(e);aR(e,i),e._didTextUpdate&&(e._didTextUpdate=false,this._updateContext(e,i)),this._renderer.renderPipes.graphics.addRenderable(i,t),i.context.customShader&&this._updateDistanceField(e);}updateRenderable(e){let t=this._getGpuBitmapText(e);aR(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e);}_updateContext(e,t){let{context:i}=t,s=Ai.getFont(e.text,e._style);i.clear(),s.distanceField.type!=="none"&&(i.customShader||(i.customShader=new Nl(this._renderer.limits.maxBatchableTextures)));let n=st.graphemeSegmenter(e.text),o=e._style,a=s.baseLineOffset,u=Un(n,o,s,true),l=o.padding,c=u.scale,h=u.width,d=u.height+u.offsetY;o._stroke&&(h+=o._stroke.width/c,d+=o._stroke.width/c),i.translate(-e._anchor._x*h-l,-e._anchor._y*d-l).scale(c,c);let f=s.applyFillAsTint?o._fill.color:16777215,m=s.fontMetrics.fontSize,_=s.lineHeight;o.lineHeight&&(m=o.fontSize/c,_=o.lineHeight/c);let x=(_-m)/2;x-s.baseLineOffset<0&&(x=0);for(let g=0;g<u.lines.length;g++){let y=u.lines[g];for(let v=0;v<y.charPositions.length;v++){let S=y.chars[v],C=s.chars[S];if(C?.texture){let
|
|
477
|
+
`)n.width!==0&&_();else if(!v){let D=S.xAdvance+(S.kerning[o]||0)+c;n.width+=D,n.spaceWidth=D,n.spacesIndex.push(n.charPositions.length),n.chars.push(y);}}else {let M=S.kerning[o]||0,D=S.xAdvance+M+c;f&&x(n.width+u.width+D)&&(m(u),_()),u.positions[u.index++]=u.width+M,u.chars.push(y),u.width+=D;}o=y;}return _(),e.align==="center"?IL(s):e.align==="right"?DL(s):e.align==="justify"&&kL(s),s}function IL(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width/2-t.width/2;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function DL(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width-t.width;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function kL(r){let e=r.width;for(let t=0;t<r.lines.length;t++){let i=r.lines[t],s=0,n=i.spacesIndex[s++],o=0,a=i.spacesIndex.length,l=(e-i.width)/a;for(let c=0;c<i.charPositions.length;c++)c===n&&(n=i.spacesIndex[s++],o+=l),i.charPositions[c]+=o;}}var Fd=p(()=>{});function n_(r){if(r==="")return [];typeof r=="string"&&(r=[r]);let e=[];for(let t=0,i=r.length;t<i;t++){let s=r[t];if(Array.isArray(s)){if(s.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${s.length}.`);if(s[0].length===0||s[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");let n=s[0].charCodeAt(0),o=s[1].charCodeAt(0);if(o<n)throw new Error("[BitmapFont]: Invalid character range.");for(let a=n,u=o;a<=u;a++)e.push(String.fromCharCode(a));}else e.push(...Array.from(s));}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}var W2=p(()=>{});var o_,X2,Ai,Vl=p(()=>{qi();Pe();Ae();Gs();Ei();z2();Fd();W2();o_=0,X2=class{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:false,textureStyle:null};}getFont(e,t){let i=`${t.fontFamily}-bitmap`,s=true;if(t._fill.fill&&!t._stroke)i+=t._fill.fill.styleKey,s=false;else if(t._stroke||t.dropShadow){let o=t.styleKey;o=o.substring(0,o.lastIndexOf("-")),i=`${o}-bitmap`,s=false;}if(!Ee.has(i)){let o=Object.create(t);o.lineHeight=0;let a=new Od({style:o,overrideFill:s,overrideSize:true,...this.defaultOptions});o_++,o_>50&&U("BitmapText",`You have dynamically created ${o_} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),a.once("destroy",()=>{o_--,Ee.remove(i);}),Ee.set(i,a);}let n=Ee.get(i);return n.ensureCharacters?.(e),n}getLayout(e,t,i=true){let s=this.getFont(e,t),n=st.graphemeSegmenter(e);return Un(n,t,s,i)}measureText(e,t,i=true){return this.getLayout(e,t,i)}install(...e){let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},G(Y,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));let i=t?.name;if(!i)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};let s=t.style,n=s instanceof ht?s:new ht(s),o=t.dynamicFill??this._canUseTintForStyle(n),a=new Od({style:n,overrideFill:o,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:false,textureStyle:t.textureStyle}),u=n_(t.chars);return a.ensureCharacters(u.join("")),Ee.set(`${i}-bitmap`,a),a.once("destroy",()=>Ee.remove(`${i}-bitmap`)),a}uninstall(e){let t=`${e}-bitmap`,i=Ee.get(t);i&&i.destroy();}_canUseTintForStyle(e){return !e._stroke&&(!e.dropShadow||e.dropShadow.color===0)&&!e._fill.fill&&e._fill.color===16777215}},Ai=new X2;});function aR(r,e){e.groupTransform=r.groupTransform,e.groupColorAlpha=r.groupColorAlpha,e.groupColor=r.groupColor,e.groupBlendMode=r.groupBlendMode,e.globalDisplayStatus=r.globalDisplayStatus,e.groupTransform=r.groupTransform,e.localDisplayStatus=r.localDisplayStatus,e.groupAlpha=r.groupAlpha,e._roundPixels=r._roundPixels;}var Gd,fa,Y2=p(()=>{qi();P();Jx();Gs();H2();Vl();Fd();Gd=class extends Fn{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy();}},fa=class{constructor(e){this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBitmapText");}validateRenderable(e){let t=this._getGpuBitmapText(e);return this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){let i=this._getGpuBitmapText(e);aR(e,i),e._didTextUpdate&&(e._didTextUpdate=false,this._updateContext(e,i)),this._renderer.renderPipes.graphics.addRenderable(i,t),i.context.customShader&&this._updateDistanceField(e);}updateRenderable(e){let t=this._getGpuBitmapText(e);aR(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e);}_updateContext(e,t){let{context:i}=t,s=Ai.getFont(e.text,e._style);i.clear(),s.distanceField.type!=="none"&&(i.customShader||(i.customShader=new Nl(this._renderer.limits.maxBatchableTextures)));let n=st.graphemeSegmenter(e.text),o=e._style,a=s.baseLineOffset,u=Un(n,o,s,true),l=o.padding,c=u.scale,h=u.width,d=u.height+u.offsetY;o._stroke&&(h+=o._stroke.width/c,d+=o._stroke.width/c),i.translate(-e._anchor._x*h-l,-e._anchor._y*d-l).scale(c,c);let f=s.applyFillAsTint?o._fill.color:16777215,m=s.fontMetrics.fontSize,_=s.lineHeight;o.lineHeight&&(m=o.fontSize/c,_=o.lineHeight/c);let x=(_-m)/2;x-s.baseLineOffset<0&&(x=0);for(let g=0;g<u.lines.length;g++){let y=u.lines[g];for(let v=0;v<y.charPositions.length;v++){let S=y.chars[v],C=s.chars[S];if(C?.texture){let E=C.texture;i.texture(E,f||"black",Math.round(y.charPositions[v]+C.xOffset),Math.round(a+C.yOffset+x),E.orig.width,E.orig.height);}}a+=_;}}_getGpuBitmapText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Gd;return e._gpuData[this._renderer.uid]=t,this._updateContext(e,t),t}_updateDistanceField(e){let t=this._getGpuBitmapText(e).context,i=e._style.fontFamily,s=Ee.get(`${i}-bitmap`),{a:n,b:o,c:a,d:u}=e.groupTransform,l=Math.sqrt(n*n+o*o),c=Math.sqrt(a*a+u*u),h=(Math.abs(l)+Math.abs(c))/2,d=s.baseRenderedFontSize/e._style.fontSize,f=h*s.distanceField.range*(1/d);t.customShader.resources.localUniforms.uniforms.uDistance=f;}destroy(){this._renderer=null;}};fa.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"bitmapText"};});var j2=p(()=>{P();Y2();V.add(fa);});var Hl,$2=p(()=>{Ml();Hl=class extends ri{constructor(e){super(),this.generatingTexture=false,this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.htmlText.returnTexturePromise(this.texturePromise),this.texturePromise=null,this._renderer=null;}};});var pa,q2=p(()=>{P();Se();Rx();$2();pa=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e).catch(s=>{console.error(s);}),e._didTextUpdate=false,oa(i,e)),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}async _updateGpuText(e){e._didTextUpdate=false;let t=this._getGpuText(e);if(t.generatingTexture)return;t.texturePromise&&(this._renderer.htmlText.returnTexturePromise(t.texturePromise),t.texturePromise=null),t.generatingTexture=true,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let i=this._renderer.htmlText.getTexturePromise(e);t.texturePromise=i,t.texture=await i;let s=e.renderGroup||e.parentRenderGroup;s&&(s.structureDidChange=true),t.generatingTexture=false,oa(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Hl(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.texture=B.EMPTY,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};pa.extension={type:[b.WebGLPipes,b.WebGPUPipes,b.CanvasPipes],name:"htmlText"};});function a_(){let{userAgent:r}=H.get().getNavigator();return /^((?!chrome|android).)*safari/i.test(r)}var K2=p(()=>{Be();});var uR,lR,Ln,u_=p(()=>{Be();uR="http://www.w3.org/2000/svg",lR="http://www.w3.org/1999/xhtml",Ln=class{constructor(){this.svgRoot=document.createElementNS(uR,"svg"),this.foreignObject=document.createElementNS(uR,"foreignObject"),this.domElement=document.createElementNS(lR,"div"),this.styleElement=document.createElementNS(lR,"style");let{foreignObject:e,svgRoot:t,styleElement:i,domElement:s}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(i),e.appendChild(s),this.image=H.get().createImage();}};});function l_(r,e){let t=e.fontFamily,i=[],s={},n=/font-family:([^;"\s]+)/g,o=r.match(n);function a(u){s[u]||(i.push(u),s[u]=true);}if(Array.isArray(t))for(let u=0;u<t.length;u++)a(t[u]);else a(t);o&&o.forEach(u=>{let l=u.split(":")[1].trim();a(l);});for(let u in e.tagStyles){let l=e.tagStyles[u].fontFamily;a(l);}return i}var Z2=p(()=>{});async function c_(r){let t=await(await H.get().fetch(r)).blob(),i=new FileReader;return await new Promise((n,o)=>{i.onloadend=()=>n(i.result),i.onerror=o,i.readAsDataURL(t);})}var Q2=p(()=>{Be();});async function h_(r,e){let t=await c_(e);return `@font-face {
|
|
478
478
|
font-family: "${r.fontFamily}";
|
|
479
479
|
font-weight: ${r.fontWeight};
|
|
480
480
|
font-style: ${r.fontStyle};
|
|
@@ -2473,7 +2473,7 @@ ${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=$t(e
|
|
|
2473
2473
|
|
|
2474
2474
|
})();
|
|
2475
2475
|
`,kc=null,Vf=class{constructor(){kc||(kc=URL.createObjectURL(new Blob([o8],{type:"application/javascript"}))),this.worker=new Worker(kc);}};Vf.revokeObjectURL=function(){kc&&(URL.revokeObjectURL(kc),kc=null);};});function jB(r){Object.assign(Oc,r);}var Oc,wC=p(()=>{Oc={jsUrl:"https://files.pixijs.download/transcoders/ktx/libktx.js",wasmUrl:"https://files.pixijs.download/transcoders/ktx/libktx.wasm"};});function a8(r){return Hf||(Hf=new Vf().worker,Hf.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load KTX texture",i),$B[i](s);},Hf.postMessage({type:"init",jsUrl:Oc.jsUrl,wasmUrl:Oc.wasmUrl,supportedTextures:r})),Hf}function Ry(r,e){let t=a8(e);return new Promise(i=>{$B[r]=i,t.postMessage({type:"load",url:r});})}var Hf,$B,PC=p(()=>{YB();wC();$B={};});var qB,KB=p(()=>{Ir();Ns();Fr();P();Mc();Bc();PC();qB={extension:{type:b.LoadParser,priority:ze.High,name:"loadKTX2"},name:"loadKTX2",id:"ktx2",test(r){return nt(r,".ktx2")},async load(r,e,t){let i=await as(),s=await Ry(r,i),n=new si(s);return rr(n,t,r)},async unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});function QB(r){let e=r.format;if(MC[e]){let t=MC[e].convertFunction,i=r.resource;for(let s=0;s<i.length;s++)i[s]=t(i[s]);r.format=MC[e].convertedFormat;}}function ZB(r){let e=r.byteLength/3,t=new Uint32Array(e);for(let i=0;i<e;++i)t[i]=r[i*3]+(r[i*3+1]<<8)+(r[i*3+2]<<16)+4278190080;return new Uint8Array(t.buffer)}var MC,JB=p(()=>{MC={rgb8unorm:{convertedFormat:"rgba8unorm",convertFunction:ZB},"rgb8unorm-srgb":{convertedFormat:"rgba8unorm-srgb",convertFunction:ZB}};});function eI(r){let e=[];for(let t=0;t<r.numLevels;t++){let i=r.getImageData(t,0,0),s=new Uint8Array(i.byteLength);s.set(i),e.push(s);}return e}var tI=p(()=>{});function By(r){let e=u8[r];if(e)return e;throw new Error(`Unsupported glInternalFormat: ${r}`)}var u8,RC=p(()=>{u8={6408:"rgba8unorm",32856:"bgra8unorm",32857:"rgb10a2unorm",33189:"depth16unorm",33190:"depth24plus",33321:"r8unorm",33323:"rg8unorm",33325:"r16float",33326:"r32float",33327:"rg16float",33328:"rg32float",33329:"r8sint",33330:"r8uint",33331:"r16sint",33332:"r16uint",33333:"r32sint",33334:"r32uint",33335:"rg8sint",33336:"rg8uint",33337:"rg16sint",33338:"rg16uint",33339:"rg32sint",33340:"rg32uint",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",34836:"rgba32float",34842:"rgba16float",35056:"depth24plus-stencil8",35898:"rg11b10ufloat",35901:"rgb9e5ufloat",35907:"rgba8unorm-srgb",36012:"depth32float",36013:"depth32float-stencil8",36168:"stencil8",36208:"rgba32uint",36214:"rgba16uint",36220:"rgba8uint",36226:"rgba32sint",36232:"rgba16sint",36238:"rgba8sint",36492:"bc7-rgba-unorm",36756:"r8snorm",36757:"rg8snorm",36759:"rgba8snorm",37496:"etc2-rgba8unorm",37808:"astc-4x4-unorm"};});function Iy(r){let e=l8[r];if(e)return e;throw new Error(`Unsupported VkFormat: ${r}`)}var l8,BC=p(()=>{l8={23:"rgb8unorm",37:"rgba8unorm",43:"rgba8unorm-srgb"};});function rI(r){return r.classId===2?Iy(r.vkFormat):By(r.glInternalformat)}var iI=p(()=>{RC();BC();});function sI(r){let e=c8[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var c8,nI=p(()=>{c8={"bc3-rgba-unorm":"BC3_RGBA","bc7-rgba-unorm":"BC7_M5_RGBA","etc2-rgba8unorm":"ETC2_RGBA","astc-4x4-unorm":"ASTC_4x4_RGBA",rgba8unorm:"RGBA32",rg11b10ufloat:"R11F_G11F_B10F"};});var Fc,oI,IC=p(()=>{pn();Fr();P();Fc=["basis","bc7","bc6h","astc","etc2","bc5","bc4","bc3","bc2","bc1","eac"],oI={extension:b.ResolveParser,test:r=>nt(r,[".ktx",".ktx2",".dds"]),parse:r=>{let e,t=r.split(".");if(t.length>2){let i=t[t.length-2];Fc.includes(i)&&(e=i);}else e=t[t.length-1];return {resolution:parseFloat(qt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e,src:r}}};});function h8(r){let e=["basis"],t={};return r.forEach(i=>{let s=i.split("-")[0];s&&!t[s]&&(t[s]=true,e.push(s));}),e.sort((i,s)=>{let n=Fc.indexOf(i),o=Fc.indexOf(s);return n===-1?1:o===-1?-1:n-o}),e}var Dy,aI,uI=p(()=>{P();Ty();$l();ql();IC();aI={extension:{type:b.DetectionParser,priority:2},test:async()=>!!(await ss()||is()),add:async r=>{let e=await Rc();return Dy=h8(e),[...Dy,...r]},remove:async r=>Dy?r.filter(e=>!(e in Dy)):r};});var d8,DC,ky,kC=p(()=>{Xt();ko();d8=new Me,DC=class{cull(e,t,i=true){this._cullRecursive(e,t,i);}_cullRecursive(e,t,i=true){if(e.cullable&&e.measurable&&e.includeInBuild){let s=e.cullArea??Yi(e,i,d8);e.culled=s.x>=t.x+t.width||s.y>=t.y+t.height||s.x+s.width<=t.x||s.y+s.height<=t.y;}else e.culled=false;if(!(!e.cullableChildren||e.culled||!e.renderable||!e.measurable||!e.includeInBuild))for(let s=0;s<e.children.length;s++)this._cullRecursive(e.children[s],t,i);}};DC.shared=new DC;ky=DC;});var zf,lI=p(()=>{P();kC();zf=class{static init(e){this._renderRef=this.render.bind(this),this.render=()=>{let t=e?.culler?.updateTransform!==true;ky.shared.cull(this.stage,this.renderer.screen,t),this.renderer.render({container:this.stage});};}static destroy(){this.render=this._renderRef;}};zf.extension={priority:10,type:b.Application,name:"culler"};});var Wf=Wi(Gc=>{function f8(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var i=0;i<r.length;i++)if(Object.prototype.hasOwnProperty.call(r,i)){var s=r[i];if(e.call(void 0,s,i,r))return s}}function OC(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}function p8(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}var cI=OC({HTML:"text/html",isHTML:function(r){return r===cI.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),hI=OC({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===hI.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Gc.assign=p8;Gc.find=f8;Gc.freeze=OC;Gc.MIME_TYPE=cI;Gc.NAMESPACE=hI;});var YC=Wi(eo=>{var bI=Wf(),us=bI.find,Xf=bI.NAMESPACE;function m8(r){return r!==""}function g8(r){return r?r.split(/[\t\n\f\r ]+/).filter(m8):[]}function x8(r,e){return r.hasOwnProperty(e)||(r[e]=true),r}function dI(r){if(!r)return [];var e=g8(r);return Object.keys(e.reduce(x8,{}))}function _8(r){return function(e){return r&&r.indexOf(e)!==-1}}function jf(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function Sr(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,jf(t,s),r.prototype=t=s;}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r);}var Er={},Pi=Er.ELEMENT_NODE=1,Lc=Er.ATTRIBUTE_NODE=2,Oy=Er.TEXT_NODE=3,yI=Er.CDATA_SECTION_NODE=4,vI=Er.ENTITY_REFERENCE_NODE=5,b8=Er.ENTITY_NODE=6,TI=Er.PROCESSING_INSTRUCTION_NODE=7,SI=Er.COMMENT_NODE=8,EI=Er.DOCUMENT_NODE=9,AI=Er.DOCUMENT_TYPE_NODE=10,Hs=Er.DOCUMENT_FRAGMENT_NODE=11,y8=Er.NOTATION_NODE=12,sr={},Lt={};sr.INDEX_SIZE_ERR=(Lt[1]="Index size error",1);sr.DOMSTRING_SIZE_ERR=(Lt[2]="DOMString size error",2);var Tr=sr.HIERARCHY_REQUEST_ERR=(Lt[3]="Hierarchy request error",3);sr.WRONG_DOCUMENT_ERR=(Lt[4]="Wrong document",4);sr.INVALID_CHARACTER_ERR=(Lt[5]="Invalid character",5);sr.NO_DATA_ALLOWED_ERR=(Lt[6]="No data allowed",6);sr.NO_MODIFICATION_ALLOWED_ERR=(Lt[7]="No modification allowed",7);var CI=sr.NOT_FOUND_ERR=(Lt[8]="Not found",8);sr.NOT_SUPPORTED_ERR=(Lt[9]="Not supported",9);var fI=sr.INUSE_ATTRIBUTE_ERR=(Lt[10]="Attribute in use",10);sr.INVALID_STATE_ERR=(Lt[11]="Invalid state",11);sr.SYNTAX_ERR=(Lt[12]="Syntax error",12);sr.INVALID_MODIFICATION_ERR=(Lt[13]="Invalid modification",13);sr.NAMESPACE_ERR=(Lt[14]="Invalid namespace",14);sr.INVALID_ACCESS_ERR=(Lt[15]="Invalid access",15);function yt(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Lt[r]),this.message=Lt[r],Error.captureStackTrace&&Error.captureStackTrace(this,yt);return t.code=r,e&&(this.message=this.message+": "+e),t}yt.prototype=Error.prototype;jf(sr,yt);function Vs(){}Vs.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r,e){for(var t=[],i=0;i<this.length;i++)Uc(this[i],t,r,e);return t.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};function Nc(r,e){this._node=r,this._refresh=e,UC(this);}function UC(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(UI(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var i=t.length;i in r;i++)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i];jf(t,r),r._inc=e;}}Nc.prototype.item=function(r){return UC(this),this[r]||null};Sr(Nc,Vs);function Fy(){}function wI(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function pI(r,e,t,i){if(i?e[wI(e,i)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(i&&RI(s,r,i),v8(s,r,t));}}function mI(r,e,t){var i=wI(e,t);if(i>=0){for(var s=e.length-1;i<s;)e[i]=e[++i];if(e.length=s,r){var n=r.ownerDocument;n&&(RI(n,r,t),t.ownerElement=null);}}else throw new yt(CI,new Error(r.tagName+"@"+t))}Fy.prototype={length:0,item:Vs.prototype.item,getNamedItem:function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},setNamedItem:function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new yt(fI);var t=this.getNamedItem(r.nodeName);return pI(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new yt(fI);return t=this.getNamedItemNS(r.namespaceURI,r.localName),pI(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return mI(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return mI(this._ownerElement,this,t),t},getNamedItemNS:function(r,e){for(var t=this.length;t--;){var i=this[t];if(i.localName==e&&i.namespaceURI==r)return i}return null}};function PI(){}PI.prototype={hasFeature:function(r,e){return true},createDocument:function(r,e,t){var i=new $f;if(i.implementation=this,i.childNodes=new Vs,i.doctype=t||null,t&&i.appendChild(t),e){var s=i.createElementNS(r,e);i.appendChild(s);}return i},createDocumentType:function(r,e,t){var i=new Ly;return i.name=r,i.nodeName=r,i.publicId=e||"",i.systemId=t||"",i}};function Ne(){}Ne.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(r,e){return Gy(this,r,e)},replaceChild:function(r,e){Gy(this,r,e,II),e&&this.removeChild(e);},removeChild:function(r){return BI(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return GC(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==Oy&&r.nodeType==Oy?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e);}},isSupported:function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&t[i]===r)return i}e=e.nodeType==Lc?e.ownerDocument:e.parentNode;}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r];e=e.nodeType==Lc?e.ownerDocument:e.parentNode;}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function MI(r){return r=="<"&&"<"||r==">"&&">"||r=="&"&&"&"||r=='"'&&"""||"&#"+r.charCodeAt()+";"}jf(Er,Ne);jf(Er,Ne.prototype);function Yf(r,e){if(e(r))return true;if(r=r.firstChild)do if(Yf(r,e))return true;while(r=r.nextSibling)}function $f(){this.ownerDocument=this;}function v8(r,e,t){r&&r._inc++;var i=t.namespaceURI;i===Xf.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value);}function RI(r,e,t,i){r&&r._inc++;var s=t.namespaceURI;s===Xf.XMLNS&&delete e._nsMap[t.prefix?t.localName:""];}function LC(r,e,t){if(r&&r._inc){r._inc++;var i=e.childNodes;if(t)i[i.length++]=t;else {for(var s=e.firstChild,n=0;s;)i[n++]=s,s=s.nextSibling;i.length=n,delete i[i.length];}}}function BI(r,e){var t=e.previousSibling,i=e.nextSibling;return t?t.nextSibling=i:r.firstChild=i,i?i.previousSibling=t:r.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,LC(r.ownerDocument,r),e}function T8(r){return r&&(r.nodeType===Ne.DOCUMENT_NODE||r.nodeType===Ne.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ne.ELEMENT_NODE)}function S8(r){return r&&(ls(r)||NC(r)||zs(r)||r.nodeType===Ne.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ne.COMMENT_NODE||r.nodeType===Ne.PROCESSING_INSTRUCTION_NODE)}function zs(r){return r&&r.nodeType===Ne.DOCUMENT_TYPE_NODE}function ls(r){return r&&r.nodeType===Ne.ELEMENT_NODE}function NC(r){return r&&r.nodeType===Ne.TEXT_NODE}function gI(r,e){var t=r.childNodes||[];if(us(t,ls)||zs(e))return false;var i=us(t,zs);return !(e&&i&&t.indexOf(i)>t.indexOf(e))}function xI(r,e){var t=r.childNodes||[];function i(n){return ls(n)&&n!==e}if(us(t,i))return false;var s=us(t,zs);return !(e&&s&&t.indexOf(s)>t.indexOf(e))}function E8(r,e,t){if(!T8(r))throw new yt(Tr,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new yt(CI,"child not in parent");if(!S8(e)||zs(e)&&r.nodeType!==Ne.DOCUMENT_NODE)throw new yt(Tr,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function A8(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ne.DOCUMENT_FRAGMENT_NODE){var n=s.filter(ls);if(n.length>1||us(s,NC))throw new yt(Tr,"More than one element or text in fragment");if(n.length===1&&!gI(r,t))throw new yt(Tr,"Element in fragment can not be inserted before doctype")}if(ls(e)&&!gI(r,t))throw new yt(Tr,"Only one element can be added and only after doctype");if(zs(e)){if(us(i,zs))throw new yt(Tr,"Only one doctype is allowed");var o=us(i,ls);if(t&&i.indexOf(o)<i.indexOf(t))throw new yt(Tr,"Doctype can only be inserted before an element");if(!t&&o)throw new yt(Tr,"Doctype can not be appended since element is present")}}function II(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ne.DOCUMENT_FRAGMENT_NODE){var n=s.filter(ls);if(n.length>1||us(s,NC))throw new yt(Tr,"More than one element or text in fragment");if(n.length===1&&!xI(r,t))throw new yt(Tr,"Element in fragment can not be inserted before doctype")}if(ls(e)&&!xI(r,t))throw new yt(Tr,"Only one element can be added and only after doctype");if(zs(e)){let u=function(l){return zs(l)&&l!==t};if(us(i,u))throw new yt(Tr,"Only one doctype is allowed");var o=us(i,ls);if(t&&i.indexOf(o)<i.indexOf(t))throw new yt(Tr,"Doctype can only be inserted before an element")}}function Gy(r,e,t,i){E8(r,e,t),r.nodeType===Ne.DOCUMENT_NODE&&(i||A8)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===Hs){var n=e.firstChild;if(n==null)return e;var o=e.lastChild;}else n=o=e;var a=t?t.previousSibling:r.lastChild;n.previousSibling=a,o.nextSibling=t,a?a.nextSibling=n:r.firstChild=n,t==null?r.lastChild=o:t.previousSibling=o;do n.parentNode=r;while(n!==o&&(n=n.nextSibling));return LC(r.ownerDocument||r,r),e.nodeType==Hs&&(e.firstChild=e.lastChild=null),e}function C8(r,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=r,e.previousSibling=r.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,r.lastChild=e,LC(r.ownerDocument,r,e),e}$f.prototype={nodeName:"#document",nodeType:EI,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==Hs){for(var t=r.firstChild;t;){var i=t.nextSibling;this.insertBefore(t,e),t=i;}return r}return Gy(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===Pi&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),BI(this,r)},replaceChild:function(r,e){Gy(this,r,e,II),r.ownerDocument=this,e&&this.removeChild(e),ls(r)&&(this.documentElement=r);},importNode:function(r,e){return GI(this,r,e)},getElementById:function(r){var e=null;return Yf(this.documentElement,function(t){if(t.nodeType==Pi&&t.getAttribute("id")==r)return e=t,true}),e},getElementsByClassName:function(r){var e=dI(r);return new Nc(this,function(t){var i=[];return e.length>0&&Yf(t.documentElement,function(s){if(s!==t&&s.nodeType===Pi){var n=s.getAttribute("class");if(n){var o=r===n;if(!o){var a=dI(n);o=e.every(_8(a));}o&&i.push(s);}}}),i})},createElement:function(r){var e=new xu;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new Vs;var t=e.attributes=new Fy;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new Ny;return r.ownerDocument=this,r.childNodes=new Vs,r},createTextNode:function(r){var e=new VC;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new HC;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new zC;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new XC;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new Uy;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=true,e},createEntityReference:function(r){var e=new WC;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new xu,i=e.split(":"),s=t.attributes=new Fy;return t.childNodes=new Vs,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,s._ownerElement=t,t},createAttributeNS:function(r,e){var t=new Uy,i=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=true,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,t}};Sr($f,Ne);function xu(){this._nsMap={};}xu.prototype={nodeType:Pi,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var e=this.getAttributeNode(r);return e&&e.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t);},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e);},appendChild:function(r){return r.nodeType===Hs?this.insertBefore(r,null):C8(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t);},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},setAttributeNS:function(r,e,t){var i=this.ownerDocument.createAttributeNS(r,e);i.value=i.nodeValue=""+t,this.setAttributeNode(i);},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByTagName:function(r){return new Nc(this,function(e){var t=[];return Yf(e,function(i){i!==e&&i.nodeType==Pi&&(r==="*"||i.tagName==r)&&t.push(i);}),t})},getElementsByTagNameNS:function(r,e){return new Nc(this,function(t){var i=[];return Yf(t,function(s){s!==t&&s.nodeType===Pi&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&i.push(s);}),i})}};$f.prototype.getElementsByTagName=xu.prototype.getElementsByTagName;$f.prototype.getElementsByTagNameNS=xu.prototype.getElementsByTagNameNS;Sr(xu,Ne);function Uy(){}Uy.prototype.nodeType=Lc;Sr(Uy,Ne);function qf(){}qf.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length;},insertData:function(r,e){this.replaceData(r,0,e);},appendChild:function(r){throw new Error(Lt[Tr])},deleteData:function(r,e){this.replaceData(r,e,"");},replaceData:function(r,e,t){var i=this.data.substring(0,r),s=this.data.substring(r+e);t=i+t+s,this.nodeValue=this.data=t,this.length=t.length;}};Sr(qf,Ne);function VC(){}VC.prototype={nodeName:"#text",nodeType:Oy,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}};Sr(VC,qf);function HC(){}HC.prototype={nodeName:"#comment",nodeType:SI};Sr(HC,qf);function zC(){}zC.prototype={nodeName:"#cdata-section",nodeType:yI};Sr(zC,qf);function Ly(){}Ly.prototype.nodeType=AI;Sr(Ly,Ne);function DI(){}DI.prototype.nodeType=y8;Sr(DI,Ne);function kI(){}kI.prototype.nodeType=b8;Sr(kI,Ne);function WC(){}WC.prototype.nodeType=vI;Sr(WC,Ne);function Ny(){}Ny.prototype.nodeName="#document-fragment";Ny.prototype.nodeType=Hs;Sr(Ny,Ne);function XC(){}XC.prototype.nodeType=TI;Sr(XC,Ne);function OI(){}OI.prototype.serializeToString=function(r,e,t){return FI.call(r,e,t)};Ne.prototype.toString=FI;function FI(r,e){var t=[],i=this.nodeType==9&&this.documentElement||this,s=i.prefix,n=i.namespaceURI;if(n&&s==null){var s=i.lookupPrefix(n);if(s==null)var o=[{namespace:n,prefix:null}];}return Uc(this,t,r,e,o),t.join("")}function _I(r,e,t){var i=r.prefix||"",s=r.namespaceURI;if(!s||i==="xml"&&s===Xf.XML||s===Xf.XMLNS)return false;for(var n=t.length;n--;){var o=t[n];if(o.prefix===i)return o.namespace!==s}return true}function FC(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,MI),'"');}function Uc(r,e,t,i,s){if(s||(s=[]),i)if(r=i(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case Pi:var n=r.attributes,o=n.length,g=r.firstChild,a=r.tagName;t=Xf.isHTML(r.namespaceURI)||t;var u=a;if(!t&&!r.prefix&&r.namespaceURI){for(var l,c=0;c<n.length;c++)if(n.item(c).name==="xmlns"){l=n.item(c).value;break}if(!l)for(var h=s.length-1;h>=0;h--){var d=s[h];if(d.prefix===""&&d.namespace===r.namespaceURI){l=d.namespace;break}}if(l!==r.namespaceURI)for(var h=s.length-1;h>=0;h--){var d=s[h];if(d.namespace===r.namespaceURI){d.prefix&&(u=d.prefix+":"+a);break}}}e.push("<",u);for(var f=0;f<o;f++){var m=n.item(f);m.prefix=="xmlns"?s.push({prefix:m.localName,namespace:m.value}):m.nodeName=="xmlns"&&s.push({prefix:"",namespace:m.value});}for(var f=0;f<o;f++){var m=n.item(f);if(_I(m,t,s)){var _=m.prefix||"",x=m.namespaceURI;FC(e,_?"xmlns:"+_:"xmlns",x),s.push({prefix:_,namespace:x});}Uc(m,e,t,i,s);}if(a===u&&_I(r,t,s)){var _=r.prefix||"",x=r.namespaceURI;FC(e,_?"xmlns:"+_:"xmlns",x),s.push({prefix:_,namespace:x});}if(g||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(a)){if(e.push(">"),t&&/^script$/i.test(a))for(;g;)g.data?e.push(g.data):Uc(g,e,t,i,s.slice()),g=g.nextSibling;else for(;g;)Uc(g,e,t,i,s.slice()),g=g.nextSibling;e.push("</",u,">");}else e.push("/>");return;case EI:case Hs:for(var g=r.firstChild;g;)Uc(g,e,t,i,s.slice()),g=g.nextSibling;return;case Lc:return FC(e,r.name,r.value);case Oy:return e.push(r.data.replace(/[<&>]/g,MI));case yI:return e.push("<![CDATA[",r.data,"]]>");case SI:return e.push("<!--",r.data,"-->");case AI:var y=r.publicId,v=r.systemId;if(e.push("<!DOCTYPE ",r.name),y)e.push(" PUBLIC ",y),v&&v!="."&&e.push(" ",v),e.push(">");else if(v&&v!=".")e.push(" SYSTEM ",v,">");else {var S=r.internalSubset;S&&e.push(" [",S,"]"),e.push(">");}return;case TI:return e.push("<?",r.target," ",r.data,"?>");case vI:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName);}}function GI(r,e,t){var i;switch(e.nodeType){case Pi:i=e.cloneNode(false),i.ownerDocument=r;case Hs:break;case Lc:t=true;break}if(i||(i=e.cloneNode(false)),i.ownerDocument=r,i.parentNode=null,t)for(var s=e.firstChild;s;)i.appendChild(GI(r,s,t)),s=s.nextSibling;return i}function GC(r,e,t){var i=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];typeof n!="object"&&n!=i[s]&&(i[s]=n);}switch(e.childNodes&&(i.childNodes=new Vs),i.ownerDocument=r,i.nodeType){case Pi:var o=e.attributes,a=i.attributes=new Fy,u=o.length;a._ownerElement=i;for(var l=0;l<u;l++)i.setAttributeNode(GC(r,o.item(l),true));break;case Lc:t=true;}if(t)for(var c=e.firstChild;c;)i.appendChild(GC(r,c,t)),c=c.nextSibling;return i}function UI(r,e,t){r[e]=t;}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case Pi:case Hs:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};w8=r,Object.defineProperty(Nc.prototype,"length",{get:function(){return UC(this),this.$$length}}),Object.defineProperty(Ne.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case Pi:case Hs:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e;}}}),UI=function(e,t,i){e["$$"+t]=i;};}}catch{}var w8;eo.DocumentType=Ly;eo.DOMException=yt;eo.DOMImplementation=PI;eo.Element=xu;eo.Node=Ne;eo.NodeList=Vs;eo.XMLSerializer=OI;});var NI=Wi(Kf=>{var LI=Wf().freeze;Kf.XML_ENTITIES=LI({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Kf.HTML_ENTITIES=LI({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
2476
|
-
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Kf.entityMap=Kf.HTML_ENTITIES;});var $I=Wi($C=>{var ep=Wf().NAMESPACE,jC=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,VI=new RegExp("[\\-\\.0-9"+jC.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),HI=new RegExp("^"+jC.source+VI.source+"*(?::"+jC.source+VI.source+"*)?$"),Zf=0,to=1,Vc=2,Qf=3,Hc=4,zc=5,Jf=6,Vy=7;function Wc(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Wc);}Wc.prototype=new Error;Wc.prototype.name=Wc.name;function XI(){}XI.prototype={parse:function(r,e,t){var i=this.domBuilder;i.startDocument(),YI(e,e={}),P8(r,e,t,i,this.errorHandler),i.endDocument();}};function P8(r,e,t,i,s){function n(X){if(X>65535){X-=65536;var q=55296+(X>>10),Rr=56320+(X&1023);return String.fromCharCode(q,Rr)}else return String.fromCharCode(X)}function o(X){var q=X.slice(1,-1);return Object.hasOwnProperty.call(t,q)?t[q]:q.charAt(0)==="#"?n(parseInt(q.substr(1).replace("x","0x"))):(s.error("entity not found:"+X),X)}function a(X){if(X>_){var q=r.substring(_,X).replace(/&#?\w+;/g,o);d&&u(_),i.characters(q,0,X-_),_=X;}}function u(X,q){for(;X>=c&&(q=h.exec(r));)l=q.index,c=l+q[0].length,d.lineNumber++;d.columnNumber=X-l+1;}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,f=[{currentNSMap:e}],m={},_=0;;){try{var x=r.indexOf("<",_);if(x<0){if(!r.substr(_).match(/^\s*$/)){var g=i.doc,y=g.createTextNode(r.substr(_));g.appendChild(y),i.currentElement=y;}return}switch(x>_&&a(x),r.charAt(x+1)){case "/":var F=r.indexOf(">",x+3),v=r.substring(x+2,F).replace(/[ \t\n\r]+$/g,""),S=f.pop();F<0?(v=r.substring(x+2).replace(/[\s<].*/,""),s.error("end tag name: "+v+" is not complete:"+S.tagName),F=x+1+v.length):v.match(/\s</)&&(v=v.replace(/[\s<].*/,""),s.error("end tag name: "+v+" maybe not complete"),F=x+1+v.length);var C=S.localNSMap,A=S.tagName==v,M=A||S.tagName&&S.tagName.toLowerCase()==v.toLowerCase();if(M){if(i.endElement(S.uri,S.localName,v),C)for(var D in C)Object.prototype.hasOwnProperty.call(C,D)&&i.endPrefixMapping(D);A||s.fatalError("end tag name: "+v+" is not match the current start tagName:"+S.tagName);}else f.push(S);F++;break;case "?":d&&u(x),F=D8(r,x,i);break;case "!":d&&u(x),F=I8(r,x,i,s);break;default:d&&u(x);var R=new jI,L=f[f.length-1].currentNSMap,F=M8(r,x,R,L,o,s),se=R.length;if(!R.closed&&B8(r,F,R.tagName,m)&&(R.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),d&&se){for(var ye=zI(d,{}),ft=0;ft<se;ft++){var ys=R[ft];u(ys.offset),ys.locator=zI(d,{});}i.locator=ye,WI(R,i,L)&&f.push(R),i.locator=d;}else WI(R,i,L)&&f.push(R);ep.isHTML(R.uri)&&!R.closed?F=R8(r,F,R.tagName,o,i):F++;}}catch(X){if(X instanceof Wc)throw X;s.error("element parse error: "+X),F=-1;}F>_?_=F:a(Math.max(x,_)+1);}}function zI(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function M8(r,e,t,i,s,n){function o(f,m,_){t.attributeNames.hasOwnProperty(f)&&n.fatalError("Attribute "+f+" redefined"),t.addValue(f,m.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),_);}for(var a,u,l=++e,c=Zf;;){var h=r.charAt(l);switch(h){case "=":if(c===to)a=r.slice(e,l),c=Qf;else if(c===Vc)c=Qf;else throw new Error("attribute equal must after attrName");break;case "'":case '"':if(c===Qf||c===to)if(c===to&&(n.warning('attribute value must after "="'),a=r.slice(e,l)),e=l+1,l=r.indexOf(h,e),l>0)u=r.slice(e,l),o(a,u,e-1),c=zc;else throw new Error("attribute value no end '"+h+"' match");else if(c==Hc)u=r.slice(e,l),o(a,u,e),n.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=l+1,c=zc;else throw new Error('attribute value must after "="');break;case "/":switch(c){case Zf:t.setTagName(r.slice(e,l));case zc:case Jf:case Vy:c=Vy,t.closed=true;case Hc:case to:break;case Vc:t.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case "":return n.error("unexpected end of input"),c==Zf&&t.setTagName(r.slice(e,l)),l;case ">":switch(c){case Zf:t.setTagName(r.slice(e,l));case zc:case Jf:case Vy:break;case Hc:case to:u=r.slice(e,l),u.slice(-1)==="/"&&(t.closed=true,u=u.slice(0,-1));case Vc:c===Vc&&(u=a),c==Hc?(n.warning('attribute "'+u+'" missed quot(")!'),o(a,u,e)):((!ep.isHTML(i[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case Qf:throw new Error("attribute value missed!!")}return l;case "\x80":h=" ";default:if(h<=" ")switch(c){case Zf:t.setTagName(r.slice(e,l)),c=Jf;break;case to:a=r.slice(e,l),c=Vc;break;case Hc:var u=r.slice(e,l);n.warning('attribute "'+u+'" missed quot(")!!'),o(a,u,e);case zc:c=Jf;break}else switch(c){case Vc:t.tagName;(!ep.isHTML(i[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,e),e=l,c=to;break;case zc:n.warning('attribute space is required"'+a+'"!!');case Jf:c=to,e=l;break;case Qf:c=Hc,e=l;break;case Vy:throw new Error("elements closed character '/' and '>' must be connected to")}}l++;}}function WI(r,e,t){for(var i=r.tagName,s=null,h=r.length;h--;){var n=r[h],o=n.qName,a=n.value,d=o.indexOf(":");if(d>0)var u=n.prefix=o.slice(0,d),l=o.slice(d+1),c=u==="xmlns"&&l;else l=o,u=null,c=o==="xmlns"&&"";n.localName=l,c!==false&&(s==null&&(s={},YI(t,t={})),t[c]=s[c]=a,n.uri=ep.XMLNS,e.startPrefixMapping(c,a));}for(var h=r.length;h--;){n=r[h];var u=n.prefix;u&&(u==="xml"&&(n.uri=ep.XML),u!=="xmlns"&&(n.uri=t[u||""]));}var d=i.indexOf(":");d>0?(u=r.prefix=i.slice(0,d),l=r.localName=i.slice(d+1)):(u=null,l=r.localName=i);var f=r.uri=t[u||""];if(e.startElement(f,l,i,r),r.closed){if(e.endElement(f,l,i),s)for(u in s)Object.prototype.hasOwnProperty.call(s,u)&&e.endPrefixMapping(u);}else return r.currentNSMap=t,r.localNSMap=s,true}function R8(r,e,t,i,s){if(/^(?:script|textarea)$/i.test(t)){var n=r.indexOf("</"+t+">",e),o=r.substring(e+1,n);if(/[&<]/.test(o))return /^script$/i.test(t)?(s.characters(o,0,o.length),n):(o=o.replace(/&#?\w+;/g,i),s.characters(o,0,o.length),n)}return e+1}function B8(r,e,t,i){var s=i[t];return s==null&&(s=r.lastIndexOf("</"+t+">"),s<e&&(s=r.lastIndexOf("</"+t)),i[t]=s),s<e}function YI(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function I8(r,e,t,i){var s=r.charAt(e+2);switch(s){case "-":if(r.charAt(e+3)==="-"){var n=r.indexOf("-->",e+4);return n>e?(t.comment(r,e+4,n-e-4),n+3):(i.error("Unclosed comment"),-1)}else return -1;default:if(r.substr(e+3,6)=="CDATA["){var n=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,n-e-9),t.endCDATA(),n+3}var o=k8(r,e),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var u=o[1][0],l=false,c=false;a>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],c=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var h=o[a-1];return t.startDTD(u,l,c),t.endDTD(),h.index+h[0].length}}return -1}function D8(r,e,t){var i=r.indexOf("?>",e);if(i){var s=r.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s){s[0].length;return t.processingInstruction(s[1],s[2]),i+2}else return -1}return -1}function jI(){this.attributeNames={};}jI.prototype={setTagName:function(r){if(!HI.test(r))throw new Error("invalid tagName:"+r);this.tagName=r;},addValue:function(r,e,t){if(!HI.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t};},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function k8(r,e){var t,i=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(r);t=s.exec(r);)if(i.push(t),t[1])return i}$C.XMLReader=XI;$C.ParseError=Wc;});var tD=Wi(zy=>{var O8=Wf(),F8=YC(),qI=NI(),QI=$I(),G8=F8.DOMImplementation,KI=O8.NAMESPACE,U8=QI.ParseError,L8=QI.XMLReader;function JI(r){return r.replace(/\r[\n\u0085]/g,`
|
|
2476
|
+
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Kf.entityMap=Kf.HTML_ENTITIES;});var $I=Wi($C=>{var ep=Wf().NAMESPACE,jC=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,VI=new RegExp("[\\-\\.0-9"+jC.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),HI=new RegExp("^"+jC.source+VI.source+"*(?::"+jC.source+VI.source+"*)?$"),Zf=0,to=1,Vc=2,Qf=3,Hc=4,zc=5,Jf=6,Vy=7;function Wc(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Wc);}Wc.prototype=new Error;Wc.prototype.name=Wc.name;function XI(){}XI.prototype={parse:function(r,e,t){var i=this.domBuilder;i.startDocument(),YI(e,e={}),P8(r,e,t,i,this.errorHandler),i.endDocument();}};function P8(r,e,t,i,s){function n(X){if(X>65535){X-=65536;var q=55296+(X>>10),Rr=56320+(X&1023);return String.fromCharCode(q,Rr)}else return String.fromCharCode(X)}function o(X){var q=X.slice(1,-1);return Object.hasOwnProperty.call(t,q)?t[q]:q.charAt(0)==="#"?n(parseInt(q.substr(1).replace("x","0x"))):(s.error("entity not found:"+X),X)}function a(X){if(X>_){var q=r.substring(_,X).replace(/&#?\w+;/g,o);d&&u(_),i.characters(q,0,X-_),_=X;}}function u(X,q){for(;X>=c&&(q=h.exec(r));)l=q.index,c=l+q[0].length,d.lineNumber++;d.columnNumber=X-l+1;}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,f=[{currentNSMap:e}],m={},_=0;;){try{var x=r.indexOf("<",_);if(x<0){if(!r.substr(_).match(/^\s*$/)){var g=i.doc,y=g.createTextNode(r.substr(_));g.appendChild(y),i.currentElement=y;}return}switch(x>_&&a(x),r.charAt(x+1)){case "/":var F=r.indexOf(">",x+3),v=r.substring(x+2,F).replace(/[ \t\n\r]+$/g,""),S=f.pop();F<0?(v=r.substring(x+2).replace(/[\s<].*/,""),s.error("end tag name: "+v+" is not complete:"+S.tagName),F=x+1+v.length):v.match(/\s</)&&(v=v.replace(/[\s<].*/,""),s.error("end tag name: "+v+" maybe not complete"),F=x+1+v.length);var C=S.localNSMap,E=S.tagName==v,M=E||S.tagName&&S.tagName.toLowerCase()==v.toLowerCase();if(M){if(i.endElement(S.uri,S.localName,v),C)for(var D in C)Object.prototype.hasOwnProperty.call(C,D)&&i.endPrefixMapping(D);E||s.fatalError("end tag name: "+v+" is not match the current start tagName:"+S.tagName);}else f.push(S);F++;break;case "?":d&&u(x),F=D8(r,x,i);break;case "!":d&&u(x),F=I8(r,x,i,s);break;default:d&&u(x);var R=new jI,L=f[f.length-1].currentNSMap,F=M8(r,x,R,L,o,s),se=R.length;if(!R.closed&&B8(r,F,R.tagName,m)&&(R.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),d&&se){for(var ye=zI(d,{}),ft=0;ft<se;ft++){var ys=R[ft];u(ys.offset),ys.locator=zI(d,{});}i.locator=ye,WI(R,i,L)&&f.push(R),i.locator=d;}else WI(R,i,L)&&f.push(R);ep.isHTML(R.uri)&&!R.closed?F=R8(r,F,R.tagName,o,i):F++;}}catch(X){if(X instanceof Wc)throw X;s.error("element parse error: "+X),F=-1;}F>_?_=F:a(Math.max(x,_)+1);}}function zI(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function M8(r,e,t,i,s,n){function o(f,m,_){t.attributeNames.hasOwnProperty(f)&&n.fatalError("Attribute "+f+" redefined"),t.addValue(f,m.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),_);}for(var a,u,l=++e,c=Zf;;){var h=r.charAt(l);switch(h){case "=":if(c===to)a=r.slice(e,l),c=Qf;else if(c===Vc)c=Qf;else throw new Error("attribute equal must after attrName");break;case "'":case '"':if(c===Qf||c===to)if(c===to&&(n.warning('attribute value must after "="'),a=r.slice(e,l)),e=l+1,l=r.indexOf(h,e),l>0)u=r.slice(e,l),o(a,u,e-1),c=zc;else throw new Error("attribute value no end '"+h+"' match");else if(c==Hc)u=r.slice(e,l),o(a,u,e),n.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=l+1,c=zc;else throw new Error('attribute value must after "="');break;case "/":switch(c){case Zf:t.setTagName(r.slice(e,l));case zc:case Jf:case Vy:c=Vy,t.closed=true;case Hc:case to:break;case Vc:t.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case "":return n.error("unexpected end of input"),c==Zf&&t.setTagName(r.slice(e,l)),l;case ">":switch(c){case Zf:t.setTagName(r.slice(e,l));case zc:case Jf:case Vy:break;case Hc:case to:u=r.slice(e,l),u.slice(-1)==="/"&&(t.closed=true,u=u.slice(0,-1));case Vc:c===Vc&&(u=a),c==Hc?(n.warning('attribute "'+u+'" missed quot(")!'),o(a,u,e)):((!ep.isHTML(i[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case Qf:throw new Error("attribute value missed!!")}return l;case "\x80":h=" ";default:if(h<=" ")switch(c){case Zf:t.setTagName(r.slice(e,l)),c=Jf;break;case to:a=r.slice(e,l),c=Vc;break;case Hc:var u=r.slice(e,l);n.warning('attribute "'+u+'" missed quot(")!!'),o(a,u,e);case zc:c=Jf;break}else switch(c){case Vc:t.tagName;(!ep.isHTML(i[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,e),e=l,c=to;break;case zc:n.warning('attribute space is required"'+a+'"!!');case Jf:c=to,e=l;break;case Qf:c=Hc,e=l;break;case Vy:throw new Error("elements closed character '/' and '>' must be connected to")}}l++;}}function WI(r,e,t){for(var i=r.tagName,s=null,h=r.length;h--;){var n=r[h],o=n.qName,a=n.value,d=o.indexOf(":");if(d>0)var u=n.prefix=o.slice(0,d),l=o.slice(d+1),c=u==="xmlns"&&l;else l=o,u=null,c=o==="xmlns"&&"";n.localName=l,c!==false&&(s==null&&(s={},YI(t,t={})),t[c]=s[c]=a,n.uri=ep.XMLNS,e.startPrefixMapping(c,a));}for(var h=r.length;h--;){n=r[h];var u=n.prefix;u&&(u==="xml"&&(n.uri=ep.XML),u!=="xmlns"&&(n.uri=t[u||""]));}var d=i.indexOf(":");d>0?(u=r.prefix=i.slice(0,d),l=r.localName=i.slice(d+1)):(u=null,l=r.localName=i);var f=r.uri=t[u||""];if(e.startElement(f,l,i,r),r.closed){if(e.endElement(f,l,i),s)for(u in s)Object.prototype.hasOwnProperty.call(s,u)&&e.endPrefixMapping(u);}else return r.currentNSMap=t,r.localNSMap=s,true}function R8(r,e,t,i,s){if(/^(?:script|textarea)$/i.test(t)){var n=r.indexOf("</"+t+">",e),o=r.substring(e+1,n);if(/[&<]/.test(o))return /^script$/i.test(t)?(s.characters(o,0,o.length),n):(o=o.replace(/&#?\w+;/g,i),s.characters(o,0,o.length),n)}return e+1}function B8(r,e,t,i){var s=i[t];return s==null&&(s=r.lastIndexOf("</"+t+">"),s<e&&(s=r.lastIndexOf("</"+t)),i[t]=s),s<e}function YI(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function I8(r,e,t,i){var s=r.charAt(e+2);switch(s){case "-":if(r.charAt(e+3)==="-"){var n=r.indexOf("-->",e+4);return n>e?(t.comment(r,e+4,n-e-4),n+3):(i.error("Unclosed comment"),-1)}else return -1;default:if(r.substr(e+3,6)=="CDATA["){var n=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,n-e-9),t.endCDATA(),n+3}var o=k8(r,e),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var u=o[1][0],l=false,c=false;a>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],c=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var h=o[a-1];return t.startDTD(u,l,c),t.endDTD(),h.index+h[0].length}}return -1}function D8(r,e,t){var i=r.indexOf("?>",e);if(i){var s=r.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s){s[0].length;return t.processingInstruction(s[1],s[2]),i+2}else return -1}return -1}function jI(){this.attributeNames={};}jI.prototype={setTagName:function(r){if(!HI.test(r))throw new Error("invalid tagName:"+r);this.tagName=r;},addValue:function(r,e,t){if(!HI.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t};},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function k8(r,e){var t,i=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(r);t=s.exec(r);)if(i.push(t),t[1])return i}$C.XMLReader=XI;$C.ParseError=Wc;});var tD=Wi(zy=>{var O8=Wf(),F8=YC(),qI=NI(),QI=$I(),G8=F8.DOMImplementation,KI=O8.NAMESPACE,U8=QI.ParseError,L8=QI.XMLReader;function JI(r){return r.replace(/\r[\n\u0085]/g,`
|
|
2477
2477
|
`).replace(/[\r\u0085\u2028]/g,`
|
|
2478
2478
|
`)}function eD(r){this.options=r||{locator:{}};}eD.prototype.parseFromString=function(r,e){var t=this.options,i=new L8,s=t.domBuilder||new tp,n=t.errorHandler,o=t.locator,a=t.xmlns||{},u=/\/x?html?$/.test(e),l=u?qI.HTML_ENTITIES:qI.XML_ENTITIES;o&&s.setDocumentLocator(o),i.errorHandler=N8(n,s,o),i.domBuilder=t.domBuilder||s,u&&(a[""]=KI.HTML),a.xml=a.xml||KI.XML;var c=t.normalizeLineEndings||JI;return r&&typeof r=="string"?i.parse(c(r),a,l):i.errorHandler.error("invalid doc source"),s.doc};function N8(r,e,t){if(!r){if(e instanceof tp)return e;r=e;}var i={},s=r instanceof Function;t=t||{};function n(o){var a=r[o];!a&&s&&(a=r.length==2?function(u){r(o,u);}:r),i[o]=a&&function(u){a("[xmldom "+o+"] "+u+qC(t));}||function(){};}return n("warning"),n("error"),n("fatalError"),i}function tp(){this.cdata=false;}function Xc(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber;}tp.prototype={startDocument:function(){this.doc=new G8().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId);},startElement:function(r,e,t,i){var s=this.doc,n=s.createElementNS(r,t||e),o=i.length;Hy(this,n),this.currentElement=n,this.locator&&Xc(this.locator,n);for(var a=0;a<o;a++){var r=i.getURI(a),u=i.getValue(a),t=i.getQName(a),l=s.createAttributeNS(r,t);this.locator&&Xc(i.getLocator(a),l),l.value=l.nodeValue=u,n.setAttributeNode(l);}},endElement:function(r,e,t){var i=this.currentElement;i.tagName;this.currentElement=i.parentNode;},startPrefixMapping:function(r,e){},endPrefixMapping:function(r){},processingInstruction:function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&Xc(this.locator,t),Hy(this,t);},ignorableWhitespace:function(r,e,t){},characters:function(r,e,t){if(r=ZI.apply(this,arguments),r){if(this.cdata)var i=this.doc.createCDATASection(r);else var i=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(r)&&this.doc.appendChild(i),this.locator&&Xc(this.locator,i);}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize();},setDocumentLocator:function(r){(this.locator=r)&&(r.lineNumber=0);},comment:function(r,e,t){r=ZI.apply(this,arguments);var i=this.doc.createComment(r);this.locator&&Xc(this.locator,i),Hy(this,i);},startCDATA:function(){this.cdata=true;},endCDATA:function(){this.cdata=false;},startDTD:function(r,e,t){var i=this.doc.implementation;if(i&&i.createDocumentType){var s=i.createDocumentType(r,e,t);this.locator&&Xc(this.locator,s),Hy(this,s),this.doc.doctype=s;}},warning:function(r){console.warn("[xmldom warning] "+r,qC(this.locator));},error:function(r){console.error("[xmldom error] "+r,qC(this.locator));},fatalError:function(r){throw new U8(r,this.locator)}};function qC(r){if(r)return `
|
|
2479
2479
|
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function ZI(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){tp.prototype[r]=function(){return null};});function Hy(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e);}zy.__DOMHandler=tp;zy.normalizeLineEndings=JI;zy.DOMParser=eD;});var iD=Wi(Wy=>{var rD=YC();Wy.DOMImplementation=rD.DOMImplementation;Wy.XMLSerializer=rD.XMLSerializer;Wy.DOMParser=tD().DOMParser;});var sD,nD,oD=p(()=>{sD=Fh(iD()),nD={createCanvas:(r,e)=>new OffscreenCanvas(r??0,e??0),createImage:()=>new Image,getCanvasRenderingContext2D:()=>OffscreenCanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>globalThis.location.href,getFontFaceSet:()=>globalThis.fonts,fetch:(r,e)=>fetch(r,e),parseXML:r=>new sD.DOMParser().parseFromString(r,"text/xml")};});var ro,rp=p(()=>{ro=`in vec2 aPosition;
|
|
@@ -3230,7 +3230,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3230
3230
|
`)}var FD=p(()=>{});var c0,GD=p(()=>{sd();nd();c0=class{constructor(e){this.priority=0,this.pipe="scissorMask",this.mask=e,this.mask.renderable=false,this.mask.measurable=false;}addBounds(e,t){gn(this.mask,e,t);}addLocalBounds(e,t){xn(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}reset(){this.mask.measurable=true,this.mask=null;}destroy(){this.reset();}};});function UD(r){return r=r.replaceAll("texture2D","texture").replaceAll("gl_FragColor","finalColor").replaceAll("varying","in"),r=`
|
|
3231
3231
|
out vec4 finalColor;
|
|
3232
3232
|
${r}
|
|
3233
|
-
`,r}var LD=p(()=>{});function ND(r){return W8[r]}var W8,VD=p(()=>{W8={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};});var HD,zD,WD=p(()=>{Pe();HD={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},zD=new Proxy(HD,{get(r,e){return G(Y,`DRAW_MODES.${e} is deprecated, use '${HD[e]}' instead`),r[e]}});});var dp,XD,fp,YD,jD=p(()=>{Pe();dp=(r=>(r.CLAMP="clamp-to-edge",r.REPEAT="repeat",r.MIRRORED_REPEAT="mirror-repeat",r))(dp||{}),XD=new Proxy(dp,{get(r,e){return G(Y,`DRAW_MODES.${e} is deprecated, use '${dp[e]}' instead`),r[e]}}),fp=(r=>(r.NEAREST="nearest",r.LINEAR="linear",r))(fp||{}),YD=new Proxy(fp,{get(r,e){return G(Y,`DRAW_MODES.${e} is deprecated, use '${fp[e]}' instead`),r[e]}});});var h0,$D=p(()=>{jh();h0=class{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8);}set(e,t,i){let s=t.width,n=t.height;if(i){let o=e.width/2/s,a=e.height/2/n,u=e.x/s+o,l=e.y/n+a;i=le.add(i,le.NW),this.x0=u+o*le.uX(i),this.y0=l+a*le.uY(i),i=le.add(i,2),this.x1=u+o*le.uX(i),this.y1=l+a*le.uY(i),i=le.add(i,2),this.x2=u+o*le.uX(i),this.y2=l+a*le.uY(i),i=le.add(i,2),this.x3=u+o*le.uX(i),this.y3=l+a*le.uY(i);}else this.x0=e.x/s,this.y0=e.y/n,this.x1=(e.x+e.width)/s,this.y1=e.y/n,this.x2=(e.x+e.width)/s,this.y2=(e.y+e.height)/n,this.x3=e.x/s,this.y3=(e.y+e.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3;}toString(){return `[pixi.js/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}};});function qD(r){let e=r.toString(),t=e.indexOf("{"),i=e.lastIndexOf("}");if(t===-1||i===-1)throw new Error("getFunctionBody: No body found in function definition");return e.slice(t+1,i).trim()}var KD=p(()=>{});function ZD(r,e){return G("8.7.0","Use container.getFastGlobalBounds() instead"),r.getFastGlobalBounds(true,e)}var QD=p(()=>{Pe();});var d0,JD=p(()=>{_i();d0=class extends gt{constructor(e){typeof e=="function"&&(e={render:e});let{render:t,...i}=e;super({label:"RenderContainer",...i}),this.renderPipeId="customRender",this.batched=false,t&&(this.render=t),this.containsPoint=e.containsPoint??(()=>false),this.addBounds=e.addBounds??(()=>false);}updateBounds(){this._bounds.clear(),this.addBounds(this._bounds);}render(e){}};});function ek(r,e,t){G("8.7.0","Please use container.collectRenderables instead.");let i=t.renderPipes?t:t.batch.renderer;return r.collectRenderables(e,i,null)}var tk=p(()=>{Pe();});function rk(r,e){let t=e._scale,i=e._pivot,s=e._position,n=t._x,o=t._y,a=i._x,u=i._y;r.a=e._cx*n,r.b=e._sx*n,r.c=e._cy*o,r.d=e._sy*o,r.tx=s._x-(a*r.a+u*r.c),r.ty=s._y-(a*r.b+u*r.d);}var ik=p(()=>{});function sk(r,e,t){let i=r.a,s=r.b,n=r.c,o=r.d,a=r.tx,u=r.ty,l=e.a,c=e.b,h=e.c,d=e.d;t.a=i*l+s*h,t.b=i*c+s*d,t.c=n*l+o*h,t.d=n*c+o*d,t.tx=a*l+u*h+e.tx,t.ty=a*c+u*d+e.ty;}var nk=p(()=>{});var ok,X8,uk,lk=p(()=>{Ae();Yt();ok=class ak extends J{constructor(e={}){e={...ak.defaultOptions,...e},super(),this.renderLayerChildren=[],this.sortableChildren=e.sortableChildren,this.sortFunction=e.sortFunction;}attach(...e){for(let t=0;t<e.length;t++){let i=e[t];if(i.parentRenderLayer){if(i.parentRenderLayer===this)continue;i.parentRenderLayer.detach(i);}this.renderLayerChildren.push(i),i.parentRenderLayer=this;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true);}return e[0]}detach(...e){for(let t=0;t<e.length;t++){let i=e[t],s=this.renderLayerChildren.indexOf(i);s!==-1&&this.renderLayerChildren.splice(s,1),i.parentRenderLayer=null;let n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=true);}return e[0]}detachAll(){let e=this.renderLayerChildren;for(let t=0;t<e.length;t++)e[t].parentRenderLayer=null;this.renderLayerChildren.length=0;}collectRenderables(e,t,i){let s=this.renderLayerChildren,n=s.length;this.sortableChildren&&this.sortRenderLayerChildren();for(let o=0;o<n;o++)s[o].parent||U("Container must be added to both layer and scene graph. Layers only handle render order - the scene graph is required for transforms (addChild)",s[o]),s[o].collectRenderables(e,t,this);}sortRenderLayerChildren(){this.renderLayerChildren.sort(this.sortFunction);}_getGlobalBoundsRecursive(e,t,i){if(!e)return;let s=this.renderLayerChildren;for(let n=0;n<s.length;n++)s[n]._getGlobalBoundsRecursive(true,t,this);}};ok.defaultOptions={sortableChildren:false,sortFunction:(r,e)=>r.zIndex-e.zIndex};X8=ok,uk=X8;});function f0(r,e,t,i){let s=t.buffers[0],n=s.data,{verticesX:o,verticesY:a}=t,u=r/(o-1),l=e/(a-1),c=0,h=i[0],d=i[1],f=i[2],m=i[3],_=i[4],x=i[5],g=i[6],y=i[7],v=i[8];for(let S=0;S<n.length;S+=2){let C=c%o*u,A=(c/o|0)*l,M=h*C+d*A+f,D=m*C+_*A+x,R=g*C+y*A+v;n[S]=M/R,n[S+1]=D/R,c++;}s.update();}var vw=p(()=>{});function hk(r,e){let t=e[0],i=e[1],s=e[2],n=e[3],o=e[4],a=e[5],u=e[6],l=e[7],c=e[8];return r[0]=o*c-a*l,r[1]=s*l-i*c,r[2]=i*a-s*o,r[3]=a*u-n*c,r[4]=t*c-s*u,r[5]=s*n-t*a,r[6]=n*l-o*u,r[7]=i*u-t*l,r[8]=t*o-i*n,r}function dk(r,e,t){let i=e[0],s=e[1],n=e[2],o=e[3],a=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=t[0],f=t[1],m=t[2],_=t[3],x=t[4],g=t[5],y=t[6],v=t[7],S=t[8];return r[0]=d*i+f*o+m*l,r[1]=d*s+f*a+m*c,r[2]=d*n+f*u+m*h,r[3]=_*i+x*o+g*l,r[4]=_*s+x*a+g*c,r[5]=_*n+x*u+g*h,r[6]=y*i+v*o+S*l,r[7]=y*s+v*a+S*c,r[8]=y*n+v*u+S*h,r}function Y8(r,e,t){let i=t[0],s=t[1],n=t[2];return r[0]=e[0]*i+e[1]*s+e[2]*n,r[1]=e[3]*i+e[4]*s+e[5]*n,r[2]=e[6]*i+e[7]*s+e[8]*n,r}function ck(r,e,t,i,s,n,o,a,u){let l=j8;l[0]=e,l[1]=i,l[2]=n,l[3]=t,l[4]=s,l[5]=o,l[6]=1,l[7]=1,l[8]=1;let c=hk(r,l);p0[0]=a,p0[1]=u,p0[2]=1;let h=Y8($8,c,p0),d=r;return r[0]=h[0],r[1]=0,r[2]=0,r[3]=0,r[4]=h[1],r[5]=0,r[6]=0,r[7]=0,r[8]=h[2],dk(r,d,l)}function m0(r,e,t,i,s,n,o,a,u,l,c,h,d,f,m,_,x){let g=ck(q8,e,t,n,o,l,c,f,m),y=ck(K8,i,s,a,u,h,d,_,x);return dk(r,hk(g,g),y)}var j8,$8,p0,q8,K8,Tw=p(()=>{j8=[0,0,0,0,0,0,0,0,0],$8=[0,0,0],p0=[0,0,0];q8=[0,0,0,0,0,0,0,0,0],K8=[0,0,0,0,0,0,0,0,0];});var eh,Sw=p(()=>{Nd();vw();Tw();eh=class extends Hn{constructor(e){super(e),this._projectionMatrix=[0,0,0,0,0,0,0,0,0];let{width:t,height:i}=e;this.corners=[0,0,t,0,t,i,0,i];}setCorners(e,t,i,s,n,o,a,u){let l=this.corners;l[0]=e,l[1]=t,l[2]=i,l[3]=s,l[4]=n,l[5]=o,l[6]=a,l[7]=u,this.updateProjection();}updateProjection(){let{width:e,height:t}=this,i=this.corners,s=m0(this._projectionMatrix,0,0,i[0],i[1],e,0,i[2],i[3],e,t,i[4],i[5],0,t,i[6],i[7]);f0(e,t,this,s);}};});var fk,mk,gk=p(()=>{Se();an();_u();Sw();fk=class pk extends Ar{constructor(e){e={...pk.defaultOptions,...e};let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new eh(Ot({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Ot({...n,geometry:o})),this._texture=t,this.geometry.setCorners(e.x0,e.y0,e.x1,e.y1,e.x2,e.y2,e.x3,e.y3);}textureUpdated(){let e=this.geometry;if(!e)return;let{width:t,height:i}=this.texture;(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.updateProjection());}set texture(e){this._texture!==e&&(super.texture=e,this.textureUpdated());}get texture(){return this._texture}setCorners(e,t,i,s,n,o,a,u){this.geometry.setCorners(e,t,i,s,n,o,a,u);}};fk.defaultOptions={texture:B.WHITE,verticesX:10,verticesY:10,x0:0,y0:0,x1:100,y1:0,x2:100,y2:100,x3:0,y3:100};mk=fk;});var g0,xk=p(()=>{an();_u();Nd();g0=class extends Ar{constructor(e){let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new Hn(Ot({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Ot({...n,geometry:o,texture:t})),this.texture=t,this.autoResize=true;}textureUpdated(){let e=this.geometry,{width:t,height:i}=this.texture;this.autoResize&&(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.build({}));}set texture(e){this._texture?.off("update",this.textureUpdated,this),super.texture=e,e.on("update",this.textureUpdated,this),this.textureUpdated();}get texture(){return this._texture}destroy(e){this.texture.off("update",this.textureUpdated,this),super.destroy(e);}};});var _k,x0,Ew=p(()=>{Nn();_k=class bk extends yr{constructor(e){let{width:t,points:i,textureScale:s}={...bk.defaultOptions,...e};super({positions:new Float32Array(i.length*4),uvs:new Float32Array(i.length*4),indices:new Uint32Array((i.length-1)*6)}),this.points=i,this._width=t,this.textureScale=s,this._build();}get width(){return this._width}_build(){let e=this.points;if(!e)return;let t=this.getBuffer("aPosition"),i=this.getBuffer("aUV"),s=this.getIndex();if(e.length<1)return;t.data.length/4!==e.length&&(t.data=new Float32Array(e.length*4),i.data=new Float32Array(e.length*4),s.data=new Uint16Array((e.length-1)*6));let n=i.data,o=s.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;let a=0,u=e[0],l=this._width*this.textureScale,c=e.length;for(let d=0;d<c;d++){let f=d*4;if(this.textureScale>0){let m=u.x-e[d].x,_=u.y-e[d].y,x=Math.sqrt(m*m+_*_);u=e[d],a+=x/l;}else a=d/(c-1);n[f]=a,n[f+1]=0,n[f+2]=a,n[f+3]=1;}let h=0;for(let d=0;d<c-1;d++){let f=d*2;o[h++]=f,o[h++]=f+1,o[h++]=f+2,o[h++]=f+2,o[h++]=f+1,o[h++]=f+3;}i.update(),s.update(),this.updateVertices();}updateVertices(){let e=this.points;if(e.length<1)return;let t=e[0],i,s=0,n=0,o=this.buffers[0].data,a=e.length,u=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let l=0;l<a;l++){let c=e[l],h=l*4;l<e.length-1?i=e[l+1]:i=c,n=-(i.x-t.x),s=i.y-t.y;let f=Math.sqrt(s*s+n*n);f<1e-6?(s=0,n=0):(s/=f,n/=f,s*=u,n*=u),o[h]=c.x+s,o[h+1]=c.y+n,o[h+2]=c.x-s,o[h+3]=c.y-n,t=c;}this.buffers[0].update();}update(){this.textureScale>0?this._build():this.updateVertices();}};_k.defaultOptions={width:200,points:[],textureScale:0};x0=_k;});var yk,Tk,Sk=p(()=>{an();_u();Ew();yk=class vk extends Ar{constructor(e){let{texture:t,points:i,textureScale:s,...n}={...vk.defaultOptions,...e},o=new x0(Ot({width:t.height,points:i,textureScale:s}));s>0&&(t.source.style.addressMode="repeat"),super(Ot({...n,texture:t,geometry:o})),this.autoUpdate=true,this.onRender=this._render;}_render(){let e=this.geometry;(this.autoUpdate||e._width!==this.texture.height)&&(e._width=this.texture.height,e.update());}};yk.defaultOptions={textureScale:0};Tk=yk;});var _0,Ek=p(()=>{an();_u();Nn();_0=class extends Ar{constructor(e){let{texture:t,vertices:i,uvs:s,indices:n,topology:o,...a}=e,u=new yr(Ot({positions:i,uvs:s,indices:n,topology:o}));super(Ot({...a,texture:t,geometry:u})),this.autoUpdate=true,this.onRender=this._render;}get vertices(){return this.geometry.getBuffer("aPosition").data}set vertices(e){this.geometry.getBuffer("aPosition").data=e;}_render(){this.autoUpdate&&this.geometry.getBuffer("aPosition").update();}};});function Ak(r,e){let{width:t,height:i}=r.frame;return e.scale(1/t,1/i),e}var Ck=p(()=>{});var wk,Pk,Mk=p(()=>{vt();Se();qm();sg();wk=class Aw{constructor(e){if(e instanceof B)this.texture=e,Lo(this,Aw.defaultOptions,{});else {let t={...Aw.defaultOptions,...e};Lo(this,t,{});}}get alpha(){return this._alpha}set alpha(e){this._alpha=Math.min(Math.max(e,0),1),this._updateColor();}get tint(){return Es(this._tint)}set tint(e){this._tint=te.shared.setValue(e??16777215).toBgrNumber(),this._updateColor();}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24);}};wk.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};Pk=wk;});var pp,Cw=p(()=>{pp={vertex:{attributeName:"aVertex",format:"float32x2",code:`
|
|
3233
|
+
`,r}var LD=p(()=>{});function ND(r){return W8[r]}var W8,VD=p(()=>{W8={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};});var HD,zD,WD=p(()=>{Pe();HD={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},zD=new Proxy(HD,{get(r,e){return G(Y,`DRAW_MODES.${e} is deprecated, use '${HD[e]}' instead`),r[e]}});});var dp,XD,fp,YD,jD=p(()=>{Pe();dp=(r=>(r.CLAMP="clamp-to-edge",r.REPEAT="repeat",r.MIRRORED_REPEAT="mirror-repeat",r))(dp||{}),XD=new Proxy(dp,{get(r,e){return G(Y,`DRAW_MODES.${e} is deprecated, use '${dp[e]}' instead`),r[e]}}),fp=(r=>(r.NEAREST="nearest",r.LINEAR="linear",r))(fp||{}),YD=new Proxy(fp,{get(r,e){return G(Y,`DRAW_MODES.${e} is deprecated, use '${fp[e]}' instead`),r[e]}});});var h0,$D=p(()=>{jh();h0=class{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8);}set(e,t,i){let s=t.width,n=t.height;if(i){let o=e.width/2/s,a=e.height/2/n,u=e.x/s+o,l=e.y/n+a;i=le.add(i,le.NW),this.x0=u+o*le.uX(i),this.y0=l+a*le.uY(i),i=le.add(i,2),this.x1=u+o*le.uX(i),this.y1=l+a*le.uY(i),i=le.add(i,2),this.x2=u+o*le.uX(i),this.y2=l+a*le.uY(i),i=le.add(i,2),this.x3=u+o*le.uX(i),this.y3=l+a*le.uY(i);}else this.x0=e.x/s,this.y0=e.y/n,this.x1=(e.x+e.width)/s,this.y1=e.y/n,this.x2=(e.x+e.width)/s,this.y2=(e.y+e.height)/n,this.x3=e.x/s,this.y3=(e.y+e.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3;}toString(){return `[pixi.js/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}};});function qD(r){let e=r.toString(),t=e.indexOf("{"),i=e.lastIndexOf("}");if(t===-1||i===-1)throw new Error("getFunctionBody: No body found in function definition");return e.slice(t+1,i).trim()}var KD=p(()=>{});function ZD(r,e){return G("8.7.0","Use container.getFastGlobalBounds() instead"),r.getFastGlobalBounds(true,e)}var QD=p(()=>{Pe();});var d0,JD=p(()=>{_i();d0=class extends gt{constructor(e){typeof e=="function"&&(e={render:e});let{render:t,...i}=e;super({label:"RenderContainer",...i}),this.renderPipeId="customRender",this.batched=false,t&&(this.render=t),this.containsPoint=e.containsPoint??(()=>false),this.addBounds=e.addBounds??(()=>false);}updateBounds(){this._bounds.clear(),this.addBounds(this._bounds);}render(e){}};});function ek(r,e,t){G("8.7.0","Please use container.collectRenderables instead.");let i=t.renderPipes?t:t.batch.renderer;return r.collectRenderables(e,i,null)}var tk=p(()=>{Pe();});function rk(r,e){let t=e._scale,i=e._pivot,s=e._position,n=t._x,o=t._y,a=i._x,u=i._y;r.a=e._cx*n,r.b=e._sx*n,r.c=e._cy*o,r.d=e._sy*o,r.tx=s._x-(a*r.a+u*r.c),r.ty=s._y-(a*r.b+u*r.d);}var ik=p(()=>{});function sk(r,e,t){let i=r.a,s=r.b,n=r.c,o=r.d,a=r.tx,u=r.ty,l=e.a,c=e.b,h=e.c,d=e.d;t.a=i*l+s*h,t.b=i*c+s*d,t.c=n*l+o*h,t.d=n*c+o*d,t.tx=a*l+u*h+e.tx,t.ty=a*c+u*d+e.ty;}var nk=p(()=>{});var ok,X8,uk,lk=p(()=>{Ae();Yt();ok=class ak extends J{constructor(e={}){e={...ak.defaultOptions,...e},super(),this.renderLayerChildren=[],this.sortableChildren=e.sortableChildren,this.sortFunction=e.sortFunction;}attach(...e){for(let t=0;t<e.length;t++){let i=e[t];if(i.parentRenderLayer){if(i.parentRenderLayer===this)continue;i.parentRenderLayer.detach(i);}this.renderLayerChildren.push(i),i.parentRenderLayer=this;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true);}return e[0]}detach(...e){for(let t=0;t<e.length;t++){let i=e[t],s=this.renderLayerChildren.indexOf(i);s!==-1&&this.renderLayerChildren.splice(s,1),i.parentRenderLayer=null;let n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=true);}return e[0]}detachAll(){let e=this.renderLayerChildren;for(let t=0;t<e.length;t++)e[t].parentRenderLayer=null;this.renderLayerChildren.length=0;}collectRenderables(e,t,i){let s=this.renderLayerChildren,n=s.length;this.sortableChildren&&this.sortRenderLayerChildren();for(let o=0;o<n;o++)s[o].parent||U("Container must be added to both layer and scene graph. Layers only handle render order - the scene graph is required for transforms (addChild)",s[o]),s[o].collectRenderables(e,t,this);}sortRenderLayerChildren(){this.renderLayerChildren.sort(this.sortFunction);}_getGlobalBoundsRecursive(e,t,i){if(!e)return;let s=this.renderLayerChildren;for(let n=0;n<s.length;n++)s[n]._getGlobalBoundsRecursive(true,t,this);}};ok.defaultOptions={sortableChildren:false,sortFunction:(r,e)=>r.zIndex-e.zIndex};X8=ok,uk=X8;});function f0(r,e,t,i){let s=t.buffers[0],n=s.data,{verticesX:o,verticesY:a}=t,u=r/(o-1),l=e/(a-1),c=0,h=i[0],d=i[1],f=i[2],m=i[3],_=i[4],x=i[5],g=i[6],y=i[7],v=i[8];for(let S=0;S<n.length;S+=2){let C=c%o*u,E=(c/o|0)*l,M=h*C+d*E+f,D=m*C+_*E+x,R=g*C+y*E+v;n[S]=M/R,n[S+1]=D/R,c++;}s.update();}var vw=p(()=>{});function hk(r,e){let t=e[0],i=e[1],s=e[2],n=e[3],o=e[4],a=e[5],u=e[6],l=e[7],c=e[8];return r[0]=o*c-a*l,r[1]=s*l-i*c,r[2]=i*a-s*o,r[3]=a*u-n*c,r[4]=t*c-s*u,r[5]=s*n-t*a,r[6]=n*l-o*u,r[7]=i*u-t*l,r[8]=t*o-i*n,r}function dk(r,e,t){let i=e[0],s=e[1],n=e[2],o=e[3],a=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=t[0],f=t[1],m=t[2],_=t[3],x=t[4],g=t[5],y=t[6],v=t[7],S=t[8];return r[0]=d*i+f*o+m*l,r[1]=d*s+f*a+m*c,r[2]=d*n+f*u+m*h,r[3]=_*i+x*o+g*l,r[4]=_*s+x*a+g*c,r[5]=_*n+x*u+g*h,r[6]=y*i+v*o+S*l,r[7]=y*s+v*a+S*c,r[8]=y*n+v*u+S*h,r}function Y8(r,e,t){let i=t[0],s=t[1],n=t[2];return r[0]=e[0]*i+e[1]*s+e[2]*n,r[1]=e[3]*i+e[4]*s+e[5]*n,r[2]=e[6]*i+e[7]*s+e[8]*n,r}function ck(r,e,t,i,s,n,o,a,u){let l=j8;l[0]=e,l[1]=i,l[2]=n,l[3]=t,l[4]=s,l[5]=o,l[6]=1,l[7]=1,l[8]=1;let c=hk(r,l);p0[0]=a,p0[1]=u,p0[2]=1;let h=Y8($8,c,p0),d=r;return r[0]=h[0],r[1]=0,r[2]=0,r[3]=0,r[4]=h[1],r[5]=0,r[6]=0,r[7]=0,r[8]=h[2],dk(r,d,l)}function m0(r,e,t,i,s,n,o,a,u,l,c,h,d,f,m,_,x){let g=ck(q8,e,t,n,o,l,c,f,m),y=ck(K8,i,s,a,u,h,d,_,x);return dk(r,hk(g,g),y)}var j8,$8,p0,q8,K8,Tw=p(()=>{j8=[0,0,0,0,0,0,0,0,0],$8=[0,0,0],p0=[0,0,0];q8=[0,0,0,0,0,0,0,0,0],K8=[0,0,0,0,0,0,0,0,0];});var eh,Sw=p(()=>{Nd();vw();Tw();eh=class extends Hn{constructor(e){super(e),this._projectionMatrix=[0,0,0,0,0,0,0,0,0];let{width:t,height:i}=e;this.corners=[0,0,t,0,t,i,0,i];}setCorners(e,t,i,s,n,o,a,u){let l=this.corners;l[0]=e,l[1]=t,l[2]=i,l[3]=s,l[4]=n,l[5]=o,l[6]=a,l[7]=u,this.updateProjection();}updateProjection(){let{width:e,height:t}=this,i=this.corners,s=m0(this._projectionMatrix,0,0,i[0],i[1],e,0,i[2],i[3],e,t,i[4],i[5],0,t,i[6],i[7]);f0(e,t,this,s);}};});var fk,mk,gk=p(()=>{Se();an();_u();Sw();fk=class pk extends Ar{constructor(e){e={...pk.defaultOptions,...e};let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new eh(Ot({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Ot({...n,geometry:o})),this._texture=t,this.geometry.setCorners(e.x0,e.y0,e.x1,e.y1,e.x2,e.y2,e.x3,e.y3);}textureUpdated(){let e=this.geometry;if(!e)return;let{width:t,height:i}=this.texture;(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.updateProjection());}set texture(e){this._texture!==e&&(super.texture=e,this.textureUpdated());}get texture(){return this._texture}setCorners(e,t,i,s,n,o,a,u){this.geometry.setCorners(e,t,i,s,n,o,a,u);}};fk.defaultOptions={texture:B.WHITE,verticesX:10,verticesY:10,x0:0,y0:0,x1:100,y1:0,x2:100,y2:100,x3:0,y3:100};mk=fk;});var g0,xk=p(()=>{an();_u();Nd();g0=class extends Ar{constructor(e){let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new Hn(Ot({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Ot({...n,geometry:o,texture:t})),this.texture=t,this.autoResize=true;}textureUpdated(){let e=this.geometry,{width:t,height:i}=this.texture;this.autoResize&&(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.build({}));}set texture(e){this._texture?.off("update",this.textureUpdated,this),super.texture=e,e.on("update",this.textureUpdated,this),this.textureUpdated();}get texture(){return this._texture}destroy(e){this.texture.off("update",this.textureUpdated,this),super.destroy(e);}};});var _k,x0,Ew=p(()=>{Nn();_k=class bk extends yr{constructor(e){let{width:t,points:i,textureScale:s}={...bk.defaultOptions,...e};super({positions:new Float32Array(i.length*4),uvs:new Float32Array(i.length*4),indices:new Uint32Array((i.length-1)*6)}),this.points=i,this._width=t,this.textureScale=s,this._build();}get width(){return this._width}_build(){let e=this.points;if(!e)return;let t=this.getBuffer("aPosition"),i=this.getBuffer("aUV"),s=this.getIndex();if(e.length<1)return;t.data.length/4!==e.length&&(t.data=new Float32Array(e.length*4),i.data=new Float32Array(e.length*4),s.data=new Uint16Array((e.length-1)*6));let n=i.data,o=s.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;let a=0,u=e[0],l=this._width*this.textureScale,c=e.length;for(let d=0;d<c;d++){let f=d*4;if(this.textureScale>0){let m=u.x-e[d].x,_=u.y-e[d].y,x=Math.sqrt(m*m+_*_);u=e[d],a+=x/l;}else a=d/(c-1);n[f]=a,n[f+1]=0,n[f+2]=a,n[f+3]=1;}let h=0;for(let d=0;d<c-1;d++){let f=d*2;o[h++]=f,o[h++]=f+1,o[h++]=f+2,o[h++]=f+2,o[h++]=f+1,o[h++]=f+3;}i.update(),s.update(),this.updateVertices();}updateVertices(){let e=this.points;if(e.length<1)return;let t=e[0],i,s=0,n=0,o=this.buffers[0].data,a=e.length,u=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let l=0;l<a;l++){let c=e[l],h=l*4;l<e.length-1?i=e[l+1]:i=c,n=-(i.x-t.x),s=i.y-t.y;let f=Math.sqrt(s*s+n*n);f<1e-6?(s=0,n=0):(s/=f,n/=f,s*=u,n*=u),o[h]=c.x+s,o[h+1]=c.y+n,o[h+2]=c.x-s,o[h+3]=c.y-n,t=c;}this.buffers[0].update();}update(){this.textureScale>0?this._build():this.updateVertices();}};_k.defaultOptions={width:200,points:[],textureScale:0};x0=_k;});var yk,Tk,Sk=p(()=>{an();_u();Ew();yk=class vk extends Ar{constructor(e){let{texture:t,points:i,textureScale:s,...n}={...vk.defaultOptions,...e},o=new x0(Ot({width:t.height,points:i,textureScale:s}));s>0&&(t.source.style.addressMode="repeat"),super(Ot({...n,texture:t,geometry:o})),this.autoUpdate=true,this.onRender=this._render;}_render(){let e=this.geometry;(this.autoUpdate||e._width!==this.texture.height)&&(e._width=this.texture.height,e.update());}};yk.defaultOptions={textureScale:0};Tk=yk;});var _0,Ek=p(()=>{an();_u();Nn();_0=class extends Ar{constructor(e){let{texture:t,vertices:i,uvs:s,indices:n,topology:o,...a}=e,u=new yr(Ot({positions:i,uvs:s,indices:n,topology:o}));super(Ot({...a,texture:t,geometry:u})),this.autoUpdate=true,this.onRender=this._render;}get vertices(){return this.geometry.getBuffer("aPosition").data}set vertices(e){this.geometry.getBuffer("aPosition").data=e;}_render(){this.autoUpdate&&this.geometry.getBuffer("aPosition").update();}};});function Ak(r,e){let{width:t,height:i}=r.frame;return e.scale(1/t,1/i),e}var Ck=p(()=>{});var wk,Pk,Mk=p(()=>{vt();Se();qm();sg();wk=class Aw{constructor(e){if(e instanceof B)this.texture=e,Lo(this,Aw.defaultOptions,{});else {let t={...Aw.defaultOptions,...e};Lo(this,t,{});}}get alpha(){return this._alpha}set alpha(e){this._alpha=Math.min(Math.max(e,0),1),this._updateColor();}get tint(){return Es(this._tint)}set tint(e){this._tint=te.shared.setValue(e??16777215).toBgrNumber(),this._updateColor();}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24);}};wk.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};Pk=wk;});var pp,Cw=p(()=>{pp={vertex:{attributeName:"aVertex",format:"float32x2",code:`
|
|
3234
3234
|
const texture = p.texture;
|
|
3235
3235
|
const sx = p.scaleX;
|
|
3236
3236
|
const sy = p.scaleY;
|
|
@@ -3310,9 +3310,9 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3310
3310
|
u32v[offset + stride] = c;
|
|
3311
3311
|
u32v[offset + (stride * 2)] = c;
|
|
3312
3312
|
u32v[offset + (stride * 3)] = c;
|
|
3313
|
-
`,dynamic:false}};});var Z8,Rk,Bk,Ik=p(()=>{Xt();_i();Cw();Z8=new Me(0,0,0,0),Rk=class ww extends gt{constructor(e={}){e={...ww.defaultOptions,...e,dynamicProperties:{...ww.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in pp){let l=pp[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return Z8}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){e??(e=0),t??(t=this.particleChildren.length);let i=this.particleChildren.splice(e,t-e);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")}};Rk.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};Bk=Rk;});var Dk,Pw,b0,Ok=p(()=>{tn();Se();Pe();_i();E_();Dk=class kk extends gt{constructor(e){e instanceof B&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??Ci.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Ci.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Ci.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Ci.defaultOptions.bottomHeight,this._width=t??l.width??Ci.defaultOptions.width,this._height=i??l.height??Ci.defaultOptions.height,this.allowChildren=false,this.texture=l??kk.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new ke({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=B.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};Dk.defaultOptions={texture:B.EMPTY};Pw=Dk,b0=class extends Pw{constructor(...e){let t=e[0];t instanceof B&&(G(Y,"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]}),G(Y,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function y0(r){let{text:e,style:t,chars:i}=r,s=t,n=Ai.getFont(e,s),o=st.graphemeSegmenter(e),a=Un(o,s,n,true),u=a.scale,l=[],c=[],h=[],d=t.lineHeight?t.lineHeight:n.lineHeight*u,f=0;for(let m of a.lines){if(m.chars.length===0)continue;let _=new J({label:"line"});_.y=f,h.push(_);let x=new J({label:"word"}),g=0;for(let y=0;y<m.chars.length;y++){let v=m.chars[y];if(!v||!n.chars[v])continue;let C=v===" ",
|
|
3313
|
+
`,dynamic:false}};});var Z8,Rk,Bk,Ik=p(()=>{Xt();_i();Cw();Z8=new Me(0,0,0,0),Rk=class ww extends gt{constructor(e={}){e={...ww.defaultOptions,...e,dynamicProperties:{...ww.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in pp){let l=pp[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return Z8}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){e??(e=0),t??(t=this.particleChildren.length);let i=this.particleChildren.splice(e,t-e);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")}};Rk.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};Bk=Rk;});var Dk,Pw,b0,Ok=p(()=>{tn();Se();Pe();_i();E_();Dk=class kk extends gt{constructor(e){e instanceof B&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??Ci.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Ci.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Ci.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Ci.defaultOptions.bottomHeight,this._width=t??l.width??Ci.defaultOptions.width,this._height=i??l.height??Ci.defaultOptions.height,this.allowChildren=false,this.texture=l??kk.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new ke({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=B.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};Dk.defaultOptions={texture:B.EMPTY};Pw=Dk,b0=class extends Pw{constructor(...e){let t=e[0];t instanceof B&&(G(Y,"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]}),G(Y,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function y0(r){let{text:e,style:t,chars:i}=r,s=t,n=Ai.getFont(e,s),o=st.graphemeSegmenter(e),a=Un(o,s,n,true),u=a.scale,l=[],c=[],h=[],d=t.lineHeight?t.lineHeight:n.lineHeight*u,f=0;for(let m of a.lines){if(m.chars.length===0)continue;let _=new J({label:"line"});_.y=f,h.push(_);let x=new J({label:"word"}),g=0;for(let y=0;y<m.chars.length;y++){let v=m.chars[y];if(!v||!n.chars[v])continue;let C=v===" ",E=y===m.chars.length-1,M;i.length>0?(M=i.shift(),M.text=v,M.style=s,M.label=`char-${v}`,M.x=m.charPositions[y]*u-m.charPositions[g]*u):M=new so({text:v,style:s,label:`char-${v}`,x:m.charPositions[y]*u-m.charPositions[g]*u}),C||(l.push(M),x.addChild(M)),(C||E)&&x.children.length>0&&(x.x=m.charPositions[g]*u,c.push(x),_.addChild(x),x=new J({label:"word"}),g=y+1);}f+=d;}return {chars:l,lines:h,words:c}}var Mw=p(()=>{Yt();Gs();Vl();u0();Fd();});var no,v0=p(()=>{Yt();Ei();no=class extends J{constructor(e){let{text:t,style:i,autoSplit:s,lineAnchor:n,wordAnchor:o,charAnchor:a,...u}=e;super(u),this._dirty=false,this._canReuseChars=false,this.chars=[],this.words=[],this.lines=[],this._originalText=t,this._autoSplit=s,this._lineAnchor=n,this._wordAnchor=o,this._charAnchor=a,this.style=i;}split(){let e=this.splitFn();this.chars=e.chars,this.words=e.words,this.lines=e.lines,this.addChild(...this.lines),this.charAnchor=this._charAnchor,this.wordAnchor=this._wordAnchor,this.lineAnchor=this._lineAnchor,this._dirty=false,this._canReuseChars=true;}get text(){return this._originalText}set text(e){this._originalText=e,this.lines.forEach(t=>t.destroy({children:true})),this.lines.length=0,this.words.length=0,this.chars.length=0,this._canReuseChars=false,this.onTextUpdate();}_setOrigin(e,t,i){let s;typeof e=="number"?s={x:e,y:e}:s={x:e.x,y:e.y},t.forEach(n=>{let o=n.getLocalBounds(),a=o.minX+o.width*s.x,u=o.minY+o.height*s.y;n.origin.set(a,u);}),this[i]=e;}get lineAnchor(){return this._lineAnchor}set lineAnchor(e){this._setOrigin(e,this.lines,"_lineAnchor");}get wordAnchor(){return this._wordAnchor}set wordAnchor(e){this._setOrigin(e,this.words,"_wordAnchor");}get charAnchor(){return this._charAnchor}set charAnchor(e){this._setOrigin(e,this.chars,"_charAnchor");}get style(){return this._style}set style(e){e||(e={}),this._style=new ht(e),this.words.forEach(t=>t.destroy()),this.words.length=0,this.lines.forEach(t=>t.destroy()),this.lines.length=0,this._canReuseChars=true,this.onTextUpdate();}onTextUpdate(){this._dirty=true,this._autoSplit&&this.split();}destroy(e){super.destroy(e),this.chars=[],this.words=[],this.lines=[],(typeof e=="boolean"?e:e?.style)&&this._style.destroy(e),this._style=null,this._originalText="";}};});var Fk,Gk,Uk=p(()=>{Ei();Mw();v0();Fk=class T0 extends no{constructor(e){let t={...T0.defaultOptions,...e};super(t);}static from(e,t){let i={...T0.defaultOptions,...t,text:e.text,style:new ht(e.style)};return new T0({...i})}splitFn(){return y0({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};Fk.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};Gk=Fk;});function Q8(r,e,t){switch(r){case "center":return (t-e)/2;case "right":return t-e;case "left":default:return 0}}function Lk(r){return r==="\r"||r===`
|
|
3314
3314
|
`||r===`\r
|
|
3315
|
-
`}function J8(r,e,t){let i=[],s=e.lines[0],n="",o=[],a=0;return t.wordWrap=false,r.forEach(u=>{let l=/^\s*$/.test(u),c=Lk(u),h=n.length===0&&l;if(l&&!c&&h)return;c||(n+=u);let d=st.measureText(u,t);o.push({char:u,metric:d}),n.length>=s.length&&(i.push({line:n,chars:o,width:o.reduce((f,m)=>f+m.metric.width,0)}),o=[],n="",a++,s=e.lines[a]);}),i}function S0(r){let{text:e,style:t,chars:i}=r,s=t,n=st.measureText(e,s),o=st.graphemeSegmenter(e),a=J8(o,n,s.clone()),u=s.align,l=n.lineWidths.reduce((x,g)=>Math.max(x,g),0),c=[],h=[],d=[],f=0,m=s.stroke?.width||0,_=s.dropShadow?.distance||0;return a.forEach((x,g)=>{let y=new J({label:`line-${g}`});y.y=f,h.push(y);let v=n.lineWidths[g],S=Q8(u,v,l),C=new J({label:"word"});C.x=S,x.chars.forEach((A,M)=>{if(A.metric.width!==0){if(Lk(A.char)){S+=A.metric.width-m;return}if(A.char===" ")C.children.length>0&&(d.push(C),y.addChild(C)),S+=A.metric.width+s.letterSpacing-m,C=new J({label:"word"}),C.x=S;else {let D;i.length>0?(D=i.shift(),D.text=A.char,D.style=s,D.setFromMatrix(O.IDENTITY),D.x=S-C.x-_*M):D=new Cr({text:A.char,style:s,x:S-C.x-_*M}),c.push(D),C.addChild(D),S+=A.metric.width+s.letterSpacing-m;}}}),C.children.length>0&&(d.push(C),y.addChild(C)),f+=n.lineHeight;}),{chars:c,lines:h,words:d}}var Rw=p(()=>{Te();Yt();Gs();cp();});var Nk,Vk,Hk=p(()=>{Ei();Rw();v0();Nk=class E0 extends no{constructor(e){let t={...E0.defaultOptions,...e};super(t);}static from(e,t){let i={...E0.defaultOptions,...t,text:e.text,style:new ht(e.style)};return new E0({...i})}splitFn(){return S0({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};Nk.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};Vk=Nk;});async function zk(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var Wk=p(()=>{});function Bw(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=eN[tN++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof De&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];Bw(a,e,{...t});}}function Iw(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];Iw(o,e,{...t,index:n});}}var eN,tN,Xk=p(()=>{mn();eN=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],tN=0;});var Yk={};vs(Yk,{AbstractBitmapFont:()=>Gn,AbstractRenderer:()=>rs,AbstractSplitText:()=>no,AbstractText:()=>cs,AccessibilitySystem:()=>cg,AlphaFilter:()=>lD,AlphaMask:()=>Xo,AlphaMaskPipe:()=>Da,AnimatedSprite:()=>$c,Application:()=>Mf,ApplicationInitHook:()=>Ba,Assets:()=>ot,AssetsClass:()=>Of,BLEND_TO_NPM:()=>Rg,BUFFER_TYPE:()=>su,BackgroundLoader:()=>yc,BackgroundSystem:()=>X_,Batch:()=>ud,BatchGeometry:()=>ml,BatchTextureArray:()=>pl,BatchableGraphics:()=>ks,BatchableHTMLText:()=>Hl,BatchableMesh:()=>Zi,BatchableSprite:()=>ri,BatchableText:()=>Rl,Batcher:()=>Og,BatcherPipe:()=>mf,BigPool:()=>He,BindGroup:()=>Tt,BindGroupSystem:()=>Va,BitmapFont:()=>gu,BitmapFontManager:()=>Ai,BitmapText:()=>so,BitmapTextGraphics:()=>Gd,BitmapTextPipe:()=>fa,BlendModeFilter:()=>ce,BlendModePipe:()=>Fa,BlurFilter:()=>sp,BlurFilterPass:()=>jc,Bounds:()=>Me,BrowserAdapter:()=>_g,Buffer:()=>rt,BufferImageSource:()=>As,BufferResource:()=>ns,BufferUsage:()=>fe,CLEAR:()=>St,Cache:()=>Ee,CanvasObserver:()=>dn,CanvasPool:()=>fr,CanvasPoolClass:()=>Dd,CanvasSource:()=>Rt,CanvasTextGenerator:()=>Us,CanvasTextMetrics:()=>st,CanvasTextPipe:()=>aa,CanvasTextSystem:()=>da,Circle:()=>Bl,Color:()=>te,ColorBlend:()=>Wd,ColorBurnBlend:()=>Xd,ColorDodgeBlend:()=>Yd,ColorMask:()=>Yo,ColorMaskPipe:()=>ka,ColorMatrixFilter:()=>Jy,CompressedSource:()=>si,Container:()=>J,Culler:()=>ky,CullerPlugin:()=>zf,CustomRenderPipe:()=>Aa,D3D10_RESOURCE_DIMENSION:()=>Cy,D3DFMT:()=>pr,DATA_URI:()=>qR,DDS:()=>ae,DEG_TO_RAD:()=>km,DEPRECATED_SCALE_MODES:()=>fp,DEPRECATED_WRAP_MODES:()=>dp,DOMAdapter:()=>H,DOMContainer:()=>xg,DOMPipe:()=>zo,DRAW_MODES:()=>zD,DXGI_FORMAT:()=>Ay,DXGI_TO_TEXTURE_FORMAT:()=>ir,DarkenBlend:()=>jd,DefaultBatcher:()=>Zo,DefaultShader:()=>yl,DifferenceBlend:()=>$d,DisplacementFilter:()=>r0,DivideBlend:()=>qd,DynamicBitmapFont:()=>Od,Ellipse:()=>Il,EventBoundary:()=>nl,EventEmitter:()=>ve,EventSystem:()=>ol,EventsTicker:()=>jr,ExclusionBlend:()=>Kd,ExtensionType:()=>b,ExtractSystem:()=>Y_,FOURCC_TO_TEXTURE_FORMAT:()=>Nf,FederatedContainer:()=>gg,FederatedEvent:()=>$i,FederatedMouseEvent:()=>xi,FederatedPointerEvent:()=>jt,FederatedWheelEvent:()=>$r,FillGradient:()=>tr,FillPattern:()=>Ti,Filter:()=>Gt,FilterEffect:()=>pi,FilterPipe:()=>ba,FilterSystem:()=>ya,FontStylePromiseCache:()=>Ud,GAUSSIAN_VALUES:()=>Yc,GL_FORMATS:()=>hc,GL_INTERNAL_FORMAT:()=>EC,GL_TARGETS:()=>Tf,GL_TYPES:()=>Ce,GL_WRAP_MODES:()=>Z1,GenerateTextureSystem:()=>Ga,Geometry:()=>Jt,GlBackBufferSystem:()=>Sb,GlBatchAdaptor:()=>iu,GlBuffer:()=>cc,GlBufferSystem:()=>nu,GlColorMaskSystem:()=>au,GlContextSystem:()=>yb,GlEncoderSystem:()=>uu,GlGeometrySystem:()=>ou,GlGraphicsAdaptor:()=>tu,GlLimitsSystem:()=>lu,GlMeshAdaptor:()=>ru,GlParticleContainerAdaptor:()=>Al,GlParticleContainerPipe:()=>sa,GlProgram:()=>je,GlProgramData:()=>pc,GlRenderTarget:()=>dc,GlRenderTargetAdaptor:()=>fc,GlRenderTargetSystem:()=>du,GlShaderSystem:()=>fu,GlStateSystem:()=>Wb,GlStencilSystem:()=>cu,GlTexture:()=>gc,GlTextureSystem:()=>mu,GlUboSystem:()=>hu,GlUniformGroupSystem:()=>pu,GlobalUniformSystem:()=>Ua,GpuBatchAdaptor:()=>Ea,GpuBlendModesToPixi:()=>Kt,GpuBufferSystem:()=>Ha,GpuColorMaskSystem:()=>za,GpuDeviceSystem:()=>$n,GpuEncoderSystem:()=>Wa,GpuGraphicsAdaptor:()=>Ta,GpuGraphicsContext:()=>vd,GpuLimitsSystem:()=>Xa,GpuMeshAdapter:()=>Sa,GpuMipmapGenerator:()=>lc,GpuParticleContainerAdaptor:()=>Pl,GpuParticleContainerPipe:()=>na,GpuProgram:()=>$e,GpuRenderTarget:()=>oc,GpuRenderTargetAdaptor:()=>ac,GpuRenderTargetSystem:()=>Za,GpuShaderSystem:()=>Qa,GpuStateSystem:()=>Ja,GpuStencilModesToPixi:()=>ii,GpuStencilSystem:()=>Ya,GpuTextureSystem:()=>eu,GpuUboSystem:()=>$a,GpuUniformBatchPipe:()=>qa,Graphics:()=>Fn,GraphicsContext:()=>bt,GraphicsContextRenderData:()=>Td,GraphicsContextSystem:()=>Rn,GraphicsGpuData:()=>Ed,GraphicsPath:()=>Qi,GraphicsPipe:()=>ra,HTMLText:()=>Qc,HTMLTextPipe:()=>pa,HTMLTextRenderData:()=>Ln,HTMLTextStyle:()=>Zc,HTMLTextSystem:()=>ma,HardLightBlend:()=>Zd,HardMixBlend:()=>Qd,HelloSystem:()=>jn,IGLUniformData:()=>Mb,ImageSource:()=>Qt,InstructionSet:()=>on,KTX:()=>at,LightenBlend:()=>Jd,LinearBurnBlend:()=>ef,LinearDodgeBlend:()=>tf,LinearLightBlend:()=>rf,Loader:()=>Sc,LoaderParserPriority:()=>ze,LuminosityBlend:()=>sf,MaskEffectManager:()=>Qu,MaskEffectManagerClass:()=>zh,MaskFilter:()=>Kl,Matrix:()=>O,Mesh:()=>Ar,MeshGeometry:()=>yr,MeshGpuData:()=>El,MeshPipe:()=>ia,MeshPlane:()=>g0,MeshRope:()=>Tk,MeshSimple:()=>_0,NOOP:()=>$h,NegationBlend:()=>nf,NineSliceGeometry:()=>Ci,NineSlicePlane:()=>b0,NineSliceSprite:()=>Pw,NineSliceSpriteGpuData:()=>Vd,NineSliceSpritePipe:()=>_a,NoiseFilter:()=>_D,ObservablePoint:()=>ke,OverlayBlend:()=>of,PI_2:()=>Im,Particle:()=>Pk,ParticleBuffer:()=>Cl,ParticleContainer:()=>Bk,ParticleContainerPipe:()=>Bn,ParticleShader:()=>wl,PerspectiveMesh:()=>mk,PerspectivePlaneGeometry:()=>eh,PinLightBlend:()=>af,PipelineSystem:()=>Ka,PlaneGeometry:()=>Hn,Point:()=>ge,Polygon:()=>Dn,Pool:()=>Ss,PoolGroupClass:()=>Vh,PrepareBase:()=>n0,PrepareQueue:()=>Kc,PrepareSystem:()=>hp,PrepareUpload:()=>Jc,QuadGeometry:()=>Xl,RAD_TO_DEG:()=>Dm,Rectangle:()=>re,RenderContainer:()=>d0,RenderGroup:()=>rl,RenderGroupPipe:()=>wa,RenderGroupSystem:()=>Ma,RenderLayer:()=>uk,RenderTarget:()=>Na,RenderTargetSystem:()=>Zn,RenderTexture:()=>Zl,RenderableGCSystem:()=>K_,RendererInitHook:()=>Ia,RendererType:()=>qe,ResizePlugin:()=>Vo,Resolver:()=>qt,RopeGeometry:()=>x0,RoundedRectangle:()=>Dl,SCALE_MODES:()=>YD,STENCIL_MODES:()=>Ve,SVGParser:()=>Yx,SaturationBlend:()=>uf,SchedulerSystem:()=>La,ScissorMask:()=>c0,SdfShader:()=>Nl,Shader:()=>it,ShaderStage:()=>Tn,ShapePath:()=>Gl,SharedRenderPipes:()=>tc,SharedSystems:()=>ec,SoftLightBlend:()=>lf,SplitBitmapText:()=>Gk,SplitText:()=>Vk,Sprite:()=>De,SpritePipe:()=>Ra,Spritesheet:()=>id,State:()=>Ze,StencilMask:()=>jo,StencilMaskPipe:()=>Oa,SubtractBlend:()=>cf,SystemRunner:()=>Xn,TEXTURE_FORMAT_BLOCK_SIZE:()=>wy,Text:()=>Cr,TextStyle:()=>ht,Texture:()=>B,TextureGCSystem:()=>Z_,TextureMatrix:()=>un,TexturePool:()=>Oe,TexturePoolClass:()=>qh,TextureSource:()=>xe,TextureStyle:()=>mt,TextureUvs:()=>h0,Ticker:()=>_e,TickerListener:()=>hn,TickerPlugin:()=>Ho,TilingSprite:()=>a0,TilingSpriteGpuData:()=>Ld,TilingSpritePipe:()=>xa,TilingSpriteShader:()=>Wl,Transform:()=>qc,Triangle:()=>s0,UNIFORM_TO_ARRAY_SETTERS:()=>Vb,UNIFORM_TO_SINGLE_SETTERS:()=>Nb,UNIFORM_TYPES_MAP:()=>ix,UNIFORM_TYPES_VALUES:()=>pd,UPDATE_BLEND:()=>il,UPDATE_COLOR:()=>No,UPDATE_PRIORITY:()=>Ft,UPDATE_TRANSFORM:()=>B3,UPDATE_VISIBLE:()=>ln,UboBatch:()=>sc,UboSystem:()=>qn,UniformGroup:()=>be,VERSION:()=>Yn,VideoSource:()=>Ms,ViewContainer:()=>gt,ViewSystem:()=>eb,ViewableBuffer:()=>qr,VividLightBlend:()=>hf,WGSL_ALIGN_SIZE_DATA:()=>ja,WGSL_TO_STD40_SIZE:()=>Sf,WRAP_MODES:()=>XD,WebGLRenderer:()=>Pf,WebGPURenderer:()=>vf,WebWorkerAdapter:()=>nD,WorkerManager:()=>kf,accessibilityTarget:()=>hg,addBits:()=>cd,addMaskBounds:()=>gn,addMaskLocalBounds:()=>xn,addProgramDefines:()=>Lg,alphaFrag:()=>Xy,alphaWgsl:()=>ip,applyMatrix:()=>v_,applyProjectiveTransformationToPlane:()=>f0,applyStyleParams:()=>wf,assignWithIgnore:()=>Lo,autoDetectEnvironment:()=>WR,autoDetectRenderer:()=>ey,autoDetectSource:()=>nM,basisTranscoderUrls:()=>Dc,bgr2rgb:()=>Es,bitmapFontCachePlugin:()=>ty,bitmapFontTextParser:()=>bc,bitmapFontXMLParser:()=>Rf,bitmapFontXMLStringParser:()=>Bf,bitmapTextSplit:()=>y0,blendTemplateFrag:()=>C_,blendTemplateVert:()=>w_,blendTemplateWgsl:()=>P_,blockDataMap:()=>yf,blurTemplateWgsl:()=>Ky,boundsPool:()=>dr,browserExt:()=>SE,buildAdaptiveBezier:()=>Ol,buildAdaptiveQuadratic:()=>Fx,buildArc:()=>Fl,buildArcTo:()=>Ux,buildArcToSvg:()=>Lx,buildCircle:()=>Mn,buildContextBatches:()=>Ax,buildEllipse:()=>lx,buildLine:()=>px,buildPixelLine:()=>mx,buildPolygon:()=>vx,buildRectangle:()=>Tx,buildRoundedRectangle:()=>cx,buildSimpleUvs:()=>ax,buildTriangle:()=>Sx,buildUvs:()=>ox,cacheAsTextureMixin:()=>Um,cacheTextureArray:()=>iy,calculateProjection:()=>fb,canvasTextSplit:()=>S0,checkChildrenDidChange:()=>Xh,checkDataUrl:()=>vr,checkExtension:()=>nt,checkMaxIfStatementsInShader:()=>dl,childrenHelperMixin:()=>Nm,cleanArray:()=>q_,cleanHash:()=>$_,clearList:()=>Pa,closePointEps:()=>hx,collectAllRenderables:()=>ek,collectRenderablesMixin:()=>Vm,color32BitToUniform:()=>ti,colorBit:()=>En,colorBitGl:()=>An,colorMatrixFilterFrag:()=>Qy,colorMatrixFilterWgsl:()=>np,colorToUniform:()=>UM,compareModeToGlCompare:()=>Kb,compileHighShader:()=>qg,compileHighShaderGl:()=>Kg,compileHighShaderGlProgram:()=>Zr,compileHighShaderGpuProgram:()=>Kr,compileHooks:()=>hd,compileInputs:()=>dd,compileOutputs:()=>$g,compileShader:()=>Ef,compute2DProjection:()=>m0,convertFormatIfRequired:()=>QB,convertToList:()=>$t,copySearchParams:()=>Wo,createIdFromString:()=>vi,createIndicesForQuads:()=>Cd,createLevelBuffers:()=>UB,createLevelBuffersFromKTX:()=>eI,createStringVariations:()=>bg,createTexture:()=>rr,createUboElementsSTD40:()=>Eb,createUboElementsWGSL:()=>ib,createUboSyncFunction:()=>rc,createUboSyncFunctionSTD40:()=>wb,createUboSyncFunctionWGSL:()=>cb,crossOrigin:()=>dC,cullingMixin:()=>Bm,curveEps:()=>dx,defaultFilterVert:()=>ro,defaultValue:()=>mc,definedProps:()=>Ot,deprecation:()=>G,detectAvif:()=>ny,detectBasis:()=>BB,detectCompressed:()=>aI,detectDefaults:()=>oy,detectMp4:()=>ay,detectOgv:()=>uy,detectVideoAlphaMode:()=>ll,detectWebm:()=>ly,detectWebp:()=>cy,determineCrossOrigin:()=>pC,displacementFrag:()=>e0,displacementVert:()=>t0,displacementWgsl:()=>op,earcut:()=>bx,effectsMixin:()=>Hm,ensureAttributes:()=>nc,ensureIsBuffer:()=>ld,ensurePrecision:()=>Ng,ensureTextOptions:()=>io,executeInstructions:()=>Ca,extensions:()=>V,extractAttributesFromGlProgram:()=>kb,extractAttributesFromGpuProgram:()=>Wg,extractFontFamilies:()=>l_,extractStructAndGroups:()=>xl,extractSvgUrlId:()=>Bd,fastCopy:()=>Ko,findMixin:()=>zm,fontStringFromTextStyle:()=>Fs,formatShader:()=>OD,fragmentGPUTemplate:()=>Qg,fragmentGlTemplate:()=>ex,generateArraySyncSTD40:()=>Cb,generateArraySyncWGSL:()=>lb,generateBlurFragSource:()=>jy,generateBlurGlProgram:()=>qy,generateBlurProgram:()=>Zy,generateBlurVertSource:()=>$y,generateGPULayout:()=>BD,generateGpuLayoutGroups:()=>Xg,generateLayout:()=>DD,generateLayoutHash:()=>Yg,generateParticleUpdateFunction:()=>Cx,generateProgram:()=>Ub,generateShaderSyncCode:()=>Pb,generateTextStyleKey:()=>$x,generateTextureBatchBit:()=>Cn,generateTextureBatchBitGl:()=>wn,generateTextureMatrix:()=>Ex,generateUniformsSync:()=>Hb,getAdjustedBlendModeBlend:()=>yi,getAttributeInfoFromFormat:()=>er,getBatchSamplersUniformGroup:()=>Pn,getBitmapTextLayout:()=>Un,getCanvasBoundingBox:()=>Kx,getCanvasFillStyle:()=>On,getCanvasTexture:()=>Jl,getDefaultUniformValue:()=>sx,getFastGlobalBounds:()=>ZD,getFastGlobalBoundsMixin:()=>Xm,getFontCss:()=>d_,getFontFamilyName:()=>iC,getGeometryBounds:()=>Fg,getGlTypeFromFormat:()=>Tb,getGlobalBounds:()=>Yi,getGlobalMixin:()=>$m,getGlobalRenderableBounds:()=>A_,getLocalBounds:()=>nn,getMaxFragmentPrecision:()=>Ug,getMaxTexturesPerBatch:()=>kg,getOrientationOfPoints:()=>fx,getPo2TextureFromSource:()=>Ll,getResolutionOfUrl:()=>Jn,getSVGUrl:()=>f_,getSupportedCompressedTextureFormats:()=>Rc,getSupportedGPUCompressedTextureFormats:()=>Gf,getSupportedGlCompressedTextureFormats:()=>Ff,getSupportedTextureFormats:()=>as,getTemporaryCanvasFromImage:()=>p_,getTestContext:()=>hl,getTextureBatchBindGroup:()=>_n,getTextureDefaultMatrix:()=>Ak,getTextureFormatFromKTXTexture:()=>rI,getUboData:()=>Ob,getUniformData:()=>Fb,getUrlExtension:()=>ST,glFormatToGPUFormat:()=>By,glUploadBufferImageResource:()=>Xb,glUploadCompressedTextureResource:()=>Yb,glUploadImageResource:()=>xc,glUploadVideoResource:()=>$b,globalUniformsBit:()=>tx,globalUniformsBitGl:()=>rx,globalUniformsUBOBitGl:()=>bM,gpuFormatToBasisTranscoderFormat:()=>NB,gpuFormatToKTXBasisTranscoderFormat:()=>sI,gpuUploadBufferImageResource:()=>gb,gpuUploadCompressedTextureResource:()=>xb,gpuUploadImageResource:()=>uc,gpuUploadVideoResource:()=>bb,groupD8:()=>le,hasCachedCanvasTexture:()=>sB,hslWgsl:()=>yD,hslgl:()=>zn,hslgpu:()=>Wn,injectBits:()=>fd,insertVersion:()=>Vg,isMobile:()=>lg,isPow2:()=>Yh,isRenderingToScreen:()=>pb,isSafari:()=>a_,isSingleItem:()=>Ps,isWebGLSupported:()=>is,isWebGPUSupported:()=>ss,ktxTranscoderUrls:()=>Oc,loadBasis:()=>FB,loadBasisOnWorker:()=>Ey,loadBitmapFont:()=>ry,loadDDS:()=>HB,loadEnvironmentExtensions:()=>df,loadFontAsBase64:()=>c_,loadFontCSS:()=>h_,loadImageBitmap:()=>lC,loadJson:()=>hy,loadKTX:()=>WB,loadKTX2:()=>qB,loadKTX2onWorker:()=>Ry,loadSVGImage:()=>m_,loadSvg:()=>py,loadTextures:()=>wc,loadTxt:()=>dy,loadVideoTextures:()=>gy,loadWebFont:()=>fy,localUniformBit:()=>Ls,localUniformBitGl:()=>Vn,localUniformBitGroup2:()=>x_,localUniformMSDFBit:()=>e_,localUniformMSDFBitGl:()=>t_,log2:()=>S3,logDebugTexture:()=>zk,logProgramError:()=>Gb,logRenderGroupScene:()=>Iw,logScene:()=>Bw,mSDFBit:()=>r_,mSDFBitGl:()=>i_,mapFormatToGlFormat:()=>Zb,mapFormatToGlInternalFormat:()=>Qb,mapFormatToGlType:()=>Jb,mapGlToVertexFormat:()=>Ib,mapSize:()=>ND,mapType:()=>Af,mapWebGLBlendModesToPixi:()=>zb,maskFrag:()=>z_,maskVert:()=>W_,maskWgsl:()=>gf,matrixPool:()=>pt,measureHtmlText:()=>zl,measureMixin:()=>Km,migrateFragmentFromV7toV8:()=>UD,mipmapScaleModeToGlFilter:()=>qb,multiplyColors:()=>sn,multiplyHexColors:()=>el,nextPow2:()=>mi,noiseFrag:()=>i0,noiseWgsl:()=>ap,nonCompressedFormats:()=>bC,normalizeExtensionPriority:()=>qu,onRenderMixin:()=>Zm,parseDDS:()=>Py,parseFunctionBody:()=>qD,parseKTX:()=>My,parseSVGDefinitions:()=>Wx,parseSVGFloatAttribute:()=>Ke,parseSVGPath:()=>Bx,parseSVGStyle:()=>Id,particleData:()=>pp,particlesFrag:()=>wx,particlesVert:()=>Px,particlesWgsl:()=>wd,path:()=>We,pointInTriangle:()=>up,preloadVideo:()=>fC,removeItems:()=>Zu,removeStructAndGroupDuplicates:()=>jg,resetUids:()=>g3,resolveCharacters:()=>n_,resolveCompressedTextureUrl:()=>oI,resolveJsonUrl:()=>_y,resolveTextureUrl:()=>Pc,resourceToTexture:()=>DT,roundPixelsBit:()=>Qr,roundPixelsBitGl:()=>Jr,roundedShapeArc:()=>Nx,roundedShapeQuadraticCurve:()=>Vx,sayHello:()=>j_,scaleModeToGlFilter:()=>Cf,setBasisTranscoderPath:()=>kB,setKTXTranscoderPath:()=>jB,setPositions:()=>y_,setProgramName:()=>Hg,setUvs:()=>T_,shapeBuilders:()=>Sl,sortMixin:()=>Qm,spritesheetAsset:()=>vg,squaredDistanceToLineSegment:()=>In,stripVersion:()=>zg,styleAttributes:()=>Xx,testImageFormat:()=>vc,testVideoFormat:()=>os,textStyleToCSS:()=>l0,textureBit:()=>D_,textureBitGl:()=>k_,textureFrom:()=>kT,tilingBit:()=>__,tilingBitGl:()=>b_,toFillStyle:()=>Si,toLocalGlobalMixin:()=>Jm,toStrokeStyle:()=>kn,transformVertices:()=>gd,triangulateWithHoles:()=>Tl,uboSyncFunctionsSTD40:()=>_f,uboSyncFunctionsWGSL:()=>ab,uid:()=>de,uniformParsers:()=>wi,unpremultiplyAlpha:()=>gB,unsafeEvalSupported:()=>Yl,updateLocalTransform:()=>rk,updateQuadBounds:()=>ul,updateRenderGroupTransform:()=>FE,updateRenderGroupTransforms:()=>pf,updateTextBounds:()=>oa,updateTransformAndChildren:()=>L_,updateTransformBackwards:()=>Ju,updateWorldTransform:()=>sk,v8_0_0:()=>Y,v8_3_4:()=>Fm,validFormats:()=>Fc,validateRenderables:()=>N_,vertexGPUTemplate:()=>Zg,vertexGlTemplate:()=>Jg,vkFormatToGPUFormat:()=>Iy,warn:()=>U,webworkerExt:()=>EE,wrapModeToGlAddress:()=>_c});var Re=p(()=>{_R();yR();P();P();wg();Tg();cT();hT();SR();ER();AR();CR();wR();PR();MR();RR();BR();IR();DR();kR();OR();FR();GR();UR();LR();NR();VR();HR();zR();EB();dT();fT();RB();YA();qi();jA();$A();qA();KA();ZA();QA();JA();sy();Tc();eC();Ir();tC();rC();sC();nC();my();mC();Ns();uC();gC();xy();pn();Qn();Fr();al();yg();TT();td();vt();IB();GB();LB();VB();yC();vC();TC();zB();SC();XB();CC();AC();KB();JB();tI();iI();RC();nI();wC();BC();PC();uI();IC();kC();lI();Uv();ag();Z3();yT();Be();RE();vT();oD();gT();mg();dg();Kh();bT();Qh();fg();pg();CE();wE();PE();vD();KC();ZC();tw();sw();nw();rp();ow();aw();uw();lw();cw();zE();WE();XE();dt();Hd();zd();cD();fD();iw();Yy();QC();ew();JC();rw();pD();mD();bD();ts();Hh();_E();vE();YE();jh();Te();Om();tl();Ix();tn();_r();hw();d2();f2();p2();xt();m2();TD();dw();gw();RD();yw();X1();Dg();FT();ID();kD();od();DE();LT();HE();HT();GT();nx();bS();Is();dS();oS();aS();uS();lS();FD();cS();fS();_l();bl();pS();ga();Ds();O_();CT();$E();wT();qE();Wv();GD();PT();KE();sd();nd();LA();Y1();j1();$1();va();K1();J1();Q1();tA();rA();iA();sA();lA();nA();uA();cA();hA();dA();md();br();fA();vA();EA();LD();pA();Rb();hb();gA();yA();WT();Ig();xA();_A();bA();VD();Db();XT();YT();jT();$T();qT();Ab();aA();oA();SA();TA();wA();AA();vb();PA();GA();MA();RA();jb();BA();DA();xC();kA();OA();FA();IA();xB();UA();g1();x1();C1();_1();b1();y1();v1();T1();A1();w1();P1();M1();B1();I1();D1();Rs();Dr();k1();sb();E1();JT();eS();S1();rS();iS();sS();O1();F1();db();V1();G1();U1();_b();L1();_C();N1();H1();QE();JE();Bs();bf();Ki();Mg();r1();s1();WD();yn();vS();NT();vn();VT();TS();eg();n1();R1();Q_();mb();o1();tS();ei();xS();rb();_t();ob();_S();ub();nb();u1();bn();cl();Or();jl();tb();R_();ca();jD();h1();i1();rg();$o();Mc();qo();Mt();Cg();Se();f1();ig();gi();ji();$D();J_();Ty();Bc();OT();gl();KD();m1();kr();e2();t2();r2();Xt();QD();ko();Wh();bE();rn();Vv();Hv();zv();Xv();Yv();jv();qm();qv();Kv();Zv();Qv();Yt();kE();JD();tT();OE();LE();sg();$v();U_();tk();an();G_();jm();Ym();ik();GE();nk();UE();z1();ta();BE();ux();Ox();b2();Gx();y2();S2();SS();AS();CS();RS();BS();IS();AM();ea();Pd();Jx();la();Sd();YS();Hx();E2();A2();C2();zx();h2();P2();M2();w2();FS();jx();OS();ES();yx();lk();gk();Sw();vw();Tw();xk();Nd();Sk();Ek();Ew();W1();IE();Ad();Ck();_u();Nn();$S();KS();n2();s2();o2();Mk();JS();Ik();Mx();Cw();i2();ZS();QS();fw();E_();Ok();gE();oE();lE();mw();pE();dE();cE();hE();fE();Ml();mn();NE();s_();HA();zA();WA();XA();VA();Vl();u0();Y2();z2();Mw();Fd();W2();$2();bw();q2();u_();_w();sE();Z2();eE();tE();rE();Q2();J2();iE();g_();xw();v0();Uk();Hk();lp();u2();Qx();Gs();l2();F2();kd();Zx();H2();U2();L2();cp();Ei();Rw();B2();qx();Rx();_i();ET();AT();cn();Cs();sT();Eg();uT();K2();$l();ql();M_();D2();V_();Wt();l1();Lm();Pt();Sg();Pg();H_();Pe();Wk();Xk();Ae();eT();pw();If();fn();Gm();Xi();a1();MS();V.add(SE,EE);});var rO=Wi((k0,tO)=>{(function(r,e){typeof k0=="object"?tO.exports=k0=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(k0,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 Mv=="function")try{i=Mv("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function g(){}return function(y){var v;return g.prototype=y,v=new g,g.prototype=null,v}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(g){var y=n(this);return g&&y.mixIn(g),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var y in g)g.hasOwnProperty(y)&&(this[y]=g[y]);g.hasOwnProperty("toString")&&(this.toString=g.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(g,y){g=this.words=g||[],y!=t?this.sigBytes=y:this.sigBytes=g.length*4;},toString:function(g){return (g||h).stringify(this)},concat:function(g){var y=this.words,v=g.words,S=this.sigBytes,C=g.sigBytes;if(this.clamp(),S%4)for(var A=0;A<C;A++){var M=v[A>>>2]>>>24-A%4*8&255;y[S+A>>>2]|=M<<24-(S+A)%4*8;}else for(var D=0;D<C;D+=4)y[S+D>>>2]=v[D>>>2];return this.sigBytes+=C,this},clamp:function(){var g=this.words,y=this.sigBytes;g[y>>>2]&=4294967295<<32-y%4*8,g.length=e.ceil(y/4);},clone:function(){var g=u.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var y=[],v=0;v<g;v+=4)y.push(s());return new l.init(y,g)}}),c=o.enc={},h=c.Hex={stringify:function(g){for(var y=g.words,v=g.sigBytes,S=[],C=0;C<v;C++){var A=y[C>>>2]>>>24-C%4*8&255;S.push((A>>>4).toString(16)),S.push((A&15).toString(16));}return S.join("")},parse:function(g){for(var y=g.length,v=[],S=0;S<y;S+=2)v[S>>>3]|=parseInt(g.substr(S,2),16)<<24-S%8*4;return new l.init(v,y/2)}},d=c.Latin1={stringify:function(g){for(var y=g.words,v=g.sigBytes,S=[],C=0;C<v;C++){var A=y[C>>>2]>>>24-C%4*8&255;S.push(String.fromCharCode(A));}return S.join("")},parse:function(g){for(var y=g.length,v=[],S=0;S<y;S++)v[S>>>2]|=(g.charCodeAt(S)&255)<<24-S%4*8;return new l.init(v,y)}},f=c.Utf8={stringify:function(g){try{return decodeURIComponent(escape(d.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return d.parse(unescape(encodeURIComponent(g)))}},m=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(g){typeof g=="string"&&(g=f.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes;},_process:function(g){var y,v=this._data,S=v.words,C=v.sigBytes,A=this.blockSize,M=A*4,D=C/M;g?D=e.ceil(D):D=e.max((D|0)-this._minBufferSize,0);var R=D*A,L=e.min(R*4,C);if(R){for(var F=0;F<R;F+=A)this._doProcessBlock(S,F);y=S.splice(0,R),v.sigBytes-=L;}return new l.init(y,L)},clone:function(){var g=u.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});a.Hasher=m.extend({cfg:u.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset();},reset:function(){m.reset.call(this),this._doReset();},update:function(g){return this._append(g),this._process(),this},finalize:function(g){g&&this._append(g);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(g){return function(y,v){return new g.init(v).finalize(y)}},_createHmacHelper:function(g){return function(y,v){return new x.HMAC.init(g,v).finalize(y)}}});var x=o.algo={};return o}(Math);return r});});var Lw=Wi((O0,iO)=>{(function(r,e){typeof O0=="object"?iO.exports=O0=e(rO()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(O0,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],d=c[1],f=c[2],m=c[3],_=c[4],x=0;x<80;x++){if(x<16)o[x]=u[l+x]|0;else {var g=o[x-3]^o[x-8]^o[x-14]^o[x-16];o[x]=g<<1|g>>>31;}var y=(h<<5|h>>>27)+_+o[x];x<20?y+=(d&f|~d&m)+1518500249:x<40?y+=(d^f^m)+1859775393:x<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=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});Re();var VP={};vs(VP,{CanvasBaseItem:()=>Bp,CanvasEvent:()=>Rp,CanvasManagerStatic:()=>k,Container:()=>fo,FadeAlphaTicker:()=>gh,ImageContainer:()=>Ye,ImageSprite:()=>Ue,MoveTicker:()=>xh,RegisteredCanvasComponents:()=>ar,RegisteredEvents:()=>hs,RegisteredTickers:()=>ur,RotateTicker:()=>_h,Sprite:()=>ms,Text:()=>po,TickerBase:()=>Hr,VideoSprite:()=>nr,ZoomTicker:()=>bh,addImage:()=>Dp,addImageCointainer:()=>Ip,addVideo:()=>kp,animate:()=>mh,canvas:()=>I,canvasComponentDecorator:()=>fO,eventDecorator:()=>pO,getTexture:()=>Mu,moveIn:()=>CO,moveOut:()=>W0,pushIn:()=>PO,pushOut:()=>rP,removeWithDissolve:()=>Fp,removeWithFade:()=>AO,shakeEffect:()=>yO,showImage:()=>TO,showImageContainer:()=>vO,showVideo:()=>SO,showWithDissolve:()=>eP,showWithFade:()=>EO,tickerDecorator:()=>_O,zoomIn:()=>wO,zoomOut:()=>tP});Re();var Xe={};vs(Xe,{DistortionFilter:()=>A0,EqualizerFilter:()=>ni,Filter:()=>Bt,MonoFilter:()=>C0,ReverbFilter:()=>w0,StereoFilter:()=>P0,StreamFilter:()=>M0,TelephoneFilter:()=>R0});var jk;function $k(r){return jk=r,r}function Fe(){return jk}var Bt=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 A0=class extends Bt{constructor(e=0){let t;if(!Fe().useLegacy){let{audioContext:i}=Fe().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Fe().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var Et=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Fe().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Ge=class extends Bt{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Ge.F32,type:"lowshelf",gain:r},{f:Ge.F64,type:"peaking",gain:e},{f:Ge.F125,type:"peaking",gain:t},{f:Ge.F250,type:"peaking",gain:i},{f:Ge.F500,type:"peaking",gain:s},{f:Ge.F1K,type:"peaking",gain:n},{f:Ge.F2K,type:"peaking",gain:o},{f:Ge.F4K,type:"peaking",gain:a},{f:Ge.F8K,type:"peaking",gain:u},{f:Ge.F16K,type:"highshelf",gain:l}];Fe().useLegacy||(c=h.map(d=>{let f=Fe().context.audioContext.createBiquadFilter();return f.type=d.type,Et.setParamValue(f.Q,1),f.frequency.value=d.f,Et.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}`);Et.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(Ge.F32,r);}get f32(){return this.getGain(Ge.F32)}set f64(r){this.setGain(Ge.F64,r);}get f64(){return this.getGain(Ge.F64)}set f125(r){this.setGain(Ge.F125,r);}get f125(){return this.getGain(Ge.F125)}set f250(r){this.setGain(Ge.F250,r);}get f250(){return this.getGain(Ge.F250)}set f500(r){this.setGain(Ge.F500,r);}get f500(){return this.getGain(Ge.F500)}set f1k(r){this.setGain(Ge.F1K,r);}get f1k(){return this.getGain(Ge.F1K)}set f2k(r){this.setGain(Ge.F2K,r);}get f2k(){return this.getGain(Ge.F2K)}set f4k(r){this.setGain(Ge.F4K,r);}get f4k(){return this.getGain(Ge.F4K)}set f8k(r){this.setGain(Ge.F8K,r);}get f8k(){return this.getGain(Ge.F8K)}set f16k(r){this.setGain(Ge.F16K,r);}get f16k(){return this.getGain(Ge.F16K)}reset(){this.bands.forEach(r=>{Et.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},ni=Ge;ni.F32=32;ni.F64=64;ni.F125=125;ni.F250=250;ni.F500=500;ni.F1K=1e3;ni.F2K=2e3;ni.F4K=4e3;ni.F8K=8e3;ni.F16K=16e3;var C0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().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 w0=class extends Bt{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(Fe().useLegacy)return;let{audioContext:e}=Fe().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var P0=class extends Bt{constructor(e=0){let t,i,s;if(!Fe().useLegacy){let{audioContext:n}=Fe().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?Et.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 M0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().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 R0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",Et.setParamValue(s.frequency,2e3),n.type="lowpass",Et.setParamValue(n.frequency,2e3),o.type="highpass",Et.setParamValue(o.frequency,500),a.type="highpass",Et.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};Re();var mp=class extends ve{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();}};Re();var rN=0,Dw=class extends ve{constructor(r){super(),this.id=rN++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-Dw.PADDING),this._end=Math.min(this._end+Dw.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),_e.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(){_e.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){_e.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}]`}},B0=Dw;B0.PADDING=.1;Re();var gp=class extends ve{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new B0(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};Re();var xp=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 bu=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],kw=["audio/mpeg","audio/ogg"],yu={};function qk(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;bu.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(yu,i);}qk();Re();Re();var sN=0,_p=class extends ve{constructor(e){super(),this.id=sN++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);Et.setParamValue(this._gain.gain,n*s*i),Et.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){_e.shared.remove(this._updateListener,this),e&&_e.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var vu=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 Kk=class extends vu{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(Kk.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,Et.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}},I0=Kk;I0.BUFFER_SIZE=0;var Tu=class{init(e){this.parent=e,this._nodes=new I0(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 _p(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 H.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var th=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=Fe().useLegacy?new gp:new Tu;return new th(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:We.extname(t).slice(1)})).filter(({ext:t})=>yu[t]).sort((t,i)=>bu.indexOf(t.ext)-bu.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Fe().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new xp(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(th._pool.length>0){let r=th._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),th._pool.indexOf(r)<0&&th._pool.push(r);}},Gr=th;Gr._pool=[];Re();var rh=class r extends vu{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new ve,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var ih=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new rh),this._htmlAudioContext=new mp,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 rh.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof Gr)return this._sounds[e]=t,t;let i=this._getOptions(t),s=Gr.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};Re();Re();var Zk=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=We.basename(e,We.extname(e))),t},Qk={extension:b.Asset,detection:{test:async()=>true,add:async r=>[...r,...bu.filter(e=>yu[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[b.LoadParser],priority:ze.High},test(r){let e=We.extname(r).slice(1);return !!yu[e]||kw.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>Gr.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Fe().add(Zk(e),t),t},async unload(r,e){Fe().remove(Zk(e));}}};V.add(Qk);var Ie=$k(new ih);var bp="1.3.1";var oo="repeat";function Ow(r){return {type:"pause",duration:r}}var Fw={DistortionFilter:Xe.DistortionFilter,EqualizerFilter:Xe.EqualizerFilter,MonoFilter:Xe.MonoFilter,ReverbFilter:Xe.ReverbFilter,StereoFilter:Xe.StereoFilter,StreamFilter:Xe.StreamFilter,TelephoneFilter:Xe.TelephoneFilter},Jk=["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"],wr="__game_layer__",sh="Container",D0="ImageContainer",Gw="Image",nh="Sprite",oh="Text",Uw="Video",he={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 E;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(E||(E={}));function pe(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw E.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function eO(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(()=>(Re(),Yk))),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 nO=Fh(Lw());Re();var uN={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Ue||r instanceof nr||r instanceof Ye},testProp(r){switch(r){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof Ue||r instanceof nr||r instanceof Ye)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "percentageX":r.percentageX=t/100;break;case "percentageY":r.percentageY=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.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},sO=uN;function lN(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var j=class j{constructor(){}static get app(){if(!j._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return j._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(wr);return e||(e=new J,e.label=wr,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return j.canvasWidth=t,j.canvasHeight=i,j._app=new Mf,j.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=j.app,extensions:a=[],...u}=n||{};eO({app:o,extensions:[sO,...a],...u}),j._isInitialized=true,j.addCanvasIntoHTMLElement(e),window.addEventListener("resize",j.resize),j.resize(),j.gameLayer;})}static addCanvasIntoHTMLElement(e){j._isInitialized?e.appendChild(j.app.canvas):E.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return j.htmlLayers.push(s),j.resize(),n}static removeHtmlLayer(e){let t=j.htmlLayers.find(i=>i.id===e);t&&(t.remove(),j.htmlLayers=j.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return j.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/j.canvasWidth,t/j.canvasHeight)}static get screenWidth(){return Math.floor(j.screenScale*j.canvasWidth)}static get screenHeight(){return Math.floor(j.screenScale*j.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-j.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-j.screenHeight)/2}static async resize(){await lN(async()=>{if(j._isInitialized){let i=j.app.canvas.style;i.width=`${j.screenWidth}px`,i.height=`${j.screenHeight}px`,i.marginLeft=`${j.horizontalMargin}px`,i.marginRight=`${j.horizontalMargin}px`,i.marginTop=`${j.verticalMargin}px`,i.marginBottom=`${j.verticalMargin}px`;}let t=j.htmlLayers.map(i=>{i.style.width=`${j.screenWidth}px`,i.style.height=`${j.screenHeight}px`,i.style.marginLeft=`${j.horizontalMargin}px`,i.style.marginRight=`${j.horizontalMargin}px`,i.style.marginTop=`${j.verticalMargin}px`,i.style.marginBottom=`${j.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return j.gameLayer.children.filter(e=>e.label).sort((e,t)=>j.gameLayer.getChildIndex(e)-j.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(j._currentTickers).filter(([e,t])=>!t.createdByTicketSteps).map(([e,t])=>[e,{id:t.ticker.id,args:t.ticker.args,canvasElementAliases:t.ticker.canvasElementAliases,priority:t.ticker.priority,duration:t.ticker.duration,paused:t.ticker.paused}]))}static generateTickerId(e){try{return (0,nO.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),j._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),j._currentTickersTimeouts[e]&&delete j._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),j.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(j._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&j.removeTickerTimeout(i);}else j._currentTickersTimeouts[i].aliases=n;});}};w(j,"_app"),w(j,"htmlLayers",[]),w(j,"canvasWidth",300),w(j,"canvasHeight",300),w(j,"_isInitialized",false),w(j,"_currentTickers",{}),w(j,"_currentTickersSequence",{}),w(j,"_currentTickersTimeouts",{}),w(j,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),w(j,"_tickersOnPause",{});var k=j;Re();var ah=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,lO=new Set,Nw=typeof process=="object"&&process?process:{},cO=(r,e,t,i)=>{typeof Nw.emitWarning=="function"?Nw.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},U0=globalThis.AbortController,oO=globalThis.AbortSignal;if(typeof U0>"u"){oO=class{constructor(){w(this,"onabort");w(this,"_onabort",[]);w(this,"reason");w(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},U0=class{constructor(){w(this,"signal",new oO);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=Nw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,cO("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 cN=r=>!lO.has(r),ao=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),hO=r=>ao(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?uh:null:null,uh=class extends Array{constructor(e){super(e),this.fill(0);}},lh,Su=class Su{constructor(e,t){w(this,"heap");w(this,"length");if(!T(Su,lh))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=hO(e);if(!t)return [];ee(Su,lh,true);let i=new Su(e,t);return ee(Su,lh,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};lh=new WeakMap,we(Su,lh,false);var Vw=Su,aO,uO,Mi,Ur,Ri,Eu,Bi,ch,hh,It,Ii,At,Je,me,mr,Lr,or,Nt,Di,Vt,ki,Oi,Nr,Fi,ho,gr,dh,z,Hw,Au,Ws,vp,Vr,dO,Cu,fh,Tp,uo,lo,zw,F0,G0,Qe,Ww,yp,co,Xw,Yw=class Yw{constructor(e){we(this,z);we(this,Mi);we(this,Ur);we(this,Ri);we(this,Eu);we(this,Bi);we(this,ch);we(this,hh);w(this,"ttl");w(this,"ttlResolution");w(this,"ttlAutopurge");w(this,"updateAgeOnGet");w(this,"updateAgeOnHas");w(this,"allowStale");w(this,"noDisposeOnSet");w(this,"noUpdateTTL");w(this,"maxEntrySize");w(this,"sizeCalculation");w(this,"noDeleteOnFetchRejection");w(this,"noDeleteOnStaleGet");w(this,"allowStaleOnFetchAbort");w(this,"allowStaleOnFetchRejection");w(this,"ignoreFetchAbort");we(this,It);we(this,Ii);we(this,At);we(this,Je);we(this,me);we(this,mr);we(this,Lr);we(this,or);we(this,Nt);we(this,Di);we(this,Vt);we(this,ki);we(this,Oi);we(this,Nr);we(this,Fi);we(this,ho);we(this,gr);we(this,dh);we(this,Au,()=>{});we(this,Ws,()=>{});we(this,vp,()=>{});we(this,Vr,()=>false);we(this,Cu,e=>{});we(this,fh,(e,t,i)=>{});we(this,Tp,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});w(this,aO,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:_=0,sizeCalculation:x,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:A,ignoreFetchAbort:M}=e;if(t!==0&&!ao(t))throw new TypeError("max option must be a nonnegative integer");let D=t?hO(t):Array;if(!D)throw new Error("invalid max value: "+t);if(ee(this,Mi,t),ee(this,Ur,m),this.maxEntrySize=_||T(this,Ur),this.sizeCalculation=x,this.sizeCalculation){if(!T(this,Ur)&&!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(ee(this,hh,y),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(ee(this,ch,g),ee(this,ho,!!g),ee(this,At,new Map),ee(this,Je,new Array(t).fill(void 0)),ee(this,me,new Array(t).fill(void 0)),ee(this,mr,new D(t)),ee(this,Lr,new D(t)),ee(this,or,0),ee(this,Nt,0),ee(this,Di,Vw.create(t)),ee(this,It,0),ee(this,Ii,0),typeof l=="function"&&ee(this,Ri,l),typeof c=="function"&&ee(this,Eu,c),typeof h=="function"?(ee(this,Bi,h),ee(this,Vt,[])):(ee(this,Bi,void 0),ee(this,Vt,void 0)),ee(this,Fi,!!T(this,Ri)),ee(this,dh,!!T(this,Eu)),ee(this,gr,!!T(this,Bi)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!M,this.maxEntrySize!==0){if(T(this,Ur)!==0&&!ao(T(this,Ur)))throw new TypeError("maxSize must be a positive integer if specified");if(!ao(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");$(this,z,dO).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ao(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!ao(this.ttl))throw new TypeError("ttl must be a positive integer if specified");$(this,z,Hw).call(this);}if(T(this,Mi)===0&&this.ttl===0&&T(this,Ur)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!T(this,Mi)&&!T(this,Ur)){let R="LRU_CACHE_UNBOUNDED";cN(R)&&(lO.add(R),cO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,Yw));}}static unsafeExposeInternals(e){return {starts:T(e,Oi),ttls:T(e,Nr),sizes:T(e,ki),keyMap:T(e,At),keyList:T(e,Je),valList:T(e,me),next:T(e,mr),prev:T(e,Lr),get head(){return T(e,or)},get tail(){return T(e,Nt)},free:T(e,Di),isBackgroundFetch:t=>{var i;return $(i=e,z,Qe).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return $(o=e,z,G0).call(o,t,i,s,n)},moveToTail:t=>{var i;return $(i=e,z,yp).call(i,t)},indexes:t=>{var i;return $(i=e,z,uo).call(i,t)},rindexes:t=>{var i;return $(i=e,z,lo).call(i,t)},isStale:t=>{var i;return T(i=e,Vr).call(i,t)}}}get max(){return T(this,Mi)}get maxSize(){return T(this,Ur)}get calculatedSize(){return T(this,Ii)}get size(){return T(this,It)}get fetchMethod(){return T(this,ch)}get memoMethod(){return T(this,hh)}get dispose(){return T(this,Ri)}get onInsert(){return T(this,Eu)}get disposeAfter(){return T(this,Bi)}getRemainingTTL(e){return T(this,At).has(e)?1/0:0}*entries(){for(let e of $(this,z,uo).call(this))T(this,me)[e]!==void 0&&T(this,Je)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield [T(this,Je)[e],T(this,me)[e]]);}*rentries(){for(let e of $(this,z,lo).call(this))T(this,me)[e]!==void 0&&T(this,Je)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield [T(this,Je)[e],T(this,me)[e]]);}*keys(){for(let e of $(this,z,uo).call(this)){let t=T(this,Je)[e];t!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield t);}}*rkeys(){for(let e of $(this,z,lo).call(this)){let t=T(this,Je)[e];t!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield t);}}*values(){for(let e of $(this,z,uo).call(this))T(this,me)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield T(this,me)[e]);}*rvalues(){for(let e of $(this,z,lo).call(this))T(this,me)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield T(this,me)[e]);}[(uO=Symbol.iterator,aO=Symbol.toStringTag,uO)](){return this.entries()}find(e,t={}){for(let i of $(this,z,uo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,T(this,Je)[i],this))return this.get(T(this,Je)[i],t)}}forEach(e,t=this){for(let i of $(this,z,uo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,Je)[i],this);}}rforEach(e,t=this){for(let i of $(this,z,lo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,Je)[i],this);}}purgeStale(){let e=false;for(let t of $(this,z,lo).call(this,{allowStale:true}))T(this,Vr).call(this,t)&&($(this,z,co).call(this,T(this,Je)[t],"expire"),e=true);return e}info(e){let t=T(this,At).get(e);if(t===void 0)return;let i=T(this,me)[t],s=$(this,z,Qe).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(T(this,Nr)&&T(this,Oi)){let o=T(this,Nr)[t],a=T(this,Oi)[t];if(o&&a){let u=o-(ah.now()-a);n.ttl=u,n.start=Date.now();}}return T(this,ki)&&(n.size=T(this,ki)[t]),n}dump(){let e=[];for(let t of $(this,z,uo).call(this,{allowStale:true})){let i=T(this,Je)[t],s=T(this,me)[t],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(T(this,Nr)&&T(this,Oi)){o.ttl=T(this,Nr)[t];let a=ah.now()-T(this,Oi)[t];o.start=Math.floor(Date.now()-a);}T(this,ki)&&(o.size=T(this,ki)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=ah.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,f,m,_;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=T(this,Tp).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),$(this,z,co).call(this,e,"set"),this;let h=T(this,It)===0?void 0:T(this,At).get(e);if(h===void 0)h=T(this,It)===0?T(this,Nt):T(this,Di).length!==0?T(this,Di).pop():T(this,It)===T(this,Mi)?$(this,z,F0).call(this,false):T(this,It),T(this,Je)[h]=e,T(this,me)[h]=t,T(this,At).set(e,h),T(this,mr)[T(this,Nt)]=h,T(this,Lr)[h]=T(this,Nt),ee(this,Nt,h),Pm(this,It)._++,T(this,fh).call(this,h,c,u),u&&(u.set="add"),l=false,T(this,dh)&&((d=T(this,Eu))==null||d.call(this,t,e,"add"));else {$(this,z,yp).call(this,h);let x=T(this,me)[h];if(t!==x){if(T(this,ho)&&$(this,z,Qe).call(this,x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=x;g!==void 0&&!o&&(T(this,Fi)&&((f=T(this,Ri))==null||f.call(this,g,e,"set")),T(this,gr)&&T(this,Vt)?.push([g,e,"set"]));}else o||(T(this,Fi)&&((m=T(this,Ri))==null||m.call(this,x,e,"set")),T(this,gr)&&T(this,Vt)?.push([x,e,"set"]));if(T(this,Cu).call(this,h),T(this,fh).call(this,h,c,u),T(this,me)[h]=t,u){u.set="replace";let g=x&&$(this,z,Qe).call(this,x)?x.__staleWhileFetching:x;g!==void 0&&(u.oldValue=g);}}else u&&(u.set="update");T(this,dh)&&this.onInsert?.(t,e,t===x?"update":"replace");}if(s!==0&&!T(this,Nr)&&$(this,z,Hw).call(this),T(this,Nr)&&(l||T(this,vp).call(this,h,s,n),u&&T(this,Ws).call(this,u,h)),!o&&T(this,gr)&&T(this,Vt)){let x=T(this,Vt),g;for(;g=x?.shift();)(_=T(this,Bi))==null||_.call(this,...g);}return this}pop(){var e;try{for(;T(this,It);){let t=T(this,me)[T(this,or)];if($(this,z,F0).call(this,!0),$(this,z,Qe).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(T(this,gr)&&T(this,Vt)){let t=T(this,Vt),i;for(;i=t?.shift();)(e=T(this,Bi))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=T(this,At).get(e);if(n!==void 0){let o=T(this,me)[n];if($(this,z,Qe).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(T(this,Vr).call(this,n))s&&(s.has="stale",T(this,Ws).call(this,s,n));else return i&&T(this,Au).call(this,n),s&&(s.has="hit",T(this,Ws).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=T(this,At).get(e);if(s===void 0||!i&&T(this,Vr).call(this,s))return;let n=T(this,me)[s];return $(this,z,Qe).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:_,forceRefresh:x=false,status:g,signal:y}=t;if(!T(this,ho))return g&&(g.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});let v={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:g,signal:y},S=T(this,At).get(e);if(S===void 0){g&&(g.fetch="miss");let C=$(this,z,G0).call(this,e,S,v,_);return C.__returned=C}else {let C=T(this,me)[S];if($(this,z,Qe).call(this,C)){let L=i&&C.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",L&&(g.returnedStale=true)),L?C.__staleWhileFetching:C.__returned=C}let A=T(this,Vr).call(this,S);if(!x&&!A)return g&&(g.fetch="hit"),$(this,z,yp).call(this,S),s&&T(this,Au).call(this,S),g&&T(this,Ws).call(this,g,S),C;let M=$(this,z,G0).call(this,e,S,v,_),R=M.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=A?"stale":"refresh",R&&A&&(g.returnedStale=true)),R?M.__staleWhileFetching:M.__returned=M}}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=T(this,hh);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=T(this,At).get(e);if(a!==void 0){let u=T(this,me)[a],l=$(this,z,Qe).call(this,u);return o&&T(this,Ws).call(this,o,a),T(this,Vr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||$(this,z,co).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:($(this,z,yp).call(this,a),s&&T(this,Au).call(this,a),u))}else o&&(o.get="miss");}delete(e){return $(this,z,co).call(this,e,"delete")}clear(){return $(this,z,Xw).call(this,"delete")}};Mi=new WeakMap,Ur=new WeakMap,Ri=new WeakMap,Eu=new WeakMap,Bi=new WeakMap,ch=new WeakMap,hh=new WeakMap,It=new WeakMap,Ii=new WeakMap,At=new WeakMap,Je=new WeakMap,me=new WeakMap,mr=new WeakMap,Lr=new WeakMap,or=new WeakMap,Nt=new WeakMap,Di=new WeakMap,Vt=new WeakMap,ki=new WeakMap,Oi=new WeakMap,Nr=new WeakMap,Fi=new WeakMap,ho=new WeakMap,gr=new WeakMap,dh=new WeakMap,z=new WeakSet,Hw=function(){let e=new uh(T(this,Mi)),t=new uh(T(this,Mi));ee(this,Nr,e),ee(this,Oi,t),ee(this,vp,(n,o,a=ah.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{T(this,Vr).call(this,n)&&$(this,z,co).call(this,T(this,Je)[n],"expire");},o+1);u.unref&&u.unref();}}),ee(this,Au,n=>{t[n]=e[n]!==0?ah.now():0;}),ee(this,Ws,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=ah.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=T(this,At).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},ee(this,Vr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},Au=new WeakMap,Ws=new WeakMap,vp=new WeakMap,Vr=new WeakMap,dO=function(){let e=new uh(T(this,Mi));ee(this,Ii,0),ee(this,ki,e),ee(this,Cu,t=>{ee(this,Ii,T(this,Ii)-e[t]),e[t]=0;}),ee(this,Tp,(t,i,s,n)=>{if($(this,z,Qe).call(this,i))return 0;if(!ao(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!ao(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),ee(this,fh,(t,i,s)=>{if(e[t]=i,T(this,Ur)){let n=T(this,Ur)-e[t];for(;T(this,Ii)>n;)$(this,z,F0).call(this,true);}ee(this,Ii,T(this,Ii)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=T(this,Ii));});},Cu=new WeakMap,fh=new WeakMap,Tp=new WeakMap,uo=function*({allowStale:e=this.allowStale}={}){if(T(this,It))for(let t=T(this,Nt);!(!$(this,z,zw).call(this,t)||((e||!T(this,Vr).call(this,t))&&(yield t),t===T(this,or)));)t=T(this,Lr)[t];},lo=function*({allowStale:e=this.allowStale}={}){if(T(this,It))for(let t=T(this,or);!(!$(this,z,zw).call(this,t)||((e||!T(this,Vr).call(this,t))&&(yield t),t===T(this,Nt)));)t=T(this,mr)[t];},zw=function(e){return e!==void 0&&T(this,At).get(T(this,Je)[e])===e},F0=function(e){var n;let t=T(this,or),i=T(this,Je)[t],s=T(this,me)[t];return T(this,ho)&&$(this,z,Qe).call(this,s)?s.__abortController.abort(new Error("evicted")):(T(this,Fi)||T(this,gr))&&(T(this,Fi)&&((n=T(this,Ri))==null||n.call(this,s,i,"evict")),T(this,gr)&&T(this,Vt)?.push([s,i,"evict"])),T(this,Cu).call(this,t),e&&(T(this,Je)[t]=void 0,T(this,me)[t]=void 0,T(this,Di).push(t)),T(this,It)===1?(ee(this,or,ee(this,Nt,0)),T(this,Di).length=0):ee(this,or,T(this,mr)[t]),T(this,At).delete(i),Pm(this,It)._--,t},G0=function(e,t,i,s){let n=t===void 0?void 0:T(this,me)[t];if($(this,z,Qe).call(this,n))return n;let o=new U0,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(_,x=false)=>{let{aborted:g}=o.signal,y=i.ignoreFetchAbort&&_!==void 0;if(i.status&&(g&&!x?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),g&&!y&&!x)return h(o.signal.reason);let v=f;return T(this,me)[t]===f&&(_===void 0?v.__staleWhileFetching?T(this,me)[t]=v.__staleWhileFetching:$(this,z,co).call(this,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:x}=o.signal,g=x&&i.allowStaleOnFetchAbort,y=g||i.allowStaleOnFetchRejection,v=y||i.noDeleteOnFetchRejection,S=f;if(T(this,me)[t]===f&&(!v||S.__staleWhileFetching===void 0?$(this,z,co).call(this,e,"fetch"):g||(T(this,me)[t]=S.__staleWhileFetching)),y)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw _},d=(_,x)=>{var y;let g=(y=T(this,ch))==null?void 0:y.call(this,e,n,u);g&&g instanceof Promise&&g.then(v=>_(v===void 0?void 0:v),x),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=v=>l(v,true)));});};i.status&&(i.status.fetchDispatched=true);let f=new Promise(d).then(l,c),m=Object.assign(f,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,m,{...u.options,status:void 0}),t=T(this,At).get(e)):T(this,me)[t]=m,m},Qe=function(e){if(!T(this,ho))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof U0},Ww=function(e,t){T(this,Lr)[t]=e,T(this,mr)[e]=t;},yp=function(e){e!==T(this,Nt)&&(e===T(this,or)?ee(this,or,T(this,mr)[e]):$(this,z,Ww).call(this,T(this,Lr)[e],T(this,mr)[e]),$(this,z,Ww).call(this,T(this,Nt),e),ee(this,Nt,e));},co=function(e,t){var s,n;let i=false;if(T(this,It)!==0){let o=T(this,At).get(e);if(o!==void 0)if(i=true,T(this,It)===1)$(this,z,Xw).call(this,t);else {T(this,Cu).call(this,o);let a=T(this,me)[o];if($(this,z,Qe).call(this,a)?a.__abortController.abort(new Error("deleted")):(T(this,Fi)||T(this,gr))&&(T(this,Fi)&&((s=T(this,Ri))==null||s.call(this,a,e,t)),T(this,gr)&&T(this,Vt)?.push([a,e,t])),T(this,At).delete(e),T(this,Je)[o]=void 0,T(this,me)[o]=void 0,o===T(this,Nt))ee(this,Nt,T(this,Lr)[o]);else if(o===T(this,or))ee(this,or,T(this,mr)[o]);else {let u=T(this,Lr)[o];T(this,mr)[u]=T(this,mr)[o];let l=T(this,mr)[o];T(this,Lr)[l]=T(this,Lr)[o];}Pm(this,It)._--,T(this,Di).push(o);}}if(T(this,gr)&&T(this,Vt)?.length){let o=T(this,Vt),a;for(;a=o?.shift();)(n=T(this,Bi))==null||n.call(this,...a);}return i},Xw=function(e){var t,i;for(let s of $(this,z,lo).call(this,{allowStale:true})){let n=T(this,me)[s];if($(this,z,Qe).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=T(this,Je)[s];T(this,Fi)&&((t=T(this,Ri))==null||t.call(this,n,o,e)),T(this,gr)&&T(this,Vt)?.push([n,o,e]);}}if(T(this,At).clear(),T(this,me).fill(void 0),T(this,Je).fill(void 0),T(this,Nr)&&T(this,Oi)&&(T(this,Nr).fill(0),T(this,Oi).fill(0)),T(this,ki)&&T(this,ki).fill(0),ee(this,or,0),ee(this,Nt,0),T(this,Di).length=0,ee(this,Ii,0),ee(this,It,0),T(this,gr)&&T(this,Vt)){let s=T(this,Vt),n;for(;n=s?.shift();)(i=T(this,Bi))==null||i.call(this,...n);}};var L0=Yw;var Ct=class{constructor(e){w(this,"cache");w(this,"map",new Map);this.cache=new L0({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Sp=new Ct({cacheSize:5});function fO(r){return function(e){N0.add(e,r);}}var N0;(s=>{function r(n,o){o||(o=n.name),Sp.get(o)&&E.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Sp.set(o,n);}s.add=r;function e(n){try{let o=Sp.get(n);if(!o){E.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){E.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Sp.values())}s.values=t;function i(n){return Sp.has(n)}s.has=i;})(N0||(N0={}));var ar=N0;var ph=new Ct({cacheSize:5});function pO(r){return function(e){V0.add(e,r);}}var V0;(n=>{function r(o,a){a||(a=o.name),ph.get(a)&&E.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,ph.set(a,o);}n.add=r;function e(o){try{let a=ph.get(o);if(!a){E.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){E.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=ph.get(o);if(!a){E.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){E.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(ph.values())}n.values=i;function s(o){return ph.has(o)}n.has=s;})(V0||(V0={}));var hs=V0;async function H0(r){let e=hN(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 hN(r){try{let e=ar.get(r);return e?new e:void 0}catch(e){E.error(`Error while getting CanvasElement ${r}`,e);return}}Re();function jw(r){return "memory"in r?r.memory:r instanceof Cr?$w(r):r instanceof De?Ep(r):wu(r)}function dN(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 mO(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function wu(r,e){let t=fN(r,sh),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>jw(n)):[];return {pixivnId:t,elements:s,...dN(r)}}function Ep(r){let e=wu(r),t=e.pixivnId??nh,i=xO(r),s="textureAlias"in r?mO(r.texture,r.textureAlias):mO(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function $w(r){let e=wu(r),t=e.pixivnId??oh,i=xO(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:pN(r.style),roundPixels:r.roundPixels,onEvents:i}}function fN(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function xO(r){return "onEvents"in r?r.onEvents:{}}function gO(r,e){if(typeof r!="object"||r===null)return r;E.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function pN(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:gO(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:gO(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var fo=class extends J{constructor(t){super(t);w(this,"pixivnId",sh);w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||sh;}get memory(){return wu(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await ds(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await H0(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):E.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ar.add(fo,sh);async function ds(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}Re();var Ap=class Ap{static init(e){Ap._getScreen=e.getScreen;}static get screen(){return Ap._getScreen()}};w(Ap,"_getScreen");var Pr=Ap;function oi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(Pr.screen.width-t)+i+n*t+(s?t:0):e*(Pr.screen.height-t)+i+n*t+(s?t:0)}function fs(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(Pr.screen.width-t):(e-i-n*t-(s?t:0))/(Pr.screen.height-t)}function ai(r,e){return r==="width"?e*Pr.screen.width:e*Pr.screen.height}function ps(r,e){return r==="width"?e/Pr.screen.width:e/Pr.screen.height}function ut(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.x*i-r.y*s,o=r.x*s+r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.y*s-r.x*i,o=r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.x*i+r.y*s,o=-r.x*s-r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.y*s-r.x*i,o=-r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}return {x:0,y:0}}function qw(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function ui(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 li(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))}Re();var mN=new RegExp(`(${Jk.join("|")})$`);function Cp(r){let e=ot.cache.has(r)?ot.get(r):null;return e instanceof B&&(r=e.source?.label||r),mN.test(r)}function Pu(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.percentageX===void 0&&(r.percentageX=r.xPercentagePosition),r.yPercentagePosition!=null&&r.percentageY===void 0&&(r.percentageY=r.yPercentagePosition),r.percentageX!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.percentageX},delete r.percentageX):(r.percentagePosition.x=r.percentageX,delete r.percentageX)),r.percentageY!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.percentageY},delete r.percentageY):(r.percentagePosition.y=r.percentageY,delete r.percentageY))),r)}Re();Re();async function Mu(r){if(r!=="EMPTY"){if(!r){E.error("Texture not found",r);return}if(ot.cache.has(r)){let e=ot.get(r);if(e)return e}return ot.load(r).then(e=>{if(!e){E.error("Texture not found",r);return}if(!(e instanceof B)){E.error("File not is a file",r);return}return e}).catch(e=>{E.error("Error loading file",e);})}}Re();var ms=class r extends De{constructor(t){super(t);w(this,"pixivnId",nh);w(this,"_textureAlias");w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||nh;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return Ep(this)}set memory(t){}async setMemory(t){return this.memory=t,await wp(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):E.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=De.from(t,i),n=new r;return n.texture=s.texture,n}};ar.add(ms,nh);async function wp(r,e,t){let i=t?.ignoreTexture||false;if(await ds(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await Mu(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&ot.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await Mu(n);o&&(r.texture=o);}}let s=t?.half;if(s?await s():"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=hs.get(o);a&&r.onEvent(n,a);}}var Ue=class r extends ms{constructor(t,i){t=Pu(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);w(this,"pixivnId",Gw);w(this,"_loadIsStarted",false);w(this,"_align");w(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...Ep(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Pp(this,t),this.reloadPosition();}static from(t,i){let s=De.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Mu(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,E.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return {x:fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x),y:fs("height",this.y,li(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("height",this.y,li(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:ps("width",this.x),y:ps("height",this.y)}}get percentageX(){return ps("width",this.x)}set percentageX(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageY(){return ps("height",this.y)}set percentageY(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);this._align.x!==void 0&&(super.x=oi("width",this._align.x,ui(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=oi("height",this._align.y,li(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=ai("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=ai("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};ar.add(Ue,Gw);async function Pp(r,e,t){let i=t?.ignoreTexture||false;return e=Pu(e),await wp(r,e,{half:async()=>{i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load(),"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)),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition);},ignoreTexture:t?.ignoreTexture})}Re();var nr=class r extends Ue{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);w(this,"pixivnId",Uw);w(this,"_looop",false);w(this,"_paused",false);w(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await Kw(this,t)}static from(t,i){let s=De.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};ar.add(nr,Uw);async function Kw(r,e,t){await Pp(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 Ye=class extends fo{constructor(t,i=[]){t=Pu(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);w(this,"pixivnId",D0);w(this,"_loadIsStarted",false);w(this,"_anchor");w(this,"_align");w(this,"_percentagePosition");t=Pu(t),i&&i.forEach(a=>{let u;Cp(a)?u=new nr(void 0,a):u=new Ue(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:D0,anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await Zw(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,E.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new B}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return {x:fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x),y:fs("height",this.y,li(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("height",this.y,li(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:ps("width",this.x),y:ps("height",this.y)}}set percentageX(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageX(){return ps("width",this.x)}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}set percentageY(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get percentageY(){return ps("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);this._align.x!==void 0&&(super.x=oi("width",this._align.x,ui(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=oi("height",this._align.y,li(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=ai("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=ai("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};ar.add(Ye,D0);async function Zw(r,e,t){e=Pu(e),ds(r,e,{...t,end:async()=>{"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();}});}Re();var po=class extends Cr{constructor(t){super(t);w(this,"pixivnId",oh);w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||oh;}get memory(){return $w(this)}set memory(t){}async setMemory(t){return this.memory=t,await Qw(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):E.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ar.add(po,oh);async function Qw(r,e){if(await ds(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=hs.get(i);s&&r.onEvent(t,s);}}Re();var Ru=class{constructor(e,t,i){w(this,"_args");w(this,"duration");w(this,"priority");w(this,"ticker",new _e);w(this,"animation");w(this,"stopped",false);w(this,"ignoreOnComplete",true);w(this,"tickerId");w(this,"canvasElementAliases",[]);w(this,"timeout",50);w(this,"onComplete",()=>{if(this.ignoreOnComplete)return;let e=this.tickerId;if(!e){E.warn("MotionTicker.complete() called without tickerId set. This may cause issues.");return}let t=this._args.options?.aliasToRemoveAfter||[];typeof t=="string"&&(t=[t]);let i=this._args.options?.tickerAliasToResume||[];typeof i=="string"&&(i=[i]);let s=this._args.options?.tickerIdToResume||[];typeof s=="string"&&(s=[s]),I.onTickerComplete(e,{aliasToRemoveAfter:t,tickerAliasToResume:i,tickerIdToResume:s,stopTicker:false});});this._args=e,this.duration=t,this.priority=i;}get args(){return {...this._args,time:this.animation?.time}}getItemByAlias(e){if(!this.canvasElementAliases.includes(e))return;let t=I.find(e);if(t)return t}async complete(){if(!this.animation){E.warn("MotionTicker.complete() called without animation set. This may cause issues.");return}this.animation.complete(),await new Promise(e=>setTimeout(e,this.timeout));}stop(){if(this.stopped=true,!this.animation){E.warn("MotionTicker.stop() called without animation set. This may cause issues.");return}this.animation.stop();}start(e){if(this.tickerId=e,this._args.options.autoplay!==false)return this.initialize()}createItem(e){return new Proxy({alias:e},{set:({alias:t},i,s)=>{if(this.stopped||this._args.startState&&this._args.startState[i]===s)return true;let n=this.getItemByAlias(t);if(!n)return true;switch(this.ignoreOnComplete&&setTimeout(()=>{this.ignoreOnComplete=false;},10),i){case "pivotX":n.pivot.x=s;break;case "pivotY":n.pivot.y=s;break;case "scaleX":n.scale.x=s;break;case "scaleY":n.scale.y=s;break;default:n[i]=s;break}return true},get:({alias:t},i)=>{if(this._args.startState||(this._args.startState={}),i in this._args.startState)return this._args.startState[i];let s=this.getItemByAlias(t);if(!s)return;let n;switch(i){case "pivotX":n=s.pivot.x;break;case "pivotY":n=s.pivot.y;break;case "scaleX":n=s.scale.x;break;case "scaleY":n=s.scale.y;break;default:n=s[i];break}return this._args.startState={...this._args.startState,[i]:n},n},has:({alias:t},i)=>{let s=this.getItemByAlias(t);if(!s)return false;switch(i){case "pivotX":return "pivot"in s&&"x"in s.pivot;case "pivotY":return "pivot"in s&&"y"in s.pivot;case "scaleX":return "scale"in s&&"x"in s.scale;case "scaleY":return "scale"in s&&"y"in s.scale;default:return i in s}},ownKeys:({alias:t})=>{let i=this.getItemByAlias(t);return i?Object.keys(i):[]}})}pause(){if(!this.animation){E.warn("MotionTicker.pause() called without animation set. This may cause issues.");return}this.animation.pause();}play(){if(this.animation||this.initialize(),!this.animation){E.warn("MotionTicker.play() called without animation set. This may cause issues.");return}this.animation.play();}get paused(){return this.animation?this.animation.state==="paused":(E.warn("MotionTicker.paused() called without animation set. This may cause issues."),true)}};var Bu=class extends Ru{constructor(){super(...arguments);w(this,"id","motion-sequence");}initialize(){let t=this.canvasElementAliases[0],i=this.createItem(t),s=this._args.sequence.map((n,o)=>[i,n[0],{...n[1]||{},ticker:this.ticker,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat,onComplete:o===this._args.sequence.length-1?()=>this.onComplete():void 0}]);this.animation=mh(s,{...this._args.options,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat}),this._args.time&&(this.animation.time=this._args.time);}};var Iu=class extends Ru{constructor(){super(...arguments);w(this,"id","motion");}initialize(){let t=this.canvasElementAliases.map(i=>this.createItem(i));this.animation=mh(t,this._args.keyframes,{...this._args.options,repeat:this._args.options?.repeat===null?1/0:this._args.options?.repeat,onComplete:()=>this.onComplete(),ticker:this.ticker}),this._args.time&&(this.animation.time=this._args.time);}};var mo=new Ct({cacheSize:5});mo.set("motion",Iu);mo.set("motion-sequence",Bu);function _O(r){return function(e){z0.add(e,r);}}var z0;(n=>{function r(o,a){a||(a=o.name),mo.get(a)&&E.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,mo.set(a,o);}n.add=r;function e(o){try{let a=mo.get(o);if(!a){E.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){E.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=mo.get(o);if(!c){E.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){E.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(mo.values())}n.values=i;function s(o){return mo.has(o)}n.has=s;})(z0||(z0={}));var ur=z0;var bO="aliasToRemoveAfter";var Mp=class{get app(){return k.app}get gameLayer(){return k.gameLayer}get isInitialized(){return k._isInitialized}get canvasWidth(){return k.canvasWidth}get canvasHeight(){return k.canvasHeight}set canvasWidth(e){k.canvasWidth=e;}set canvasHeight(e){k.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await k.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await k.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}get children(){return k.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {E.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {E.error(`Canvas element ${e} not found`);return}}e instanceof J&&(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 nr?await Kw(t,e,{ignoreTexture:true}):t instanceof Ue?await Pp(t,e,{ignoreTexture:true}):t instanceof ms?await wp(t,e,{ignoreTexture:true}):t instanceof po?await Qw(t,e):t instanceof Ye?await Zw(t,e):t instanceof J&&await ds(t,e);}add(e,t,i={}){if(e===wr){E.error(`The alias ${wr} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?E.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===wr){E.error(`The alias ${wr} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}find(e){if(e===wr)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();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return k._currentTickers}get currentTickersSteps(){return k._currentTickersSequence}findTicker(e){let t=k._currentTickers[e];if(t)return t.ticker}addTicker(e,t,i){let s=t.id;if(typeof e=="string"&&(e=[e]),t.canvasElementAliases=e,!ur.has(s)){E.error(`Ticker ${s} not found`);return}let n={ticker:t},{id:o=k.generateTickerId(n)}=i||{};if(k._currentTickers[o]=n,n.ticker.start(o),t.duration){let a=setTimeout(()=>{k.removeTickerTimeoutInfo(a),k._currentTickersTimeouts[a.toString()]&&n.ticker.complete({ignoreTickerSteps:true});},t.duration*1e3);k.addTickerTimeoutInfo(e,s,a.toString(),true);}return o}addTickersSequence(e,t,i=0){if(t.length==0){E.warn("The steps of the tickers is empty");return}e in k._currentTickersSequence||(k._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===oo||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:pe(o.args),duration:o.duration})},n=k.generateTickerId(s);return k._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!k._currentTickersSequence[e]||!k._currentTickersSequence[e][t])return;let i=k._currentTickersSequence[e][t].steps[k._currentTickersSequence[e][t].currentStepNumber];if(i===oo&&(i=k._currentTickersSequence[e][t].steps[0],k._currentTickersSequence[e][t].currentStepNumber=0,i===oo)){E.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=k._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),k.removeTickerTimeoutInfo(u);},i.duration*1e3);k.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=ur.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){E.error(`Ticker ${i.ticker} not found`);return}s.canvasElementAliases=[e];let n=s.id,o={createdByTicketSteps:{canvasElementAlias:e,id:t},ticker:s},a=k.generateTickerId(o);if(k._currentTickers[a]=o,o.ticker.start(a),s.duration){let u=setTimeout(()=>{let l=k._currentTickersTimeouts[u.toString()];l&&(o.ticker.complete({ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),k.removeTickerTimeoutInfo(u);},s.duration*1e3);k.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(k._currentTickersSequence[e]&&k._currentTickersSequence[e][t]){let i=k._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,k._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&k._currentTickersSequence[e]&&k._currentTickersSequence[e][t]&&(delete k._currentTickersSequence[e][t],Object.entries(k._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){return this.onTickerComplete(e,t)}onTickerComplete(e,t){let{stopTicker:i=true,aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o}=t,a=k._currentTickers[e],u=t.ignoreTickerSteps||false;this.remove(s),n.forEach(l=>this.resumeTicker({canvasAlias:l})),this.resumeTicker({id:o}),a&&(this.removeTicker(e,{stopTicker:i}),!u&&a.ticker.duration==null&&a.createdByTicketSteps&&this.nextTickerStep(a.createdByTicketSteps.canvasElementAlias,a.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(k._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(s)&&(o.ticker.canvasElementAliases.length===1?this.removeTicker(n):o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(a=>a!==s));}),k._currentTickersSequence[s]&&delete k._currentTickersSequence[s],k.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:i=t.prototype.id,e.forEach(s=>{k._currentTickersSequence[s]&&Object.entries(k._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete k._currentTickersSequence[s][n];});}),Object.entries(k._currentTickers).forEach(([s,n])=>{n.ticker.id===i&&(k._currentTickers[s].ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(k._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(k._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(k._currentTickers).forEach(([e,t])=>{t.ticker.canvasElementAliases=t.ticker.canvasElementAliases.filter(i=>this.find(i)),t.ticker.canvasElementAliases.length===0&&t.ticker.complete({ignoreTickerSteps:true});}),Object.entries(k._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete k._currentTickersSequence[e];}),Object.entries(k._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&k.removeTickerTimeout(e);});}removeAllTickers(){k._currentTickersSequence={},Object.keys(k._currentTickers).forEach(e=>{this.removeTicker(e);}),k._currentTickers={};for(let e in k._currentTickersTimeouts)k.removeTickerTimeout(e);k._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},k._tickersOnPause={};}removeTicker(e,t={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(i=>{let s=k._currentTickers[i];s&&(t.stopTicker&&s.ticker.stop(),delete k._currentTickers[i]);});}pauseTicker(e){let t=[];if("canvasAlias"in e){let{canvasAlias:i,tickerIdsExcluded:s=[]}=e;Object.entries(k._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(i)&&!s.includes(o.ticker.id)&&o.ticker.paused===false&&(o.ticker.pause(),t.push(n));});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),i.forEach(s=>{let n=k._currentTickers[s];n?n.ticker.paused===false&&(n.ticker.pause(),t.push(s)):E.error(`Ticker with id ${s} not found`);});}return t}resumeTicker(e){if("canvasAlias"in e){let{canvasAlias:t}=e;Object.values(k._currentTickers).forEach(i=>{i.ticker.canvasElementAliases.includes(t)&&i.ticker.play();}),delete k._tickersOnPause[t];}else if("id"in e){let{id:t}=e;typeof t=="string"&&(t=[t]),t.forEach(i=>{let s=k._currentTickers[i];s?s.ticker.play():E.error(`Ticker with id ${i} not found`);});}}isTickerPaused(e,t){let i=k._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}transferTickers(e,t,i="move"){k._currentTickersSequence[e]&&(i==="move"?k._currentTickersSequence[t]=pe(k._currentTickersSequence[e]):i==="duplicate"&&(k._currentTickersSequence[t]=pe(k._currentTickersSequence[e]))),Object.entries(k._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.ticker.canvasElementAliases.includes(e)){let o=ur.getInstance(n.ticker.id,pe(n.ticker.args),n.ticker.duration,n.ticker.priority);if(o?(o.canvasElementAliases=[t],this.addTicker(t,o),n.ticker.paused&&o.pause()):E.error(`Ticker ${n.ticker.id} not found`),i==="move"&&(n.ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(a=>a!==e)),n.ticker.args.hasOwnProperty(bO)){let a=n.ticker.args.aliasToRemoveAfter;typeof a=="string"&&(a=[a]),Array.isArray(a)&&(i==="move"?n.ticker.args.aliasToRemoveAfter=a.map(u=>u===e?t:u):i==="duplicate"&&a.find(u=>u===e)&&(n.ticker.args.aliasToRemoveAfter=[...a,t]));}}}),Object.values(k._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),k._currentTickersSequence[t]&&Object.keys(k._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&k._currentTickersSequence[e]&&Object.keys(k._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}completeTickerOnStepEnd(e){e.alias?k._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):k._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,t){if(t){let i=k._currentTickersSequence[t];if(i&&i[e])if(i[e].steps.includes(oo))E.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]);else {let s=i[e].steps.map(n=>{if(typeof n=="object"&&"ticker"in n){let o=ur.getInstance(n.ticker,n.args,n.duration,n.priority);if(o)return o.canvasElementAliases=[t],o.complete()}});await Promise.all(s);}}else {let i=k._currentTickers[e];i&&await i.ticker.complete();}}animate(e,t,i,s){try{t=pe(t);}catch(l){throw E.error("animate keyframes cannot contain functions or classes"),l}try{i=pe(i);}catch(l){throw E.error("animate options cannot contain functions or classes"),l}let n=[];typeof e=="string"?n=[e]:Array.isArray(e)?n=e.map(l=>typeof l=="string"?l:l.label):n=[e.label];let o;Array.isArray(t)?o=new Bu({sequence:t,options:i},void 0,s):o=new Iu({keyframes:t,options:i},void 0,s);let a=this.addTicker(n,o),{forceCompleteBeforeNext:u}=i||{};return a&&u&&this.completeTickerOnStepEnd({id:a}),a}addLayer(e,t){if(e===wr){E.error(`The alias ${wr} is reserved`);return}return t.label=e,k.app.stage.addChild(t)}getLayer(e){return k.app.stage.getChildByLabel(e)}removeLayer(e){k.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return k.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return k.removeHtmlLayer(e)}getHtmlLayer(e){return k.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAllTickers(),this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=jw(t));}),{tickers:pe(k.currentTickersWithoutCreatedBySteps),tickersSteps:pe(k._currentTickersSequence),elements:pe(e),stage:pe(wu(this.gameLayer)),elementAliasesOrder:pe(k.childrenAliasesOrder),tickersOnPause:pe(k._tickersOnPause),tickersToCompleteOnStepEnd:pe(k._tickersToCompleteOnStepEnd)}}async restore(e){this.clear();try{if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let t=e.elementAliasesOrder,i={},s=Object.entries(e.elements).map(async([n,o])=>{i[n]=await H0(o);});await Promise.all(s),t.forEach(n=>{let o=i[n];o&&this.add(n,o);});}else {E.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?ds(this.gameLayer,e.stage,{ignoreScale:!0}):E.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let t=e.tickers;Object.entries(t).forEach(([i,s])=>{let n=s.canvasElementAliases;if(n.length!==0){let o=ur.getInstance(s.id,s.args,s.duration,s.priority);o?(o.canvasElementAliases=n,this.addTicker(n,o,{id:i}),s.paused&&o.pause()):E.error(`Ticker ${s.id} not found`);}});}if(e.hasOwnProperty("tickersSteps")){let t=e.tickersSteps;Object.entries(t).forEach(([i,s])=>{k._currentTickersSequence[i]=s,Object.keys(s).forEach(n=>{this.runTickersSequence(i,n);});});}if(e.hasOwnProperty("tickersOnPause")){let t=e.tickersOnPause;Object.keys(t).forEach(i=>{let s=t[i];"tickerIdsExcluded"in s&&s.tickerIdsExcluded&&(t[i].tickerIdsExcluded=s.tickerIdsExcluded),"tickerIdsIncluded"in s&&s.tickerIdsIncluded&&(t[i].tickerIdsIncluded=s.tickerIdsIncluded);}),k._tickersOnPause=t;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let t=e.tickersToCompleteOnStepEnd,i=t.tikersIds,s=t.stepAlias.map(n=>({id:n.id,alias:n.alias}));k._tickersToCompleteOnStepEnd={tikersIds:i,stepAlias:s};}}catch(t){E.error("Error importing data",t);}}};var Rp=class{constructor(){w(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var Bp=class{constructor(){w(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};async function yO(r,e={},t){let i=I.find(r);if(!i){E.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},{shakeType:n="horizontal",maxShockSize:o=10,shocksNumber:a=10,...u}=e,l=a-1;if(l<2){E.error("The number of shocks must be at least 3.");return}let c=Math.floor(l/2),h=Math.ceil(l/2),d=[];for(let _=0;_<c;_++){let x=o*(_+1)/c;n==="horizontal"?_%2!==0?d.push(s.x+x):d.push(s.x-x):_%2!==0?d.push(s.y+x):d.push(s.y-x);}let f=c%2===0;for(let _=h;_>0;_--){let x=o*(_+1)/(h-1);n==="horizontal"?_%2===0&&!f||_%2!==0&&f?d.push(s.x-x):d.push(s.x+x):_%2===0&&!f||_%2!==0&&f?d.push(s.y-x):d.push(s.y+x);}let m;if(n==="horizontal"?(d.push(s.x),m=I.animate(r,{x:d},u,t)):(d.push(s.y),m=I.animate(r,{y:d},u,t)),m)return [m]}Re();function Ip(r,e,t){let i=new Ye(t,e);return I.add(r,i),i}async function vO(r,e,t){let i=new Ye(t,e);return await i.load(),I.add(r,i),i}Re();function Dp(r,e,t){if(!e)if(ot.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return I.add(r,i),i}async function TO(r,e,t){if(!e)if(ot.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return await i.load(),I.add(r,i),i}Re();function kp(r,e,t){if(!e)if(ot.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new nr(t,e);return I.add(r,i),i}async function SO(r,e,t){if(!e)if(ot.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new nr(t,e);return await i.load(),I.add(r,i),i}function Jw(r,e){if(r.type==="align"){let t,i;e instanceof De&&(t=e.anchor.x,i=e.anchor.y);let s=ut(e.pivot,e.angle),n=ut(e.scale,e.angle);r.x=oi("width",r.x,ui(e),s.x,n.x<0,t),r.y=oi("height",r.y,li(e),s.y,n.y<0,i);}return r.type==="percentage"&&(r.x=ai("width",r.x),r.y=ai("height",r.y)),{x:r.x,y:r.y}}function Op(r,e){if(typeof e=="string")return Cp(e)?kp(r,e):Dp(r,e);if(Array.isArray(e))return Ip(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Cp(e.value)?kp(r,e.value,e.options):Dp(r,e.value,e.options);if(Array.isArray(e.value))return Ip(r,e.value,e.options)}return I.add(r,e),e}async function eP(r,e,t={},i){let{forceCompleteBeforeNext:s=true,tickerIdToResume:n=[],...o}=t,a=[];e||(e=r),typeof n=="string"&&(n=[n]);let u;if(I.find(r)&&(u=r+"_temp_disolve",I.editAlias(r,u)),e=Op(r,e),u&&I.copyCanvasElementProperty(u,r),u&&I.transferTickers(u,r,"duplicate"),e.alpha=0,u){let c=Fp(u,{...t,autoplay:false,forceCompleteBeforeNext:s},i);c&&(a.push(...c),n.push(...c));}let l=I.animate(r,{alpha:1},{...o,tickerIdToResume:n,forceCompleteBeforeNext:s},i);if(l&&a.push(l),(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function Fp(r,e={},t){let{forceCompleteBeforeNext:i=true,aliasToRemoveAfter:s=[],...n}=e;typeof s=="string"&&(s=[s]),s.push(r);let o=I.animate(r,{alpha:0},{...n,aliasToRemoveAfter:s,forceCompleteBeforeNext:i},t);if(o)return [o]}async function EO(r,e,t={},i){let{forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=t,a=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!I.find(r))return eP(r,e,t,i);let u=r+"_temp_fade";I.editAlias(r,u),n.push(u),e=Op(r,e),u&&I.copyCanvasElementProperty(u,r),u&&I.transferTickers(u,r,"duplicate"),e.alpha=0;let l=I.animate(r,{alpha:1},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},i);if(l){let c=Fp(u,{...t,tickerIdToResume:l,forceCompleteBeforeNext:s},i);c&&a.push(...c),a.push(l),I.pauseTicker({id:l});}if((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function AO(r,e={},t){return Fp(r,e,t)}async function CO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u,...l}=t,c=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let h;I.find(r)&&(h=r+"_temp_movein",I.editAlias(r,h)),e=Op(r,e),h&&I.copyCanvasElementProperty(h,r),h&&I.transferTickers(h,r,"move");let d;if(e instanceof Ue||e instanceof Ye?d=e.positionInfo:d={x:e.x,y:e.y,type:"pixel"},h)if(u){let _=W0(h,{...t,autoplay:false,forceCompleteBeforeNext:n},i);_&&(c.push(..._),o.push(..._));}else a.push(h);switch((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),s){case "up":e.y=I.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=I.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let f=I.pauseTicker({canvasAlias:r});o.push(...f);let m=I.animate(r,Jw(d,e),{...l,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(m&&c.push(m),c.length>0)return c}function W0(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=I.find(r);if(!a){E.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y};switch(i){case "up":u.y=-a.height;break;case "down":u.y=I.canvasHeight+a.height;break;case "left":u.x=-a.width;break;case "right":u.x=I.canvasWidth+a.width;break}I.pauseTicker({canvasAlias:r});let l=I.animate(r,u,{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(l)return [l]}async function wO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],...u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;I.find(r)&&(c=r+"_temp_zoom",I.editAlias(r,c)),e=Op(r,e),c&&I.copyCanvasElementProperty(c,r),c&&I.transferTickers(c,r,"move");let h;e instanceof Ue||e instanceof Ye?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d={x:e.pivot.x,y:e.pivot.y},f={x:e.scale.x,y:e.scale.y};if(c)if(t.removeOldComponentWithZoomOut){let x=tP(c,{...t,autoplay:false,forceCompleteBeforeNext:n},i);x&&(l.push(...x),o.push(...x));}else a.push(c);(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),s=="up"?(e.pivot.y=I.canvasHeight-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=I.canvasHeight,e.x=I.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=0,e.x=I.canvasWidth/2):s=="left"?(e.pivot.x=I.canvasWidth-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=I.canvasWidth,e.y=I.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=0,e.y=I.canvasHeight/2),e.pivot=qw(e.pivot,e.angle),e.scale.set(0);let m=I.pauseTicker({canvasAlias:r});o.push(...m);let _=I.animate(r,{...Jw(h,e),pivotX:d.x,pivotY:d.y,scaleX:f.x,scaleY:f.y},{...u,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(_&&l.push(_),l.length>0)return l}function tP(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=I.find(r);if(!a){E.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y},l={x:a.pivot.x,y:a.pivot.y};i=="down"?(u.y=I.canvasHeight,u.x=I.canvasWidth/2,l.y=I.canvasHeight-u.y,l.x=I.canvasWidth/2-u.x):i=="up"?(u.y=0,u.x=I.canvasWidth/2,l.y=0-u.y,l.x=I.canvasWidth/2-u.x):i=="right"?(u.x=I.canvasWidth,u.y=I.canvasHeight/2,l.x=I.canvasWidth-u.x,l.y=I.canvasHeight/2-u.y):i=="left"&&(u.x=0,u.y=I.canvasHeight/2,l.x=0-u.x,l.y=I.canvasHeight/2-u.y),l=qw(l,a.angle),I.pauseTicker({canvasAlias:r});let c=I.animate(r,{...u,pivotX:l.x,pivotY:l.y,scaleX:0,scaleY:0},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(c)return [c]}async function PO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],...a}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]);let l;I.find(r)&&(l=r+"_temp_push",I.editAlias(r,l)),e=Op(r,e),l&&I.copyCanvasElementProperty(l,r),l&&I.transferTickers(l,r,"move");let c;switch((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture?c=e.positionInfo:c={x:e.x,y:e.y,type:"pixel"},s){case "up":e.y=I.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=I.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let h=I.pauseTicker({canvasAlias:r});if(o.push(...h),l){let f=rP(l,{...t,direction:s,forceCompleteBeforeNext:n});f&&u.push(...f);}let d=I.animate(r,Jw(c,e),{...a,tickerIdToResume:o,forceCompleteBeforeNext:n},i);if(d&&u.push(d),(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function rP(r,e={direction:"right"},t){return W0(r,e,t)}Re();var Hr=class{constructor(e,t,i){w(this,"id","ticker_id_not_set");w(this,"args");w(this,"duration");w(this,"priority");w(this,"ticker",new _e);w(this,"tickerId");w(this,"canvasElementAliases",[]);w(this,"fnValue");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){E.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(e){this.tickerId=e;let t=()=>{let{createdByTicketSteps:i}=k._currentTickers[e],s=this.canvasElementAliases;if(i){if(I.isTickerPaused(i.canvasElementAlias,i.id))return}else s=s.filter(n=>!I.isTickerPaused(n,e));return this.fn(this.ticker,this.args,s,e)};this.fnValue=t,this.ticker.add(t,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};Re();Re();function go(r){return (r instanceof Ue||r instanceof Ye)&&r.haveEmptyTexture?false:!(r instanceof De&&r.texture?.label=="EMPTY")}function xo(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=iP(r[e],t):t.type==="exponential"&&(r[e]=sP(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=iP(r[e].x,t),r[e].y=iP(r[e].y,t)):t.type==="exponential"&&(r[e].x=sP(r[e].x,t),r[e].y=sP(r[e].y,t))));}function iP(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 sP(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 gN=5,gh=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=gN:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=I.find(c);return !(!h||o&&!go(h))}).forEach(c=>{let h=I.find(c);if(h&&h instanceof J){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.complete();return}else if(n==="hide"&&h.alpha<=l){this.complete();return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){E.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.complete();return}}}),a&&xo(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=I.find(s);if(n){let o=this.getLimit(i);n.alpha=o;}});}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(gh);Re();var nP={};vs(nP,{createExportableElement:()=>pe});var xN=10;function _N(r,e){let t=pe(r.destination);if(t.type==="align"){let i,s;e instanceof De&&(i=e.anchor.x,s=e.anchor.y);let n=ut(e.pivot,e.angle),o=ut(e.scale,e.angle);t.x=oi("width",t.x,ui(e),n.x,o.x<0,i),t.y=oi("height",t.y,li(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=ai("width",t.x),t.y=ai("height",t.y)),t}var xh=class extends Hr{fn(e,t,i,s){t.speed===void 0&&(t.speed=xN);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=I.find(u);return !(!l||o&&!go(l))}).forEach(u=>{let l=I.find(u);if(l&&l instanceof J){let c=_N(t,l),h=c.x-l.x,d=c.y-l.y,f=h>0?1:-1,m=d>0?1:-1,_,x;if(typeof n=="number"){let g=this.speedConvert(n);h===0||d===0?_=x=g:(_=Math.abs(h/(h+d))*g,x=Math.abs(d/(h+d))*g);}else _=this.speedConvert(n.x),x=this.speedConvert(n.y);if(_>0){l.x+=f*_*e.deltaTime;let g=c.x-l.x;(f<0&&g>0||f>0&&g<0)&&(l.x=c.x);}if(x>0){l.y+=m*x*e.deltaTime;let g=c.y-l.y;(m<0&&g>0||m>0&&g<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.complete();return}else if(_<1e-5&&x<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){E.warn("The speed of the MoveTicker must be greater than 0."),this.complete();return}}}),a&&xo(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=I.find(s);if(n){let o=i.destination;n instanceof Ue||n instanceof Ye?n.positionInfo=o:(n.x=o.x,n.y=o.y);}});}speedConvert(e){return e*(66/400)}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(xh);Re();var bN=1,_h=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=bN);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=I.find(l);return !(!c||t.startOnlyIfHaveTexture&&!go(c))}).forEach(l=>{let c=I.find(l);if(c&&c instanceof J&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.complete()):!n&&c.angle<=a&&(c.angle=a,this.complete())),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){E.warn("The speed of the RotateTicker must be greater than 0."),this.complete();return}}),o&&xo(t,"speed",o);}onComplete(e,t,i){let{limit:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);o&&s!==void 0&&(o.angle=s);});}speedConvert(e){return e/100}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(_h);Re();var yN=10,bh=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=yN);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(d=>{let f=I.find(d);return !(!f||a&&!go(f))}).forEach(d=>{let f=I.find(d);if(f&&f instanceof J){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.complete();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.complete();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)){E.warn("The speed of the ZoomTicker must be greater than 0."),this.complete();return}}}),u&&xo(t,"speed",u);}speedConvert(e){return e/600}onComplete(e,t,i){let{isZoomInOut:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);if(o){let a=this.getLimit(i);if(o.scale.x=a.x,o.scale.y=a.y,s){let{pivot:u,position:l}=s;o.pivot=u.x,o.position=l;}}});}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(bh);function oP(r,e){r.indexOf(e)===-1&&r.push(e);}function Du(r,e){let t=r.indexOf(e);t>-1&&r.splice(t,1);}var Mr=(r,e,t)=>t>e?e:t<r?r:t;function Gp(r,e){return e?`${r}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:r}var gs=()=>{},Ht=()=>{};process.env.NODE_ENV!=="production"&&(gs=(r,e,t)=>{!r&&typeof console<"u"&&console.warn(Gp(e,t));},Ht=(r,e,t)=>{if(!r)throw new Error(Gp(e,t))});var lr={};var Up=r=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(r);function aP(r){return typeof r=="object"&&r!==null}var Lp=r=>/^0[^.\s]+$/u.test(r);function ku(r){let e;return ()=>(e===void 0&&(e=r()),e)}var zr=r=>r;var vN=(r,e)=>t=>e(r(t)),Ou=(...r)=>r.reduce(vN);var Fu=(r,e,t)=>{let i=e-r;return i===0?1:(t-r)/i};var Gu=class{constructor(){this.subscriptions=[];}add(e){return oP(this.subscriptions,e),()=>Du(this.subscriptions,e)}notify(e,t,i){let s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,t,i);else for(let n=0;n<s;n++){let o=this.subscriptions[n];o&&o(e,t,i);}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0;}};var Dt=r=>r*1e3,xr=r=>r/1e3;function Np(r,e){return e?r*(1e3/e):0}var MO=new Set;function Vp(r,e,t){r||MO.has(e)||(console.warn(Gp(e,t)),MO.add(e));}var RO=(r,e,t)=>{let i=e-r;return ((t-r)%i+i)%i+r};var BO=(r,e,t)=>(((1-3*t+3*e)*r+(3*t-6*e))*r+3*e)*r,TN=1e-7,SN=12;function EN(r,e,t,i,s){let n,o,a=0;do o=e+(t-e)/2,n=BO(o,i,s)-r,n>0?t=o:e=o;while(Math.abs(n)>TN&&++a<SN);return o}function _o(r,e,t,i){if(r===e&&t===i)return zr;let s=n=>EN(n,0,1,r,t);return n=>n===0||n===1?n:BO(s(n),e,i)}var X0=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2;var Y0=r=>e=>1-r(1-e);var j0=_o(.33,1.53,.69,.99),yh=Y0(j0),Hp=X0(yh);var zp=r=>(r*=2)<1?.5*yh(r):.5*(2-Math.pow(2,-10*(r-1)));var Wp=r=>1-Math.sin(Math.acos(r)),uP=Y0(Wp),Xp=X0(Wp);var lP=_o(.42,0,1,1),cP=_o(0,0,.58,1),Yp=_o(.42,0,.58,1);var jp=r=>Array.isArray(r)&&typeof r[0]!="number";function $p(r,e){return jp(r)?r[RO(0,r.length,e)]:r}var qp=r=>Array.isArray(r)&&typeof r[0]=="number";var IO={linear:zr,easeIn:lP,easeInOut:Yp,easeOut:cP,circIn:Wp,circInOut:Xp,circOut:uP,backIn:yh,backInOut:Hp,backOut:j0,anticipate:zp},AN=r=>typeof r=="string",$0=r=>{if(qp(r)){Ht(r.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,t,i,s]=r;return _o(e,t,i,s)}else if(AN(r))return Ht(IO[r]!==void 0,`Invalid easing type '${r}'`,"invalid-easing-type"),IO[r];return r};var Kp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function DO(r,e){let t=new Set,i=new Set,s=false,n=false,o=new WeakSet,a={delta:0,timestamp:0,isProcessing:false};function l(h){o.has(h)&&(c.schedule(h),r()),h(a);}let c={schedule:(h,d=false,f=false)=>{let _=f&&s?t:i;return d&&o.add(h),_.has(h)||_.add(h),h},cancel:h=>{i.delete(h),o.delete(h);},process:h=>{if(a=h,s){n=true;return}s=true,[t,i]=[i,t],t.forEach(l),t.clear(),s=false,n&&(n=false,c.process(h));}};return c}var CN=40;function q0(r,e){let t=false,i=true,s={delta:0,timestamp:0,isProcessing:false},n=()=>t=true,o=Kp.reduce((v,S)=>(v[S]=DO(n),v),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:d,render:f,postRender:m}=o,_=()=>{let v=lr.useManualTiming?s.timestamp:performance.now();t=false,lr.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(v-s.timestamp,CN),1)),s.timestamp=v,s.isProcessing=true,a.process(s),u.process(s),l.process(s),c.process(s),h.process(s),d.process(s),f.process(s),m.process(s),s.isProcessing=false,t&&e&&(i=false,r(_));},x=()=>{t=true,i=true,s.isProcessing||r(_);};return {schedule:Kp.reduce((v,S)=>{let C=o[S];return v[S]=(A,M=false,D=false)=>(t||x(),C.schedule(A,M,D)),v},{}),cancel:v=>{for(let S=0;S<Kp.length;S++)o[Kp[S]].cancel(v);},state:s,steps:o}}var{schedule:cr,cancel:Th,state:Uu}=q0(typeof requestAnimationFrame<"u"?requestAnimationFrame:zr,true);var K0;function PN(){K0=void 0;}var zt={now:()=>(K0===void 0&&zt.set(Uu.isProcessing||lr.useManualTiming?Uu.timestamp:performance.now()),K0),set:r=>{K0=r,queueMicrotask(PN);}};var kO=r=>e=>typeof e=="string"&&e.startsWith(r),Zp=kO("--"),MN=kO("var(--"),Lu=r=>MN(r)?RN.test(r.split("/*")[0].trim()):false,RN=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var xs={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},Xs={...xs,transform:r=>Mr(0,1,r)},Qp={...xs,default:1};var bo=r=>Math.round(r*1e5)/1e5;var Eh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function OO(r){return r==null}var FO=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Ah=(r,e)=>t=>!!(typeof t=="string"&&FO.test(t)&&t.startsWith(r)||e&&!OO(t)&&Object.prototype.hasOwnProperty.call(t,e)),Z0=(r,e,t)=>i=>{if(typeof i!="string")return i;let[s,n,o,a]=i.match(Eh);return {[r]:parseFloat(s),[e]:parseFloat(n),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var BN=r=>Mr(0,255,r),hP={...xs,transform:r=>Math.round(BN(r))},_s={test:Ah("rgb","red"),parse:Z0("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:i=1})=>"rgba("+hP.transform(r)+", "+hP.transform(e)+", "+hP.transform(t)+", "+bo(Xs.transform(i))+")"};function IN(r){let e="",t="",i="",s="";return r.length>5?(e=r.substring(1,3),t=r.substring(3,5),i=r.substring(5,7),s=r.substring(7,9)):(e=r.substring(1,2),t=r.substring(2,3),i=r.substring(3,4),s=r.substring(4,5),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}var Jp={test:Ah("#"),parse:IN,transform:_s.transform};var em=r=>({test:e=>typeof e=="string"&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),Gi=em("deg"),Ys=em("%"),ie=em("px"),dP=em("vh"),fP=em("vw"),Q0={...Ys,parse:r=>Ys.parse(r)/100,transform:r=>Ys.transform(r*100)};var yo={test:Ah("hsl","hue"),parse:Z0("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(r)+", "+Ys.transform(bo(e))+", "+Ys.transform(bo(t))+", "+bo(Xs.transform(i))+")"};var lt={test:r=>_s.test(r)||Jp.test(r)||yo.test(r),parse:r=>_s.test(r)?_s.parse(r):yo.test(r)?yo.parse(r):Jp.parse(r),transform:r=>typeof r=="string"?r:r.hasOwnProperty("red")?_s.transform(r):yo.transform(r),getAnimatableNone:r=>{let e=lt.parse(r);return e.alpha=0,lt.transform(e)}};var GO=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function DN(r){return isNaN(r)&&typeof r=="string"&&(r.match(Eh)?.length||0)+(r.match(GO)?.length||0)>0}var LO="number",NO="color",kN="var",ON="var(",UO="${}",FN=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vo(r){let e=r.toString(),t=[],i={color:[],number:[],var:[]},s=[],n=0,a=e.replace(FN,u=>(lt.test(u)?(i.color.push(n),s.push(NO),t.push(lt.parse(u))):u.startsWith(ON)?(i.var.push(n),s.push(kN),t.push(u)):(i.number.push(n),s.push(LO),t.push(parseFloat(u))),++n,UO)).split(UO);return {values:t,split:a,indexes:i,types:s}}function VO(r){return vo(r).values}function HO(r){let{split:e,types:t}=vo(r),i=e.length;return s=>{let n="";for(let o=0;o<i;o++)if(n+=e[o],s[o]!==void 0){let a=t[o];a===LO?n+=bo(s[o]):a===NO?n+=lt.transform(s[o]):n+=s[o];}return n}}var GN=r=>typeof r=="number"?0:lt.test(r)?lt.getAnimatableNone(r):r;function UN(r){let e=VO(r);return HO(r)(e.map(GN))}var Wr={test:DN,parse:VO,createTransformer:HO,getAnimatableNone:UN};function pP(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function zO({hue:r,saturation:e,lightness:t,alpha:i}){r/=360,e/=100,t/=100;let s=0,n=0,o=0;if(!e)s=n=o=t;else {let a=t<.5?t*(1+e):t+e-t*e,u=2*t-a;s=pP(u,a,r+1/3),n=pP(u,a,r),o=pP(u,a,r-1/3);}return {red:Math.round(s*255),green:Math.round(n*255),blue:Math.round(o*255),alpha:i}}function Ch(r,e){return t=>t>0?e:r}var Ui=(r,e,t)=>r+(e-r)*t;var mP=(r,e,t)=>{let i=r*r,s=t*(e*e-i)+i;return s<0?0:Math.sqrt(s)},LN=[Jp,_s,yo],NN=r=>LN.find(e=>e.test(r));function WO(r){let e=NN(r);if(gs(!!e,`'${r}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return false;let t=e.parse(r);return e===yo&&(t=zO(t)),t}var gP=(r,e)=>{let t=WO(r),i=WO(e);if(!t||!i)return Ch(r,e);let s={...t};return n=>(s.red=mP(t.red,i.red,n),s.green=mP(t.green,i.green,n),s.blue=mP(t.blue,i.blue,n),s.alpha=Ui(t.alpha,i.alpha,n),_s.transform(s))};var J0=new Set(["none","hidden"]);function XO(r,e){return J0.has(r)?t=>t<=0?r:e:t=>t>=1?e:r}function VN(r,e){return t=>Ui(r,e,t)}function ev(r){return typeof r=="number"?VN:typeof r=="string"?Lu(r)?Ch:lt.test(r)?gP:WN:Array.isArray(r)?YO:typeof r=="object"?lt.test(r)?gP:HN:Ch}function YO(r,e){let t=[...r],i=t.length,s=r.map((n,o)=>ev(n)(n,e[o]));return n=>{for(let o=0;o<i;o++)t[o]=s[o](n);return t}}function HN(r,e){let t={...r,...e},i={};for(let s in t)r[s]!==void 0&&e[s]!==void 0&&(i[s]=ev(r[s])(r[s],e[s]));return s=>{for(let n in i)t[n]=i[n](s);return t}}function zN(r,e){let t=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let n=e.types[s],o=r.indexes[n][i[n]],a=r.values[o]??0;t[s]=a,i[n]++;}return t}var WN=(r,e)=>{let t=Wr.createTransformer(e),i=vo(r),s=vo(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?J0.has(r)&&!s.values.length||J0.has(e)&&!i.values.length?XO(r,e):Ou(YO(zN(i,s),s.values),t):(gs(true,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ch(r,e))};function tv(r,e,t){return typeof r=="number"&&typeof e=="number"&&typeof t=="number"?Ui(r,e,t):ev(r)(r,e)}var jO=r=>{let e=({timestamp:t})=>r(t);return {start:(t=true)=>cr.update(e,t),stop:()=>Th(e),now:()=>Uu.isProcessing?Uu.timestamp:zt.now()}};var rv=(r,e,t=10)=>{let i="",s=Math.max(Math.round(e/t),2);for(let n=0;n<s;n++)i+=Math.round(r(n/(s-1))*1e4)/1e4+", ";return `linear(${i.substring(0,i.length-2)})`};function wh(r){let e=0,t=50,i=r.next(e);for(;!i.done&&e<2e4;)e+=t,i=r.next(e);return e>=2e4?1/0:e}function tm(r,e=100,t){let i=t({...r,keyframes:[0,e]}),s=Math.min(wh(i),2e4);return {type:"keyframes",ease:n=>i.next(s*n).value/e,duration:xr(s)}}var XN=5;function iv(r,e,t){let i=Math.max(e-XN,0);return Np(t-r(i),e-i)}var et={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var _P=.001;function $O({duration:r=et.duration,bounce:e=et.bounce,velocity:t=et.velocity,mass:i=et.mass}){let s,n;gs(r<=Dt(et.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=Mr(et.minDamping,et.maxDamping,o),r=Mr(et.minDuration,et.maxDuration,xr(r)),o<1?(s=l=>{let c=l*o,h=c*r,d=c-t,f=sv(l,o),m=Math.exp(-h);return _P-d/f*m},n=l=>{let h=l*o*r,d=h*t+t,f=Math.pow(o,2)*Math.pow(l,2)*r,m=Math.exp(-h),_=sv(Math.pow(l,2),o);return (-s(l)+_P>0?-1:1)*((d-f)*m)/_}):(s=l=>{let c=Math.exp(-l*r),h=(l-t)*r+1;return -_P+c*h},n=l=>{let c=Math.exp(-l*r),h=(t-l)*(r*r);return c*h});let a=5/r,u=jN(s,n,a);if(r=Dt(r),isNaN(u))return {stiffness:et.stiffness,damping:et.damping,duration:r};{let l=Math.pow(u,2)*i;return {stiffness:l,damping:o*2*Math.sqrt(i*l),duration:r}}}var YN=12;function jN(r,e,t){let i=t;for(let s=1;s<YN;s++)i=i-r(i)/e(i);return i}function sv(r,e){return r*Math.sqrt(1-e*e)}var $N=["duration","bounce"],qN=["stiffness","damping","mass"];function qO(r,e){return e.some(t=>r[t]!==void 0)}function KN(r){let e={velocity:et.velocity,stiffness:et.stiffness,damping:et.damping,mass:et.mass,isResolvedFromDuration:false,...r};if(!qO(r,qN)&&qO(r,$N))if(r.visualDuration){let t=r.visualDuration,i=2*Math.PI/(t*1.2),s=i*i,n=2*Mr(.05,1,1-(r.bounce||0))*Math.sqrt(s);e={...e,mass:et.mass,stiffness:s,damping:n};}else {let t=$O(r);e={...e,...t,mass:et.mass},e.isResolvedFromDuration=true;}return e}function js(r=et.visualDuration,e=et.bounce){let t=typeof r!="object"?{visualDuration:r,keyframes:[0,1],bounce:e}:r,{restSpeed:i,restDelta:s}=t,n=t.keyframes[0],o=t.keyframes[t.keyframes.length-1],a={done:false,value:n},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=KN({...t,velocity:-xr(t.velocity||0)}),m=d||0,_=l/(2*Math.sqrt(u*c)),x=o-n,g=xr(Math.sqrt(u/c)),y=Math.abs(x)<5;i||(i=y?et.restSpeed.granular:et.restSpeed.default),s||(s=y?et.restDelta.granular:et.restDelta.default);let v;if(_<1){let C=sv(g,_);v=A=>{let M=Math.exp(-_*g*A);return o-M*((m+_*g*x)/C*Math.sin(C*A)+x*Math.cos(C*A))};}else if(_===1)v=C=>o-Math.exp(-g*C)*(x+(m+g*x)*C);else {let C=g*Math.sqrt(_*_-1);v=A=>{let M=Math.exp(-_*g*A),D=Math.min(C*A,300);return o-M*((m+_*g*x)*Math.sinh(D)+C*x*Math.cosh(D))/C};}let S={calculatedDuration:f&&h||null,next:C=>{let A=v(C);if(f)a.done=C>=h;else {let M=C===0?m:0;_<1&&(M=C===0?Dt(m):iv(v,C,A));let D=Math.abs(M)<=i,R=Math.abs(o-A)<=s;a.done=D&&R;}return a.value=a.done?o:A,a},toString:()=>{let C=Math.min(wh(S),2e4),A=rv(M=>S.next(C*M).value,C,30);return C+"ms "+A},toTransition:()=>{}};return S}js.applyToOptions=r=>{let e=tm(r,100,js);return r.ease=e.ease,r.duration=Dt(e.duration),r.type="keyframes",r};function rm({keyframes:r,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:n=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){let h=r[0],d={done:false,value:h},f=D=>a!==void 0&&D<a||u!==void 0&&D>u,m=D=>a===void 0?u:u===void 0||Math.abs(a-D)<Math.abs(u-D)?a:u,_=t*e,x=h+_,g=o===void 0?x:o(x);g!==x&&(_=g-h);let y=D=>-_*Math.exp(-D/i),v=D=>g+y(D),S=D=>{let R=y(D),L=v(D);d.done=Math.abs(R)<=l,d.value=d.done?g:L;},C,A,M=D=>{f(d.value)&&(C=D,A=js({keyframes:[d.value,m(d.value)],velocity:iv(v,D,d.value),damping:s,stiffness:n,restDelta:l,restSpeed:c}));};return M(0),{calculatedDuration:null,next:D=>{let R=false;return !A&&C===void 0&&(R=true,S(D),M(D)),C!==void 0&&D>=C?A.next(D-C):(!R&&S(D),d)}}}function ZN(r,e,t){let i=[],s=t||lr.mix||tv,n=r.length-1;for(let o=0;o<n;o++){let a=s(r[o],r[o+1]);if(e){let u=Array.isArray(e)?e[o]||zr:e;a=Ou(u,a);}i.push(a);}return i}function KO(r,e,{clamp:t=true,ease:i,mixer:s}={}){let n=r.length;if(Ht(n===e.length,"Both input and output ranges must be the same length","range-length"),n===1)return ()=>e[0];if(n===2&&e[0]===e[1])return ()=>e[1];let o=r[0]===r[1];r[0]>r[n-1]&&(r=[...r].reverse(),e=[...e].reverse());let a=ZN(e,i,s),u=a.length,l=c=>{if(o&&c<r[0])return e[0];let h=0;if(u>1)for(;h<r.length-2&&!(c<r[h+1]);h++);let d=Fu(r[h],r[h+1],c);return a[h](d)};return t?c=>l(Mr(r[0],r[n-1],c)):l}function im(r,e){let t=r[r.length-1];for(let i=1;i<=e;i++){let s=Fu(0,e,i);r.push(Ui(t,1,s));}}function sm(r){let e=[0];return im(e,r.length-1),e}function ZO(r,e){return r.map(t=>t*e)}function QN(r,e){return r.map(()=>e||Yp).splice(0,r.length-1)}function To({duration:r=300,keyframes:e,times:t,ease:i="easeInOut"}){let s=jp(i)?i.map($0):$0(i),n={done:false,value:e[0]},o=ZO(t&&t.length===e.length?t:sm(e),r),a=KO(o,e,{ease:Array.isArray(s)?s:QN(e,s)});return {calculatedDuration:r,next:u=>(n.value=a(u),n.done=u>=r,n)}}var JN=r=>r!==null;function Ph(r,{repeat:e,repeatType:t="loop"},i,s=1){let n=r.filter(JN),a=s<0||e&&t!=="loop"&&e%2===1?0:n.length-1;return !a||i===void 0?n[a]:i}var e5={decay:rm,inertia:rm,tween:To,keyframes:To,spring:js};function nv(r){typeof r.type=="string"&&(r.type=e5[r.type]);}var So=class{constructor(){this.updateFinished();}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e;});}notifyFinished(){this.resolve();}then(e,t){return this.finished.then(e,t)}};var t5=r=>r/100,$s=class extends So{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=false,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==zt.now()&&this.tick(zt.now()),this.isStopped=true,this.state!=="idle"&&(this.teardown(),this.options.onStop?.());},this.options=e,this.initAnimation(),this.play(),e.autoplay===false&&this.pause();}initAnimation(){let{options:e}=this;nv(e);let{type:t=To,repeat:i=0,repeatDelay:s=0,repeatType:n,velocity:o=0}=e,{keyframes:a}=e,u=t||To;process.env.NODE_ENV!=="production"&&u!==To&&Ht(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),u!==To&&typeof a[0]!="number"&&(this.mixKeyframes=Ou(t5,tv(a[0],a[1])),a=[0,100]);let l=u({...e,keyframes:a});n==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=wh(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=l;}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t;}tick(e,t=false){let{generator:i,totalDuration:s,mixKeyframes:n,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return i.next(0);let{delay:l=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:f,type:m,onUpdate:_,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,S=i;if(h){let D=Math.min(this.currentTime,s)/a,R=Math.floor(D),L=D%1;!L&&D>=1&&(L=1),L===1&&R--,R=Math.min(R,h+1),!!(R%2)&&(d==="reverse"?(L=1-L,f&&(L-=f/a)):d==="mirror"&&(S=o)),v=Mr(0,1,L)*a;}let C=y?{done:false,value:c[0]}:S.next(v);n&&(C.value=n(C.value));let{done:A}=C;!y&&u!==null&&(A=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);let M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return M&&m!==rm&&(C.value=Ph(c,this.options,x,this.speed)),_&&_(C.value),M&&this.finish(),C}then(e,t){return this.finished.then(e,t)}get duration(){return xr(this.calculatedDuration)}get time(){return xr(this.currentTime)}set time(e){e=Dt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(false);}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(zt.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=xr(this.currentTime));}play(){if(this.isStopped)return;let{driver:e=jO,startTime:t}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),this.options.onPlay?.();let i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=t??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start();}pause(){this.state="paused",this.updateTime(zt.now()),this.holdTime=this.currentTime;}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null;}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.();}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.();}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null;}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0);}sample(e){return this.startTime=0,this.tick(e,true)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function QO(r){for(let e=1;e<r.length;e++)r[e]??(r[e]=r[e-1]);}var Nu=r=>r*180/Math.PI,bP=r=>{let e=Nu(Math.atan2(r[1],r[0]));return yP(e)},r5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:r=>(Math.abs(r[0])+Math.abs(r[3]))/2,rotate:bP,rotateZ:bP,skewX:r=>Nu(Math.atan(r[1])),skewY:r=>Nu(Math.atan(r[2])),skew:r=>(Math.abs(r[1])+Math.abs(r[2]))/2},yP=r=>(r=r%360,r<0&&(r+=360),r),JO=bP,eF=r=>Math.sqrt(r[0]*r[0]+r[1]*r[1]),tF=r=>Math.sqrt(r[4]*r[4]+r[5]*r[5]),i5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:eF,scaleY:tF,scale:r=>(eF(r)+tF(r))/2,rotateX:r=>yP(Nu(Math.atan2(r[6],r[5]))),rotateY:r=>yP(Nu(Math.atan2(-r[2],r[0]))),rotateZ:JO,rotate:JO,skewX:r=>Nu(Math.atan(r[4])),skewY:r=>Nu(Math.atan(r[1])),skew:r=>(Math.abs(r[1])+Math.abs(r[4]))/2};function nm(r){return r.includes("scale")?1:0}function om(r,e){if(!r||r==="none")return nm(e);let t=r.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),i,s;if(t)i=i5,s=t;else {let a=r.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=r5,s=a;}if(!s)return nm(e);let n=i[e],o=s[1].split(",").map(s5);return typeof n=="function"?n(o):o[n]}var vP=(r,e)=>{let{transform:t="none"}=getComputedStyle(r);return om(t,e)};function s5(r){return parseFloat(r.trim())}var Li=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xr=new Set(Li);var TP=r=>r===xs||r===ie,n5=new Set(["x","y","z"]),o5=Li.filter(r=>!n5.has(r));function rF(r){let e=[];return o5.forEach(t=>{let i=r.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0));}),e}var Eo={width:({x:r},{paddingLeft:e="0",paddingRight:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),height:({y:r},{paddingTop:e="0",paddingBottom:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),top:(r,{top:e})=>parseFloat(e),left:(r,{left:e})=>parseFloat(e),bottom:({y:r},{top:e})=>parseFloat(e)+(r.max-r.min),right:({x:r},{left:e})=>parseFloat(e)+(r.max-r.min),x:(r,{transform:e})=>om(e,"x"),y:(r,{transform:e})=>om(e,"y")};Eo.translateX=Eo.x;Eo.translateY=Eo.y;var Vu=new Set,SP=false,EP=false,AP=false;function iF(){if(EP){let r=Array.from(Vu).filter(i=>i.needsMeasurement),e=new Set(r.map(i=>i.element)),t=new Map;e.forEach(i=>{let s=rF(i);s.length&&(t.set(i,s),i.render());}),r.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();let s=t.get(i);s&&s.forEach(([n,o])=>{i.getValue(n)?.set(o);});}),r.forEach(i=>i.measureEndState()),r.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY);});}EP=false,SP=false,Vu.forEach(r=>r.complete(AP)),Vu.clear();}function sF(){Vu.forEach(r=>{r.readKeyframes(),r.needsMeasurement&&(EP=true);});}function CP(){AP=true,sF(),iF(),AP=false;}var qs=class{constructor(e,t,i,s,n,o=false){this.state="pending",this.isAsync=false,this.needsMeasurement=false,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=s,this.element=n,this.isAsync=o;}scheduleResolve(){this.state="scheduled",this.isAsync?(Vu.add(this),SP||(SP=true,cr.read(sF),cr.resolveKeyframes(iF))):(this.readKeyframes(),this.complete());}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:i,motionValue:s}=this;if(e[0]===null){let n=s?.get(),o=e[e.length-1];if(n!==void 0)e[0]=n;else if(i&&t){let a=i.readValue(t,o);a!=null&&(e[0]=a);}e[0]===void 0&&(e[0]=o),s&&n===void 0&&s.set(e[0]);}QO(e);}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=false){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vu.delete(this);}cancel(){this.state==="scheduled"&&(Vu.delete(this),this.state="pending");}resume(){this.state==="pending"&&this.scheduleResolve();}};var nF=r=>r.startsWith("--");function oF(r,e,t){nF(e)?r.style.setProperty(e,t):r.style[e]=t;}var aF=ku(()=>window.ScrollTimeline!==void 0);var uF={};function lF(r,e){let t=ku(r);return ()=>uF[e]??t()}var ov=lF(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"});}catch{return false}return true},"linearEasing");var Hu=([r,e,t,i])=>`cubic-bezier(${r}, ${e}, ${t}, ${i})`;var wP={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hu([0,.65,.55,1]),circOut:Hu([.55,0,1,.45]),backIn:Hu([.31,.01,.66,-0.59]),backOut:Hu([.33,1.53,.69,.99])};function PP(r,e){if(r)return typeof r=="function"?ov()?rv(r,e):"ease-out":qp(r)?Hu(r):Array.isArray(r)?r.map(t=>PP(t,e)||wP.easeOut):wP[r]}function cF(r,e,t,{delay:i=0,duration:s=300,repeat:n=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){let c={[e]:t};u&&(c.offset=u);let h=PP(a,s);Array.isArray(h)&&(c.easing=h);let d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:n+1,direction:o==="reverse"?"alternate":"normal"};l&&(d.pseudoElement=l);let f=r.animate(c,d);return f}function zu(r){return typeof r=="function"&&"applyToOptions"in r}function hF({type:r,...e}){return zu(r)&&ov()?r.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}var av=class extends So{constructor(e){if(super(),this.finishedTime=null,this.isStopped=false,!e)return;let{element:t,name:i,keyframes:s,pseudoElement:n,allowFlatten:o=false,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!n,this.allowFlatten=o,this.options=e,Ht(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let l=hF(e);this.animation=cF(t,i,s,l,n),l.autoplay===false&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){let c=Ph(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):oF(t,i,c),this.animation.cancel();}u?.(),this.notifyFinished();};}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished());}pause(){this.animation.pause();}complete(){this.animation.finish?.();}cancel(){try{this.animation.cancel();}catch{}}stop(){if(this.isStopped)return;this.isStopped=true;let{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel());}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.();}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return xr(Number(e))}get time(){return xr(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Dt(e);}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e;}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e;}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&aF()?(this.animation.timeline=e,zr):t(this)}};var dF={anticipate:zp,backInOut:Hp,circInOut:Xp};function a5(r){return r in dF}function fF(r){typeof r.ease=="string"&&a5(r.ease)&&(r.ease=dF[r.ease]);}var pF=10,uv=class extends av{constructor(e){fF(e),nv(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e;}updateMotionValue(e){let{motionValue:t,onUpdate:i,onComplete:s,element:n,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let a=new $s({...o,autoplay:false}),u=Dt(this.finishedTime??this.time);t.setWithVelocity(a.sample(u-pF).value,a.sample(u).value,pF),a.stop();}};var MP=(r,e)=>e==="zIndex"?false:!!(typeof r=="number"||Array.isArray(r)||typeof r=="string"&&(Wr.test(r)||r==="0")&&!r.startsWith("url("));function u5(r){let e=r[0];if(r.length===1)return true;for(let t=0;t<r.length;t++)if(r[t]!==e)return true}function mF(r,e,t,i){let s=r[0];if(s===null)return false;if(e==="display"||e==="visibility")return true;let n=r[r.length-1],o=MP(s,e),a=MP(n,e);return gs(o===a,`You are trying to animate ${e} from "${s}" to "${n}". "${o?n:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?false:u5(r)||(t==="spring"||zu(t))&&i}function Mh(r){r.duration=0,r.type;}var l5=new Set(["opacity","clipPath","filter","transform"]),c5=ku(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function gF(r){let{motionValue:e,name:t,repeatDelay:i,repeatType:s,damping:n,type:o}=r;if(!(e?.owner?.current instanceof HTMLElement))return false;let{onUpdate:u,transformTemplate:l}=e.owner.getProps();return c5()&&t&&l5.has(t)&&(t!=="transform"||!l)&&!u&&!i&&s!=="mirror"&&n!==0&&o!=="inertia"}var h5=40,am=class extends So{constructor({autoplay:e=true,delay:t=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel();},this.createdAt=zt.now();let d={autoplay:e,delay:t,type:i,repeat:s,repeatDelay:n,repeatType:o,name:u,motionValue:l,element:c,...h},f=c?.KeyframeResolver||qs;this.keyframeResolver=new f(a,(m,_,x)=>this.onKeyframesResolved(m,_,d,!x),u,l,c),this.keyframeResolver?.scheduleResolve();}onKeyframesResolved(e,t,i,s){this.keyframeResolver=void 0;let{name:n,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=i;this.resolvedAt=zt.now(),mF(e,n,o,a)||((lr.instantAnimations||!u)&&c?.(Ph(e,i,t)),e[0]=e[e.length-1],Mh(i),i.repeat=0);let d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>h5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...i,keyframes:e},f=!l&&gF(d)?new uv({...d,element:d.motionValue.owner.current}):new $s(d);f.finished.then(()=>this.notifyFinished()).catch(zr),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f;}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),CP()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e;}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e;}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play();}pause(){this.animation.pause();}complete(){this.animation.complete();}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel();}};var lv=class{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean);}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t;}attachTimeline(e){let t=this.animations.map(i=>i.attachTimeline(e));return ()=>{t.forEach((i,s)=>{i&&i(),this.animations[s].stop();});}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e);}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e);}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]());}play(){this.runAll("play");}pause(){this.runAll("pause");}cancel(){this.runAll("cancel");}complete(){this.runAll("complete");}};var um=class extends lv{then(e,t){return this.finished.finally(e).then(()=>{})}};var d5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function f5(r){let e=d5.exec(r);if(!e)return [,];let[,t,i,s]=e;return [`--${t??i}`,s]}var p5=4;function RP(r,e,t=1){Ht(t<=p5,`Max CSS variable fallback depth detected in property "${r}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[i,s]=f5(r);if(!i)return;let n=window.getComputedStyle(e).getPropertyValue(i);if(n){let o=n.trim();return Up(o)?parseFloat(o):o}return Lu(s)?RP(s,e,t+1):s}function lm(r,e){return r?.[e]??r?.default??r}var cm=new Set(["width","height","top","left","right","bottom",...Li]);var xF={test:r=>r==="auto",parse:r=>r};var cv=r=>e=>e.test(r);var BP=[xs,ie,Ys,Gi,fP,dP,xF],IP=r=>BP.find(cv(r));function _F(r){return typeof r=="number"?r===0:r!==null?r==="none"||r==="0"||Lp(r):true}var m5=new Set(["brightness","contrast","saturate","opacity"]);function g5(r){let[e,t]=r.slice(0,-1).split("(");if(e==="drop-shadow")return r;let[i]=t.match(Eh)||[];if(!i)return r;let s=t.replace(i,""),n=m5.has(e)?1:0;return i!==t&&(n*=100),e+"("+n+s+")"}var x5=/\b([a-z-]*)\(.*?\)/gu,hm={...Wr,getAnimatableNone:r=>{let e=r.match(x5);return e?e.map(g5).join(" "):r}};var DP={...xs,transform:Math.round};var bF={rotate:Gi,rotateX:Gi,rotateY:Gi,rotateZ:Gi,scale:Qp,scaleX:Qp,scaleY:Qp,scaleZ:Qp,skew:Gi,skewX:Gi,skewY:Gi,distance:ie,translateX:ie,translateY:ie,translateZ:ie,x:ie,y:ie,z:ie,perspective:ie,transformPerspective:ie,opacity:Xs,originX:Q0,originY:Q0,originZ:ie};var Wu={borderWidth:ie,borderTopWidth:ie,borderRightWidth:ie,borderBottomWidth:ie,borderLeftWidth:ie,borderRadius:ie,radius:ie,borderTopLeftRadius:ie,borderTopRightRadius:ie,borderBottomRightRadius:ie,borderBottomLeftRadius:ie,width:ie,maxWidth:ie,height:ie,maxHeight:ie,top:ie,right:ie,bottom:ie,left:ie,padding:ie,paddingTop:ie,paddingRight:ie,paddingBottom:ie,paddingLeft:ie,margin:ie,marginTop:ie,marginRight:ie,marginBottom:ie,marginLeft:ie,backgroundPositionX:ie,backgroundPositionY:ie,...bF,zIndex:DP,fillOpacity:Xs,strokeOpacity:Xs,numOctaves:DP};var yF={...Wu,color:lt,backgroundColor:lt,outlineColor:lt,fill:lt,stroke:lt,borderColor:lt,borderTopColor:lt,borderRightColor:lt,borderBottomColor:lt,borderLeftColor:lt,filter:hm,WebkitFilter:hm},dm=r=>yF[r];function fm(r,e){let t=dm(r);return t!==hm&&(t=Wr),t.getAnimatableNone?t.getAnimatableNone(e):void 0}var _5=new Set(["auto","none","0"]);function vF(r,e,t){let i=0,s;for(;i<r.length&&!s;){let n=r[i];typeof n=="string"&&!_5.has(n)&&vo(n).values.length&&(s=r[i]),i++;}if(s&&t)for(let n of e)r[n]=fm(t,s);}var pm=class extends qs{constructor(e,t,i,s,n){super(e,t,i,s,n,true);}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let l=e[u];if(typeof l=="string"&&(l=l.trim(),Lu(l))){let c=RP(l,t.current);c!==void 0&&(e[u]=c),u===e.length-1&&(this.finalKeyframe=l);}}if(this.resolveNoneKeyframes(),!cm.has(i)||e.length!==2)return;let[s,n]=e,o=IP(s),a=IP(n);if(o!==a)if(TP(o)&&TP(a))for(let u=0;u<e.length;u++){let l=e[u];typeof l=="string"&&(e[u]=parseFloat(l));}else Eo[i]&&(this.needsMeasurement=true);}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||_F(e[s]))&&i.push(s);i.length&&vF(e,i,t);}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Eo[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let s=t[t.length-1];s!==void 0&&e.getValue(i,s).jump(s,false);}measureEndState(){let{element:e,name:t,unresolvedKeyframes:i}=this;if(!e||!e.current)return;let s=e.getValue(t);s&&s.jump(this.measuredOrigin,false);let n=i.length-1,o=i[n];i[n]=Eo[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u);}),this.resolveNoneKeyframes();}};function kP(r,e,t){if(r instanceof EventTarget)return [r];if(typeof r=="string"){let i=document;let s=t?.[r]??i.querySelectorAll(r);return s?Array.from(s):[]}return Array.from(r)}var mm=(r,e)=>e&&typeof r=="number"?e.transform(r):r;var TF=30,b5=r=>!isNaN(parseFloat(r)),hv=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{let s=zt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let n of this.dependents)n.dirty();},this.hasAnimated=false,this.setCurrent(e),this.owner=t.owner;}setCurrent(e){this.current=e,this.updatedAt=zt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=b5(this.current));}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt;}onChange(e){return process.env.NODE_ENV!=="production"&&Vp(false,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Gu);let i=this.events[e].add(t);return e==="change"?()=>{i(),cr.read(()=>{this.events.change.getSize()||this.stop();});}:i}clearListeners(){for(let e in this.events)this.events[e].clear();}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t;}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e);}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i;}jump(e,t=true){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}dirty(){this.events.change?.notify(this.current);}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e);}removeDependent(e){this.dependents&&this.dependents.delete(e);}get(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=zt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>TF)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,TF);return Np(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=true,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify();}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation();})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation();}isAnimating(){return !!this.animation}clearAnimation(){delete this.animation;}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}};function bs(r,e){return new hv(r,e)}var{schedule:FP}=q0(queueMicrotask,false);function gm(r){return aP(r)&&"ownerSVGElement"in r}function GP(r){return gm(r)&&r.tagName==="svg"}var tt=r=>!!(r&&r.getVelocity);var v5=[...BP,lt,Wr],UP=r=>v5.find(cv(r));function xm(r){return typeof r=="object"&&!Array.isArray(r)}function dv(r,e,t,i){return typeof r=="string"&&xm(e)?kP(r,t,i):r instanceof NodeList?Array.from(r):Array.isArray(r)?r:[r]}function SF(r,e,t){return r*(e+1)}function LP(r,e,t,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,r+parseFloat(e)):e==="<"?t:e.startsWith("<")?Math.max(0,t+parseFloat(e.slice(1))):i.get(e)??r}function T5(r,e,t){for(let i=0;i<r.length;i++){let s=r[i];s.at>e&&s.at<t&&(Du(r,s),i--);}}function EF(r,e,t,i,s,n){T5(r,s,n);for(let o=0;o<e.length;o++)r.push({value:e[o],at:Ui(s,n,i[o]),easing:$p(t,o)});}function AF(r,e){for(let t=0;t<r.length;t++)r[t]=r[t]/(e+1);}function CF(r,e){return r.at===e.at?r.value===null?1:e.value===null?-1:0:r.at-e.at}var S5="easeInOut",E5=20;function MF(r,{defaultTransition:e={},...t}={},i,s){let n=e.duration||.3,o=new Map,a=new Map,u={},l=new Map,c=0,h=0,d=0;for(let f=0;f<r.length;f++){let m=r[f];if(typeof m=="string"){l.set(m,h);continue}else if(!Array.isArray(m)){l.set(m.name,LP(h,m.at,c,l));continue}let[_,x,g={}]=m;g.at!==void 0&&(h=LP(h,g.at,c,l));let y=0,v=(S,C,A,M=0,D=0)=>{let R=A5(S),{delay:L=0,times:F=sm(R),type:se="keyframes",repeat:ye,repeatType:ft,repeatDelay:ys=0,...X}=C,{ease:q=e.ease||"easeOut",duration:Rr}=C,Le=typeof L=="function"?L(M,D):L,di=R.length,Zs=zu(se)?se:s?.[se||"keyframes"];if(di<=2&&Zs){let Vi=100;if(di===2&&P5(R)){let en=R[1]-R[0];Vi=Math.abs(en);}let Hi={...X};Rr!==void 0&&(Hi.duration=Dt(Rr));let Mo=tm(Hi,Vi,Zs);q=Mo.ease,Rr=Mo.duration;}Rr??(Rr=n);let Qs=h+Le;F.length===1&&F[0]===0&&(F[1]=1);let Js=F.length-R.length;if(Js>0&&im(F,Js),R.length===1&&R.unshift(null),ye){Ht(ye<E5,"Repeat count too high, must be less than 20","repeat-count-high"),Rr=SF(Rr,ye);let Vi=[...R],Hi=[...F];q=Array.isArray(q)?[...q]:[q];let Mo=[...q];for(let en=0;en<ye;en++){R.push(...Vi);for(let zi=0;zi<Vi.length;zi++)F.push(Hi[zi]+(en+1)),q.push(zi===0?"linear":$p(Mo,zi-1));}AF(F,ye);}let Oh=Qs+Rr;EF(A,R,q,F,Qs,Oh),y=Math.max(Le+Rr,y),d=Math.max(Oh,d);};if(tt(_)){let S=wF(_,a);v(x,g,PF("default",S));}else {let S=dv(_,x,i,u),C=S.length;for(let A=0;A<C;A++){x=x,g=g;let M=S[A],D=wF(M,a);for(let R in x)v(x[R],C5(g,R),PF(R,D),A,C);}}c=h,h+=y;}return a.forEach((f,m)=>{for(let _ in f){let x=f[_];x.sort(CF);let g=[],y=[],v=[];for(let C=0;C<x.length;C++){let{at:A,value:M,easing:D}=x[C];g.push(M),y.push(Fu(0,d,A)),v.push(D||"easeOut");}y[0]!==0&&(y.unshift(0),g.unshift(g[0]),v.unshift(S5)),y[y.length-1]!==1&&(y.push(1),g.push(null)),o.has(m)||o.set(m,{keyframes:{},transition:{}});let S=o.get(m);S.keyframes[_]=g,S.transition[_]={...e,duration:d,ease:v,times:y,...t};}}),o}function wF(r,e){return !e.has(r)&&e.set(r,{}),e.get(r)}function PF(r,e){return e[r]||(e[r]=[]),e[r]}function A5(r){return Array.isArray(r)?r:[r]}function C5(r,e){return r&&r[e]?{...r,...r[e]}:{...r}}var w5=r=>typeof r=="number",P5=r=>r.every(w5);var Ao=new WeakMap;var RF=r=>Array.isArray(r);function BF(r){let e=[{},{}];return r?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity();}),e}function fv(r,e,t,i){if(typeof e=="function"){let[s,n]=BF(i);e=e(t!==void 0?t:r.custom,s,n);}if(typeof e=="string"&&(e=r.variants&&r.variants[e]),typeof e=="function"){let[s,n]=BF(i);e=e(t!==void 0?t:r.custom,s,n);}return e}function IF(r,e,t){let i=r.getProps();return fv(i,e,i.custom,r)}function M5(r,e,t){r.hasValue(e)?r.getValue(e).set(t):r.addValue(e,bs(t));}function R5(r){return RF(r)?r[r.length-1]||0:r}function DF(r,e){let t=IF(r,e),{transitionEnd:i={},transition:s={},...n}=t||{};n={...n,...i};for(let o in n){let a=R5(n[o]);M5(r,o,a);}}function kF(r){return !!(tt(r)&&r.add)}function OF(r,e){let t=r.getValue("willChange");if(kF(t))return t.add(e);if(!t&&lr.WillChange){let i=new lr.WillChange("auto");r.addValue("willChange",i),i.add(e);}}var Rh=r=>r.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var B5="framerAppearId",FF="data-"+Rh(B5);function GF(r){return r.props[FF]}var I5=r=>r!==null;function UF(r,{repeat:e,repeatType:t="loop"},i){let s=r.filter(I5),n=e&&t!=="loop"&&e%2===1?0:s.length-1;return !n||i===void 0?s[n]:i}var D5={type:"spring",stiffness:500,damping:25,restSpeed:10},k5=r=>({type:"spring",stiffness:550,damping:r===0?2*Math.sqrt(550):30,restSpeed:10}),O5={type:"keyframes",duration:.8},F5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LF=(r,{keyframes:e})=>e.length>2?O5:Xr.has(r)?r.startsWith("scale")?k5(e[1]):D5:F5;function NF({when:r,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:s,repeat:n,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return !!Object.keys(c).length}var pv=(r,e,t,i={},s,n)=>o=>{let a=lm(i,r)||{},u=a.delay||i.delay||0,{elapsed:l=0}=i;l=l-Dt(u);let c={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d);},onComplete:()=>{o(),a.onComplete&&a.onComplete();},name:r,motionValue:e,element:n?void 0:s};NF(a)||Object.assign(c,LF(r,c)),c.duration&&(c.duration=Dt(c.duration)),c.repeatDelay&&(c.repeatDelay=Dt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=false;if((c.type===false||c.duration===0&&!c.repeatDelay)&&(Mh(c),c.delay===0&&(h=true)),(lr.instantAnimations||lr.skipAnimations)&&(h=true,Mh(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!n&&e.get()!==void 0){let d=UF(c.keyframes,a);if(d!==void 0){cr.update(()=>{c.onUpdate(d),c.onComplete();});return}}return a.isSync?new $s(c):new am(c)};function G5({protectedKeys:r,needsAnimating:e},t){let i=r.hasOwnProperty(t)&&e[t]!==true;return e[t]=false,i}function VF(r,e,{delay:t=0,transitionOverride:i,type:s}={}){let{transition:n=r.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(n=i);let u=[],l=s&&r.animationState&&r.animationState.getState()[s];for(let c in a){let h=r.getValue(c,r.latestValues[c]??null),d=a[c];if(d===void 0||l&&G5(l,c))continue;let f={delay:t,...lm(n||{},c)},m=h.get();if(m!==void 0&&!h.isAnimating&&!Array.isArray(d)&&d===m&&!f.velocity)continue;let _=false;if(window.MotionHandoffAnimation){let g=GF(r);if(g){let y=window.MotionHandoffAnimation(g,c,cr);y!==null&&(f.startTime=y,_=true);}}OF(r,c),h.start(pv(c,h,d,r.shouldReduceMotion&&cm.has(c)?{type:false}:f,r,_));let x=h.animation;x&&u.push(x);}return o&&Promise.all(u).then(()=>{cr.update(()=>{o&&DF(r,o);});}),u}function HF({top:r,left:e,right:t,bottom:i}){return {x:{min:e,max:t},y:{min:r,max:i}}}function zF(r,e){if(!e)return r;let t=e({x:r.left,y:r.top}),i=e({x:r.right,y:r.bottom});return {top:t.y,left:t.x,bottom:i.y,right:i.x}}function WF(r,e){return HF(zF(r.getBoundingClientRect(),e))}var XF={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},mv={};for(let r in XF)mv[r]={isEnabled:e=>XF[r].some(t=>!!e[t])};var YF=()=>({min:0,max:0}),Bh=()=>({x:YF(),y:YF()});var jF=typeof window<"u";var _m={current:null},gv={current:false};function $F(){if(gv.current=true,!!jF)if(window.matchMedia){let r=window.matchMedia("(prefers-reduced-motion)"),e=()=>_m.current=r.matches;r.addEventListener("change",e),e();}else _m.current=false;}function qF(r){return r!==null&&typeof r=="object"&&typeof r.start=="function"}function KF(r){return typeof r=="string"||Array.isArray(r)}var U5=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ZF=["initial",...U5];function NP(r){return qF(r.animate)||ZF.some(e=>KF(r[e]))}function QF(r){return !!(NP(r)||r.variants)}function JF(r,e,t){for(let i in e){let s=e[i],n=t[i];if(tt(s))r.addValue(i,s);else if(tt(n))r.addValue(i,bs(s,{owner:r}));else if(n!==s)if(r.hasValue(i)){let o=r.getValue(i);o.liveStyle===true?o.jump(s):o.hasAnimated||o.set(s);}else {let o=r.getStaticValue(i);r.addValue(i,bs(o!==void 0?o:s,{owner:r}));}}for(let i in t)e[i]===void 0&&r.removeValue(i);return e}var eG=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ih=class{scrapeMotionValuesFromProps(e,t,i){return {}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:n,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=false,this.isControllingVariants=false,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=qs,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection));},this.renderScheduledAt=0,this.scheduleRender=()=>{let d=zt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,cr.render(this.render,false,true));};let{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=t.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!n,this.isControllingVariants=NP(t),this.isVariantNode=QF(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...h}=this.scrapeMotionValuesFromProps(t,{},this);for(let d in h){let f=h[d];u[d]!==void 0&&tt(f)&&f.set(u[d]);}}mount(e){this.current=e,Ao.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),gv.current||$F(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?false:this.reducedMotionConfig==="always"?true:_m.current,process.env.NODE_ENV!=="production"&&Vp(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext);}unmount(){this.projection&&this.projection.unmount(),Th(this.notifyUpdate),Th(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=false);}this.current=null;}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e);}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e);}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let i=Xr.has(e);i&&this.onBindTransform&&this.onBindTransform();let s=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&cr.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=true),this.scheduleRender();}),n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{s(),n&&n(),t.owner&&t.stop();});}sortNodePosition(e){return !this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in mv){let t=mv[e];if(!t)continue;let{isEnabled:i,Feature:s}=t;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){let n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=true);}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props);}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Bh()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t;}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<eG.length;i++){let s=eG[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);let n="on"+s,o=e[n];o&&(this.propEventSubscriptions[s]=this.on(s,o));}this.prevMotionValues=JF(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue();}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get());}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState);}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=bs(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Up(i)||Lp(i))?i=parseFloat(i):!UP(i)&&Wr.test(t)&&(i=fm(e,t)),this.setBaseTarget(e,tt(i)?i.get():i)),tt(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t;}getBaseTarget(e){let{initial:t}=this.props,i;if(typeof t=="string"||typeof t=="object"){let n=fv(this.props,t,this.presenceContext?.custom);n&&(i=n[e]);}if(t&&i!==void 0)return i;let s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!tt(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Gu),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t);}scheduleRenderMicrotask(){FP.render(this.render);}};var Dh=class extends Ih{constructor(){super(...arguments),this.KeyframeResolver=pm;}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e];}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;tt(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`);}));}};var L5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},N5=Li.length;function tG(r,e,t){let i="",s=true;for(let n=0;n<N5;n++){let o=Li[n],a=r[o];if(a===void 0)continue;let u=true;if(typeof a=="number"?u=a===(o.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||t){let l=mm(a,Wu[o]);if(!u){s=false;let c=L5[o]||o;i+=`${c}(${l}) `;}t&&(e[o]=l);}}return i=i.trim(),t?i=t(e,s?"":i):s&&(i="none"),i}function xv(r,e,t){let{style:i,vars:s,transformOrigin:n}=r,o=false,a=false;for(let u in e){let l=e[u];if(Xr.has(u)){o=true;continue}else if(Zp(u)){s[u]=l;continue}else {let c=mm(l,Wu[u]);u.startsWith("origin")?(a=true,n[u]=c):i[u]=c;}}if(e.transform||(o||t?i.transform=tG(e,r.transform,t):i.transform&&(i.transform="none")),a){let{originX:u="50%",originY:l="50%",originZ:c=0}=n;i.transformOrigin=`${u} ${l} ${c}`;}}function _v(r,{style:e,vars:t},i,s){let n=r.style,o;for(o in e)n[o]=e[o];s?.applyProjectionStyles(n,i);for(o in t)n.setProperty(o,t[o]);}var rG={};function iG(r,{layout:e,layoutId:t}){return Xr.has(r)||r.startsWith("origin")||(e||t!==void 0)&&(!!rG[r]||r==="opacity")}function bv(r,e,t){let{style:i}=r,s={};for(let n in i)(tt(i[n])||e.style&&tt(e.style[n])||iG(n,r)||t?.getValue(n)?.liveStyle!==void 0)&&(s[n]=i[n]);return s}function V5(r){return window.getComputedStyle(r)}var yv=class extends Dh{constructor(){super(...arguments),this.type="html",this.renderInstance=_v;}readValueFromInstance(e,t){if(Xr.has(t))return this.projection?.isProjecting?nm(t):vP(e,t);{let i=V5(e),s=(Zp(t)?i.getPropertyValue(t):i[t])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:t}){return WF(e,t)}build(e,t,i){xv(e,t,i.transformTemplate);}scrapeMotionValuesFromProps(e,t,i){return bv(e,t,i)}};function H5(r,e){return r in e}var vv=class extends Ih{constructor(){super(...arguments),this.type="object";}readValueFromInstance(e,t){if(H5(t,e)){let i=e[t];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e];}measureInstanceViewportBox(){return Bh()}build(e,t){Object.assign(e.output,t);}renderInstance(e,{output:t}){Object.assign(e,t);}sortInstanceNodePosition(){return 0}};var z5={offset:"stroke-dashoffset",array:"stroke-dasharray"},W5={offset:"strokeDashoffset",array:"strokeDasharray"};function sG(r,e,t=1,i=0,s=true){r.pathLength=1;let n=s?z5:W5;r[n.offset]=ie.transform(-i);let o=ie.transform(e),a=ie.transform(t);r[n.array]=`${o} ${a}`;}function nG(r,{attrX:e,attrY:t,attrScale:i,pathLength:s,pathSpacing:n=1,pathOffset:o=0,...a},u,l,c){if(xv(r,a,l),u){r.style.viewBox&&(r.attrs.viewBox=r.style.viewBox);return}r.attrs=r.style,r.style={};let{attrs:h,style:d}=r;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),t!==void 0&&(h.y=t),i!==void 0&&(h.scale=i),s!==void 0&&sG(h,s,n,o,false);}var Tv=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);var oG=r=>typeof r=="string"&&r.toLowerCase()==="svg";function aG(r,e,t,i){_v(r,e,void 0,i);for(let s in e.attrs)r.setAttribute(Tv.has(s)?s:Rh(s),e.attrs[s]);}function uG(r,e,t){let i=bv(r,e,t);for(let s in r)if(tt(r[s])||tt(e[s])){let n=Li.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[n]=r[s];}return i}var Sv=class extends Dh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=false,this.measureInstanceViewportBox=Bh;}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Xr.has(t)){let i=dm(t);return i&&i.default||0}return t=Tv.has(t)?t:Rh(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return uG(e,t,i)}build(e,t,i){nG(e,t,this.isSVGTag,i.transformTemplate,i.style);}renderInstance(e,t,i,s){aG(e,t,i,s);}mount(e){this.isSVGTag=oG(e.tagName),super.mount(e);}};function lG(r){let e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},t=gm(r)&&!GP(r)?new Sv(e):new yv(e);t.mount(r),Ao.set(r,t);}function cG(r){let e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},t=new vv(e);t.mount(r),Ao.set(r,t);}function hG(r,e,t){let i=tt(r)?r:bs(r);return i.start(pv("",i,e,t)),i.animation}function X5(r,e){return tt(r)||typeof r=="number"||typeof r=="string"&&!xm(e)}function Ev(r,e,t,i){let s=[];if(X5(r,e))s.push(hG(r,xm(e)&&e.default||e,t&&(t.default||t)));else {let n=dv(r,e,i),o=n.length;Ht(!!o,"No valid elements provided.","no-valid-elements");for(let a=0;a<o;a++){let u=n[a];Ht(u!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");let l=u instanceof Element?lG:cG;Ao.has(u)||l(u);let c=Ao.get(u),h={...t};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),s.push(...VF(c,{...e,transition:h},{}));}}return s}function dG(r,e,t){let i=[];return MF(r,e,t,{spring:js}).forEach(({keyframes:n,transition:o},a)=>{i.push(...Ev(a,n,o));}),i}function Y5(r){return Array.isArray(r)&&r.some(Array.isArray)}function fG(r){function e(t,i,s){let n=[];Y5(t)?n=dG(t,i,r):n=Ev(t,i,s,r);let o=new um(n);return o}return e}var Av=fG();Re();function j5(r,e,t){if(Array.isArray(r)&&Array.isArray(r[0])){let i=r.map(s=>{let{ticker:n=new _e,...o}=s[2]||{};return [s[0],s[1],{driver:a=>{let u=({lastTime:l})=>a(l);return {start:(l=true)=>{n.add(u),n.start();},stop:()=>n.remove(u),now:()=>n.lastTime}},...o}]});return Av(i,e)}else {let{ticker:i=new _e}=t||{};return Av(r,e,{driver:s=>{let n=({lastTime:o})=>s(o);return {start:(o=true)=>{i.add(n),i.start();},stop:()=>i.remove(n),now:()=>i.lastTime}},...t||{}})}}var mh=j5;var I=new Mp;Pr.init({getScreen:()=>I.screen});var zP={};vs(zP,{CharacterBaseModel:()=>ym,CharacterStoredClass:()=>Xu,RegisteredCharacters:()=>pG});var ne=class ne{static init(e){ne._getStepCounter=e.getStepCounter,ne._setStepCounter=e.setStepCounter,ne._getCurrentGameStepState=e.getCurrentGameStepState,ne._restoreGameStepState=e.restoreGameStepState,ne._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(ne._onGoNextEnd=e.onGoNextEnd),ne._getVariable=e.getVariable,ne._setVariable=e.setVariable,ne._removeVariable=e.removeVariable,ne._getFlag=e.getFlag,ne._setFlag=e.setFlag,e.onLabelClosing&&(ne._onLabelClosing=e.onLabelClosing),ne._addHistoryItem=e.addHistoryItem,ne._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,ne._getCharacter=e.getCharacter;}static get stepCounter(){return ne._getStepCounter()}static set stepCounter(e){ne._setStepCounter(e);}static get currentGameStepState(){return ne._getCurrentGameStepState()}static get restoreGameStepState(){return ne._restoreGameStepState}static get openedLabels(){return ne._getOpenedLabels()}static get onGoNextEnd(){return ne._onGoNextEnd}static get getVariable(){return ne._getVariable}static get setVariable(){return ne._setVariable}static get removeVariable(){return ne._removeVariable}static get getFlag(){return ne._getFlag}static get setFlag(){return ne._setFlag}static get onLabelClosing(){return ne._onLabelClosing}static get addHistoryItem(){return ne._addHistoryItem}static get currentStepsRunningNumber(){return ne._getCurrentStepsRunningNumber()}static get getCharacter(){return ne._getCharacter}};w(ne,"_getStepCounter",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_setStepCounter",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getCurrentGameStepState",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_restoreGameStepState",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getOpenedLabels",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_onGoNextEnd",async()=>{}),w(ne,"_getVariable",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_setVariable",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_removeVariable",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getFlag",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_setFlag",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_onLabelClosing",()=>{}),w(ne,"_addHistoryItem",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getCurrentStepsRunningNumber",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getCharacter",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")}),w(ne,"onEnd"),w(ne,"onError");var W=ne;var wt=class wt{constructor(){}static clearOldTempVariables(e){wt.tempStorageDeadlines.forEach((t,i)=>{t>e&&(wt.tempStorage.delete(i),wt.tempStorageDeadlines.delete(i),wt.storage.cache.delete(i));});}static setVariable(e,t){let i=wt.tempStorage.has(e);t==null?(wt.storage.map.delete(e),!i&&wt.storage.cache.delete(e)):(wt.storage.map.set(e,t),!i&&wt.storage.cache.set(e,t));}static getVariable(e){let t=wt.storage.cache.get(e);return t===void 0&&(t=wt.tempStorage.get(e)),t===void 0&&(t=wt.storage.map.get(e)),pe(t)}static removeVariable(e){wt.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)}};w(wt,"storage",new Ct({cacheSize:20})),w(wt,"startingStorage",[]),w(wt,"flags",Array()),w(wt,"tempStorage",new Map),w(wt,"tempStorageDeadlines",new Map);var ue=wt;var bm=class{get storage(){return ue.storage.map}get cache(){return ue.storage.cache}get flags(){return ue.flags}get tempStorage(){return ue.tempStorage}get tempStorageDeadlines(){return ue.tempStorageDeadlines}set startingStorage(e){let t=[],i=W.stepCounter===0;Object.entries(e).forEach(([s,n])=>{t.push({key:s,value:n}),i&&ue.storage.set(s,n);}),ue.startingStorage=t;}setVariable(e,t){return ue.setVariable(e,t)}getVariable(e){return ue.getVariable(e)}removeVariable(e){return ue.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else ue.tempStorage.set(e,t),ue.storage.cache.set(e,t),ue.tempStorageDeadlines.has(e)||ue.tempStorageDeadlines.set(e,W.openedLabels);}removeTempVariable(e){ue.tempStorage.has(e)&&(ue.tempStorage.delete(e),ue.tempStorageDeadlines.delete(e),ue.storage.cache.delete(e));}setFlag(e,t){return ue.setFlag(e,t)}getFlag(e){return ue.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),ue.flags=[],ue.tempStorage.clear(),ue.tempStorageDeadlines.clear(),ue.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...ue.tempStorage.keys()].forEach(s=>{t.push({key:s,value:ue.tempStorage.get(s)});});let i=[];return [...ue.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:ue.tempStorageDeadlines.get(s)});}),pe({base:e,temp:t,tempDeadlines:i,flags:ue.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(([s,n])=>{ue.tempStorage.set(s,n);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([s,n])=>{ue.tempStorageDeadlines.set(s,n);});}else t.key==="___flags___"?t.value.forEach(s=>{ue.flags.push(s);}):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=>{ue.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{ue.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([s,n])=>{ue.tempStorage.set(s,n);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([s,n])=>{ue.tempStorageDeadlines.set(s,n);}):t==="___flags___"?i.forEach(s=>{ue.flags.push(s);}):this.storage.set(t,i);})):E.warn("No storage data found");}catch(t){E.error("Error importing data",t);}}};var kh=class{constructor(e,t){w(this,"_id");w(this,"categoryId");this.categoryId=e,this._id=t;}get id(){return this._id}setStorageProperty(e,t){let i=ue.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],ue.setVariable(this.categoryId,i);}getStorageProperty(e,t=this.id){let i=ue.getVariable(this.categoryId);if(i&&i.hasOwnProperty(t)&&i[t].hasOwnProperty(e))return i[t][e]}};var ci=new bm;var q5="@",Xu=class extends kh{constructor(t,i=""){super(he.CHARACTER_CATEGORY_KEY,t+(i?q5+i:""));w(this,"sourceId");this.sourceId=t;}getStorageProperty(t){let i=super.getStorageProperty(t);return i===void 0&&(i=super.getStorageProperty(t,this.sourceId)),i}};var ym=class extends Xu{constructor(t,i){super(typeof t=="string"?t:t.id,typeof t=="string"?"":t.emotion);w(this,"defaultName");w(this,"defaultSurname");w(this,"defaultAge");w(this,"_icon");w(this,"_color");this.defaultName=i.name,this.defaultSurname=i.surname,this.defaultAge=i.age,this._icon=i.icon,this._color=i.color;}get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(t){this.setStorageProperty("name",t);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(t){this.setStorageProperty("surname",t);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(t){this.setStorageProperty("age",t);}get icon(){return this._icon}get color(){return this._color}};var Yu=new Ct({cacheSize:10}),HP;(s=>{function r(n){try{let o=Yu.get(n);if(!o){E.warn(`Character "${n}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return o}catch(o){E.error(`Error while getting Character "${n}"`,o);return}}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}Yu.get(n.id)&&E.info(`Character id "${n.id}" already exists, it will be overwritten`),Yu.set(n.id,n);}s.add=e;function t(){return Array.from(Yu.values())}s.values=t;function i(n){return Yu.has(n)}s.has=i;})(HP||(HP={}));var pG=HP;var K5={Date:true,RegExp:true,String:true,Number:true};function Cv(r,e,t={cyclesFix:true},i=[]){let s=[],n=Array.isArray(r);for(let a in r){let u=r[a],l=n?+a:a;if(!(a in e)){s.push({type:"REMOVE",path:[l],oldValue:r[a]});continue}let c=e[a],h=typeof u=="object"&&typeof c=="object"&&Array.isArray(u)===Array.isArray(c);u&&c&&h&&!K5[Object.getPrototypeOf(u)?.constructor?.name]&&(!t.cyclesFix||!i.includes(u))?s.push.apply(s,Cv(u,c,t,t.cyclesFix?i.concat([u]):[]).map(d=>(d.path.unshift(l),d))):u!==c&&!(Number.isNaN(u)&&Number.isNaN(c))&&!(h&&(isNaN(u)?u+""==c+"":+u==+c))&&s.push({path:[l],type:"CHANGE",value:c,oldValue:u});}let o=Array.isArray(e);for(let a in e)a in r||s.push({type:"CREATE",path:[o?+a:a],value:e[a]});return s}function mG(r,e){let t=pe(r);return e.length>1&&"type"in e[0]&&(e=e.reverse()),e.forEach(i=>{"type"in i?Z5(t,i):Q5(t,i);}),t}function Z5(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===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];}):E.warn("No path found, skipping diff",e);}function Q5(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===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 n=e.index;e.item.kind==="N"?t[i].splice(n,1):e.item.kind==="E"||e.item.kind==="D"?t[i][n]=e.item.lhs:e.item.kind==="A"?E.warn("Nested array found, skipping diff",e):E.warn("No array found, skipping diff",e);}}else t=t[i];}):E.warn("No path found, skipping diff",e);}var Ni=class Ni{static get originalStepData(){return Ni._originalStepData?pe(Ni._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){Ni._originalStepData=pe(e);}};w(Ni,"_diffHistory",new Ct({cacheSize:5})),w(Ni,"_stepsInfoHistory",new Ct({cacheSize:5})),w(Ni,"_narrationHistory",new Ct({cacheSize:50})),w(Ni,"stepLimitSaved",20),w(Ni,"goBackRunning",false),w(Ni,"_originalStepData");var K=Ni;var vm=class{get stepsInfoMap(){return K._stepsInfoHistory}get diffMap(){return K._diffHistory}get narrationMap(){return K._narrationHistory}get size(){return K._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return K._stepsInfoHistory.keys()}get(e){let t=K._narrationHistory.get(e);if(!(t&&Object.keys(t).length===1&&t.stepIndex!==void 0))return t}delete(e){K._stepsInfoHistory.delete(e),K._diffHistory.delete(e),K._narrationHistory.delete(e);}internalRestoreOldGameState(e,t){if(e<=0||this.size==0)return t;let i=this.lastKey;if(typeof i!="number")return E.error("You can't go back, there is no step to go back"),t;let s=K._diffHistory.get(i);if(s)try{let n=mG(t,s);return W.stepCounter=i,this.delete(i),this.internalRestoreOldGameState(e-1,n)}catch(n){return E.error("Error applying diff",n),t}else return E.error("You can't go back, there is no step to go back"),t}async goBack(e,t=1){if(t<=0){E.warn("The parameter steps must be greater than 0");return}if(K._diffHistory.size<1){E.warn("You can't go back, there is no step to go back");return}if(K.goBackRunning){E.warn("Go back is already running");return}K.goBackRunning=true;try{let i=pe(this.internalRestoreOldGameState(t,K.originalStepData));if(i){await W.restoreGameStepState(i,e);let s=W.stepCounter-1,n=K._narrationHistory.get(s);if(n&&Object.keys(n).length===1&&n.stepIndex!==void 0){let o=K._stepsInfoHistory.get(s);if(o){let a=this.itemMapper({step:o});K._narrationHistory.set(o.index,a);}}}else E.error("Error going back");K.originalStepData=i,K.goBackRunning=!1;}catch(i){E.error("Error going back",i),K.goBackRunning=false;}}add(e,t={}){let i=K.originalStepData,{ignoreSameStep:s}=t,n=W.currentGameStepState;if(!s&&this.isSameStep(i,n))return;let o=this.lastKey;(async()=>{try{let u,l;if(typeof o=="number"&&(u=K._stepsInfoHistory.get(o),l=K._narrationHistory.get(o)),K._stepsInfoHistory.set(e.index,e),e.index!==0){let d=Cv(i,n);d?K._diffHistory.set(e.index,d):E.warn("It was not possible to create the difference between the two steps");}let c={},h=this.itemMapper({step:e},c);if(K._narrationHistory.set(e.index,h),u&&l&&typeof o=="number"){let d=this.itemMapper({...c,step:u},{});K._narrationHistory.set(o,d);}}catch(u){E.error("Error adding history step",u);}})(),K.originalStepData=n;}itemMapper(e,t){let{step:i,choiceIndexMade:s,inputValue:n,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||n){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);}s!==void 0&&(l[s].isResponse=true);}return {dialogue:a?{...a,character:a.character?W.getCharacter(a.character)||a.character:void 0}:void 0,playerMadeChoice:typeof s=="number",choices:l,stepIndex:i.index,inputValue:n}}return {stepIndex:i.index}}get narrativeHistory(){let e=[];return Array.from(this.keys()).sort((i,s)=>i-s).forEach(i=>{let s=this.get(i);s&&e.push(s);}),e}get currentLabelHistory(){let e=[],t=Array.from(this.keys()).sort((u,l)=>l-u);if(t.length===0)return e;let i=t[0];if(typeof i!="number")return e;let s=K._stepsInfoHistory.get(i);if(!s)return e;let n=s.openedLabels;if(!n||!Array.isArray(n)||n.length===0)return e;let o=n[0].currentStepIndex,a=n[0].label;return t.every((u,l)=>{let c=this.get(u);if(c){if(l===0)return e.push(c),true;let h=K._stepsInfoHistory.get(u);if(!h)return true;let d=h.openedLabels;if(!d||!Array.isArray(d)||d.length===0||d[0].label!==a||d[0].currentStepIndex>=o)return false;o=d[0].currentStepIndex,e.push(c);}return true}),e.reverse()}removeNarrativeHistory(e){if(e){let t=Array.from(this.keys()).sort((i,s)=>i-s);t=t.slice(0,e),t.forEach(i=>{K._narrationHistory.delete(i),K._stepsInfoHistory.delete(i),K._diffHistory.delete(i);});}else K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear();}get canGoBack(){let e=this.lastKey;return typeof e!="number"?false:K._diffHistory.has(e)}blockGoBack(){W.currentStepsRunningNumber===0&&K._diffHistory.clear();}isSameStep(e,t){if(e.openedLabels.length===t.openedLabels.length)try{let i=JSON.stringify(e.openedLabels),s=JSON.stringify(t.openedLabels);if(i===s&&e.path===t.path&&e.labelIndex===t.labelIndex)return !0}catch(i){return E.error("Error comparing opened labels",i),true}return false}clear(){K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear(),K._originalStepData=void 0;}get stepLimitSaved(){return K.stepLimitSaved}set stepLimitSaved(e){K.stepLimitSaved=e;}export(){let e=Array.from(this.keys()).sort((i,s)=>i-s);e.length>this.stepLimitSaved&&(e=e.slice(e.length-this.stepLimitSaved));let t=[];return e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n=K._diffHistory.get(i);t.push({...s,diff:n});}}),{stepsHistory:pe(t),originalStepData:pe(K._originalStepData)}}restoreNarrativeHistory(){let e=Array.from(this.keys()).sort((i,s)=>i-s),t={};e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n={...t};t={};let o=this.itemMapper({step:s,choiceIndexMade:n.choiceIndexMade,inputValue:n.inputValue,removeDialogue:n.removeDialogue},t);o&&K._narrationHistory.set(i,o);}});}async restore(e){this.clear();try{e.hasOwnProperty("stepsHistory")?(e.stepsHistory.forEach(i=>{i.diff&&K._diffHistory.set(i.index,i.diff);let s={...i,diff:void 0};K._stepsInfoHistory.set(i.index,s);}),this.restoreNarrativeHistory()):E.warn("Could not import stepsHistory data, so will be ignored"),e.hasOwnProperty("originalStepData")?K._originalStepData=e.originalStepData:E.warn("Could not import originalStepData data, so will be ignored");}catch(t){E.error("Error importing data",t);}}};var Co=new vm;var gG={};var YP={};vs(YP,{Close:()=>wv,Label:()=>$u,LabelAbstract:()=>ju,NarrationManagerStatic:()=>N,RegisteredLabels:()=>hi,narration:()=>Ks,newChoiceOption:()=>xG,newCloseChoiceOption:()=>_G,newLabel:()=>XP});var Tm=new Ct({cacheSize:10}),WP;(s=>{function r(n){let o=Tm.get(n);if(!o){E.error(`Label "${n}" not found`);return}return o}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}Tm.has(n.id)&&E.info(`Label "${n.id}" already exists, it will be overwritten`),Tm.set(n.id,n);}s.add=e;function t(){return Array.from(Tm.values())}s.values=t;function i(n){return Tm.has(n)}s.has=i;})(WP||(WP={}));var hi=WP;var Z=class Z{constructor(){}static get allOpenedLabels(){return W.getVariable(he.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(e){W.setVariable(he.OPENED_LABELS_COUNTER_KEY,e);}static getCurrentStepTimesCounterData(e=""){let t=Z.currentLabelStepIndex;if(t===null)return E.error("currentLabelStepIndex is null"),null;let i=`${t}${e}`,s=Z.currentLabelId,n=Z._currentLabel;if(!s||t===null||!n)return E.error("currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let o=n.getStepSha(t)||"error",a=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[s]||(a[s]={}),(!a[s][i]||a[s][i].stepSha1!=o)&&(a[s][i]={stepSha1:o}),a[s][i]}static setCurrentStepTimesCounterData(e="",t){let i=Z.currentLabelStepIndex,s=i+e,n=Z.currentLabelId;if(!n||i===null){E.error("currentLabelId or currentLabelStepIndex is null");return}let o=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[n]||(o[n]={}),o[n][s]=t,W.setVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static getCurrentStepTimesCounter(e=""){let t=Z._stepCounter,i=Z.getCurrentStepTimesCounterData(e);if(!i)return E.error("getCurrentStepTimesCounter obj is null"),0;let s=i.stepCounters||i.lastStepIndexs||[];return s.find(o=>o===t)||(s.push(t),delete i.lastStepIndexs,i.stepCounters=s,Z.setCurrentStepTimesCounterData(e,i)),s.length}static getRandomNumber(e,t,i={}){let s=i.nestedId||"";if(i.onceOnly||false){let o=Z.getCurrentStepTimesCounterData(s);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,Z.setCurrentStepTimesCounterData(s,o),c}return Math.floor(Math.random()*(t-e+1))+e}static resetCurrentStepTimesCounter(e=""){let t=Z.currentLabelStepIndex,i=t+e,s=Z.currentLabelId;if(!s||t===null){E.error("currentLabelId or currentLabelStepIndex is null");return}let n=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};n[s]||(n[s]={}),n[s][i]={stepCounters:[],stepSha1:""},W.setVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY,n);}static get allChoicesMade(){return W.getVariable(he.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(e){W.setVariable(he.ALL_CHOICES_MADE_KEY,e);}static increaseStepCounter(){Z._stepCounter++;}static get openedLabels(){return pe(Z._openedLabels)}static set openedLabels(e){Z._openedLabels=pe(e);}static get originalOpenedLabels(){return pe(Z._originalOpenedLabels)}static set originalOpenedLabels(e){Z._originalOpenedLabels=pe(e);}static get _currentLabel(){if(Z.currentLabelId)return hi.get(Z.currentLabelId)}static get currentLabelId(){if(Z._openedLabels.length>0)return Z._openedLabels[Z._openedLabels.length-1].label}static get currentLabelStepIndex(){return Z._openedLabels.length>0?Z._openedLabels[Z._openedLabels.length-1].currentStepIndex:null}static addLabelHistory(e,t){let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;(!s||s<t)&&(i[e]={biggestStep:t,openCount:n},Z.allOpenedLabels=i);}static addChoicesMade(e,t,i,s){let n=Z.allChoicesMade,o=n.findIndex(a=>a.labelId===e&&a.stepIndex===t&&a.choiceIndex===s&&a.stepSha1===i);o<0?n.push({labelId:e,stepIndex:t,choiceIndex:s,stepSha1:i,madeTimes:1}):n[o].madeTimes++,Z.allChoicesMade=n;}static pushNewLabel(e){if(!hi.get(e))throw new Error(`[Pixi\u2019VN] Label ${e} not found`);Z._openedLabels.push({label:e,currentStepIndex:0});let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;i[e]={biggestStep:s,openCount:n+1},Z.allOpenedLabels=i;}static increaseCurrentStepIndex(){if(Z._openedLabels.length>0){let e=Z._openedLabels[Z._openedLabels.length-1];Z._openedLabels[Z._openedLabels.length-1]={...e,currentStepIndex:e.currentStepIndex+1};}}static set onStepStart(e){Z._onStepStart=e;}static get onStepStart(){return async(e,t)=>{let i=[];return Z.onLoadingLabel&&e===0&&i.push(Z.onLoadingLabel(e,t)),Z._onStepStart&&i.push(Z._onStepStart(e,t)),await Promise.all(i)}}};w(Z,"stepsRunning",0),w(Z,"goNextRequests",0),w(Z,"choiceMadeTemp"),w(Z,"lastHistoryStep",null),w(Z,"_stepCounter",0),w(Z,"_openedLabels",[]),w(Z,"_originalOpenedLabels",[]),w(Z,"_onStepStart"),w(Z,"onLoadingLabel"),w(Z,"onStepEnd");var N=Z;var Sm=class{get currentStepTimesCounter(){return N.getCurrentStepTimesCounter()}set currentStepTimesCounter(e){N.resetCurrentStepTimesCounter();}getRandomNumber(e,t,i={}){return N.getRandomNumber(e,t,i)}get stepCounter(){return N._stepCounter}get openedLabels(){return N.openedLabels}get currentLabel(){return N._currentLabel}addStepHistory(e,t={}){let{choiceMade:i,ignoreSameStep:s}=t,n,o,a,u=W.getVariable(he.LAST_STEP_GLUED)===this.stepCounter;W.getVariable(he.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(n=W.getVariable(he.CURRENT_DIALOGUE_MEMORY_KEY)),W.getVariable(he.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(o=W.getVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY)),W.getVariable(he.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(a=W.getVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY));let l=N.openedLabels,c={currentLabel:N.currentLabelId,dialogue:n,choices:o,stepSha1:e,index:this.stepCounter,labelStepIndex:N.currentLabelStepIndex,choiceIndexMade:i,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices,isGlued:u,openedLabels:l};N.originalOpenedLabels=l,W.addHistoryItem(c,{ignoreSameStep:s}),N.lastHistoryStep=c,N.increaseStepCounter();}closeCurrentLabel(){if(!N.currentLabelId){E.warn("No label to close");return}if(!this.currentLabel){E.error("currentLabel not found");return}let e=N.openedLabels;e.pop(),N.openedLabels=e,W.onLabelClosing(this.openedLabels.length);}closeAllLabels(){for(;N.openedLabels.length>0;)this.closeCurrentLabel(),W.onLabelClosing(this.openedLabels.length);}isLabelAlreadyCompleted(e){let t;typeof e=="string"?t=e:t=e.id;let s=N.allOpenedLabels[t]?.biggestStep||0;if(s){let n=hi.get(t);if(n)return n.stepCount<=s}return false}get alreadyCurrentStepMadeChoicesObj(){let e=N.currentLabelStepIndex,t=this.currentLabel;if(e===null||!t)return;let i=t.getStepSha(e);return i||(E.warn("stepSha not found, setting to ERROR"),i="error"),N.allChoicesMade.filter(s=>s.labelId===t?.id&&s.stepIndex===e&&s.stepSha1===i)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(e=>e.choiceIndex)}get isCurrentStepAlreadyOpened(){let e=N.currentLabelId;if(e){let t=N.allOpenedLabels[e]?.openCount||0;if(N.currentLabelStepIndex&&t>=N.currentLabelStepIndex)return true}return false}getTimesLabelOpened(e){return N.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&&E.warn("The player must make a choice"),false):this.isRequiredInput?(t&&E.warn("The player must enter a value"),false):true}get canGoNext(){return N.stepsRunning!==0?false:this.getCanGoNext()}async onStepRun(e,t){let i=[];return e.onStepStart&&i.push(e.onStepStart(t,e)),N.onStepStart&&i.push(N.onStepStart(t,e)),await Promise.all(i)}async onStepEnd(e,t){let i=[];return e.onStepEnd&&i.push(e.onStepEnd(t,e)),N.onStepEnd&&i.push(N.onStepEnd(t,e)),await Promise.all(i)}async goNext(e,t={}){let{runNow:i=false}=t;if(!(!i&&!this.getCanGoNext({showWarn:true}))){if(!i&&N.stepsRunning!==0){N.goNextRequests++;return}try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(s){E.error("Error running onStepEnd",s);}return N.stepsRunning===0&&await W.onGoNextEnd(),N.increaseCurrentStepIndex(),await this.runCurrentStep(e,t)}}async runCurrentStep(e,t={}){let{choiceMade:i}=t;if(N.currentLabelId){let s=N.currentLabelStepIndex;if(s===null){E.error("currentLabelStepIndex is null");return}let n=N._currentLabel;if(!n){E.error("currentLabel not found");return}if(n.stepCount>s){try{await this.onStepRun(n,s);}catch(u){E.error("Error running onStepStart",u),this.onStepError&&this.onStepError(u,e);return}let o=n.getStepById(s);if(!o){E.error("step not found");return}let a=n.getStepSha(s);a||(E.warn("stepSha not found, setting to ERROR"),a="error");try{N.stepsRunning++;let u=await o(e,{labelId:n.id}),l=this.choiceMenuOptions;if(l?.length===1&&l[0].autoSelect){let h=l[0];u=await this.selectChoice(h,e);}let c=N.lastHistoryStep;if(i!==void 0&&c){let h=c.stepSha1;h||(E.warn("stepSha not found, setting to ERROR"),h="error"),N.addChoicesMade(c.currentLabel||"error",typeof c.labelStepIndex=="number"?c.labelStepIndex:-1,c.stepSha1||"error",i),N.choiceMadeTemp=i;}return N.stepsRunning--,N.stepsRunning===0&&(N.addLabelHistory(n.id,s),this.addStepHistory(a,{...t,choiceMade:N.choiceMadeTemp}),N.choiceMadeTemp=void 0,N.goNextRequests>0)?(N.goNextRequests--,await this.goNext(e)):u}catch(u){N.stepsRunning>0&&N.stepsRunning--,E.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 N.openedLabels=[],W.onEnd?await W.onEnd(e,{labelId:"end"}):void 0}}else if(this.openedLabels.length===0){if(N.openedLabels=N.originalOpenedLabels,W.onEnd)return await W.onEnd(e,{labelId:"end"});E.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 E.error("currentLabelId not found");}async callLabel(e,t,i){let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=hi.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(a){E.error("Error running onStepEnd",a);}N.pushNewLabel(o.id);}catch(o){E.error("Error calling label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}async jumpLabel(e,t,i){this.openedLabels.length>0&&this.closeCurrentLabel();let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=hi.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(a){E.error("Error running onStepEnd",a);}N.pushNewLabel(o.id);}catch(o){E.error("Error jumping label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}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 E.error(`Type ${i} not found`),new Error(`[Pixi\u2019VN] Type ${i} not found`)}}async closeChoiceMenu(e,t){if(e.type!=="close")throw E.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 onStepError(){let e=W.onError;return e?(t,i)=>e("step",t,i):void 0}set onStepError(e){W.onError=(t,i,s)=>e(i,s);}get dialogue(){let e=W.getVariable(he.CURRENT_DIALOGUE_MEMORY_KEY);if(e)return {...e,character:e.character?W.getCharacter(e.character)||e.character:void 0}}set dialogue(e){if(!e){W.setVariable(he.CURRENT_DIALOGUE_MEMORY_KEY,void 0);return}if((typeof e=="string"||Array.isArray(e))&&(e={text:e}),this.dialogGlue){let t=W.getVariable(he.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;}W.setVariable(he.LAST_STEP_GLUED,this.stepCounter),this.dialogGlue=false;}try{W.setVariable(he.CURRENT_DIALOGUE_MEMORY_KEY,pe({...e,character:typeof e.character=="string"?e.character:e.character?.id})),W.setVariable(he.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw E.error("DialogueInterface cannot contain functions or classes"),t}}get choiceMenuOptions(){let e=W.getVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(e){let t=[],i=e.map((n,o)=>({...n,choiceIndex:o})),s=this.alreadyCurrentStepMadeChoices;if(i=i.filter((n,o)=>n.oneTime&&s&&s.includes(o)?false:n.onlyHaveNoChoice?(t.push(n),false):true),i.length>0)return i;if(t.length>0)return [t[0]]}}set choiceMenuOptions(e){if(!e||e.length===0){W.setVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY,void 0);return}try{W.setVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY,pe(e)),W.setVariable(he.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw E.error("ChoiceInterface cannot contain functions or classes"),t}}get dialogGlue(){return W.getFlag(he.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(e){W.setFlag(he.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,e);}get inputValue(){return W.getVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(e){this.removeInputRequest(),W.setVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY,e),W.setVariable(he.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}get isRequiredInput(){return W.getVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return W.getVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(e,t){e.isRequired=true,W.setVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY,e),t!==void 0?W.setVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY,t):W.removeVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){W.removeVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY),W.removeVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){N.openedLabels=[],N._stepCounter=0;}export(){return {openedLabels:pe(N.openedLabels),stepCounter:this.stepCounter}}async onLoadingLabel(e){let t=this.openedLabels.map(async i=>{let s=[],n=hi.get(i.label);return n&&(n.onLoadingLabel&&s.push(n.onLoadingLabel(e,n)),N.onLoadingLabel&&s.push(N.onLoadingLabel(e,n))),await Promise.all(s)});return await Promise.all(t)}async restore(e,t){this.clear();try{N.lastHistoryStep=t,e.hasOwnProperty("openedLabels")?(N.openedLabels=e.openedLabels,N.originalOpenedLabels=N.openedLabels):E.warn("Could not import openedLabels data, so will be ignored"),e.hasOwnProperty("stepCounter")?N._stepCounter=e.stepCounter:e.hasOwnProperty("lastStepIndex")?N._stepCounter=e.lastStepIndex:E.warn("Could not import stepCounter data, so will be ignored");try{await this.onLoadingLabel(N.currentLabelStepIndex||0);}catch(i){E.error("Error running onLoadingLabel",i);}}catch(i){E.error("Error importing data",i);}}};function xG(r,e,t,i){let s=typeof e=="string"?e:e.id;return {...i,label:s,props:t,text:r,type:i?.type||"call"}}var wv="close";function _G(r,e){return {...e,type:wv,text:r}}var bG=Fh(Lw());var ju=class{constructor(e,t){w(this,"_id");w(this,"_onStepStart");w(this,"_onLoadingLabel");w(this,"_onStepEnd");this._id=e,this._onStepStart=t?.onStepStart,this._onLoadingLabel=t?.onLoadingLabel,this._onStepEnd=t?.onStepEnd;}get id(){return this._id}get onStepStart(){return async(e,t)=>{if(this._onLoadingLabel&&e===0&&await this._onLoadingLabel(e,t),this._onStepStart)return await this._onStepStart(e,t)}}get onLoadingLabel(){return this._onLoadingLabel}get onStepEnd(){return this._onStepEnd}};var $u=class extends ju{constructor(t,i,s){super(t,s);w(this,"_steps");this._steps=i;}get stepCount(){return this.steps.length}getStepById(t){return this.steps[t]}get steps(){return typeof this._steps=="function"?this._steps():this._steps}getStepSha(t){if(t<0||t>=this.steps.length)return E.warn("stepSha not found, setting to ERROR"),"error";try{let i=this.steps[t];return (0,bG.default)(i.toString().toLocaleLowerCase()).toString()}catch(i){return E.warn("stepSha not found, setting to ERROR",i),"error"}}};function XP(r,e,t){let i=new $u(r,e,t);return hi.add(i),i}var Ks=new Sm;var $P={};vs($P,{Sound:()=>wo,SoundManagerStatic:()=>oe,sound:()=>Po});var oe=class{constructor(){}};w(oe,"soundAliasesOrder",[]),w(oe,"soundsPlaying",{}),w(oe,"sounds",{});var wo=class r extends Gr{constructor(){super(...arguments);w(this,"alias");}pause(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=oe.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[this.alias]={...t,paused:true},super.pause()}resume(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=oe.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[this.alias]={options:t.options,stepIndex:W.stepCounter,paused:false},super.resume()}destroy(){return this.alias&&delete oe.soundsPlaying[this.alias],super.destroy()}stop(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return delete oe.soundsPlaying[this.alias],super.stop()}play(t){if(typeof t=="string"&&(this.alias=t),!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return oe.soundsPlaying[this.alias]={stepIndex:W.stepCounter,options:t,paused:false},super.play(t)}static from(t){let i=Gr.from(t);return new r(i.media,i.options)}};function Em(r){let e=[];for(let t of r)t.type==="TelephoneFilter"?e.push(new Xe.TelephoneFilter):t.type==="StreamFilter"?e.push(new Xe.StreamFilter):t.type==="StereoFilter"?e.push(new Xe.StereoFilter(t.pan)):t.type==="ReverbFilter"?e.push(new Xe.ReverbFilter(t.seconds,t.decay,t.reverse)):t.type==="MonoFilter"?e.push(new Xe.MonoFilter):t.type==="EqualizerFilter"?e.push(new Xe.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 Xe.DistortionFilter(t.amount)):E.error("Unknown sound filter type");return e}function jP(r){if(!r)return;let e=[];for(let t of r)t instanceof Xe.TelephoneFilter?e.push({type:"TelephoneFilter"}):t instanceof Xe.StreamFilter?e.push({type:"StreamFilter"}):t instanceof Xe.StereoFilter?e.push({type:"StereoFilter",pan:t.pan}):t instanceof Xe.ReverbFilter?e.push({type:"ReverbFilter",seconds:t.seconds,decay:t.decay,reverse:t.reverse}):t instanceof Xe.MonoFilter?e.push({type:"MonoFilter"}):t instanceof Xe.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 Xe.DistortionFilter?e.push({type:"DistortionFilter",amount:t.amount}):E.error("Unknown sound filter type");return e}var Am=class extends ih{constructor(){super();}get context(){return Ie.context}get filtersAll(){return Ie.filtersAll}set filtersAll(e){Ie.filtersAll=e.filter(t=>!(t instanceof Xe.Filter));}get supported(){return Ie.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 Gr&&(t=t.options);let i;if(t instanceof wo)i=t;else {let s=this.getOptions(t||{});i=wo.from(s);}return i.alias=e,!oe.soundAliasesOrder.includes(e)&&oe.soundAliasesOrder.push(e),oe.sounds[e]=i,Ie.add(e,i),i}get useLegacy(){return Ie.useLegacy}set useLegacy(e){Ie.useLegacy=e;}get disableAutoPause(){return Ie.disableAutoPause}set disableAutoPause(e){Ie.disableAutoPause=e;}remove(e){return oe.soundAliasesOrder=oe.soundAliasesOrder.filter(t=>t!==e),delete oe.soundsPlaying[e],delete oe.sounds[e],Ie.remove(e)}get volumeAll(){return Ie.volumeAll}set volumeAll(e){Ie.volumeAll=e;}get speedAll(){return Ie.speedAll}set speedAll(e){Ie.speedAll=e;}togglePauseAll(){return Ie.togglePauseAll()}pauseAll(){return Ie.pauseAll()}resumeAll(){return Ie.resumeAll()}toggleMuteAll(){return Ie.toggleMuteAll()}muteAll(){return Ie.muteAll()}unmuteAll(){return Ie.unmuteAll()}removeAll(){return oe.soundAliasesOrder=[],oe.soundsPlaying={},oe.sounds={},Ie.removeAll()}stopAll(){for(let e in oe.sounds)oe.sounds[e].stop();return oe.soundsPlaying={},Ie.stopAll()}exists(e,t){return Ie.exists(e,t)||e in oe.sounds}isPlaying(){return Ie.isPlaying()}find(e){let t=oe.sounds[e];return t||(t=Ie.find(e),t&&(oe.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 oe.soundsPlaying[e]={stepIndex:W.stepCounter,options:t,paused:false},Ie.play(e,t)}stop(e){return delete oe.soundsPlaying[e],Ie.stop(e)}pause(e){let t=oe.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[e]={...t,paused:true},Ie.pause(e)}resume(e){let t=oe.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[e]={options:t.options,stepIndex:W.stepCounter,paused:false},Ie.resume(e)}volume(e,t){return Ie.volume(e,t)}speed(e,t){return Ie.speed(e,t)}duration(e){return Ie.duration(e)}close(){return Ie.close()}clear(){this.stopAll();}export(){let e={};for(let t in oe.soundsPlaying){let i=oe.soundsPlaying[t],s=this.find(t);s&&(e[t]={...i,sound:{options:{...s.options,autoPlay:s.autoPlay,loop:s.loop,preload:s.preload,singleInstance:s.singleInstance,url:s.options.url,volume:s.options.volume},filters:jP(s.media.filters)}});}return {soundsPlaying:pe(e),soundAliasesOrder:pe(oe.soundAliasesOrder),filters:pe(jP(this.filtersAll))}}removeOldSoundAndExport(){return this.export()}restore(e){let t=W.stepCounter-1;this.clear();try{if(e.hasOwnProperty("soundAliasesOrder"))oe.soundAliasesOrder=e.soundAliasesOrder;else {E.error("The data does not have the properties soundAliasesOrder");return}if(e.hasOwnProperty("filters")){let i=e.filters;i&&(this.filtersAll=Em(i));}if(e.hasOwnProperty("playInStepIndex")){let i=e.playInStepIndex;i&&(oe.soundsPlaying=i);}if(e.hasOwnProperty("sounds")){let i=e.sounds;for(let s in i){let n=i[s],o=!1,a=this.add(s,{...n.options,autoPlay:!1});if(s in oe.soundsPlaying){let u=oe.soundsPlaying[s];(n.options.loop||u.options&&typeof u.options=="object"&&u.options.loop||u.stepIndex===t)&&(o=!0),n.filters&&(a.filters=Em(n.filters)),o&&a.play();}}}if(e.hasOwnProperty("soundsPlaying")){let i=e.soundsPlaying;for(let s in i){let n=i[s];oe.soundsPlaying[s]={paused:n.paused,stepIndex:n.stepIndex,options:n.options};let o=i[s].sound,a=!1,u;if(this.exists(s)?(u=this.find(s),o.options.url=u.options.url,o.options.volume=u.options.volume,u.options=o.options,u.autoPlay=!1,u.filters=o.filters?Em(o.filters):[]):u=this.add(s,{...o.options,autoPlay:!1}),s in oe.soundsPlaying){let l=oe.soundsPlaying[s];(o.options.loop||l.options&&typeof l.options=="object"&&l.options.loop||l.stepIndex===t)&&(a=!0),o.filters&&(u.filters=Em(o.filters)),a&&u.play();}}}else {E.error("The data does not have the properties soundsPlaying");return}}catch(i){E.error("Error importing data",i);}}};var Po=new Am;Re();function yG(){console.info(`
|
|
3315
|
+
`}function J8(r,e,t){let i=[],s=e.lines[0],n="",o=[],a=0;return t.wordWrap=false,r.forEach(u=>{let l=/^\s*$/.test(u),c=Lk(u),h=n.length===0&&l;if(l&&!c&&h)return;c||(n+=u);let d=st.measureText(u,t);o.push({char:u,metric:d}),n.length>=s.length&&(i.push({line:n,chars:o,width:o.reduce((f,m)=>f+m.metric.width,0)}),o=[],n="",a++,s=e.lines[a]);}),i}function S0(r){let{text:e,style:t,chars:i}=r,s=t,n=st.measureText(e,s),o=st.graphemeSegmenter(e),a=J8(o,n,s.clone()),u=s.align,l=n.lineWidths.reduce((x,g)=>Math.max(x,g),0),c=[],h=[],d=[],f=0,m=s.stroke?.width||0,_=s.dropShadow?.distance||0;return a.forEach((x,g)=>{let y=new J({label:`line-${g}`});y.y=f,h.push(y);let v=n.lineWidths[g],S=Q8(u,v,l),C=new J({label:"word"});C.x=S,x.chars.forEach((E,M)=>{if(E.metric.width!==0){if(Lk(E.char)){S+=E.metric.width-m;return}if(E.char===" ")C.children.length>0&&(d.push(C),y.addChild(C)),S+=E.metric.width+s.letterSpacing-m,C=new J({label:"word"}),C.x=S;else {let D;i.length>0?(D=i.shift(),D.text=E.char,D.style=s,D.setFromMatrix(O.IDENTITY),D.x=S-C.x-_*M):D=new Cr({text:E.char,style:s,x:S-C.x-_*M}),c.push(D),C.addChild(D),S+=E.metric.width+s.letterSpacing-m;}}}),C.children.length>0&&(d.push(C),y.addChild(C)),f+=n.lineHeight;}),{chars:c,lines:h,words:d}}var Rw=p(()=>{Te();Yt();Gs();cp();});var Nk,Vk,Hk=p(()=>{Ei();Rw();v0();Nk=class E0 extends no{constructor(e){let t={...E0.defaultOptions,...e};super(t);}static from(e,t){let i={...E0.defaultOptions,...t,text:e.text,style:new ht(e.style)};return new E0({...i})}splitFn(){return S0({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};Nk.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};Vk=Nk;});async function zk(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var Wk=p(()=>{});function Bw(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=eN[tN++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof De&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];Bw(a,e,{...t});}}function Iw(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];Iw(o,e,{...t,index:n});}}var eN,tN,Xk=p(()=>{mn();eN=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],tN=0;});var Yk={};vs(Yk,{AbstractBitmapFont:()=>Gn,AbstractRenderer:()=>rs,AbstractSplitText:()=>no,AbstractText:()=>cs,AccessibilitySystem:()=>cg,AlphaFilter:()=>lD,AlphaMask:()=>Xo,AlphaMaskPipe:()=>Da,AnimatedSprite:()=>$c,Application:()=>Mf,ApplicationInitHook:()=>Ba,Assets:()=>ot,AssetsClass:()=>Of,BLEND_TO_NPM:()=>Rg,BUFFER_TYPE:()=>su,BackgroundLoader:()=>yc,BackgroundSystem:()=>X_,Batch:()=>ud,BatchGeometry:()=>ml,BatchTextureArray:()=>pl,BatchableGraphics:()=>ks,BatchableHTMLText:()=>Hl,BatchableMesh:()=>Zi,BatchableSprite:()=>ri,BatchableText:()=>Rl,Batcher:()=>Og,BatcherPipe:()=>mf,BigPool:()=>He,BindGroup:()=>Tt,BindGroupSystem:()=>Va,BitmapFont:()=>gu,BitmapFontManager:()=>Ai,BitmapText:()=>so,BitmapTextGraphics:()=>Gd,BitmapTextPipe:()=>fa,BlendModeFilter:()=>ce,BlendModePipe:()=>Fa,BlurFilter:()=>sp,BlurFilterPass:()=>jc,Bounds:()=>Me,BrowserAdapter:()=>_g,Buffer:()=>rt,BufferImageSource:()=>As,BufferResource:()=>ns,BufferUsage:()=>fe,CLEAR:()=>St,Cache:()=>Ee,CanvasObserver:()=>dn,CanvasPool:()=>fr,CanvasPoolClass:()=>Dd,CanvasSource:()=>Rt,CanvasTextGenerator:()=>Us,CanvasTextMetrics:()=>st,CanvasTextPipe:()=>aa,CanvasTextSystem:()=>da,Circle:()=>Bl,Color:()=>te,ColorBlend:()=>Wd,ColorBurnBlend:()=>Xd,ColorDodgeBlend:()=>Yd,ColorMask:()=>Yo,ColorMaskPipe:()=>ka,ColorMatrixFilter:()=>Jy,CompressedSource:()=>si,Container:()=>J,Culler:()=>ky,CullerPlugin:()=>zf,CustomRenderPipe:()=>Aa,D3D10_RESOURCE_DIMENSION:()=>Cy,D3DFMT:()=>pr,DATA_URI:()=>qR,DDS:()=>ae,DEG_TO_RAD:()=>km,DEPRECATED_SCALE_MODES:()=>fp,DEPRECATED_WRAP_MODES:()=>dp,DOMAdapter:()=>H,DOMContainer:()=>xg,DOMPipe:()=>zo,DRAW_MODES:()=>zD,DXGI_FORMAT:()=>Ay,DXGI_TO_TEXTURE_FORMAT:()=>ir,DarkenBlend:()=>jd,DefaultBatcher:()=>Zo,DefaultShader:()=>yl,DifferenceBlend:()=>$d,DisplacementFilter:()=>r0,DivideBlend:()=>qd,DynamicBitmapFont:()=>Od,Ellipse:()=>Il,EventBoundary:()=>nl,EventEmitter:()=>ve,EventSystem:()=>ol,EventsTicker:()=>jr,ExclusionBlend:()=>Kd,ExtensionType:()=>b,ExtractSystem:()=>Y_,FOURCC_TO_TEXTURE_FORMAT:()=>Nf,FederatedContainer:()=>gg,FederatedEvent:()=>$i,FederatedMouseEvent:()=>xi,FederatedPointerEvent:()=>jt,FederatedWheelEvent:()=>$r,FillGradient:()=>tr,FillPattern:()=>Ti,Filter:()=>Gt,FilterEffect:()=>pi,FilterPipe:()=>ba,FilterSystem:()=>ya,FontStylePromiseCache:()=>Ud,GAUSSIAN_VALUES:()=>Yc,GL_FORMATS:()=>hc,GL_INTERNAL_FORMAT:()=>EC,GL_TARGETS:()=>Tf,GL_TYPES:()=>Ce,GL_WRAP_MODES:()=>Z1,GenerateTextureSystem:()=>Ga,Geometry:()=>Jt,GlBackBufferSystem:()=>Sb,GlBatchAdaptor:()=>iu,GlBuffer:()=>cc,GlBufferSystem:()=>nu,GlColorMaskSystem:()=>au,GlContextSystem:()=>yb,GlEncoderSystem:()=>uu,GlGeometrySystem:()=>ou,GlGraphicsAdaptor:()=>tu,GlLimitsSystem:()=>lu,GlMeshAdaptor:()=>ru,GlParticleContainerAdaptor:()=>Al,GlParticleContainerPipe:()=>sa,GlProgram:()=>je,GlProgramData:()=>pc,GlRenderTarget:()=>dc,GlRenderTargetAdaptor:()=>fc,GlRenderTargetSystem:()=>du,GlShaderSystem:()=>fu,GlStateSystem:()=>Wb,GlStencilSystem:()=>cu,GlTexture:()=>gc,GlTextureSystem:()=>mu,GlUboSystem:()=>hu,GlUniformGroupSystem:()=>pu,GlobalUniformSystem:()=>Ua,GpuBatchAdaptor:()=>Ea,GpuBlendModesToPixi:()=>Kt,GpuBufferSystem:()=>Ha,GpuColorMaskSystem:()=>za,GpuDeviceSystem:()=>$n,GpuEncoderSystem:()=>Wa,GpuGraphicsAdaptor:()=>Ta,GpuGraphicsContext:()=>vd,GpuLimitsSystem:()=>Xa,GpuMeshAdapter:()=>Sa,GpuMipmapGenerator:()=>lc,GpuParticleContainerAdaptor:()=>Pl,GpuParticleContainerPipe:()=>na,GpuProgram:()=>$e,GpuRenderTarget:()=>oc,GpuRenderTargetAdaptor:()=>ac,GpuRenderTargetSystem:()=>Za,GpuShaderSystem:()=>Qa,GpuStateSystem:()=>Ja,GpuStencilModesToPixi:()=>ii,GpuStencilSystem:()=>Ya,GpuTextureSystem:()=>eu,GpuUboSystem:()=>$a,GpuUniformBatchPipe:()=>qa,Graphics:()=>Fn,GraphicsContext:()=>bt,GraphicsContextRenderData:()=>Td,GraphicsContextSystem:()=>Rn,GraphicsGpuData:()=>Ed,GraphicsPath:()=>Qi,GraphicsPipe:()=>ra,HTMLText:()=>Qc,HTMLTextPipe:()=>pa,HTMLTextRenderData:()=>Ln,HTMLTextStyle:()=>Zc,HTMLTextSystem:()=>ma,HardLightBlend:()=>Zd,HardMixBlend:()=>Qd,HelloSystem:()=>jn,IGLUniformData:()=>Mb,ImageSource:()=>Qt,InstructionSet:()=>on,KTX:()=>at,LightenBlend:()=>Jd,LinearBurnBlend:()=>ef,LinearDodgeBlend:()=>tf,LinearLightBlend:()=>rf,Loader:()=>Sc,LoaderParserPriority:()=>ze,LuminosityBlend:()=>sf,MaskEffectManager:()=>Qu,MaskEffectManagerClass:()=>zh,MaskFilter:()=>Kl,Matrix:()=>O,Mesh:()=>Ar,MeshGeometry:()=>yr,MeshGpuData:()=>El,MeshPipe:()=>ia,MeshPlane:()=>g0,MeshRope:()=>Tk,MeshSimple:()=>_0,NOOP:()=>$h,NegationBlend:()=>nf,NineSliceGeometry:()=>Ci,NineSlicePlane:()=>b0,NineSliceSprite:()=>Pw,NineSliceSpriteGpuData:()=>Vd,NineSliceSpritePipe:()=>_a,NoiseFilter:()=>_D,ObservablePoint:()=>ke,OverlayBlend:()=>of,PI_2:()=>Im,Particle:()=>Pk,ParticleBuffer:()=>Cl,ParticleContainer:()=>Bk,ParticleContainerPipe:()=>Bn,ParticleShader:()=>wl,PerspectiveMesh:()=>mk,PerspectivePlaneGeometry:()=>eh,PinLightBlend:()=>af,PipelineSystem:()=>Ka,PlaneGeometry:()=>Hn,Point:()=>ge,Polygon:()=>Dn,Pool:()=>Ss,PoolGroupClass:()=>Vh,PrepareBase:()=>n0,PrepareQueue:()=>Kc,PrepareSystem:()=>hp,PrepareUpload:()=>Jc,QuadGeometry:()=>Xl,RAD_TO_DEG:()=>Dm,Rectangle:()=>re,RenderContainer:()=>d0,RenderGroup:()=>rl,RenderGroupPipe:()=>wa,RenderGroupSystem:()=>Ma,RenderLayer:()=>uk,RenderTarget:()=>Na,RenderTargetSystem:()=>Zn,RenderTexture:()=>Zl,RenderableGCSystem:()=>K_,RendererInitHook:()=>Ia,RendererType:()=>qe,ResizePlugin:()=>Vo,Resolver:()=>qt,RopeGeometry:()=>x0,RoundedRectangle:()=>Dl,SCALE_MODES:()=>YD,STENCIL_MODES:()=>Ve,SVGParser:()=>Yx,SaturationBlend:()=>uf,SchedulerSystem:()=>La,ScissorMask:()=>c0,SdfShader:()=>Nl,Shader:()=>it,ShaderStage:()=>Tn,ShapePath:()=>Gl,SharedRenderPipes:()=>tc,SharedSystems:()=>ec,SoftLightBlend:()=>lf,SplitBitmapText:()=>Gk,SplitText:()=>Vk,Sprite:()=>De,SpritePipe:()=>Ra,Spritesheet:()=>id,State:()=>Ze,StencilMask:()=>jo,StencilMaskPipe:()=>Oa,SubtractBlend:()=>cf,SystemRunner:()=>Xn,TEXTURE_FORMAT_BLOCK_SIZE:()=>wy,Text:()=>Cr,TextStyle:()=>ht,Texture:()=>B,TextureGCSystem:()=>Z_,TextureMatrix:()=>un,TexturePool:()=>Oe,TexturePoolClass:()=>qh,TextureSource:()=>xe,TextureStyle:()=>mt,TextureUvs:()=>h0,Ticker:()=>_e,TickerListener:()=>hn,TickerPlugin:()=>Ho,TilingSprite:()=>a0,TilingSpriteGpuData:()=>Ld,TilingSpritePipe:()=>xa,TilingSpriteShader:()=>Wl,Transform:()=>qc,Triangle:()=>s0,UNIFORM_TO_ARRAY_SETTERS:()=>Vb,UNIFORM_TO_SINGLE_SETTERS:()=>Nb,UNIFORM_TYPES_MAP:()=>ix,UNIFORM_TYPES_VALUES:()=>pd,UPDATE_BLEND:()=>il,UPDATE_COLOR:()=>No,UPDATE_PRIORITY:()=>Ft,UPDATE_TRANSFORM:()=>B3,UPDATE_VISIBLE:()=>ln,UboBatch:()=>sc,UboSystem:()=>qn,UniformGroup:()=>be,VERSION:()=>Yn,VideoSource:()=>Ms,ViewContainer:()=>gt,ViewSystem:()=>eb,ViewableBuffer:()=>qr,VividLightBlend:()=>hf,WGSL_ALIGN_SIZE_DATA:()=>ja,WGSL_TO_STD40_SIZE:()=>Sf,WRAP_MODES:()=>XD,WebGLRenderer:()=>Pf,WebGPURenderer:()=>vf,WebWorkerAdapter:()=>nD,WorkerManager:()=>kf,accessibilityTarget:()=>hg,addBits:()=>cd,addMaskBounds:()=>gn,addMaskLocalBounds:()=>xn,addProgramDefines:()=>Lg,alphaFrag:()=>Xy,alphaWgsl:()=>ip,applyMatrix:()=>v_,applyProjectiveTransformationToPlane:()=>f0,applyStyleParams:()=>wf,assignWithIgnore:()=>Lo,autoDetectEnvironment:()=>WR,autoDetectRenderer:()=>ey,autoDetectSource:()=>nM,basisTranscoderUrls:()=>Dc,bgr2rgb:()=>Es,bitmapFontCachePlugin:()=>ty,bitmapFontTextParser:()=>bc,bitmapFontXMLParser:()=>Rf,bitmapFontXMLStringParser:()=>Bf,bitmapTextSplit:()=>y0,blendTemplateFrag:()=>C_,blendTemplateVert:()=>w_,blendTemplateWgsl:()=>P_,blockDataMap:()=>yf,blurTemplateWgsl:()=>Ky,boundsPool:()=>dr,browserExt:()=>SE,buildAdaptiveBezier:()=>Ol,buildAdaptiveQuadratic:()=>Fx,buildArc:()=>Fl,buildArcTo:()=>Ux,buildArcToSvg:()=>Lx,buildCircle:()=>Mn,buildContextBatches:()=>Ax,buildEllipse:()=>lx,buildLine:()=>px,buildPixelLine:()=>mx,buildPolygon:()=>vx,buildRectangle:()=>Tx,buildRoundedRectangle:()=>cx,buildSimpleUvs:()=>ax,buildTriangle:()=>Sx,buildUvs:()=>ox,cacheAsTextureMixin:()=>Um,cacheTextureArray:()=>iy,calculateProjection:()=>fb,canvasTextSplit:()=>S0,checkChildrenDidChange:()=>Xh,checkDataUrl:()=>vr,checkExtension:()=>nt,checkMaxIfStatementsInShader:()=>dl,childrenHelperMixin:()=>Nm,cleanArray:()=>q_,cleanHash:()=>$_,clearList:()=>Pa,closePointEps:()=>hx,collectAllRenderables:()=>ek,collectRenderablesMixin:()=>Vm,color32BitToUniform:()=>ti,colorBit:()=>En,colorBitGl:()=>An,colorMatrixFilterFrag:()=>Qy,colorMatrixFilterWgsl:()=>np,colorToUniform:()=>UM,compareModeToGlCompare:()=>Kb,compileHighShader:()=>qg,compileHighShaderGl:()=>Kg,compileHighShaderGlProgram:()=>Zr,compileHighShaderGpuProgram:()=>Kr,compileHooks:()=>hd,compileInputs:()=>dd,compileOutputs:()=>$g,compileShader:()=>Ef,compute2DProjection:()=>m0,convertFormatIfRequired:()=>QB,convertToList:()=>$t,copySearchParams:()=>Wo,createIdFromString:()=>vi,createIndicesForQuads:()=>Cd,createLevelBuffers:()=>UB,createLevelBuffersFromKTX:()=>eI,createStringVariations:()=>bg,createTexture:()=>rr,createUboElementsSTD40:()=>Eb,createUboElementsWGSL:()=>ib,createUboSyncFunction:()=>rc,createUboSyncFunctionSTD40:()=>wb,createUboSyncFunctionWGSL:()=>cb,crossOrigin:()=>dC,cullingMixin:()=>Bm,curveEps:()=>dx,defaultFilterVert:()=>ro,defaultValue:()=>mc,definedProps:()=>Ot,deprecation:()=>G,detectAvif:()=>ny,detectBasis:()=>BB,detectCompressed:()=>aI,detectDefaults:()=>oy,detectMp4:()=>ay,detectOgv:()=>uy,detectVideoAlphaMode:()=>ll,detectWebm:()=>ly,detectWebp:()=>cy,determineCrossOrigin:()=>pC,displacementFrag:()=>e0,displacementVert:()=>t0,displacementWgsl:()=>op,earcut:()=>bx,effectsMixin:()=>Hm,ensureAttributes:()=>nc,ensureIsBuffer:()=>ld,ensurePrecision:()=>Ng,ensureTextOptions:()=>io,executeInstructions:()=>Ca,extensions:()=>V,extractAttributesFromGlProgram:()=>kb,extractAttributesFromGpuProgram:()=>Wg,extractFontFamilies:()=>l_,extractStructAndGroups:()=>xl,extractSvgUrlId:()=>Bd,fastCopy:()=>Ko,findMixin:()=>zm,fontStringFromTextStyle:()=>Fs,formatShader:()=>OD,fragmentGPUTemplate:()=>Qg,fragmentGlTemplate:()=>ex,generateArraySyncSTD40:()=>Cb,generateArraySyncWGSL:()=>lb,generateBlurFragSource:()=>jy,generateBlurGlProgram:()=>qy,generateBlurProgram:()=>Zy,generateBlurVertSource:()=>$y,generateGPULayout:()=>BD,generateGpuLayoutGroups:()=>Xg,generateLayout:()=>DD,generateLayoutHash:()=>Yg,generateParticleUpdateFunction:()=>Cx,generateProgram:()=>Ub,generateShaderSyncCode:()=>Pb,generateTextStyleKey:()=>$x,generateTextureBatchBit:()=>Cn,generateTextureBatchBitGl:()=>wn,generateTextureMatrix:()=>Ex,generateUniformsSync:()=>Hb,getAdjustedBlendModeBlend:()=>yi,getAttributeInfoFromFormat:()=>er,getBatchSamplersUniformGroup:()=>Pn,getBitmapTextLayout:()=>Un,getCanvasBoundingBox:()=>Kx,getCanvasFillStyle:()=>On,getCanvasTexture:()=>Jl,getDefaultUniformValue:()=>sx,getFastGlobalBounds:()=>ZD,getFastGlobalBoundsMixin:()=>Xm,getFontCss:()=>d_,getFontFamilyName:()=>iC,getGeometryBounds:()=>Fg,getGlTypeFromFormat:()=>Tb,getGlobalBounds:()=>Yi,getGlobalMixin:()=>$m,getGlobalRenderableBounds:()=>A_,getLocalBounds:()=>nn,getMaxFragmentPrecision:()=>Ug,getMaxTexturesPerBatch:()=>kg,getOrientationOfPoints:()=>fx,getPo2TextureFromSource:()=>Ll,getResolutionOfUrl:()=>Jn,getSVGUrl:()=>f_,getSupportedCompressedTextureFormats:()=>Rc,getSupportedGPUCompressedTextureFormats:()=>Gf,getSupportedGlCompressedTextureFormats:()=>Ff,getSupportedTextureFormats:()=>as,getTemporaryCanvasFromImage:()=>p_,getTestContext:()=>hl,getTextureBatchBindGroup:()=>_n,getTextureDefaultMatrix:()=>Ak,getTextureFormatFromKTXTexture:()=>rI,getUboData:()=>Ob,getUniformData:()=>Fb,getUrlExtension:()=>ST,glFormatToGPUFormat:()=>By,glUploadBufferImageResource:()=>Xb,glUploadCompressedTextureResource:()=>Yb,glUploadImageResource:()=>xc,glUploadVideoResource:()=>$b,globalUniformsBit:()=>tx,globalUniformsBitGl:()=>rx,globalUniformsUBOBitGl:()=>bM,gpuFormatToBasisTranscoderFormat:()=>NB,gpuFormatToKTXBasisTranscoderFormat:()=>sI,gpuUploadBufferImageResource:()=>gb,gpuUploadCompressedTextureResource:()=>xb,gpuUploadImageResource:()=>uc,gpuUploadVideoResource:()=>bb,groupD8:()=>le,hasCachedCanvasTexture:()=>sB,hslWgsl:()=>yD,hslgl:()=>zn,hslgpu:()=>Wn,injectBits:()=>fd,insertVersion:()=>Vg,isMobile:()=>lg,isPow2:()=>Yh,isRenderingToScreen:()=>pb,isSafari:()=>a_,isSingleItem:()=>Ps,isWebGLSupported:()=>is,isWebGPUSupported:()=>ss,ktxTranscoderUrls:()=>Oc,loadBasis:()=>FB,loadBasisOnWorker:()=>Ey,loadBitmapFont:()=>ry,loadDDS:()=>HB,loadEnvironmentExtensions:()=>df,loadFontAsBase64:()=>c_,loadFontCSS:()=>h_,loadImageBitmap:()=>lC,loadJson:()=>hy,loadKTX:()=>WB,loadKTX2:()=>qB,loadKTX2onWorker:()=>Ry,loadSVGImage:()=>m_,loadSvg:()=>py,loadTextures:()=>wc,loadTxt:()=>dy,loadVideoTextures:()=>gy,loadWebFont:()=>fy,localUniformBit:()=>Ls,localUniformBitGl:()=>Vn,localUniformBitGroup2:()=>x_,localUniformMSDFBit:()=>e_,localUniformMSDFBitGl:()=>t_,log2:()=>S3,logDebugTexture:()=>zk,logProgramError:()=>Gb,logRenderGroupScene:()=>Iw,logScene:()=>Bw,mSDFBit:()=>r_,mSDFBitGl:()=>i_,mapFormatToGlFormat:()=>Zb,mapFormatToGlInternalFormat:()=>Qb,mapFormatToGlType:()=>Jb,mapGlToVertexFormat:()=>Ib,mapSize:()=>ND,mapType:()=>Af,mapWebGLBlendModesToPixi:()=>zb,maskFrag:()=>z_,maskVert:()=>W_,maskWgsl:()=>gf,matrixPool:()=>pt,measureHtmlText:()=>zl,measureMixin:()=>Km,migrateFragmentFromV7toV8:()=>UD,mipmapScaleModeToGlFilter:()=>qb,multiplyColors:()=>sn,multiplyHexColors:()=>el,nextPow2:()=>mi,noiseFrag:()=>i0,noiseWgsl:()=>ap,nonCompressedFormats:()=>bC,normalizeExtensionPriority:()=>qu,onRenderMixin:()=>Zm,parseDDS:()=>Py,parseFunctionBody:()=>qD,parseKTX:()=>My,parseSVGDefinitions:()=>Wx,parseSVGFloatAttribute:()=>Ke,parseSVGPath:()=>Bx,parseSVGStyle:()=>Id,particleData:()=>pp,particlesFrag:()=>wx,particlesVert:()=>Px,particlesWgsl:()=>wd,path:()=>We,pointInTriangle:()=>up,preloadVideo:()=>fC,removeItems:()=>Zu,removeStructAndGroupDuplicates:()=>jg,resetUids:()=>g3,resolveCharacters:()=>n_,resolveCompressedTextureUrl:()=>oI,resolveJsonUrl:()=>_y,resolveTextureUrl:()=>Pc,resourceToTexture:()=>DT,roundPixelsBit:()=>Qr,roundPixelsBitGl:()=>Jr,roundedShapeArc:()=>Nx,roundedShapeQuadraticCurve:()=>Vx,sayHello:()=>j_,scaleModeToGlFilter:()=>Cf,setBasisTranscoderPath:()=>kB,setKTXTranscoderPath:()=>jB,setPositions:()=>y_,setProgramName:()=>Hg,setUvs:()=>T_,shapeBuilders:()=>Sl,sortMixin:()=>Qm,spritesheetAsset:()=>vg,squaredDistanceToLineSegment:()=>In,stripVersion:()=>zg,styleAttributes:()=>Xx,testImageFormat:()=>vc,testVideoFormat:()=>os,textStyleToCSS:()=>l0,textureBit:()=>D_,textureBitGl:()=>k_,textureFrom:()=>kT,tilingBit:()=>__,tilingBitGl:()=>b_,toFillStyle:()=>Si,toLocalGlobalMixin:()=>Jm,toStrokeStyle:()=>kn,transformVertices:()=>gd,triangulateWithHoles:()=>Tl,uboSyncFunctionsSTD40:()=>_f,uboSyncFunctionsWGSL:()=>ab,uid:()=>de,uniformParsers:()=>wi,unpremultiplyAlpha:()=>gB,unsafeEvalSupported:()=>Yl,updateLocalTransform:()=>rk,updateQuadBounds:()=>ul,updateRenderGroupTransform:()=>FE,updateRenderGroupTransforms:()=>pf,updateTextBounds:()=>oa,updateTransformAndChildren:()=>L_,updateTransformBackwards:()=>Ju,updateWorldTransform:()=>sk,v8_0_0:()=>Y,v8_3_4:()=>Fm,validFormats:()=>Fc,validateRenderables:()=>N_,vertexGPUTemplate:()=>Zg,vertexGlTemplate:()=>Jg,vkFormatToGPUFormat:()=>Iy,warn:()=>U,webworkerExt:()=>EE,wrapModeToGlAddress:()=>_c});var Re=p(()=>{_R();yR();P();P();wg();Tg();cT();hT();SR();ER();AR();CR();wR();PR();MR();RR();BR();IR();DR();kR();OR();FR();GR();UR();LR();NR();VR();HR();zR();EB();dT();fT();RB();YA();qi();jA();$A();qA();KA();ZA();QA();JA();sy();Tc();eC();Ir();tC();rC();sC();nC();my();mC();Ns();uC();gC();xy();pn();Qn();Fr();al();yg();TT();td();vt();IB();GB();LB();VB();yC();vC();TC();zB();SC();XB();CC();AC();KB();JB();tI();iI();RC();nI();wC();BC();PC();uI();IC();kC();lI();Uv();ag();Z3();yT();Be();RE();vT();oD();gT();mg();dg();Kh();bT();Qh();fg();pg();CE();wE();PE();vD();KC();ZC();tw();sw();nw();rp();ow();aw();uw();lw();cw();zE();WE();XE();dt();Hd();zd();cD();fD();iw();Yy();QC();ew();JC();rw();pD();mD();bD();ts();Hh();_E();vE();YE();jh();Te();Om();tl();Ix();tn();_r();hw();d2();f2();p2();xt();m2();TD();dw();gw();RD();yw();X1();Dg();FT();ID();kD();od();DE();LT();HE();HT();GT();nx();bS();Is();dS();oS();aS();uS();lS();FD();cS();fS();_l();bl();pS();ga();Ds();O_();CT();$E();wT();qE();Wv();GD();PT();KE();sd();nd();LA();Y1();j1();$1();va();K1();J1();Q1();tA();rA();iA();sA();lA();nA();uA();cA();hA();dA();md();br();fA();vA();EA();LD();pA();Rb();hb();gA();yA();WT();Ig();xA();_A();bA();VD();Db();XT();YT();jT();$T();qT();Ab();aA();oA();SA();TA();wA();AA();vb();PA();GA();MA();RA();jb();BA();DA();xC();kA();OA();FA();IA();xB();UA();g1();x1();C1();_1();b1();y1();v1();T1();A1();w1();P1();M1();B1();I1();D1();Rs();Dr();k1();sb();E1();JT();eS();S1();rS();iS();sS();O1();F1();db();V1();G1();U1();_b();L1();_C();N1();H1();QE();JE();Bs();bf();Ki();Mg();r1();s1();WD();yn();vS();NT();vn();VT();TS();eg();n1();R1();Q_();mb();o1();tS();ei();xS();rb();_t();ob();_S();ub();nb();u1();bn();cl();Or();jl();tb();R_();ca();jD();h1();i1();rg();$o();Mc();qo();Mt();Cg();Se();f1();ig();gi();ji();$D();J_();Ty();Bc();OT();gl();KD();m1();kr();e2();t2();r2();Xt();QD();ko();Wh();bE();rn();Vv();Hv();zv();Xv();Yv();jv();qm();qv();Kv();Zv();Qv();Yt();kE();JD();tT();OE();LE();sg();$v();U_();tk();an();G_();jm();Ym();ik();GE();nk();UE();z1();ta();BE();ux();Ox();b2();Gx();y2();S2();SS();AS();CS();RS();BS();IS();AM();ea();Pd();Jx();la();Sd();YS();Hx();E2();A2();C2();zx();h2();P2();M2();w2();FS();jx();OS();ES();yx();lk();gk();Sw();vw();Tw();xk();Nd();Sk();Ek();Ew();W1();IE();Ad();Ck();_u();Nn();$S();KS();n2();s2();o2();Mk();JS();Ik();Mx();Cw();i2();ZS();QS();fw();E_();Ok();gE();oE();lE();mw();pE();dE();cE();hE();fE();Ml();mn();NE();s_();HA();zA();WA();XA();VA();Vl();u0();Y2();z2();Mw();Fd();W2();$2();bw();q2();u_();_w();sE();Z2();eE();tE();rE();Q2();J2();iE();g_();xw();v0();Uk();Hk();lp();u2();Qx();Gs();l2();F2();kd();Zx();H2();U2();L2();cp();Ei();Rw();B2();qx();Rx();_i();ET();AT();cn();Cs();sT();Eg();uT();K2();$l();ql();M_();D2();V_();Wt();l1();Lm();Pt();Sg();Pg();H_();Pe();Wk();Xk();Ae();eT();pw();If();fn();Gm();Xi();a1();MS();V.add(SE,EE);});var rO=Wi((k0,tO)=>{(function(r,e){typeof k0=="object"?tO.exports=k0=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(k0,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 Mv=="function")try{i=Mv("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function g(){}return function(y){var v;return g.prototype=y,v=new g,g.prototype=null,v}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(g){var y=n(this);return g&&y.mixIn(g),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var y in g)g.hasOwnProperty(y)&&(this[y]=g[y]);g.hasOwnProperty("toString")&&(this.toString=g.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(g,y){g=this.words=g||[],y!=t?this.sigBytes=y:this.sigBytes=g.length*4;},toString:function(g){return (g||h).stringify(this)},concat:function(g){var y=this.words,v=g.words,S=this.sigBytes,C=g.sigBytes;if(this.clamp(),S%4)for(var E=0;E<C;E++){var M=v[E>>>2]>>>24-E%4*8&255;y[S+E>>>2]|=M<<24-(S+E)%4*8;}else for(var D=0;D<C;D+=4)y[S+D>>>2]=v[D>>>2];return this.sigBytes+=C,this},clamp:function(){var g=this.words,y=this.sigBytes;g[y>>>2]&=4294967295<<32-y%4*8,g.length=e.ceil(y/4);},clone:function(){var g=u.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var y=[],v=0;v<g;v+=4)y.push(s());return new l.init(y,g)}}),c=o.enc={},h=c.Hex={stringify:function(g){for(var y=g.words,v=g.sigBytes,S=[],C=0;C<v;C++){var E=y[C>>>2]>>>24-C%4*8&255;S.push((E>>>4).toString(16)),S.push((E&15).toString(16));}return S.join("")},parse:function(g){for(var y=g.length,v=[],S=0;S<y;S+=2)v[S>>>3]|=parseInt(g.substr(S,2),16)<<24-S%8*4;return new l.init(v,y/2)}},d=c.Latin1={stringify:function(g){for(var y=g.words,v=g.sigBytes,S=[],C=0;C<v;C++){var E=y[C>>>2]>>>24-C%4*8&255;S.push(String.fromCharCode(E));}return S.join("")},parse:function(g){for(var y=g.length,v=[],S=0;S<y;S++)v[S>>>2]|=(g.charCodeAt(S)&255)<<24-S%4*8;return new l.init(v,y)}},f=c.Utf8={stringify:function(g){try{return decodeURIComponent(escape(d.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return d.parse(unescape(encodeURIComponent(g)))}},m=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(g){typeof g=="string"&&(g=f.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes;},_process:function(g){var y,v=this._data,S=v.words,C=v.sigBytes,E=this.blockSize,M=E*4,D=C/M;g?D=e.ceil(D):D=e.max((D|0)-this._minBufferSize,0);var R=D*E,L=e.min(R*4,C);if(R){for(var F=0;F<R;F+=E)this._doProcessBlock(S,F);y=S.splice(0,R),v.sigBytes-=L;}return new l.init(y,L)},clone:function(){var g=u.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});a.Hasher=m.extend({cfg:u.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset();},reset:function(){m.reset.call(this),this._doReset();},update:function(g){return this._append(g),this._process(),this},finalize:function(g){g&&this._append(g);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(g){return function(y,v){return new g.init(v).finalize(y)}},_createHmacHelper:function(g){return function(y,v){return new x.HMAC.init(g,v).finalize(y)}}});var x=o.algo={};return o}(Math);return r});});var Lw=Wi((O0,iO)=>{(function(r,e){typeof O0=="object"?iO.exports=O0=e(rO()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(O0,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],d=c[1],f=c[2],m=c[3],_=c[4],x=0;x<80;x++){if(x<16)o[x]=u[l+x]|0;else {var g=o[x-3]^o[x-8]^o[x-14]^o[x-16];o[x]=g<<1|g>>>31;}var y=(h<<5|h>>>27)+_+o[x];x<20?y+=(d&f|~d&m)+1518500249:x<40?y+=(d^f^m)+1859775393:x<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=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});Re();var VP={};vs(VP,{CanvasBaseItem:()=>Bp,CanvasEvent:()=>Rp,CanvasManagerStatic:()=>k,Container:()=>fo,FadeAlphaTicker:()=>gh,ImageContainer:()=>Ye,ImageSprite:()=>Ue,MoveTicker:()=>xh,RegisteredCanvasComponents:()=>ar,RegisteredEvents:()=>hs,RegisteredTickers:()=>ur,RotateTicker:()=>_h,Sprite:()=>ms,Text:()=>po,TickerBase:()=>Hr,VideoSprite:()=>nr,ZoomTicker:()=>bh,addImage:()=>Dp,addImageCointainer:()=>Ip,addVideo:()=>kp,animate:()=>mh,canvas:()=>I,canvasComponentDecorator:()=>fO,eventDecorator:()=>pO,getTexture:()=>Mu,moveIn:()=>CO,moveOut:()=>W0,pushIn:()=>PO,pushOut:()=>rP,removeWithDissolve:()=>Fp,removeWithFade:()=>AO,shakeEffect:()=>yO,showImage:()=>TO,showImageContainer:()=>vO,showVideo:()=>SO,showWithDissolve:()=>eP,showWithFade:()=>EO,tickerDecorator:()=>_O,zoomIn:()=>wO,zoomOut:()=>tP});Re();var Xe={};vs(Xe,{DistortionFilter:()=>A0,EqualizerFilter:()=>ni,Filter:()=>Bt,MonoFilter:()=>C0,ReverbFilter:()=>w0,StereoFilter:()=>P0,StreamFilter:()=>M0,TelephoneFilter:()=>R0});var jk;function $k(r){return jk=r,r}function Fe(){return jk}var Bt=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 A0=class extends Bt{constructor(e=0){let t;if(!Fe().useLegacy){let{audioContext:i}=Fe().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Fe().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var Et=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Fe().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Ge=class extends Bt{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Ge.F32,type:"lowshelf",gain:r},{f:Ge.F64,type:"peaking",gain:e},{f:Ge.F125,type:"peaking",gain:t},{f:Ge.F250,type:"peaking",gain:i},{f:Ge.F500,type:"peaking",gain:s},{f:Ge.F1K,type:"peaking",gain:n},{f:Ge.F2K,type:"peaking",gain:o},{f:Ge.F4K,type:"peaking",gain:a},{f:Ge.F8K,type:"peaking",gain:u},{f:Ge.F16K,type:"highshelf",gain:l}];Fe().useLegacy||(c=h.map(d=>{let f=Fe().context.audioContext.createBiquadFilter();return f.type=d.type,Et.setParamValue(f.Q,1),f.frequency.value=d.f,Et.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}`);Et.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(Ge.F32,r);}get f32(){return this.getGain(Ge.F32)}set f64(r){this.setGain(Ge.F64,r);}get f64(){return this.getGain(Ge.F64)}set f125(r){this.setGain(Ge.F125,r);}get f125(){return this.getGain(Ge.F125)}set f250(r){this.setGain(Ge.F250,r);}get f250(){return this.getGain(Ge.F250)}set f500(r){this.setGain(Ge.F500,r);}get f500(){return this.getGain(Ge.F500)}set f1k(r){this.setGain(Ge.F1K,r);}get f1k(){return this.getGain(Ge.F1K)}set f2k(r){this.setGain(Ge.F2K,r);}get f2k(){return this.getGain(Ge.F2K)}set f4k(r){this.setGain(Ge.F4K,r);}get f4k(){return this.getGain(Ge.F4K)}set f8k(r){this.setGain(Ge.F8K,r);}get f8k(){return this.getGain(Ge.F8K)}set f16k(r){this.setGain(Ge.F16K,r);}get f16k(){return this.getGain(Ge.F16K)}reset(){this.bands.forEach(r=>{Et.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},ni=Ge;ni.F32=32;ni.F64=64;ni.F125=125;ni.F250=250;ni.F500=500;ni.F1K=1e3;ni.F2K=2e3;ni.F4K=4e3;ni.F8K=8e3;ni.F16K=16e3;var C0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().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 w0=class extends Bt{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(Fe().useLegacy)return;let{audioContext:e}=Fe().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var P0=class extends Bt{constructor(e=0){let t,i,s;if(!Fe().useLegacy){let{audioContext:n}=Fe().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?Et.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 M0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().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 R0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",Et.setParamValue(s.frequency,2e3),n.type="lowpass",Et.setParamValue(n.frequency,2e3),o.type="highpass",Et.setParamValue(o.frequency,500),a.type="highpass",Et.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};Re();var mp=class extends ve{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();}};Re();var rN=0,Dw=class extends ve{constructor(r){super(),this.id=rN++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-Dw.PADDING),this._end=Math.min(this._end+Dw.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),_e.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(){_e.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){_e.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}]`}},B0=Dw;B0.PADDING=.1;Re();var gp=class extends ve{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new B0(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};Re();var xp=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 bu=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],kw=["audio/mpeg","audio/ogg"],yu={};function qk(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;bu.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(yu,i);}qk();Re();Re();var sN=0,_p=class extends ve{constructor(e){super(),this.id=sN++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);Et.setParamValue(this._gain.gain,n*s*i),Et.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){_e.shared.remove(this._updateListener,this),e&&_e.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var vu=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 Kk=class extends vu{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(Kk.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,Et.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}},I0=Kk;I0.BUFFER_SIZE=0;var Tu=class{init(e){this.parent=e,this._nodes=new I0(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 _p(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 H.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var th=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=Fe().useLegacy?new gp:new Tu;return new th(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:We.extname(t).slice(1)})).filter(({ext:t})=>yu[t]).sort((t,i)=>bu.indexOf(t.ext)-bu.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Fe().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new xp(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(th._pool.length>0){let r=th._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),th._pool.indexOf(r)<0&&th._pool.push(r);}},Gr=th;Gr._pool=[];Re();var rh=class r extends vu{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new ve,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var ih=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new rh),this._htmlAudioContext=new mp,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 rh.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof Gr)return this._sounds[e]=t,t;let i=this._getOptions(t),s=Gr.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};Re();Re();var Zk=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=We.basename(e,We.extname(e))),t},Qk={extension:b.Asset,detection:{test:async()=>true,add:async r=>[...r,...bu.filter(e=>yu[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[b.LoadParser],priority:ze.High},test(r){let e=We.extname(r).slice(1);return !!yu[e]||kw.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>Gr.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Fe().add(Zk(e),t),t},async unload(r,e){Fe().remove(Zk(e));}}};V.add(Qk);var Ie=$k(new ih);var bp="1.3.2";var oo="repeat";function Ow(r){return {type:"pause",duration:r}}var Fw={DistortionFilter:Xe.DistortionFilter,EqualizerFilter:Xe.EqualizerFilter,MonoFilter:Xe.MonoFilter,ReverbFilter:Xe.ReverbFilter,StereoFilter:Xe.StereoFilter,StreamFilter:Xe.StreamFilter,TelephoneFilter:Xe.TelephoneFilter},Jk=["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"],wr="__game_layer__",sh="Container",D0="ImageContainer",Gw="Image",nh="Sprite",oh="Text",Uw="Video",he={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;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(A||(A={}));function pe(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 eO(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(()=>(Re(),Yk))),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 nO=Fh(Lw());Re();var uN={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Ue||r instanceof nr||r instanceof Ye},testProp(r){switch(r){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof Ue||r instanceof nr||r instanceof Ye)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "percentageX":r.percentageX=t/100;break;case "percentageY":r.percentageY=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.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},sO=uN;function lN(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var j=class j{constructor(){}static get app(){if(!j._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return j._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(wr);return e||(e=new J,e.label=wr,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return j.canvasWidth=t,j.canvasHeight=i,j._app=new Mf,j.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=j.app,extensions:a=[],...u}=n||{};eO({app:o,extensions:[sO,...a],...u}),j._isInitialized=true,j.addCanvasIntoHTMLElement(e),window.addEventListener("resize",j.resize),j.resize(),j.gameLayer;})}static addCanvasIntoHTMLElement(e){j._isInitialized?e.appendChild(j.app.canvas):A.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return j.htmlLayers.push(s),j.resize(),n}static removeHtmlLayer(e){let t=j.htmlLayers.find(i=>i.id===e);t&&(t.remove(),j.htmlLayers=j.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return j.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/j.canvasWidth,t/j.canvasHeight)}static get screenWidth(){return Math.floor(j.screenScale*j.canvasWidth)}static get screenHeight(){return Math.floor(j.screenScale*j.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-j.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-j.screenHeight)/2}static async resize(){await lN(async()=>{if(j._isInitialized){let i=j.app.canvas.style;i.width=`${j.screenWidth}px`,i.height=`${j.screenHeight}px`,i.marginLeft=`${j.horizontalMargin}px`,i.marginRight=`${j.horizontalMargin}px`,i.marginTop=`${j.verticalMargin}px`,i.marginBottom=`${j.verticalMargin}px`;}let t=j.htmlLayers.map(i=>{i.style.width=`${j.screenWidth}px`,i.style.height=`${j.screenHeight}px`,i.style.marginLeft=`${j.horizontalMargin}px`,i.style.marginRight=`${j.horizontalMargin}px`,i.style.marginTop=`${j.verticalMargin}px`,i.style.marginBottom=`${j.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return j.gameLayer.children.filter(e=>e.label).sort((e,t)=>j.gameLayer.getChildIndex(e)-j.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(j._currentTickers).filter(([e,t])=>!t.createdByTicketSteps).map(([e,t])=>[e,{id:t.ticker.id,args:t.ticker.args,canvasElementAliases:t.ticker.canvasElementAliases,priority:t.ticker.priority,duration:t.ticker.duration,paused:t.ticker.paused}]))}static generateTickerId(e){try{return (0,nO.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),j._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),j._currentTickersTimeouts[e]&&delete j._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),j.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(j._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&j.removeTickerTimeout(i);}else j._currentTickersTimeouts[i].aliases=n;});}};w(j,"_app"),w(j,"htmlLayers",[]),w(j,"canvasWidth",300),w(j,"canvasHeight",300),w(j,"_isInitialized",false),w(j,"_currentTickers",{}),w(j,"_currentTickersSequence",{}),w(j,"_currentTickersTimeouts",{}),w(j,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),w(j,"_tickersOnPause",{});var k=j;Re();var ah=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,lO=new Set,Nw=typeof process=="object"&&process?process:{},cO=(r,e,t,i)=>{typeof Nw.emitWarning=="function"?Nw.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},U0=globalThis.AbortController,oO=globalThis.AbortSignal;if(typeof U0>"u"){oO=class{constructor(){w(this,"onabort");w(this,"_onabort",[]);w(this,"reason");w(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},U0=class{constructor(){w(this,"signal",new oO);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=Nw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,cO("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 cN=r=>!lO.has(r),ao=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),hO=r=>ao(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?uh:null:null,uh=class extends Array{constructor(e){super(e),this.fill(0);}},lh,Su=class Su{constructor(e,t){w(this,"heap");w(this,"length");if(!T(Su,lh))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=hO(e);if(!t)return [];ee(Su,lh,true);let i=new Su(e,t);return ee(Su,lh,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};lh=new WeakMap,we(Su,lh,false);var Vw=Su,aO,uO,Mi,Ur,Ri,Eu,Bi,ch,hh,It,Ii,At,Je,me,mr,Lr,or,Nt,Di,Vt,ki,Oi,Nr,Fi,ho,gr,dh,z,Hw,Au,Ws,vp,Vr,dO,Cu,fh,Tp,uo,lo,zw,F0,G0,Qe,Ww,yp,co,Xw,Yw=class Yw{constructor(e){we(this,z);we(this,Mi);we(this,Ur);we(this,Ri);we(this,Eu);we(this,Bi);we(this,ch);we(this,hh);w(this,"ttl");w(this,"ttlResolution");w(this,"ttlAutopurge");w(this,"updateAgeOnGet");w(this,"updateAgeOnHas");w(this,"allowStale");w(this,"noDisposeOnSet");w(this,"noUpdateTTL");w(this,"maxEntrySize");w(this,"sizeCalculation");w(this,"noDeleteOnFetchRejection");w(this,"noDeleteOnStaleGet");w(this,"allowStaleOnFetchAbort");w(this,"allowStaleOnFetchRejection");w(this,"ignoreFetchAbort");we(this,It);we(this,Ii);we(this,At);we(this,Je);we(this,me);we(this,mr);we(this,Lr);we(this,or);we(this,Nt);we(this,Di);we(this,Vt);we(this,ki);we(this,Oi);we(this,Nr);we(this,Fi);we(this,ho);we(this,gr);we(this,dh);we(this,Au,()=>{});we(this,Ws,()=>{});we(this,vp,()=>{});we(this,Vr,()=>false);we(this,Cu,e=>{});we(this,fh,(e,t,i)=>{});we(this,Tp,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});w(this,aO,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:_=0,sizeCalculation:x,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:E,ignoreFetchAbort:M}=e;if(t!==0&&!ao(t))throw new TypeError("max option must be a nonnegative integer");let D=t?hO(t):Array;if(!D)throw new Error("invalid max value: "+t);if(ee(this,Mi,t),ee(this,Ur,m),this.maxEntrySize=_||T(this,Ur),this.sizeCalculation=x,this.sizeCalculation){if(!T(this,Ur)&&!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(ee(this,hh,y),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(ee(this,ch,g),ee(this,ho,!!g),ee(this,At,new Map),ee(this,Je,new Array(t).fill(void 0)),ee(this,me,new Array(t).fill(void 0)),ee(this,mr,new D(t)),ee(this,Lr,new D(t)),ee(this,or,0),ee(this,Nt,0),ee(this,Di,Vw.create(t)),ee(this,It,0),ee(this,Ii,0),typeof l=="function"&&ee(this,Ri,l),typeof c=="function"&&ee(this,Eu,c),typeof h=="function"?(ee(this,Bi,h),ee(this,Vt,[])):(ee(this,Bi,void 0),ee(this,Vt,void 0)),ee(this,Fi,!!T(this,Ri)),ee(this,dh,!!T(this,Eu)),ee(this,gr,!!T(this,Bi)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!M,this.maxEntrySize!==0){if(T(this,Ur)!==0&&!ao(T(this,Ur)))throw new TypeError("maxSize must be a positive integer if specified");if(!ao(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");$(this,z,dO).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ao(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!ao(this.ttl))throw new TypeError("ttl must be a positive integer if specified");$(this,z,Hw).call(this);}if(T(this,Mi)===0&&this.ttl===0&&T(this,Ur)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!T(this,Mi)&&!T(this,Ur)){let R="LRU_CACHE_UNBOUNDED";cN(R)&&(lO.add(R),cO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,Yw));}}static unsafeExposeInternals(e){return {starts:T(e,Oi),ttls:T(e,Nr),sizes:T(e,ki),keyMap:T(e,At),keyList:T(e,Je),valList:T(e,me),next:T(e,mr),prev:T(e,Lr),get head(){return T(e,or)},get tail(){return T(e,Nt)},free:T(e,Di),isBackgroundFetch:t=>{var i;return $(i=e,z,Qe).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return $(o=e,z,G0).call(o,t,i,s,n)},moveToTail:t=>{var i;return $(i=e,z,yp).call(i,t)},indexes:t=>{var i;return $(i=e,z,uo).call(i,t)},rindexes:t=>{var i;return $(i=e,z,lo).call(i,t)},isStale:t=>{var i;return T(i=e,Vr).call(i,t)}}}get max(){return T(this,Mi)}get maxSize(){return T(this,Ur)}get calculatedSize(){return T(this,Ii)}get size(){return T(this,It)}get fetchMethod(){return T(this,ch)}get memoMethod(){return T(this,hh)}get dispose(){return T(this,Ri)}get onInsert(){return T(this,Eu)}get disposeAfter(){return T(this,Bi)}getRemainingTTL(e){return T(this,At).has(e)?1/0:0}*entries(){for(let e of $(this,z,uo).call(this))T(this,me)[e]!==void 0&&T(this,Je)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield [T(this,Je)[e],T(this,me)[e]]);}*rentries(){for(let e of $(this,z,lo).call(this))T(this,me)[e]!==void 0&&T(this,Je)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield [T(this,Je)[e],T(this,me)[e]]);}*keys(){for(let e of $(this,z,uo).call(this)){let t=T(this,Je)[e];t!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield t);}}*rkeys(){for(let e of $(this,z,lo).call(this)){let t=T(this,Je)[e];t!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield t);}}*values(){for(let e of $(this,z,uo).call(this))T(this,me)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield T(this,me)[e]);}*rvalues(){for(let e of $(this,z,lo).call(this))T(this,me)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield T(this,me)[e]);}[(uO=Symbol.iterator,aO=Symbol.toStringTag,uO)](){return this.entries()}find(e,t={}){for(let i of $(this,z,uo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,T(this,Je)[i],this))return this.get(T(this,Je)[i],t)}}forEach(e,t=this){for(let i of $(this,z,uo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,Je)[i],this);}}rforEach(e,t=this){for(let i of $(this,z,lo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,Je)[i],this);}}purgeStale(){let e=false;for(let t of $(this,z,lo).call(this,{allowStale:true}))T(this,Vr).call(this,t)&&($(this,z,co).call(this,T(this,Je)[t],"expire"),e=true);return e}info(e){let t=T(this,At).get(e);if(t===void 0)return;let i=T(this,me)[t],s=$(this,z,Qe).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(T(this,Nr)&&T(this,Oi)){let o=T(this,Nr)[t],a=T(this,Oi)[t];if(o&&a){let u=o-(ah.now()-a);n.ttl=u,n.start=Date.now();}}return T(this,ki)&&(n.size=T(this,ki)[t]),n}dump(){let e=[];for(let t of $(this,z,uo).call(this,{allowStale:true})){let i=T(this,Je)[t],s=T(this,me)[t],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(T(this,Nr)&&T(this,Oi)){o.ttl=T(this,Nr)[t];let a=ah.now()-T(this,Oi)[t];o.start=Math.floor(Date.now()-a);}T(this,ki)&&(o.size=T(this,ki)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=ah.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,f,m,_;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=T(this,Tp).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),$(this,z,co).call(this,e,"set"),this;let h=T(this,It)===0?void 0:T(this,At).get(e);if(h===void 0)h=T(this,It)===0?T(this,Nt):T(this,Di).length!==0?T(this,Di).pop():T(this,It)===T(this,Mi)?$(this,z,F0).call(this,false):T(this,It),T(this,Je)[h]=e,T(this,me)[h]=t,T(this,At).set(e,h),T(this,mr)[T(this,Nt)]=h,T(this,Lr)[h]=T(this,Nt),ee(this,Nt,h),Pm(this,It)._++,T(this,fh).call(this,h,c,u),u&&(u.set="add"),l=false,T(this,dh)&&((d=T(this,Eu))==null||d.call(this,t,e,"add"));else {$(this,z,yp).call(this,h);let x=T(this,me)[h];if(t!==x){if(T(this,ho)&&$(this,z,Qe).call(this,x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=x;g!==void 0&&!o&&(T(this,Fi)&&((f=T(this,Ri))==null||f.call(this,g,e,"set")),T(this,gr)&&T(this,Vt)?.push([g,e,"set"]));}else o||(T(this,Fi)&&((m=T(this,Ri))==null||m.call(this,x,e,"set")),T(this,gr)&&T(this,Vt)?.push([x,e,"set"]));if(T(this,Cu).call(this,h),T(this,fh).call(this,h,c,u),T(this,me)[h]=t,u){u.set="replace";let g=x&&$(this,z,Qe).call(this,x)?x.__staleWhileFetching:x;g!==void 0&&(u.oldValue=g);}}else u&&(u.set="update");T(this,dh)&&this.onInsert?.(t,e,t===x?"update":"replace");}if(s!==0&&!T(this,Nr)&&$(this,z,Hw).call(this),T(this,Nr)&&(l||T(this,vp).call(this,h,s,n),u&&T(this,Ws).call(this,u,h)),!o&&T(this,gr)&&T(this,Vt)){let x=T(this,Vt),g;for(;g=x?.shift();)(_=T(this,Bi))==null||_.call(this,...g);}return this}pop(){var e;try{for(;T(this,It);){let t=T(this,me)[T(this,or)];if($(this,z,F0).call(this,!0),$(this,z,Qe).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(T(this,gr)&&T(this,Vt)){let t=T(this,Vt),i;for(;i=t?.shift();)(e=T(this,Bi))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=T(this,At).get(e);if(n!==void 0){let o=T(this,me)[n];if($(this,z,Qe).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(T(this,Vr).call(this,n))s&&(s.has="stale",T(this,Ws).call(this,s,n));else return i&&T(this,Au).call(this,n),s&&(s.has="hit",T(this,Ws).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=T(this,At).get(e);if(s===void 0||!i&&T(this,Vr).call(this,s))return;let n=T(this,me)[s];return $(this,z,Qe).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:_,forceRefresh:x=false,status:g,signal:y}=t;if(!T(this,ho))return g&&(g.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});let v={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:g,signal:y},S=T(this,At).get(e);if(S===void 0){g&&(g.fetch="miss");let C=$(this,z,G0).call(this,e,S,v,_);return C.__returned=C}else {let C=T(this,me)[S];if($(this,z,Qe).call(this,C)){let L=i&&C.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",L&&(g.returnedStale=true)),L?C.__staleWhileFetching:C.__returned=C}let E=T(this,Vr).call(this,S);if(!x&&!E)return g&&(g.fetch="hit"),$(this,z,yp).call(this,S),s&&T(this,Au).call(this,S),g&&T(this,Ws).call(this,g,S),C;let M=$(this,z,G0).call(this,e,S,v,_),R=M.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=E?"stale":"refresh",R&&E&&(g.returnedStale=true)),R?M.__staleWhileFetching:M.__returned=M}}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=T(this,hh);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=T(this,At).get(e);if(a!==void 0){let u=T(this,me)[a],l=$(this,z,Qe).call(this,u);return o&&T(this,Ws).call(this,o,a),T(this,Vr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||$(this,z,co).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:($(this,z,yp).call(this,a),s&&T(this,Au).call(this,a),u))}else o&&(o.get="miss");}delete(e){return $(this,z,co).call(this,e,"delete")}clear(){return $(this,z,Xw).call(this,"delete")}};Mi=new WeakMap,Ur=new WeakMap,Ri=new WeakMap,Eu=new WeakMap,Bi=new WeakMap,ch=new WeakMap,hh=new WeakMap,It=new WeakMap,Ii=new WeakMap,At=new WeakMap,Je=new WeakMap,me=new WeakMap,mr=new WeakMap,Lr=new WeakMap,or=new WeakMap,Nt=new WeakMap,Di=new WeakMap,Vt=new WeakMap,ki=new WeakMap,Oi=new WeakMap,Nr=new WeakMap,Fi=new WeakMap,ho=new WeakMap,gr=new WeakMap,dh=new WeakMap,z=new WeakSet,Hw=function(){let e=new uh(T(this,Mi)),t=new uh(T(this,Mi));ee(this,Nr,e),ee(this,Oi,t),ee(this,vp,(n,o,a=ah.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{T(this,Vr).call(this,n)&&$(this,z,co).call(this,T(this,Je)[n],"expire");},o+1);u.unref&&u.unref();}}),ee(this,Au,n=>{t[n]=e[n]!==0?ah.now():0;}),ee(this,Ws,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=ah.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=T(this,At).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},ee(this,Vr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},Au=new WeakMap,Ws=new WeakMap,vp=new WeakMap,Vr=new WeakMap,dO=function(){let e=new uh(T(this,Mi));ee(this,Ii,0),ee(this,ki,e),ee(this,Cu,t=>{ee(this,Ii,T(this,Ii)-e[t]),e[t]=0;}),ee(this,Tp,(t,i,s,n)=>{if($(this,z,Qe).call(this,i))return 0;if(!ao(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!ao(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),ee(this,fh,(t,i,s)=>{if(e[t]=i,T(this,Ur)){let n=T(this,Ur)-e[t];for(;T(this,Ii)>n;)$(this,z,F0).call(this,true);}ee(this,Ii,T(this,Ii)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=T(this,Ii));});},Cu=new WeakMap,fh=new WeakMap,Tp=new WeakMap,uo=function*({allowStale:e=this.allowStale}={}){if(T(this,It))for(let t=T(this,Nt);!(!$(this,z,zw).call(this,t)||((e||!T(this,Vr).call(this,t))&&(yield t),t===T(this,or)));)t=T(this,Lr)[t];},lo=function*({allowStale:e=this.allowStale}={}){if(T(this,It))for(let t=T(this,or);!(!$(this,z,zw).call(this,t)||((e||!T(this,Vr).call(this,t))&&(yield t),t===T(this,Nt)));)t=T(this,mr)[t];},zw=function(e){return e!==void 0&&T(this,At).get(T(this,Je)[e])===e},F0=function(e){var n;let t=T(this,or),i=T(this,Je)[t],s=T(this,me)[t];return T(this,ho)&&$(this,z,Qe).call(this,s)?s.__abortController.abort(new Error("evicted")):(T(this,Fi)||T(this,gr))&&(T(this,Fi)&&((n=T(this,Ri))==null||n.call(this,s,i,"evict")),T(this,gr)&&T(this,Vt)?.push([s,i,"evict"])),T(this,Cu).call(this,t),e&&(T(this,Je)[t]=void 0,T(this,me)[t]=void 0,T(this,Di).push(t)),T(this,It)===1?(ee(this,or,ee(this,Nt,0)),T(this,Di).length=0):ee(this,or,T(this,mr)[t]),T(this,At).delete(i),Pm(this,It)._--,t},G0=function(e,t,i,s){let n=t===void 0?void 0:T(this,me)[t];if($(this,z,Qe).call(this,n))return n;let o=new U0,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(_,x=false)=>{let{aborted:g}=o.signal,y=i.ignoreFetchAbort&&_!==void 0;if(i.status&&(g&&!x?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),g&&!y&&!x)return h(o.signal.reason);let v=f;return T(this,me)[t]===f&&(_===void 0?v.__staleWhileFetching?T(this,me)[t]=v.__staleWhileFetching:$(this,z,co).call(this,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:x}=o.signal,g=x&&i.allowStaleOnFetchAbort,y=g||i.allowStaleOnFetchRejection,v=y||i.noDeleteOnFetchRejection,S=f;if(T(this,me)[t]===f&&(!v||S.__staleWhileFetching===void 0?$(this,z,co).call(this,e,"fetch"):g||(T(this,me)[t]=S.__staleWhileFetching)),y)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw _},d=(_,x)=>{var y;let g=(y=T(this,ch))==null?void 0:y.call(this,e,n,u);g&&g instanceof Promise&&g.then(v=>_(v===void 0?void 0:v),x),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=v=>l(v,true)));});};i.status&&(i.status.fetchDispatched=true);let f=new Promise(d).then(l,c),m=Object.assign(f,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,m,{...u.options,status:void 0}),t=T(this,At).get(e)):T(this,me)[t]=m,m},Qe=function(e){if(!T(this,ho))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof U0},Ww=function(e,t){T(this,Lr)[t]=e,T(this,mr)[e]=t;},yp=function(e){e!==T(this,Nt)&&(e===T(this,or)?ee(this,or,T(this,mr)[e]):$(this,z,Ww).call(this,T(this,Lr)[e],T(this,mr)[e]),$(this,z,Ww).call(this,T(this,Nt),e),ee(this,Nt,e));},co=function(e,t){var s,n;let i=false;if(T(this,It)!==0){let o=T(this,At).get(e);if(o!==void 0)if(i=true,T(this,It)===1)$(this,z,Xw).call(this,t);else {T(this,Cu).call(this,o);let a=T(this,me)[o];if($(this,z,Qe).call(this,a)?a.__abortController.abort(new Error("deleted")):(T(this,Fi)||T(this,gr))&&(T(this,Fi)&&((s=T(this,Ri))==null||s.call(this,a,e,t)),T(this,gr)&&T(this,Vt)?.push([a,e,t])),T(this,At).delete(e),T(this,Je)[o]=void 0,T(this,me)[o]=void 0,o===T(this,Nt))ee(this,Nt,T(this,Lr)[o]);else if(o===T(this,or))ee(this,or,T(this,mr)[o]);else {let u=T(this,Lr)[o];T(this,mr)[u]=T(this,mr)[o];let l=T(this,mr)[o];T(this,Lr)[l]=T(this,Lr)[o];}Pm(this,It)._--,T(this,Di).push(o);}}if(T(this,gr)&&T(this,Vt)?.length){let o=T(this,Vt),a;for(;a=o?.shift();)(n=T(this,Bi))==null||n.call(this,...a);}return i},Xw=function(e){var t,i;for(let s of $(this,z,lo).call(this,{allowStale:true})){let n=T(this,me)[s];if($(this,z,Qe).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=T(this,Je)[s];T(this,Fi)&&((t=T(this,Ri))==null||t.call(this,n,o,e)),T(this,gr)&&T(this,Vt)?.push([n,o,e]);}}if(T(this,At).clear(),T(this,me).fill(void 0),T(this,Je).fill(void 0),T(this,Nr)&&T(this,Oi)&&(T(this,Nr).fill(0),T(this,Oi).fill(0)),T(this,ki)&&T(this,ki).fill(0),ee(this,or,0),ee(this,Nt,0),T(this,Di).length=0,ee(this,Ii,0),ee(this,It,0),T(this,gr)&&T(this,Vt)){let s=T(this,Vt),n;for(;n=s?.shift();)(i=T(this,Bi))==null||i.call(this,...n);}};var L0=Yw;var Ct=class{constructor(e){w(this,"cache");w(this,"map",new Map);this.cache=new L0({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Sp=new Ct({cacheSize:5});function fO(r){return function(e){N0.add(e,r);}}var N0;(s=>{function r(n,o){o||(o=n.name),Sp.get(o)&&A.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Sp.set(o,n);}s.add=r;function e(n){try{let o=Sp.get(n);if(!o){A.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){A.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Sp.values())}s.values=t;function i(n){return Sp.has(n)}s.has=i;})(N0||(N0={}));var ar=N0;var ph=new Ct({cacheSize:5});function pO(r){return function(e){V0.add(e,r);}}var V0;(n=>{function r(o,a){a||(a=o.name),ph.get(a)&&A.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,ph.set(a,o);}n.add=r;function e(o){try{let a=ph.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}}n.get=e;function t(o){try{let a=ph.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}}n.getInstance=t;function i(){return Array.from(ph.values())}n.values=i;function s(o){return ph.has(o)}n.has=s;})(V0||(V0={}));var hs=V0;async function H0(r){let e=hN(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 hN(r){try{let e=ar.get(r);return e?new e:void 0}catch(e){A.error(`Error while getting CanvasElement ${r}`,e);return}}Re();function jw(r){return "memory"in r?r.memory:r instanceof Cr?$w(r):r instanceof De?Ep(r):wu(r)}function dN(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 mO(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function wu(r,e){let t=fN(r,sh),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>jw(n)):[];return {pixivnId:t,elements:s,...dN(r)}}function Ep(r){let e=wu(r),t=e.pixivnId??nh,i=xO(r),s="textureAlias"in r?mO(r.texture,r.textureAlias):mO(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function $w(r){let e=wu(r),t=e.pixivnId??oh,i=xO(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:pN(r.style),roundPixels:r.roundPixels,onEvents:i}}function fN(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function xO(r){return "onEvents"in r?r.onEvents:{}}function gO(r,e){if(typeof r!="object"||r===null)return r;A.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function pN(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:gO(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:gO(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var fo=class extends J{constructor(t){super(t);w(this,"pixivnId",sh);w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||sh;}get memory(){return wu(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await ds(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await H0(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):A.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ar.add(fo,sh);async function ds(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}Re();var Ap=class Ap{static init(e){Ap._getScreen=e.getScreen;}static get screen(){return Ap._getScreen()}};w(Ap,"_getScreen");var Pr=Ap;function oi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(Pr.screen.width-t)+i+n*t+(s?t:0):e*(Pr.screen.height-t)+i+n*t+(s?t:0)}function fs(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(Pr.screen.width-t):(e-i-n*t-(s?t:0))/(Pr.screen.height-t)}function ai(r,e){return r==="width"?e*Pr.screen.width:e*Pr.screen.height}function ps(r,e){return r==="width"?e/Pr.screen.width:e/Pr.screen.height}function ut(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.x*i-r.y*s,o=r.x*s+r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.y*s-r.x*i,o=r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.x*i+r.y*s,o=-r.x*s-r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.y*s-r.x*i,o=-r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}return {x:0,y:0}}function qw(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function ui(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 li(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))}Re();var mN=new RegExp(`(${Jk.join("|")})$`);function Cp(r){let e=ot.cache.has(r)?ot.get(r):null;return e instanceof B&&(r=e.source?.label||r),mN.test(r)}function Pu(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.percentageX===void 0&&(r.percentageX=r.xPercentagePosition),r.yPercentagePosition!=null&&r.percentageY===void 0&&(r.percentageY=r.yPercentagePosition),r.percentageX!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.percentageX},delete r.percentageX):(r.percentagePosition.x=r.percentageX,delete r.percentageX)),r.percentageY!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.percentageY},delete r.percentageY):(r.percentagePosition.y=r.percentageY,delete r.percentageY))),r)}Re();Re();async function Mu(r){if(r!=="EMPTY"){if(!r){A.error("Texture not found",r);return}if(ot.cache.has(r)){let e=ot.get(r);if(e)return e}return ot.load(r).then(e=>{if(!e){A.error("Texture not found",r);return}if(!(e instanceof B)){A.error("File not is a file",r);return}return e}).catch(e=>{A.error("Error loading file",e);})}}Re();var ms=class r extends De{constructor(t){super(t);w(this,"pixivnId",nh);w(this,"_textureAlias");w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||nh;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return Ep(this)}set memory(t){}async setMemory(t){return this.memory=t,await wp(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):A.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=De.from(t,i),n=new r;return n.texture=s.texture,n}};ar.add(ms,nh);async function wp(r,e,t){let i=t?.ignoreTexture||false;if(await ds(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await Mu(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&ot.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await Mu(n);o&&(r.texture=o);}}let s=t?.half;if(s?await s():"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=hs.get(o);a&&r.onEvent(n,a);}}var Ue=class r extends ms{constructor(t,i){t=Pu(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);w(this,"pixivnId",Gw);w(this,"_loadIsStarted",false);w(this,"_align");w(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...Ep(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Pp(this,t),this.reloadPosition();}static from(t,i){let s=De.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Mu(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,A.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return {x:fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x),y:fs("height",this.y,li(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("height",this.y,li(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:ps("width",this.x),y:ps("height",this.y)}}get percentageX(){return ps("width",this.x)}set percentageX(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageY(){return ps("height",this.y)}set percentageY(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);this._align.x!==void 0&&(super.x=oi("width",this._align.x,ui(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=oi("height",this._align.y,li(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=ai("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=ai("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};ar.add(Ue,Gw);async function Pp(r,e,t){let i=t?.ignoreTexture||false;return e=Pu(e),await wp(r,e,{half:async()=>{i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load(),"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)),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition);},ignoreTexture:t?.ignoreTexture})}Re();var nr=class r extends Ue{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);w(this,"pixivnId",Uw);w(this,"_looop",false);w(this,"_paused",false);w(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await Kw(this,t)}static from(t,i){let s=De.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};ar.add(nr,Uw);async function Kw(r,e,t){await Pp(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 Ye=class extends fo{constructor(t,i=[]){t=Pu(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);w(this,"pixivnId",D0);w(this,"_loadIsStarted",false);w(this,"_anchor");w(this,"_align");w(this,"_percentagePosition");t=Pu(t),i&&i.forEach(a=>{let u;Cp(a)?u=new nr(void 0,a):u=new Ue(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:D0,anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await Zw(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,A.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new B}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return {x:fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x),y:fs("height",this.y,li(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("height",this.y,li(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:ps("width",this.x),y:ps("height",this.y)}}set percentageX(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageX(){return ps("width",this.x)}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}set percentageY(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get percentageY(){return ps("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);this._align.x!==void 0&&(super.x=oi("width",this._align.x,ui(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=oi("height",this._align.y,li(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=ai("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=ai("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};ar.add(Ye,D0);async function Zw(r,e,t){e=Pu(e),ds(r,e,{...t,end:async()=>{"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();}});}Re();var po=class extends Cr{constructor(t){super(t);w(this,"pixivnId",oh);w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||oh;}get memory(){return $w(this)}set memory(t){}async setMemory(t){return this.memory=t,await Qw(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):A.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ar.add(po,oh);async function Qw(r,e){if(await ds(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=hs.get(i);s&&r.onEvent(t,s);}}Re();var Ru=class{constructor(e,t,i){w(this,"_args");w(this,"duration");w(this,"priority");w(this,"ticker",new _e);w(this,"animation");w(this,"stopped",false);w(this,"ignoreOnComplete",true);w(this,"tickerId");w(this,"canvasElementAliases",[]);w(this,"timeout",50);w(this,"onComplete",()=>{if(this.ignoreOnComplete)return;let e=this.tickerId;if(!e){A.warn("MotionTicker.complete() called without tickerId set. This may cause issues.");return}let t=this._args.options?.aliasToRemoveAfter||[];typeof t=="string"&&(t=[t]);let i=this._args.options?.tickerAliasToResume||[];typeof i=="string"&&(i=[i]);let s=this._args.options?.tickerIdToResume||[];typeof s=="string"&&(s=[s]),I.onTickerComplete(e,{aliasToRemoveAfter:t,tickerAliasToResume:i,tickerIdToResume:s,stopTicker:false});});this._args=e,this.duration=t,this.priority=i;}get args(){return {...this._args,time:this.animation?.time}}getItemByAlias(e){if(!this.canvasElementAliases.includes(e))return;let t=I.find(e);if(t)return t}async complete(){if(!this.animation){A.warn("MotionTicker.complete() called without animation set. This may cause issues.");return}this.animation.complete(),await new Promise(e=>setTimeout(e,this.timeout));}stop(){if(this.stopped=true,!this.animation){A.warn("MotionTicker.stop() called without animation set. This may cause issues.");return}this.animation.stop();}start(e){if(this.tickerId=e,this._args.options.autoplay!==false)return this.initialize()}createItem(e){return new Proxy({alias:e},{set:({alias:t},i,s)=>{if(this.stopped||this._args.startState&&this._args.startState[i]===s)return true;let n=this.getItemByAlias(t);if(!n)return true;switch(this.ignoreOnComplete&&setTimeout(()=>{this.ignoreOnComplete=false;},10),i){case "pivotX":n.pivot.x=s;break;case "pivotY":n.pivot.y=s;break;case "scaleX":n.scale.x=s;break;case "scaleY":n.scale.y=s;break;default:n[i]=s;break}return true},get:({alias:t},i)=>{if(this._args.startState||(this._args.startState={}),i in this._args.startState)return this._args.startState[i];let s=this.getItemByAlias(t);if(!s)return;let n;switch(i){case "pivotX":n=s.pivot.x;break;case "pivotY":n=s.pivot.y;break;case "scaleX":n=s.scale.x;break;case "scaleY":n=s.scale.y;break;default:n=s[i];break}return this._args.startState={...this._args.startState,[i]:n},n},has:({alias:t},i)=>{let s=this.getItemByAlias(t);if(!s)return false;switch(i){case "pivotX":return "pivot"in s&&"x"in s.pivot;case "pivotY":return "pivot"in s&&"y"in s.pivot;case "scaleX":return "scale"in s&&"x"in s.scale;case "scaleY":return "scale"in s&&"y"in s.scale;default:return i in s}},ownKeys:({alias:t})=>{let i=this.getItemByAlias(t);return i?Object.keys(i):[]}})}pause(){this.animation&&this.animation.pause();}play(){if(this.animation||this.initialize(),!this.animation){A.warn("MotionTicker.play() called without animation set. This may cause issues.");return}this.animation.play();}get paused(){return this.animation?this.animation.state==="paused":true}};var Bu=class extends Ru{constructor(){super(...arguments);w(this,"id","motion-sequence");}initialize(){let t=this.canvasElementAliases[0],i=this.createItem(t),s=this._args.sequence.map((n,o)=>[i,n[0],{...n[1]||{},ticker:this.ticker,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat,onComplete:o===this._args.sequence.length-1?()=>this.onComplete():void 0}]);this.animation=mh(s,{...this._args.options,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat}),this._args.time&&(this.animation.time=this._args.time);}};var Iu=class extends Ru{constructor(){super(...arguments);w(this,"id","motion");}initialize(){let t=this.canvasElementAliases.map(i=>this.createItem(i));this.animation=mh(t,this._args.keyframes,{...this._args.options,repeat:this._args.options?.repeat===null?1/0:this._args.options?.repeat,onComplete:()=>this.onComplete(),ticker:this.ticker}),this._args.time&&(this.animation.time=this._args.time);}};var mo=new Ct({cacheSize:5});mo.set("motion",Iu);mo.set("motion-sequence",Bu);function _O(r){return function(e){z0.add(e,r);}}var z0;(n=>{function r(o,a){a||(a=o.name),mo.get(a)&&A.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,mo.set(a,o);}n.add=r;function e(o){try{let a=mo.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}}n.get=e;function t(o,a,u,l){try{let c=mo.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}}n.getInstance=t;function i(){return Array.from(mo.values())}n.values=i;function s(o){return mo.has(o)}n.has=s;})(z0||(z0={}));var ur=z0;var bO="aliasToRemoveAfter";var Mp=class{get app(){return k.app}get gameLayer(){return k.gameLayer}get isInitialized(){return k._isInitialized}get canvasWidth(){return k.canvasWidth}get canvasHeight(){return k.canvasHeight}set canvasWidth(e){k.canvasWidth=e;}set canvasHeight(e){k.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await k.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await k.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}get children(){return k.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 J&&(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 nr?await Kw(t,e,{ignoreTexture:true}):t instanceof Ue?await Pp(t,e,{ignoreTexture:true}):t instanceof ms?await wp(t,e,{ignoreTexture:true}):t instanceof po?await Qw(t,e):t instanceof Ye?await Zw(t,e):t instanceof J&&await ds(t,e);}add(e,t,i={}){if(e===wr){A.error(`The alias ${wr} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?A.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===wr){A.error(`The alias ${wr} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}find(e){if(e===wr)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();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return k._currentTickers}get currentTickersSteps(){return k._currentTickersSequence}findTicker(e){let t=k._currentTickers[e];if(t)return t.ticker}addTicker(e,t,i){let s=t.id;if(typeof e=="string"&&(e=[e]),t.canvasElementAliases=e,!ur.has(s)){A.error(`Ticker ${s} not found`);return}let n={ticker:t},{id:o=k.generateTickerId(n)}=i||{};if(k._currentTickers[o]=n,n.ticker.start(o),t.duration){let a=setTimeout(()=>{k.removeTickerTimeoutInfo(a),k._currentTickersTimeouts[a.toString()]&&n.ticker.complete({ignoreTickerSteps:true});},t.duration*1e3);k.addTickerTimeoutInfo(e,s,a.toString(),true);}return o}addTickersSequence(e,t,i=0){if(t.length==0){A.warn("The steps of the tickers is empty");return}e in k._currentTickersSequence||(k._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===oo||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:pe(o.args),duration:o.duration})},n=k.generateTickerId(s);return k._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!k._currentTickersSequence[e]||!k._currentTickersSequence[e][t])return;let i=k._currentTickersSequence[e][t].steps[k._currentTickersSequence[e][t].currentStepNumber];if(i===oo&&(i=k._currentTickersSequence[e][t].steps[0],k._currentTickersSequence[e][t].currentStepNumber=0,i===oo)){A.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=k._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),k.removeTickerTimeoutInfo(u);},i.duration*1e3);k.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=ur.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){A.error(`Ticker ${i.ticker} not found`);return}s.canvasElementAliases=[e];let n=s.id,o={createdByTicketSteps:{canvasElementAlias:e,id:t},ticker:s},a=k.generateTickerId(o);if(k._currentTickers[a]=o,o.ticker.start(a),s.duration){let u=setTimeout(()=>{let l=k._currentTickersTimeouts[u.toString()];l&&(o.ticker.complete({ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),k.removeTickerTimeoutInfo(u);},s.duration*1e3);k.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(k._currentTickersSequence[e]&&k._currentTickersSequence[e][t]){let i=k._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,k._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&k._currentTickersSequence[e]&&k._currentTickersSequence[e][t]&&(delete k._currentTickersSequence[e][t],Object.entries(k._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){return this.onTickerComplete(e,t)}onTickerComplete(e,t){let{stopTicker:i=true,aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o}=t,a=k._currentTickers[e],u=t.ignoreTickerSteps||false;this.remove(s),n.forEach(l=>this.resumeTicker({canvasAlias:l})),this.resumeTicker({id:o}),a&&(this.removeTicker(e,{stopTicker:i}),!u&&a.ticker.duration==null&&a.createdByTicketSteps&&this.nextTickerStep(a.createdByTicketSteps.canvasElementAlias,a.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(k._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(s)&&(o.ticker.canvasElementAliases.length===1?this.removeTicker(n):o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(a=>a!==s));}),k._currentTickersSequence[s]&&delete k._currentTickersSequence[s],k.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:i=t.prototype.id,e.forEach(s=>{k._currentTickersSequence[s]&&Object.entries(k._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete k._currentTickersSequence[s][n];});}),Object.entries(k._currentTickers).forEach(([s,n])=>{n.ticker.id===i&&(k._currentTickers[s].ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(k._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(k._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(k._currentTickers).forEach(([e,t])=>{t.ticker.canvasElementAliases=t.ticker.canvasElementAliases.filter(i=>this.find(i)),t.ticker.canvasElementAliases.length===0&&t.ticker.complete({ignoreTickerSteps:true});}),Object.entries(k._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete k._currentTickersSequence[e];}),Object.entries(k._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&k.removeTickerTimeout(e);});}removeAllTickers(){k._currentTickersSequence={},Object.keys(k._currentTickers).forEach(e=>{this.removeTicker(e);}),k._currentTickers={};for(let e in k._currentTickersTimeouts)k.removeTickerTimeout(e);k._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},k._tickersOnPause={};}removeTicker(e,t={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(i=>{let s=k._currentTickers[i];s&&(t.stopTicker&&s.ticker.stop(),delete k._currentTickers[i]);});}pauseTicker(e){let t=[];if("canvasAlias"in e){let{canvasAlias:i,tickerIdsExcluded:s=[]}=e;Object.entries(k._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(i)&&!s.includes(o.ticker.id)&&o.ticker.paused===false&&(o.ticker.pause(),t.push(n));});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),i.forEach(s=>{let n=k._currentTickers[s];n?n.ticker.paused===false&&(n.ticker.pause(),t.push(s)):A.error(`Ticker with id ${s} not found`);});}return t}resumeTicker(e){if("canvasAlias"in e){let{canvasAlias:t}=e;Object.values(k._currentTickers).forEach(i=>{i.ticker.canvasElementAliases.includes(t)&&i.ticker.play();}),delete k._tickersOnPause[t];}else if("id"in e){let{id:t}=e;typeof t=="string"&&(t=[t]),t.forEach(i=>{let s=k._currentTickers[i];s?s.ticker.play():A.error(`Ticker with id ${i} not found`);});}}isTickerPaused(e,t){let i=k._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}transferTickers(e,t,i="move"){k._currentTickersSequence[e]&&(i==="move"?k._currentTickersSequence[t]=pe(k._currentTickersSequence[e]):i==="duplicate"&&(k._currentTickersSequence[t]=pe(k._currentTickersSequence[e]))),Object.entries(k._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.ticker.canvasElementAliases.includes(e)){let o=ur.getInstance(n.ticker.id,pe(n.ticker.args),n.ticker.duration,n.ticker.priority);if(o?(o.canvasElementAliases=[t],this.addTicker(t,o),n.ticker.paused&&o.pause()):A.error(`Ticker ${n.ticker.id} not found`),i==="move"&&(n.ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(a=>a!==e)),n.ticker.args.hasOwnProperty(bO)){let a=n.ticker.args.aliasToRemoveAfter;typeof a=="string"&&(a=[a]),Array.isArray(a)&&(i==="move"?n.ticker.args.aliasToRemoveAfter=a.map(u=>u===e?t:u):i==="duplicate"&&a.find(u=>u===e)&&(n.ticker.args.aliasToRemoveAfter=[...a,t]));}}}),Object.values(k._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),k._currentTickersSequence[t]&&Object.keys(k._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&k._currentTickersSequence[e]&&Object.keys(k._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}completeTickerOnStepEnd(e){e.alias?k._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):k._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,t){if(t){let i=k._currentTickersSequence[t];if(i&&i[e])if(i[e].steps.includes(oo))A.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]);else {let s=i[e].steps.map(n=>{if(typeof n=="object"&&"ticker"in n){let o=ur.getInstance(n.ticker,n.args,n.duration,n.priority);if(o)return o.canvasElementAliases=[t],o.complete()}});await Promise.all(s);}}else {let i=k._currentTickers[e];i&&await i.ticker.complete();}}animate(e,t,i,s){try{t=pe(t);}catch(l){throw A.error("animate keyframes cannot contain functions or classes"),l}try{i=pe(i);}catch(l){throw A.error("animate options cannot contain functions or classes"),l}let n=[];typeof e=="string"?n=[e]:Array.isArray(e)?n=e.map(l=>typeof l=="string"?l:l.label):n=[e.label];let o;Array.isArray(t)?o=new Bu({sequence:t,options:i},void 0,s):o=new Iu({keyframes:t,options:i},void 0,s);let a=this.addTicker(n,o),{forceCompleteBeforeNext:u}=i||{};return a&&u&&this.completeTickerOnStepEnd({id:a}),a}addLayer(e,t){if(e===wr){A.error(`The alias ${wr} is reserved`);return}return t.label=e,k.app.stage.addChild(t)}getLayer(e){return k.app.stage.getChildByLabel(e)}removeLayer(e){k.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return k.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return k.removeHtmlLayer(e)}getHtmlLayer(e){return k.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAllTickers(),this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=jw(t));}),{tickers:pe(k.currentTickersWithoutCreatedBySteps),tickersSteps:pe(k._currentTickersSequence),elements:pe(e),stage:pe(wu(this.gameLayer)),elementAliasesOrder:pe(k.childrenAliasesOrder),tickersOnPause:pe(k._tickersOnPause),tickersToCompleteOnStepEnd:pe(k._tickersToCompleteOnStepEnd)}}async restore(e){this.clear();try{if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let t=e.elementAliasesOrder,i={},s=Object.entries(e.elements).map(async([n,o])=>{i[n]=await H0(o);});await Promise.all(s),t.forEach(n=>{let o=i[n];o&&this.add(n,o);});}else {A.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?ds(this.gameLayer,e.stage,{ignoreScale:!0}):A.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let t=e.tickers;Object.entries(t).forEach(([i,s])=>{let n=s.canvasElementAliases;if(n.length!==0){let o=ur.getInstance(s.id,s.args,s.duration,s.priority);o?(o.canvasElementAliases=n,this.addTicker(n,o,{id:i}),s.paused&&o.pause()):A.error(`Ticker ${s.id} not found`);}});}if(e.hasOwnProperty("tickersSteps")){let t=e.tickersSteps;Object.entries(t).forEach(([i,s])=>{k._currentTickersSequence[i]=s,Object.keys(s).forEach(n=>{this.runTickersSequence(i,n);});});}if(e.hasOwnProperty("tickersOnPause")){let t=e.tickersOnPause;Object.keys(t).forEach(i=>{let s=t[i];"tickerIdsExcluded"in s&&s.tickerIdsExcluded&&(t[i].tickerIdsExcluded=s.tickerIdsExcluded),"tickerIdsIncluded"in s&&s.tickerIdsIncluded&&(t[i].tickerIdsIncluded=s.tickerIdsIncluded);}),k._tickersOnPause=t;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let t=e.tickersToCompleteOnStepEnd,i=t.tikersIds,s=t.stepAlias.map(n=>({id:n.id,alias:n.alias}));k._tickersToCompleteOnStepEnd={tikersIds:i,stepAlias:s};}}catch(t){A.error("Error importing data",t);}}};var Rp=class{constructor(){w(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var Bp=class{constructor(){w(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};async function yO(r,e={},t){let i=I.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 s={x:i.position.x,y:i.position.y},{shakeType:n="horizontal",maxShockSize:o=10,shocksNumber:a=10,...u}=e,l=a-1;if(l<2){A.error("The number of shocks must be at least 3.");return}let c=Math.floor(l/2),h=Math.ceil(l/2),d=[];for(let _=0;_<c;_++){let x=o*(_+1)/c;n==="horizontal"?_%2!==0?d.push(s.x+x):d.push(s.x-x):_%2!==0?d.push(s.y+x):d.push(s.y-x);}let f=c%2===0;for(let _=h;_>0;_--){let x=o*(_+1)/(h-1);n==="horizontal"?_%2===0&&!f||_%2!==0&&f?d.push(s.x-x):d.push(s.x+x):_%2===0&&!f||_%2!==0&&f?d.push(s.y-x):d.push(s.y+x);}let m;if(n==="horizontal"?(d.push(s.x),m=I.animate(r,{x:d},u,t)):(d.push(s.y),m=I.animate(r,{y:d},u,t)),m)return [m]}Re();function Ip(r,e,t){let i=new Ye(t,e);return I.add(r,i),i}async function vO(r,e,t){let i=new Ye(t,e);return await i.load(),I.add(r,i),i}Re();function Dp(r,e,t){if(!e)if(ot.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return I.add(r,i),i}async function TO(r,e,t){if(!e)if(ot.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return await i.load(),I.add(r,i),i}Re();function kp(r,e,t){if(!e)if(ot.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new nr(t,e);return I.add(r,i),i}async function SO(r,e,t){if(!e)if(ot.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new nr(t,e);return await i.load(),I.add(r,i),i}function Jw(r,e){if(r.type==="align"){let t,i;e instanceof De&&(t=e.anchor.x,i=e.anchor.y);let s=ut(e.pivot,e.angle),n=ut(e.scale,e.angle);r.x=oi("width",r.x,ui(e),s.x,n.x<0,t),r.y=oi("height",r.y,li(e),s.y,n.y<0,i);}return r.type==="percentage"&&(r.x=ai("width",r.x),r.y=ai("height",r.y)),{x:r.x,y:r.y}}function Op(r,e){if(typeof e=="string")return Cp(e)?kp(r,e):Dp(r,e);if(Array.isArray(e))return Ip(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Cp(e.value)?kp(r,e.value,e.options):Dp(r,e.value,e.options);if(Array.isArray(e.value))return Ip(r,e.value,e.options)}return I.add(r,e),e}async function eP(r,e,t={},i){let{forceCompleteBeforeNext:s=true,tickerIdToResume:n=[],...o}=t,a=[];e||(e=r),typeof n=="string"&&(n=[n]);let u;if(I.find(r)&&(u=r+"_temp_disolve",I.editAlias(r,u)),e=Op(r,e),u&&I.copyCanvasElementProperty(u,r),u&&I.transferTickers(u,r,"duplicate"),e.alpha=0,u){let c=Fp(u,{...t,autoplay:false,forceCompleteBeforeNext:s},i);c&&(a.push(...c),n.push(...c));}let l=I.animate(r,{alpha:1},{...o,tickerIdToResume:n,forceCompleteBeforeNext:s},i);if(l&&a.push(l),(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function Fp(r,e={},t){let{forceCompleteBeforeNext:i=true,aliasToRemoveAfter:s=[],...n}=e;typeof s=="string"&&(s=[s]),s.push(r);let o=I.animate(r,{alpha:0},{...n,aliasToRemoveAfter:s,forceCompleteBeforeNext:i},t);if(o)return [o]}async function EO(r,e,t={},i){let{forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=t,a=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!I.find(r))return eP(r,e,t,i);let u=r+"_temp_fade";I.editAlias(r,u),n.push(u),e=Op(r,e),u&&I.copyCanvasElementProperty(u,r),u&&I.transferTickers(u,r,"duplicate"),e.alpha=0;let l=I.animate(r,{alpha:1},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},i);if(l){let c=Fp(u,{...t,tickerIdToResume:l,forceCompleteBeforeNext:s},i);c&&a.push(...c),a.push(l),I.pauseTicker({id:l});}if((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function AO(r,e={},t){return Fp(r,e,t)}async function CO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u,...l}=t,c=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let h;I.find(r)&&(h=r+"_temp_movein",I.editAlias(r,h)),e=Op(r,e),h&&I.copyCanvasElementProperty(h,r),h&&I.transferTickers(h,r,"move");let d;if(e instanceof Ue||e instanceof Ye?d=e.positionInfo:d={x:e.x,y:e.y,type:"pixel"},h)if(u){let _=W0(h,{...t,autoplay:false,forceCompleteBeforeNext:n},i);_&&(c.push(..._),o.push(..._));}else a.push(h);switch((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),s){case "up":e.y=I.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=I.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let f=I.pauseTicker({canvasAlias:r});o.push(...f);let m=I.animate(r,Jw(d,e),{...l,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(m&&c.push(m),c.length>0)return c}function W0(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=I.find(r);if(!a){A.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y};switch(i){case "up":u.y=-a.height;break;case "down":u.y=I.canvasHeight+a.height;break;case "left":u.x=-a.width;break;case "right":u.x=I.canvasWidth+a.width;break}I.pauseTicker({canvasAlias:r});let l=I.animate(r,u,{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(l)return [l]}async function wO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],...u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;I.find(r)&&(c=r+"_temp_zoom",I.editAlias(r,c)),e=Op(r,e),c&&I.copyCanvasElementProperty(c,r),c&&I.transferTickers(c,r,"move");let h;e instanceof Ue||e instanceof Ye?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d={x:e.pivot.x,y:e.pivot.y},f={x:e.scale.x,y:e.scale.y};if(c)if(t.removeOldComponentWithZoomOut){let x=tP(c,{...t,autoplay:false,forceCompleteBeforeNext:n},i);x&&(l.push(...x),o.push(...x));}else a.push(c);(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),s=="up"?(e.pivot.y=I.canvasHeight-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=I.canvasHeight,e.x=I.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=0,e.x=I.canvasWidth/2):s=="left"?(e.pivot.x=I.canvasWidth-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=I.canvasWidth,e.y=I.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=0,e.y=I.canvasHeight/2),e.pivot=qw(e.pivot,e.angle),e.scale.set(0);let m=I.pauseTicker({canvasAlias:r});o.push(...m);let _=I.animate(r,{...Jw(h,e),pivotX:d.x,pivotY:d.y,scaleX:f.x,scaleY:f.y},{...u,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(_&&l.push(_),l.length>0)return l}function tP(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=I.find(r);if(!a){A.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y},l={x:a.pivot.x,y:a.pivot.y};i=="down"?(u.y=I.canvasHeight,u.x=I.canvasWidth/2,l.y=I.canvasHeight-u.y,l.x=I.canvasWidth/2-u.x):i=="up"?(u.y=0,u.x=I.canvasWidth/2,l.y=0-u.y,l.x=I.canvasWidth/2-u.x):i=="right"?(u.x=I.canvasWidth,u.y=I.canvasHeight/2,l.x=I.canvasWidth-u.x,l.y=I.canvasHeight/2-u.y):i=="left"&&(u.x=0,u.y=I.canvasHeight/2,l.x=0-u.x,l.y=I.canvasHeight/2-u.y),l=qw(l,a.angle),I.pauseTicker({canvasAlias:r});let c=I.animate(r,{...u,pivotX:l.x,pivotY:l.y,scaleX:0,scaleY:0},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(c)return [c]}async function PO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],...a}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]);let l;I.find(r)&&(l=r+"_temp_push",I.editAlias(r,l)),e=Op(r,e),l&&I.copyCanvasElementProperty(l,r),l&&I.transferTickers(l,r,"move");let c;switch((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture?c=e.positionInfo:c={x:e.x,y:e.y,type:"pixel"},s){case "up":e.y=I.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=I.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let h=I.pauseTicker({canvasAlias:r});if(o.push(...h),l){let f=rP(l,{...t,direction:s,forceCompleteBeforeNext:n});f&&u.push(...f);}let d=I.animate(r,Jw(c,e),{...a,tickerIdToResume:o,forceCompleteBeforeNext:n},i);if(d&&u.push(d),(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function rP(r,e={direction:"right"},t){return W0(r,e,t)}Re();var Hr=class{constructor(e,t,i){w(this,"id","ticker_id_not_set");w(this,"args");w(this,"duration");w(this,"priority");w(this,"ticker",new _e);w(this,"tickerId");w(this,"canvasElementAliases",[]);w(this,"fnValue");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){A.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(e){this.tickerId=e;let t=()=>{let{createdByTicketSteps:i}=k._currentTickers[e],s=this.canvasElementAliases;if(i){if(I.isTickerPaused(i.canvasElementAlias,i.id))return}else s=s.filter(n=>!I.isTickerPaused(n,e));return this.fn(this.ticker,this.args,s,e)};this.fnValue=t,this.ticker.add(t,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};Re();Re();function go(r){return (r instanceof Ue||r instanceof Ye)&&r.haveEmptyTexture?false:!(r instanceof De&&r.texture?.label=="EMPTY")}function xo(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=iP(r[e],t):t.type==="exponential"&&(r[e]=sP(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=iP(r[e].x,t),r[e].y=iP(r[e].y,t)):t.type==="exponential"&&(r[e].x=sP(r[e].x,t),r[e].y=sP(r[e].y,t))));}function iP(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 sP(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 gN=5,gh=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=gN:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=I.find(c);return !(!h||o&&!go(h))}).forEach(c=>{let h=I.find(c);if(h&&h instanceof J){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.complete();return}else if(n==="hide"&&h.alpha<=l){this.complete();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.complete();return}}}),a&&xo(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=I.find(s);if(n){let o=this.getLimit(i);n.alpha=o;}});}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){A.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(gh);Re();var nP={};vs(nP,{createExportableElement:()=>pe});var xN=10;function _N(r,e){let t=pe(r.destination);if(t.type==="align"){let i,s;e instanceof De&&(i=e.anchor.x,s=e.anchor.y);let n=ut(e.pivot,e.angle),o=ut(e.scale,e.angle);t.x=oi("width",t.x,ui(e),n.x,o.x<0,i),t.y=oi("height",t.y,li(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=ai("width",t.x),t.y=ai("height",t.y)),t}var xh=class extends Hr{fn(e,t,i,s){t.speed===void 0&&(t.speed=xN);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=I.find(u);return !(!l||o&&!go(l))}).forEach(u=>{let l=I.find(u);if(l&&l instanceof J){let c=_N(t,l),h=c.x-l.x,d=c.y-l.y,f=h>0?1:-1,m=d>0?1:-1,_,x;if(typeof n=="number"){let g=this.speedConvert(n);h===0||d===0?_=x=g:(_=Math.abs(h/(h+d))*g,x=Math.abs(d/(h+d))*g);}else _=this.speedConvert(n.x),x=this.speedConvert(n.y);if(_>0){l.x+=f*_*e.deltaTime;let g=c.x-l.x;(f<0&&g>0||f>0&&g<0)&&(l.x=c.x);}if(x>0){l.y+=m*x*e.deltaTime;let g=c.y-l.y;(m<0&&g>0||m>0&&g<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.complete();return}else if(_<1e-5&&x<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){A.warn("The speed of the MoveTicker must be greater than 0."),this.complete();return}}}),a&&xo(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=I.find(s);if(n){let o=i.destination;n instanceof Ue||n instanceof Ye?n.positionInfo=o:(n.x=o.x,n.y=o.y);}});}speedConvert(e){return e*(66/400)}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){A.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(xh);Re();var bN=1,_h=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=bN);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=I.find(l);return !(!c||t.startOnlyIfHaveTexture&&!go(c))}).forEach(l=>{let c=I.find(l);if(c&&c instanceof J&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.complete()):!n&&c.angle<=a&&(c.angle=a,this.complete())),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){A.warn("The speed of the RotateTicker must be greater than 0."),this.complete();return}}),o&&xo(t,"speed",o);}onComplete(e,t,i){let{limit:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);o&&s!==void 0&&(o.angle=s);});}speedConvert(e){return e/100}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){A.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(_h);Re();var yN=10,bh=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=yN);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(d=>{let f=I.find(d);return !(!f||a&&!go(f))}).forEach(d=>{let f=I.find(d);if(f&&f instanceof J){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.complete();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.complete();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.complete();return}}}),u&&xo(t,"speed",u);}speedConvert(e){return e/600}onComplete(e,t,i){let{isZoomInOut:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);if(o){let a=this.getLimit(i);if(o.scale.x=a.x,o.scale.y=a.y,s){let{pivot:u,position:l}=s;o.pivot=u.x,o.position=l;}}});}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){A.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(bh);function oP(r,e){r.indexOf(e)===-1&&r.push(e);}function Du(r,e){let t=r.indexOf(e);t>-1&&r.splice(t,1);}var Mr=(r,e,t)=>t>e?e:t<r?r:t;function Gp(r,e){return e?`${r}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:r}var gs=()=>{},Ht=()=>{};process.env.NODE_ENV!=="production"&&(gs=(r,e,t)=>{!r&&typeof console<"u"&&console.warn(Gp(e,t));},Ht=(r,e,t)=>{if(!r)throw new Error(Gp(e,t))});var lr={};var Up=r=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(r);function aP(r){return typeof r=="object"&&r!==null}var Lp=r=>/^0[^.\s]+$/u.test(r);function ku(r){let e;return ()=>(e===void 0&&(e=r()),e)}var zr=r=>r;var vN=(r,e)=>t=>e(r(t)),Ou=(...r)=>r.reduce(vN);var Fu=(r,e,t)=>{let i=e-r;return i===0?1:(t-r)/i};var Gu=class{constructor(){this.subscriptions=[];}add(e){return oP(this.subscriptions,e),()=>Du(this.subscriptions,e)}notify(e,t,i){let s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,t,i);else for(let n=0;n<s;n++){let o=this.subscriptions[n];o&&o(e,t,i);}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0;}};var Dt=r=>r*1e3,xr=r=>r/1e3;function Np(r,e){return e?r*(1e3/e):0}var MO=new Set;function Vp(r,e,t){r||MO.has(e)||(console.warn(Gp(e,t)),MO.add(e));}var RO=(r,e,t)=>{let i=e-r;return ((t-r)%i+i)%i+r};var BO=(r,e,t)=>(((1-3*t+3*e)*r+(3*t-6*e))*r+3*e)*r,TN=1e-7,SN=12;function EN(r,e,t,i,s){let n,o,a=0;do o=e+(t-e)/2,n=BO(o,i,s)-r,n>0?t=o:e=o;while(Math.abs(n)>TN&&++a<SN);return o}function _o(r,e,t,i){if(r===e&&t===i)return zr;let s=n=>EN(n,0,1,r,t);return n=>n===0||n===1?n:BO(s(n),e,i)}var X0=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2;var Y0=r=>e=>1-r(1-e);var j0=_o(.33,1.53,.69,.99),yh=Y0(j0),Hp=X0(yh);var zp=r=>(r*=2)<1?.5*yh(r):.5*(2-Math.pow(2,-10*(r-1)));var Wp=r=>1-Math.sin(Math.acos(r)),uP=Y0(Wp),Xp=X0(Wp);var lP=_o(.42,0,1,1),cP=_o(0,0,.58,1),Yp=_o(.42,0,.58,1);var jp=r=>Array.isArray(r)&&typeof r[0]!="number";function $p(r,e){return jp(r)?r[RO(0,r.length,e)]:r}var qp=r=>Array.isArray(r)&&typeof r[0]=="number";var IO={linear:zr,easeIn:lP,easeInOut:Yp,easeOut:cP,circIn:Wp,circInOut:Xp,circOut:uP,backIn:yh,backInOut:Hp,backOut:j0,anticipate:zp},AN=r=>typeof r=="string",$0=r=>{if(qp(r)){Ht(r.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,t,i,s]=r;return _o(e,t,i,s)}else if(AN(r))return Ht(IO[r]!==void 0,`Invalid easing type '${r}'`,"invalid-easing-type"),IO[r];return r};var Kp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function DO(r,e){let t=new Set,i=new Set,s=false,n=false,o=new WeakSet,a={delta:0,timestamp:0,isProcessing:false};function l(h){o.has(h)&&(c.schedule(h),r()),h(a);}let c={schedule:(h,d=false,f=false)=>{let _=f&&s?t:i;return d&&o.add(h),_.has(h)||_.add(h),h},cancel:h=>{i.delete(h),o.delete(h);},process:h=>{if(a=h,s){n=true;return}s=true,[t,i]=[i,t],t.forEach(l),t.clear(),s=false,n&&(n=false,c.process(h));}};return c}var CN=40;function q0(r,e){let t=false,i=true,s={delta:0,timestamp:0,isProcessing:false},n=()=>t=true,o=Kp.reduce((v,S)=>(v[S]=DO(n),v),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:d,render:f,postRender:m}=o,_=()=>{let v=lr.useManualTiming?s.timestamp:performance.now();t=false,lr.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(v-s.timestamp,CN),1)),s.timestamp=v,s.isProcessing=true,a.process(s),u.process(s),l.process(s),c.process(s),h.process(s),d.process(s),f.process(s),m.process(s),s.isProcessing=false,t&&e&&(i=false,r(_));},x=()=>{t=true,i=true,s.isProcessing||r(_);};return {schedule:Kp.reduce((v,S)=>{let C=o[S];return v[S]=(E,M=false,D=false)=>(t||x(),C.schedule(E,M,D)),v},{}),cancel:v=>{for(let S=0;S<Kp.length;S++)o[Kp[S]].cancel(v);},state:s,steps:o}}var{schedule:cr,cancel:Th,state:Uu}=q0(typeof requestAnimationFrame<"u"?requestAnimationFrame:zr,true);var K0;function PN(){K0=void 0;}var zt={now:()=>(K0===void 0&&zt.set(Uu.isProcessing||lr.useManualTiming?Uu.timestamp:performance.now()),K0),set:r=>{K0=r,queueMicrotask(PN);}};var kO=r=>e=>typeof e=="string"&&e.startsWith(r),Zp=kO("--"),MN=kO("var(--"),Lu=r=>MN(r)?RN.test(r.split("/*")[0].trim()):false,RN=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var xs={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},Xs={...xs,transform:r=>Mr(0,1,r)},Qp={...xs,default:1};var bo=r=>Math.round(r*1e5)/1e5;var Eh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function OO(r){return r==null}var FO=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Ah=(r,e)=>t=>!!(typeof t=="string"&&FO.test(t)&&t.startsWith(r)||e&&!OO(t)&&Object.prototype.hasOwnProperty.call(t,e)),Z0=(r,e,t)=>i=>{if(typeof i!="string")return i;let[s,n,o,a]=i.match(Eh);return {[r]:parseFloat(s),[e]:parseFloat(n),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var BN=r=>Mr(0,255,r),hP={...xs,transform:r=>Math.round(BN(r))},_s={test:Ah("rgb","red"),parse:Z0("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:i=1})=>"rgba("+hP.transform(r)+", "+hP.transform(e)+", "+hP.transform(t)+", "+bo(Xs.transform(i))+")"};function IN(r){let e="",t="",i="",s="";return r.length>5?(e=r.substring(1,3),t=r.substring(3,5),i=r.substring(5,7),s=r.substring(7,9)):(e=r.substring(1,2),t=r.substring(2,3),i=r.substring(3,4),s=r.substring(4,5),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}var Jp={test:Ah("#"),parse:IN,transform:_s.transform};var em=r=>({test:e=>typeof e=="string"&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),Gi=em("deg"),Ys=em("%"),ie=em("px"),dP=em("vh"),fP=em("vw"),Q0={...Ys,parse:r=>Ys.parse(r)/100,transform:r=>Ys.transform(r*100)};var yo={test:Ah("hsl","hue"),parse:Z0("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(r)+", "+Ys.transform(bo(e))+", "+Ys.transform(bo(t))+", "+bo(Xs.transform(i))+")"};var lt={test:r=>_s.test(r)||Jp.test(r)||yo.test(r),parse:r=>_s.test(r)?_s.parse(r):yo.test(r)?yo.parse(r):Jp.parse(r),transform:r=>typeof r=="string"?r:r.hasOwnProperty("red")?_s.transform(r):yo.transform(r),getAnimatableNone:r=>{let e=lt.parse(r);return e.alpha=0,lt.transform(e)}};var GO=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function DN(r){return isNaN(r)&&typeof r=="string"&&(r.match(Eh)?.length||0)+(r.match(GO)?.length||0)>0}var LO="number",NO="color",kN="var",ON="var(",UO="${}",FN=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vo(r){let e=r.toString(),t=[],i={color:[],number:[],var:[]},s=[],n=0,a=e.replace(FN,u=>(lt.test(u)?(i.color.push(n),s.push(NO),t.push(lt.parse(u))):u.startsWith(ON)?(i.var.push(n),s.push(kN),t.push(u)):(i.number.push(n),s.push(LO),t.push(parseFloat(u))),++n,UO)).split(UO);return {values:t,split:a,indexes:i,types:s}}function VO(r){return vo(r).values}function HO(r){let{split:e,types:t}=vo(r),i=e.length;return s=>{let n="";for(let o=0;o<i;o++)if(n+=e[o],s[o]!==void 0){let a=t[o];a===LO?n+=bo(s[o]):a===NO?n+=lt.transform(s[o]):n+=s[o];}return n}}var GN=r=>typeof r=="number"?0:lt.test(r)?lt.getAnimatableNone(r):r;function UN(r){let e=VO(r);return HO(r)(e.map(GN))}var Wr={test:DN,parse:VO,createTransformer:HO,getAnimatableNone:UN};function pP(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function zO({hue:r,saturation:e,lightness:t,alpha:i}){r/=360,e/=100,t/=100;let s=0,n=0,o=0;if(!e)s=n=o=t;else {let a=t<.5?t*(1+e):t+e-t*e,u=2*t-a;s=pP(u,a,r+1/3),n=pP(u,a,r),o=pP(u,a,r-1/3);}return {red:Math.round(s*255),green:Math.round(n*255),blue:Math.round(o*255),alpha:i}}function Ch(r,e){return t=>t>0?e:r}var Ui=(r,e,t)=>r+(e-r)*t;var mP=(r,e,t)=>{let i=r*r,s=t*(e*e-i)+i;return s<0?0:Math.sqrt(s)},LN=[Jp,_s,yo],NN=r=>LN.find(e=>e.test(r));function WO(r){let e=NN(r);if(gs(!!e,`'${r}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return false;let t=e.parse(r);return e===yo&&(t=zO(t)),t}var gP=(r,e)=>{let t=WO(r),i=WO(e);if(!t||!i)return Ch(r,e);let s={...t};return n=>(s.red=mP(t.red,i.red,n),s.green=mP(t.green,i.green,n),s.blue=mP(t.blue,i.blue,n),s.alpha=Ui(t.alpha,i.alpha,n),_s.transform(s))};var J0=new Set(["none","hidden"]);function XO(r,e){return J0.has(r)?t=>t<=0?r:e:t=>t>=1?e:r}function VN(r,e){return t=>Ui(r,e,t)}function ev(r){return typeof r=="number"?VN:typeof r=="string"?Lu(r)?Ch:lt.test(r)?gP:WN:Array.isArray(r)?YO:typeof r=="object"?lt.test(r)?gP:HN:Ch}function YO(r,e){let t=[...r],i=t.length,s=r.map((n,o)=>ev(n)(n,e[o]));return n=>{for(let o=0;o<i;o++)t[o]=s[o](n);return t}}function HN(r,e){let t={...r,...e},i={};for(let s in t)r[s]!==void 0&&e[s]!==void 0&&(i[s]=ev(r[s])(r[s],e[s]));return s=>{for(let n in i)t[n]=i[n](s);return t}}function zN(r,e){let t=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let n=e.types[s],o=r.indexes[n][i[n]],a=r.values[o]??0;t[s]=a,i[n]++;}return t}var WN=(r,e)=>{let t=Wr.createTransformer(e),i=vo(r),s=vo(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?J0.has(r)&&!s.values.length||J0.has(e)&&!i.values.length?XO(r,e):Ou(YO(zN(i,s),s.values),t):(gs(true,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ch(r,e))};function tv(r,e,t){return typeof r=="number"&&typeof e=="number"&&typeof t=="number"?Ui(r,e,t):ev(r)(r,e)}var jO=r=>{let e=({timestamp:t})=>r(t);return {start:(t=true)=>cr.update(e,t),stop:()=>Th(e),now:()=>Uu.isProcessing?Uu.timestamp:zt.now()}};var rv=(r,e,t=10)=>{let i="",s=Math.max(Math.round(e/t),2);for(let n=0;n<s;n++)i+=Math.round(r(n/(s-1))*1e4)/1e4+", ";return `linear(${i.substring(0,i.length-2)})`};function wh(r){let e=0,t=50,i=r.next(e);for(;!i.done&&e<2e4;)e+=t,i=r.next(e);return e>=2e4?1/0:e}function tm(r,e=100,t){let i=t({...r,keyframes:[0,e]}),s=Math.min(wh(i),2e4);return {type:"keyframes",ease:n=>i.next(s*n).value/e,duration:xr(s)}}var XN=5;function iv(r,e,t){let i=Math.max(e-XN,0);return Np(t-r(i),e-i)}var et={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var _P=.001;function $O({duration:r=et.duration,bounce:e=et.bounce,velocity:t=et.velocity,mass:i=et.mass}){let s,n;gs(r<=Dt(et.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=Mr(et.minDamping,et.maxDamping,o),r=Mr(et.minDuration,et.maxDuration,xr(r)),o<1?(s=l=>{let c=l*o,h=c*r,d=c-t,f=sv(l,o),m=Math.exp(-h);return _P-d/f*m},n=l=>{let h=l*o*r,d=h*t+t,f=Math.pow(o,2)*Math.pow(l,2)*r,m=Math.exp(-h),_=sv(Math.pow(l,2),o);return (-s(l)+_P>0?-1:1)*((d-f)*m)/_}):(s=l=>{let c=Math.exp(-l*r),h=(l-t)*r+1;return -_P+c*h},n=l=>{let c=Math.exp(-l*r),h=(t-l)*(r*r);return c*h});let a=5/r,u=jN(s,n,a);if(r=Dt(r),isNaN(u))return {stiffness:et.stiffness,damping:et.damping,duration:r};{let l=Math.pow(u,2)*i;return {stiffness:l,damping:o*2*Math.sqrt(i*l),duration:r}}}var YN=12;function jN(r,e,t){let i=t;for(let s=1;s<YN;s++)i=i-r(i)/e(i);return i}function sv(r,e){return r*Math.sqrt(1-e*e)}var $N=["duration","bounce"],qN=["stiffness","damping","mass"];function qO(r,e){return e.some(t=>r[t]!==void 0)}function KN(r){let e={velocity:et.velocity,stiffness:et.stiffness,damping:et.damping,mass:et.mass,isResolvedFromDuration:false,...r};if(!qO(r,qN)&&qO(r,$N))if(r.visualDuration){let t=r.visualDuration,i=2*Math.PI/(t*1.2),s=i*i,n=2*Mr(.05,1,1-(r.bounce||0))*Math.sqrt(s);e={...e,mass:et.mass,stiffness:s,damping:n};}else {let t=$O(r);e={...e,...t,mass:et.mass},e.isResolvedFromDuration=true;}return e}function js(r=et.visualDuration,e=et.bounce){let t=typeof r!="object"?{visualDuration:r,keyframes:[0,1],bounce:e}:r,{restSpeed:i,restDelta:s}=t,n=t.keyframes[0],o=t.keyframes[t.keyframes.length-1],a={done:false,value:n},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=KN({...t,velocity:-xr(t.velocity||0)}),m=d||0,_=l/(2*Math.sqrt(u*c)),x=o-n,g=xr(Math.sqrt(u/c)),y=Math.abs(x)<5;i||(i=y?et.restSpeed.granular:et.restSpeed.default),s||(s=y?et.restDelta.granular:et.restDelta.default);let v;if(_<1){let C=sv(g,_);v=E=>{let M=Math.exp(-_*g*E);return o-M*((m+_*g*x)/C*Math.sin(C*E)+x*Math.cos(C*E))};}else if(_===1)v=C=>o-Math.exp(-g*C)*(x+(m+g*x)*C);else {let C=g*Math.sqrt(_*_-1);v=E=>{let M=Math.exp(-_*g*E),D=Math.min(C*E,300);return o-M*((m+_*g*x)*Math.sinh(D)+C*x*Math.cosh(D))/C};}let S={calculatedDuration:f&&h||null,next:C=>{let E=v(C);if(f)a.done=C>=h;else {let M=C===0?m:0;_<1&&(M=C===0?Dt(m):iv(v,C,E));let D=Math.abs(M)<=i,R=Math.abs(o-E)<=s;a.done=D&&R;}return a.value=a.done?o:E,a},toString:()=>{let C=Math.min(wh(S),2e4),E=rv(M=>S.next(C*M).value,C,30);return C+"ms "+E},toTransition:()=>{}};return S}js.applyToOptions=r=>{let e=tm(r,100,js);return r.ease=e.ease,r.duration=Dt(e.duration),r.type="keyframes",r};function rm({keyframes:r,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:n=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){let h=r[0],d={done:false,value:h},f=D=>a!==void 0&&D<a||u!==void 0&&D>u,m=D=>a===void 0?u:u===void 0||Math.abs(a-D)<Math.abs(u-D)?a:u,_=t*e,x=h+_,g=o===void 0?x:o(x);g!==x&&(_=g-h);let y=D=>-_*Math.exp(-D/i),v=D=>g+y(D),S=D=>{let R=y(D),L=v(D);d.done=Math.abs(R)<=l,d.value=d.done?g:L;},C,E,M=D=>{f(d.value)&&(C=D,E=js({keyframes:[d.value,m(d.value)],velocity:iv(v,D,d.value),damping:s,stiffness:n,restDelta:l,restSpeed:c}));};return M(0),{calculatedDuration:null,next:D=>{let R=false;return !E&&C===void 0&&(R=true,S(D),M(D)),C!==void 0&&D>=C?E.next(D-C):(!R&&S(D),d)}}}function ZN(r,e,t){let i=[],s=t||lr.mix||tv,n=r.length-1;for(let o=0;o<n;o++){let a=s(r[o],r[o+1]);if(e){let u=Array.isArray(e)?e[o]||zr:e;a=Ou(u,a);}i.push(a);}return i}function KO(r,e,{clamp:t=true,ease:i,mixer:s}={}){let n=r.length;if(Ht(n===e.length,"Both input and output ranges must be the same length","range-length"),n===1)return ()=>e[0];if(n===2&&e[0]===e[1])return ()=>e[1];let o=r[0]===r[1];r[0]>r[n-1]&&(r=[...r].reverse(),e=[...e].reverse());let a=ZN(e,i,s),u=a.length,l=c=>{if(o&&c<r[0])return e[0];let h=0;if(u>1)for(;h<r.length-2&&!(c<r[h+1]);h++);let d=Fu(r[h],r[h+1],c);return a[h](d)};return t?c=>l(Mr(r[0],r[n-1],c)):l}function im(r,e){let t=r[r.length-1];for(let i=1;i<=e;i++){let s=Fu(0,e,i);r.push(Ui(t,1,s));}}function sm(r){let e=[0];return im(e,r.length-1),e}function ZO(r,e){return r.map(t=>t*e)}function QN(r,e){return r.map(()=>e||Yp).splice(0,r.length-1)}function To({duration:r=300,keyframes:e,times:t,ease:i="easeInOut"}){let s=jp(i)?i.map($0):$0(i),n={done:false,value:e[0]},o=ZO(t&&t.length===e.length?t:sm(e),r),a=KO(o,e,{ease:Array.isArray(s)?s:QN(e,s)});return {calculatedDuration:r,next:u=>(n.value=a(u),n.done=u>=r,n)}}var JN=r=>r!==null;function Ph(r,{repeat:e,repeatType:t="loop"},i,s=1){let n=r.filter(JN),a=s<0||e&&t!=="loop"&&e%2===1?0:n.length-1;return !a||i===void 0?n[a]:i}var e5={decay:rm,inertia:rm,tween:To,keyframes:To,spring:js};function nv(r){typeof r.type=="string"&&(r.type=e5[r.type]);}var So=class{constructor(){this.updateFinished();}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e;});}notifyFinished(){this.resolve();}then(e,t){return this.finished.then(e,t)}};var t5=r=>r/100,$s=class extends So{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=false,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==zt.now()&&this.tick(zt.now()),this.isStopped=true,this.state!=="idle"&&(this.teardown(),this.options.onStop?.());},this.options=e,this.initAnimation(),this.play(),e.autoplay===false&&this.pause();}initAnimation(){let{options:e}=this;nv(e);let{type:t=To,repeat:i=0,repeatDelay:s=0,repeatType:n,velocity:o=0}=e,{keyframes:a}=e,u=t||To;process.env.NODE_ENV!=="production"&&u!==To&&Ht(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),u!==To&&typeof a[0]!="number"&&(this.mixKeyframes=Ou(t5,tv(a[0],a[1])),a=[0,100]);let l=u({...e,keyframes:a});n==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=wh(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=l;}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t;}tick(e,t=false){let{generator:i,totalDuration:s,mixKeyframes:n,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return i.next(0);let{delay:l=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:f,type:m,onUpdate:_,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,S=i;if(h){let D=Math.min(this.currentTime,s)/a,R=Math.floor(D),L=D%1;!L&&D>=1&&(L=1),L===1&&R--,R=Math.min(R,h+1),!!(R%2)&&(d==="reverse"?(L=1-L,f&&(L-=f/a)):d==="mirror"&&(S=o)),v=Mr(0,1,L)*a;}let C=y?{done:false,value:c[0]}:S.next(v);n&&(C.value=n(C.value));let{done:E}=C;!y&&u!==null&&(E=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);let M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return M&&m!==rm&&(C.value=Ph(c,this.options,x,this.speed)),_&&_(C.value),M&&this.finish(),C}then(e,t){return this.finished.then(e,t)}get duration(){return xr(this.calculatedDuration)}get time(){return xr(this.currentTime)}set time(e){e=Dt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(false);}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(zt.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=xr(this.currentTime));}play(){if(this.isStopped)return;let{driver:e=jO,startTime:t}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),this.options.onPlay?.();let i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=t??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start();}pause(){this.state="paused",this.updateTime(zt.now()),this.holdTime=this.currentTime;}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null;}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.();}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.();}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null;}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0);}sample(e){return this.startTime=0,this.tick(e,true)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function QO(r){for(let e=1;e<r.length;e++)r[e]??(r[e]=r[e-1]);}var Nu=r=>r*180/Math.PI,bP=r=>{let e=Nu(Math.atan2(r[1],r[0]));return yP(e)},r5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:r=>(Math.abs(r[0])+Math.abs(r[3]))/2,rotate:bP,rotateZ:bP,skewX:r=>Nu(Math.atan(r[1])),skewY:r=>Nu(Math.atan(r[2])),skew:r=>(Math.abs(r[1])+Math.abs(r[2]))/2},yP=r=>(r=r%360,r<0&&(r+=360),r),JO=bP,eF=r=>Math.sqrt(r[0]*r[0]+r[1]*r[1]),tF=r=>Math.sqrt(r[4]*r[4]+r[5]*r[5]),i5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:eF,scaleY:tF,scale:r=>(eF(r)+tF(r))/2,rotateX:r=>yP(Nu(Math.atan2(r[6],r[5]))),rotateY:r=>yP(Nu(Math.atan2(-r[2],r[0]))),rotateZ:JO,rotate:JO,skewX:r=>Nu(Math.atan(r[4])),skewY:r=>Nu(Math.atan(r[1])),skew:r=>(Math.abs(r[1])+Math.abs(r[4]))/2};function nm(r){return r.includes("scale")?1:0}function om(r,e){if(!r||r==="none")return nm(e);let t=r.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),i,s;if(t)i=i5,s=t;else {let a=r.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=r5,s=a;}if(!s)return nm(e);let n=i[e],o=s[1].split(",").map(s5);return typeof n=="function"?n(o):o[n]}var vP=(r,e)=>{let{transform:t="none"}=getComputedStyle(r);return om(t,e)};function s5(r){return parseFloat(r.trim())}var Li=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xr=new Set(Li);var TP=r=>r===xs||r===ie,n5=new Set(["x","y","z"]),o5=Li.filter(r=>!n5.has(r));function rF(r){let e=[];return o5.forEach(t=>{let i=r.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0));}),e}var Eo={width:({x:r},{paddingLeft:e="0",paddingRight:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),height:({y:r},{paddingTop:e="0",paddingBottom:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),top:(r,{top:e})=>parseFloat(e),left:(r,{left:e})=>parseFloat(e),bottom:({y:r},{top:e})=>parseFloat(e)+(r.max-r.min),right:({x:r},{left:e})=>parseFloat(e)+(r.max-r.min),x:(r,{transform:e})=>om(e,"x"),y:(r,{transform:e})=>om(e,"y")};Eo.translateX=Eo.x;Eo.translateY=Eo.y;var Vu=new Set,SP=false,EP=false,AP=false;function iF(){if(EP){let r=Array.from(Vu).filter(i=>i.needsMeasurement),e=new Set(r.map(i=>i.element)),t=new Map;e.forEach(i=>{let s=rF(i);s.length&&(t.set(i,s),i.render());}),r.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();let s=t.get(i);s&&s.forEach(([n,o])=>{i.getValue(n)?.set(o);});}),r.forEach(i=>i.measureEndState()),r.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY);});}EP=false,SP=false,Vu.forEach(r=>r.complete(AP)),Vu.clear();}function sF(){Vu.forEach(r=>{r.readKeyframes(),r.needsMeasurement&&(EP=true);});}function CP(){AP=true,sF(),iF(),AP=false;}var qs=class{constructor(e,t,i,s,n,o=false){this.state="pending",this.isAsync=false,this.needsMeasurement=false,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=s,this.element=n,this.isAsync=o;}scheduleResolve(){this.state="scheduled",this.isAsync?(Vu.add(this),SP||(SP=true,cr.read(sF),cr.resolveKeyframes(iF))):(this.readKeyframes(),this.complete());}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:i,motionValue:s}=this;if(e[0]===null){let n=s?.get(),o=e[e.length-1];if(n!==void 0)e[0]=n;else if(i&&t){let a=i.readValue(t,o);a!=null&&(e[0]=a);}e[0]===void 0&&(e[0]=o),s&&n===void 0&&s.set(e[0]);}QO(e);}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=false){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vu.delete(this);}cancel(){this.state==="scheduled"&&(Vu.delete(this),this.state="pending");}resume(){this.state==="pending"&&this.scheduleResolve();}};var nF=r=>r.startsWith("--");function oF(r,e,t){nF(e)?r.style.setProperty(e,t):r.style[e]=t;}var aF=ku(()=>window.ScrollTimeline!==void 0);var uF={};function lF(r,e){let t=ku(r);return ()=>uF[e]??t()}var ov=lF(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"});}catch{return false}return true},"linearEasing");var Hu=([r,e,t,i])=>`cubic-bezier(${r}, ${e}, ${t}, ${i})`;var wP={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hu([0,.65,.55,1]),circOut:Hu([.55,0,1,.45]),backIn:Hu([.31,.01,.66,-0.59]),backOut:Hu([.33,1.53,.69,.99])};function PP(r,e){if(r)return typeof r=="function"?ov()?rv(r,e):"ease-out":qp(r)?Hu(r):Array.isArray(r)?r.map(t=>PP(t,e)||wP.easeOut):wP[r]}function cF(r,e,t,{delay:i=0,duration:s=300,repeat:n=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){let c={[e]:t};u&&(c.offset=u);let h=PP(a,s);Array.isArray(h)&&(c.easing=h);let d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:n+1,direction:o==="reverse"?"alternate":"normal"};l&&(d.pseudoElement=l);let f=r.animate(c,d);return f}function zu(r){return typeof r=="function"&&"applyToOptions"in r}function hF({type:r,...e}){return zu(r)&&ov()?r.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}var av=class extends So{constructor(e){if(super(),this.finishedTime=null,this.isStopped=false,!e)return;let{element:t,name:i,keyframes:s,pseudoElement:n,allowFlatten:o=false,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!n,this.allowFlatten=o,this.options=e,Ht(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let l=hF(e);this.animation=cF(t,i,s,l,n),l.autoplay===false&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){let c=Ph(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):oF(t,i,c),this.animation.cancel();}u?.(),this.notifyFinished();};}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished());}pause(){this.animation.pause();}complete(){this.animation.finish?.();}cancel(){try{this.animation.cancel();}catch{}}stop(){if(this.isStopped)return;this.isStopped=true;let{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel());}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.();}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return xr(Number(e))}get time(){return xr(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Dt(e);}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e;}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e;}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&aF()?(this.animation.timeline=e,zr):t(this)}};var dF={anticipate:zp,backInOut:Hp,circInOut:Xp};function a5(r){return r in dF}function fF(r){typeof r.ease=="string"&&a5(r.ease)&&(r.ease=dF[r.ease]);}var pF=10,uv=class extends av{constructor(e){fF(e),nv(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e;}updateMotionValue(e){let{motionValue:t,onUpdate:i,onComplete:s,element:n,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let a=new $s({...o,autoplay:false}),u=Dt(this.finishedTime??this.time);t.setWithVelocity(a.sample(u-pF).value,a.sample(u).value,pF),a.stop();}};var MP=(r,e)=>e==="zIndex"?false:!!(typeof r=="number"||Array.isArray(r)||typeof r=="string"&&(Wr.test(r)||r==="0")&&!r.startsWith("url("));function u5(r){let e=r[0];if(r.length===1)return true;for(let t=0;t<r.length;t++)if(r[t]!==e)return true}function mF(r,e,t,i){let s=r[0];if(s===null)return false;if(e==="display"||e==="visibility")return true;let n=r[r.length-1],o=MP(s,e),a=MP(n,e);return gs(o===a,`You are trying to animate ${e} from "${s}" to "${n}". "${o?n:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?false:u5(r)||(t==="spring"||zu(t))&&i}function Mh(r){r.duration=0,r.type;}var l5=new Set(["opacity","clipPath","filter","transform"]),c5=ku(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function gF(r){let{motionValue:e,name:t,repeatDelay:i,repeatType:s,damping:n,type:o}=r;if(!(e?.owner?.current instanceof HTMLElement))return false;let{onUpdate:u,transformTemplate:l}=e.owner.getProps();return c5()&&t&&l5.has(t)&&(t!=="transform"||!l)&&!u&&!i&&s!=="mirror"&&n!==0&&o!=="inertia"}var h5=40,am=class extends So{constructor({autoplay:e=true,delay:t=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel();},this.createdAt=zt.now();let d={autoplay:e,delay:t,type:i,repeat:s,repeatDelay:n,repeatType:o,name:u,motionValue:l,element:c,...h},f=c?.KeyframeResolver||qs;this.keyframeResolver=new f(a,(m,_,x)=>this.onKeyframesResolved(m,_,d,!x),u,l,c),this.keyframeResolver?.scheduleResolve();}onKeyframesResolved(e,t,i,s){this.keyframeResolver=void 0;let{name:n,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=i;this.resolvedAt=zt.now(),mF(e,n,o,a)||((lr.instantAnimations||!u)&&c?.(Ph(e,i,t)),e[0]=e[e.length-1],Mh(i),i.repeat=0);let d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>h5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...i,keyframes:e},f=!l&&gF(d)?new uv({...d,element:d.motionValue.owner.current}):new $s(d);f.finished.then(()=>this.notifyFinished()).catch(zr),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f;}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),CP()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e;}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e;}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play();}pause(){this.animation.pause();}complete(){this.animation.complete();}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel();}};var lv=class{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean);}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t;}attachTimeline(e){let t=this.animations.map(i=>i.attachTimeline(e));return ()=>{t.forEach((i,s)=>{i&&i(),this.animations[s].stop();});}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e);}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e);}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]());}play(){this.runAll("play");}pause(){this.runAll("pause");}cancel(){this.runAll("cancel");}complete(){this.runAll("complete");}};var um=class extends lv{then(e,t){return this.finished.finally(e).then(()=>{})}};var d5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function f5(r){let e=d5.exec(r);if(!e)return [,];let[,t,i,s]=e;return [`--${t??i}`,s]}var p5=4;function RP(r,e,t=1){Ht(t<=p5,`Max CSS variable fallback depth detected in property "${r}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[i,s]=f5(r);if(!i)return;let n=window.getComputedStyle(e).getPropertyValue(i);if(n){let o=n.trim();return Up(o)?parseFloat(o):o}return Lu(s)?RP(s,e,t+1):s}function lm(r,e){return r?.[e]??r?.default??r}var cm=new Set(["width","height","top","left","right","bottom",...Li]);var xF={test:r=>r==="auto",parse:r=>r};var cv=r=>e=>e.test(r);var BP=[xs,ie,Ys,Gi,fP,dP,xF],IP=r=>BP.find(cv(r));function _F(r){return typeof r=="number"?r===0:r!==null?r==="none"||r==="0"||Lp(r):true}var m5=new Set(["brightness","contrast","saturate","opacity"]);function g5(r){let[e,t]=r.slice(0,-1).split("(");if(e==="drop-shadow")return r;let[i]=t.match(Eh)||[];if(!i)return r;let s=t.replace(i,""),n=m5.has(e)?1:0;return i!==t&&(n*=100),e+"("+n+s+")"}var x5=/\b([a-z-]*)\(.*?\)/gu,hm={...Wr,getAnimatableNone:r=>{let e=r.match(x5);return e?e.map(g5).join(" "):r}};var DP={...xs,transform:Math.round};var bF={rotate:Gi,rotateX:Gi,rotateY:Gi,rotateZ:Gi,scale:Qp,scaleX:Qp,scaleY:Qp,scaleZ:Qp,skew:Gi,skewX:Gi,skewY:Gi,distance:ie,translateX:ie,translateY:ie,translateZ:ie,x:ie,y:ie,z:ie,perspective:ie,transformPerspective:ie,opacity:Xs,originX:Q0,originY:Q0,originZ:ie};var Wu={borderWidth:ie,borderTopWidth:ie,borderRightWidth:ie,borderBottomWidth:ie,borderLeftWidth:ie,borderRadius:ie,radius:ie,borderTopLeftRadius:ie,borderTopRightRadius:ie,borderBottomRightRadius:ie,borderBottomLeftRadius:ie,width:ie,maxWidth:ie,height:ie,maxHeight:ie,top:ie,right:ie,bottom:ie,left:ie,padding:ie,paddingTop:ie,paddingRight:ie,paddingBottom:ie,paddingLeft:ie,margin:ie,marginTop:ie,marginRight:ie,marginBottom:ie,marginLeft:ie,backgroundPositionX:ie,backgroundPositionY:ie,...bF,zIndex:DP,fillOpacity:Xs,strokeOpacity:Xs,numOctaves:DP};var yF={...Wu,color:lt,backgroundColor:lt,outlineColor:lt,fill:lt,stroke:lt,borderColor:lt,borderTopColor:lt,borderRightColor:lt,borderBottomColor:lt,borderLeftColor:lt,filter:hm,WebkitFilter:hm},dm=r=>yF[r];function fm(r,e){let t=dm(r);return t!==hm&&(t=Wr),t.getAnimatableNone?t.getAnimatableNone(e):void 0}var _5=new Set(["auto","none","0"]);function vF(r,e,t){let i=0,s;for(;i<r.length&&!s;){let n=r[i];typeof n=="string"&&!_5.has(n)&&vo(n).values.length&&(s=r[i]),i++;}if(s&&t)for(let n of e)r[n]=fm(t,s);}var pm=class extends qs{constructor(e,t,i,s,n){super(e,t,i,s,n,true);}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let l=e[u];if(typeof l=="string"&&(l=l.trim(),Lu(l))){let c=RP(l,t.current);c!==void 0&&(e[u]=c),u===e.length-1&&(this.finalKeyframe=l);}}if(this.resolveNoneKeyframes(),!cm.has(i)||e.length!==2)return;let[s,n]=e,o=IP(s),a=IP(n);if(o!==a)if(TP(o)&&TP(a))for(let u=0;u<e.length;u++){let l=e[u];typeof l=="string"&&(e[u]=parseFloat(l));}else Eo[i]&&(this.needsMeasurement=true);}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||_F(e[s]))&&i.push(s);i.length&&vF(e,i,t);}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Eo[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let s=t[t.length-1];s!==void 0&&e.getValue(i,s).jump(s,false);}measureEndState(){let{element:e,name:t,unresolvedKeyframes:i}=this;if(!e||!e.current)return;let s=e.getValue(t);s&&s.jump(this.measuredOrigin,false);let n=i.length-1,o=i[n];i[n]=Eo[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u);}),this.resolveNoneKeyframes();}};function kP(r,e,t){if(r instanceof EventTarget)return [r];if(typeof r=="string"){let i=document;let s=t?.[r]??i.querySelectorAll(r);return s?Array.from(s):[]}return Array.from(r)}var mm=(r,e)=>e&&typeof r=="number"?e.transform(r):r;var TF=30,b5=r=>!isNaN(parseFloat(r)),hv=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{let s=zt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let n of this.dependents)n.dirty();},this.hasAnimated=false,this.setCurrent(e),this.owner=t.owner;}setCurrent(e){this.current=e,this.updatedAt=zt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=b5(this.current));}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt;}onChange(e){return process.env.NODE_ENV!=="production"&&Vp(false,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Gu);let i=this.events[e].add(t);return e==="change"?()=>{i(),cr.read(()=>{this.events.change.getSize()||this.stop();});}:i}clearListeners(){for(let e in this.events)this.events[e].clear();}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t;}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e);}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i;}jump(e,t=true){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}dirty(){this.events.change?.notify(this.current);}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e);}removeDependent(e){this.dependents&&this.dependents.delete(e);}get(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=zt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>TF)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,TF);return Np(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=true,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify();}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation();})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation();}isAnimating(){return !!this.animation}clearAnimation(){delete this.animation;}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}};function bs(r,e){return new hv(r,e)}var{schedule:FP}=q0(queueMicrotask,false);function gm(r){return aP(r)&&"ownerSVGElement"in r}function GP(r){return gm(r)&&r.tagName==="svg"}var tt=r=>!!(r&&r.getVelocity);var v5=[...BP,lt,Wr],UP=r=>v5.find(cv(r));function xm(r){return typeof r=="object"&&!Array.isArray(r)}function dv(r,e,t,i){return typeof r=="string"&&xm(e)?kP(r,t,i):r instanceof NodeList?Array.from(r):Array.isArray(r)?r:[r]}function SF(r,e,t){return r*(e+1)}function LP(r,e,t,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,r+parseFloat(e)):e==="<"?t:e.startsWith("<")?Math.max(0,t+parseFloat(e.slice(1))):i.get(e)??r}function T5(r,e,t){for(let i=0;i<r.length;i++){let s=r[i];s.at>e&&s.at<t&&(Du(r,s),i--);}}function EF(r,e,t,i,s,n){T5(r,s,n);for(let o=0;o<e.length;o++)r.push({value:e[o],at:Ui(s,n,i[o]),easing:$p(t,o)});}function AF(r,e){for(let t=0;t<r.length;t++)r[t]=r[t]/(e+1);}function CF(r,e){return r.at===e.at?r.value===null?1:e.value===null?-1:0:r.at-e.at}var S5="easeInOut",E5=20;function MF(r,{defaultTransition:e={},...t}={},i,s){let n=e.duration||.3,o=new Map,a=new Map,u={},l=new Map,c=0,h=0,d=0;for(let f=0;f<r.length;f++){let m=r[f];if(typeof m=="string"){l.set(m,h);continue}else if(!Array.isArray(m)){l.set(m.name,LP(h,m.at,c,l));continue}let[_,x,g={}]=m;g.at!==void 0&&(h=LP(h,g.at,c,l));let y=0,v=(S,C,E,M=0,D=0)=>{let R=A5(S),{delay:L=0,times:F=sm(R),type:se="keyframes",repeat:ye,repeatType:ft,repeatDelay:ys=0,...X}=C,{ease:q=e.ease||"easeOut",duration:Rr}=C,Le=typeof L=="function"?L(M,D):L,di=R.length,Zs=zu(se)?se:s?.[se||"keyframes"];if(di<=2&&Zs){let Vi=100;if(di===2&&P5(R)){let en=R[1]-R[0];Vi=Math.abs(en);}let Hi={...X};Rr!==void 0&&(Hi.duration=Dt(Rr));let Mo=tm(Hi,Vi,Zs);q=Mo.ease,Rr=Mo.duration;}Rr??(Rr=n);let Qs=h+Le;F.length===1&&F[0]===0&&(F[1]=1);let Js=F.length-R.length;if(Js>0&&im(F,Js),R.length===1&&R.unshift(null),ye){Ht(ye<E5,"Repeat count too high, must be less than 20","repeat-count-high"),Rr=SF(Rr,ye);let Vi=[...R],Hi=[...F];q=Array.isArray(q)?[...q]:[q];let Mo=[...q];for(let en=0;en<ye;en++){R.push(...Vi);for(let zi=0;zi<Vi.length;zi++)F.push(Hi[zi]+(en+1)),q.push(zi===0?"linear":$p(Mo,zi-1));}AF(F,ye);}let Oh=Qs+Rr;EF(E,R,q,F,Qs,Oh),y=Math.max(Le+Rr,y),d=Math.max(Oh,d);};if(tt(_)){let S=wF(_,a);v(x,g,PF("default",S));}else {let S=dv(_,x,i,u),C=S.length;for(let E=0;E<C;E++){x=x,g=g;let M=S[E],D=wF(M,a);for(let R in x)v(x[R],C5(g,R),PF(R,D),E,C);}}c=h,h+=y;}return a.forEach((f,m)=>{for(let _ in f){let x=f[_];x.sort(CF);let g=[],y=[],v=[];for(let C=0;C<x.length;C++){let{at:E,value:M,easing:D}=x[C];g.push(M),y.push(Fu(0,d,E)),v.push(D||"easeOut");}y[0]!==0&&(y.unshift(0),g.unshift(g[0]),v.unshift(S5)),y[y.length-1]!==1&&(y.push(1),g.push(null)),o.has(m)||o.set(m,{keyframes:{},transition:{}});let S=o.get(m);S.keyframes[_]=g,S.transition[_]={...e,duration:d,ease:v,times:y,...t};}}),o}function wF(r,e){return !e.has(r)&&e.set(r,{}),e.get(r)}function PF(r,e){return e[r]||(e[r]=[]),e[r]}function A5(r){return Array.isArray(r)?r:[r]}function C5(r,e){return r&&r[e]?{...r,...r[e]}:{...r}}var w5=r=>typeof r=="number",P5=r=>r.every(w5);var Ao=new WeakMap;var RF=r=>Array.isArray(r);function BF(r){let e=[{},{}];return r?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity();}),e}function fv(r,e,t,i){if(typeof e=="function"){let[s,n]=BF(i);e=e(t!==void 0?t:r.custom,s,n);}if(typeof e=="string"&&(e=r.variants&&r.variants[e]),typeof e=="function"){let[s,n]=BF(i);e=e(t!==void 0?t:r.custom,s,n);}return e}function IF(r,e,t){let i=r.getProps();return fv(i,e,i.custom,r)}function M5(r,e,t){r.hasValue(e)?r.getValue(e).set(t):r.addValue(e,bs(t));}function R5(r){return RF(r)?r[r.length-1]||0:r}function DF(r,e){let t=IF(r,e),{transitionEnd:i={},transition:s={},...n}=t||{};n={...n,...i};for(let o in n){let a=R5(n[o]);M5(r,o,a);}}function kF(r){return !!(tt(r)&&r.add)}function OF(r,e){let t=r.getValue("willChange");if(kF(t))return t.add(e);if(!t&&lr.WillChange){let i=new lr.WillChange("auto");r.addValue("willChange",i),i.add(e);}}var Rh=r=>r.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var B5="framerAppearId",FF="data-"+Rh(B5);function GF(r){return r.props[FF]}var I5=r=>r!==null;function UF(r,{repeat:e,repeatType:t="loop"},i){let s=r.filter(I5),n=e&&t!=="loop"&&e%2===1?0:s.length-1;return !n||i===void 0?s[n]:i}var D5={type:"spring",stiffness:500,damping:25,restSpeed:10},k5=r=>({type:"spring",stiffness:550,damping:r===0?2*Math.sqrt(550):30,restSpeed:10}),O5={type:"keyframes",duration:.8},F5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LF=(r,{keyframes:e})=>e.length>2?O5:Xr.has(r)?r.startsWith("scale")?k5(e[1]):D5:F5;function NF({when:r,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:s,repeat:n,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return !!Object.keys(c).length}var pv=(r,e,t,i={},s,n)=>o=>{let a=lm(i,r)||{},u=a.delay||i.delay||0,{elapsed:l=0}=i;l=l-Dt(u);let c={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d);},onComplete:()=>{o(),a.onComplete&&a.onComplete();},name:r,motionValue:e,element:n?void 0:s};NF(a)||Object.assign(c,LF(r,c)),c.duration&&(c.duration=Dt(c.duration)),c.repeatDelay&&(c.repeatDelay=Dt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=false;if((c.type===false||c.duration===0&&!c.repeatDelay)&&(Mh(c),c.delay===0&&(h=true)),(lr.instantAnimations||lr.skipAnimations)&&(h=true,Mh(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!n&&e.get()!==void 0){let d=UF(c.keyframes,a);if(d!==void 0){cr.update(()=>{c.onUpdate(d),c.onComplete();});return}}return a.isSync?new $s(c):new am(c)};function G5({protectedKeys:r,needsAnimating:e},t){let i=r.hasOwnProperty(t)&&e[t]!==true;return e[t]=false,i}function VF(r,e,{delay:t=0,transitionOverride:i,type:s}={}){let{transition:n=r.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(n=i);let u=[],l=s&&r.animationState&&r.animationState.getState()[s];for(let c in a){let h=r.getValue(c,r.latestValues[c]??null),d=a[c];if(d===void 0||l&&G5(l,c))continue;let f={delay:t,...lm(n||{},c)},m=h.get();if(m!==void 0&&!h.isAnimating&&!Array.isArray(d)&&d===m&&!f.velocity)continue;let _=false;if(window.MotionHandoffAnimation){let g=GF(r);if(g){let y=window.MotionHandoffAnimation(g,c,cr);y!==null&&(f.startTime=y,_=true);}}OF(r,c),h.start(pv(c,h,d,r.shouldReduceMotion&&cm.has(c)?{type:false}:f,r,_));let x=h.animation;x&&u.push(x);}return o&&Promise.all(u).then(()=>{cr.update(()=>{o&&DF(r,o);});}),u}function HF({top:r,left:e,right:t,bottom:i}){return {x:{min:e,max:t},y:{min:r,max:i}}}function zF(r,e){if(!e)return r;let t=e({x:r.left,y:r.top}),i=e({x:r.right,y:r.bottom});return {top:t.y,left:t.x,bottom:i.y,right:i.x}}function WF(r,e){return HF(zF(r.getBoundingClientRect(),e))}var XF={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},mv={};for(let r in XF)mv[r]={isEnabled:e=>XF[r].some(t=>!!e[t])};var YF=()=>({min:0,max:0}),Bh=()=>({x:YF(),y:YF()});var jF=typeof window<"u";var _m={current:null},gv={current:false};function $F(){if(gv.current=true,!!jF)if(window.matchMedia){let r=window.matchMedia("(prefers-reduced-motion)"),e=()=>_m.current=r.matches;r.addEventListener("change",e),e();}else _m.current=false;}function qF(r){return r!==null&&typeof r=="object"&&typeof r.start=="function"}function KF(r){return typeof r=="string"||Array.isArray(r)}var U5=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ZF=["initial",...U5];function NP(r){return qF(r.animate)||ZF.some(e=>KF(r[e]))}function QF(r){return !!(NP(r)||r.variants)}function JF(r,e,t){for(let i in e){let s=e[i],n=t[i];if(tt(s))r.addValue(i,s);else if(tt(n))r.addValue(i,bs(s,{owner:r}));else if(n!==s)if(r.hasValue(i)){let o=r.getValue(i);o.liveStyle===true?o.jump(s):o.hasAnimated||o.set(s);}else {let o=r.getStaticValue(i);r.addValue(i,bs(o!==void 0?o:s,{owner:r}));}}for(let i in t)e[i]===void 0&&r.removeValue(i);return e}var eG=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ih=class{scrapeMotionValuesFromProps(e,t,i){return {}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:n,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=false,this.isControllingVariants=false,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=qs,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection));},this.renderScheduledAt=0,this.scheduleRender=()=>{let d=zt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,cr.render(this.render,false,true));};let{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=t.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!n,this.isControllingVariants=NP(t),this.isVariantNode=QF(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...h}=this.scrapeMotionValuesFromProps(t,{},this);for(let d in h){let f=h[d];u[d]!==void 0&&tt(f)&&f.set(u[d]);}}mount(e){this.current=e,Ao.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),gv.current||$F(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?false:this.reducedMotionConfig==="always"?true:_m.current,process.env.NODE_ENV!=="production"&&Vp(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext);}unmount(){this.projection&&this.projection.unmount(),Th(this.notifyUpdate),Th(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=false);}this.current=null;}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e);}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e);}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let i=Xr.has(e);i&&this.onBindTransform&&this.onBindTransform();let s=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&cr.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=true),this.scheduleRender();}),n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{s(),n&&n(),t.owner&&t.stop();});}sortNodePosition(e){return !this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in mv){let t=mv[e];if(!t)continue;let{isEnabled:i,Feature:s}=t;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){let n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=true);}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props);}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Bh()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t;}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<eG.length;i++){let s=eG[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);let n="on"+s,o=e[n];o&&(this.propEventSubscriptions[s]=this.on(s,o));}this.prevMotionValues=JF(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue();}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get());}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState);}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=bs(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Up(i)||Lp(i))?i=parseFloat(i):!UP(i)&&Wr.test(t)&&(i=fm(e,t)),this.setBaseTarget(e,tt(i)?i.get():i)),tt(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t;}getBaseTarget(e){let{initial:t}=this.props,i;if(typeof t=="string"||typeof t=="object"){let n=fv(this.props,t,this.presenceContext?.custom);n&&(i=n[e]);}if(t&&i!==void 0)return i;let s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!tt(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Gu),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t);}scheduleRenderMicrotask(){FP.render(this.render);}};var Dh=class extends Ih{constructor(){super(...arguments),this.KeyframeResolver=pm;}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e];}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;tt(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`);}));}};var L5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},N5=Li.length;function tG(r,e,t){let i="",s=true;for(let n=0;n<N5;n++){let o=Li[n],a=r[o];if(a===void 0)continue;let u=true;if(typeof a=="number"?u=a===(o.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||t){let l=mm(a,Wu[o]);if(!u){s=false;let c=L5[o]||o;i+=`${c}(${l}) `;}t&&(e[o]=l);}}return i=i.trim(),t?i=t(e,s?"":i):s&&(i="none"),i}function xv(r,e,t){let{style:i,vars:s,transformOrigin:n}=r,o=false,a=false;for(let u in e){let l=e[u];if(Xr.has(u)){o=true;continue}else if(Zp(u)){s[u]=l;continue}else {let c=mm(l,Wu[u]);u.startsWith("origin")?(a=true,n[u]=c):i[u]=c;}}if(e.transform||(o||t?i.transform=tG(e,r.transform,t):i.transform&&(i.transform="none")),a){let{originX:u="50%",originY:l="50%",originZ:c=0}=n;i.transformOrigin=`${u} ${l} ${c}`;}}function _v(r,{style:e,vars:t},i,s){let n=r.style,o;for(o in e)n[o]=e[o];s?.applyProjectionStyles(n,i);for(o in t)n.setProperty(o,t[o]);}var rG={};function iG(r,{layout:e,layoutId:t}){return Xr.has(r)||r.startsWith("origin")||(e||t!==void 0)&&(!!rG[r]||r==="opacity")}function bv(r,e,t){let{style:i}=r,s={};for(let n in i)(tt(i[n])||e.style&&tt(e.style[n])||iG(n,r)||t?.getValue(n)?.liveStyle!==void 0)&&(s[n]=i[n]);return s}function V5(r){return window.getComputedStyle(r)}var yv=class extends Dh{constructor(){super(...arguments),this.type="html",this.renderInstance=_v;}readValueFromInstance(e,t){if(Xr.has(t))return this.projection?.isProjecting?nm(t):vP(e,t);{let i=V5(e),s=(Zp(t)?i.getPropertyValue(t):i[t])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:t}){return WF(e,t)}build(e,t,i){xv(e,t,i.transformTemplate);}scrapeMotionValuesFromProps(e,t,i){return bv(e,t,i)}};function H5(r,e){return r in e}var vv=class extends Ih{constructor(){super(...arguments),this.type="object";}readValueFromInstance(e,t){if(H5(t,e)){let i=e[t];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e];}measureInstanceViewportBox(){return Bh()}build(e,t){Object.assign(e.output,t);}renderInstance(e,{output:t}){Object.assign(e,t);}sortInstanceNodePosition(){return 0}};var z5={offset:"stroke-dashoffset",array:"stroke-dasharray"},W5={offset:"strokeDashoffset",array:"strokeDasharray"};function sG(r,e,t=1,i=0,s=true){r.pathLength=1;let n=s?z5:W5;r[n.offset]=ie.transform(-i);let o=ie.transform(e),a=ie.transform(t);r[n.array]=`${o} ${a}`;}function nG(r,{attrX:e,attrY:t,attrScale:i,pathLength:s,pathSpacing:n=1,pathOffset:o=0,...a},u,l,c){if(xv(r,a,l),u){r.style.viewBox&&(r.attrs.viewBox=r.style.viewBox);return}r.attrs=r.style,r.style={};let{attrs:h,style:d}=r;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),t!==void 0&&(h.y=t),i!==void 0&&(h.scale=i),s!==void 0&&sG(h,s,n,o,false);}var Tv=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);var oG=r=>typeof r=="string"&&r.toLowerCase()==="svg";function aG(r,e,t,i){_v(r,e,void 0,i);for(let s in e.attrs)r.setAttribute(Tv.has(s)?s:Rh(s),e.attrs[s]);}function uG(r,e,t){let i=bv(r,e,t);for(let s in r)if(tt(r[s])||tt(e[s])){let n=Li.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[n]=r[s];}return i}var Sv=class extends Dh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=false,this.measureInstanceViewportBox=Bh;}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Xr.has(t)){let i=dm(t);return i&&i.default||0}return t=Tv.has(t)?t:Rh(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return uG(e,t,i)}build(e,t,i){nG(e,t,this.isSVGTag,i.transformTemplate,i.style);}renderInstance(e,t,i,s){aG(e,t,i,s);}mount(e){this.isSVGTag=oG(e.tagName),super.mount(e);}};function lG(r){let e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},t=gm(r)&&!GP(r)?new Sv(e):new yv(e);t.mount(r),Ao.set(r,t);}function cG(r){let e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},t=new vv(e);t.mount(r),Ao.set(r,t);}function hG(r,e,t){let i=tt(r)?r:bs(r);return i.start(pv("",i,e,t)),i.animation}function X5(r,e){return tt(r)||typeof r=="number"||typeof r=="string"&&!xm(e)}function Ev(r,e,t,i){let s=[];if(X5(r,e))s.push(hG(r,xm(e)&&e.default||e,t&&(t.default||t)));else {let n=dv(r,e,i),o=n.length;Ht(!!o,"No valid elements provided.","no-valid-elements");for(let a=0;a<o;a++){let u=n[a];Ht(u!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");let l=u instanceof Element?lG:cG;Ao.has(u)||l(u);let c=Ao.get(u),h={...t};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),s.push(...VF(c,{...e,transition:h},{}));}}return s}function dG(r,e,t){let i=[];return MF(r,e,t,{spring:js}).forEach(({keyframes:n,transition:o},a)=>{i.push(...Ev(a,n,o));}),i}function Y5(r){return Array.isArray(r)&&r.some(Array.isArray)}function fG(r){function e(t,i,s){let n=[];Y5(t)?n=dG(t,i,r):n=Ev(t,i,s,r);let o=new um(n);return o}return e}var Av=fG();Re();function j5(r,e,t){if(Array.isArray(r)&&Array.isArray(r[0])){let i=r.map(s=>{let{ticker:n=new _e,...o}=s[2]||{};return [s[0],s[1],{driver:a=>{let u=({lastTime:l})=>a(l);return {start:(l=true)=>{n.add(u),n.start();},stop:()=>n.remove(u),now:()=>n.lastTime}},...o}]});return Av(i,e)}else {let{ticker:i=new _e}=t||{};return Av(r,e,{driver:s=>{let n=({lastTime:o})=>s(o);return {start:(o=true)=>{i.add(n),i.start();},stop:()=>i.remove(n),now:()=>i.lastTime}},...t||{}})}}var mh=j5;var I=new Mp;Pr.init({getScreen:()=>I.screen});var zP={};vs(zP,{CharacterBaseModel:()=>ym,CharacterStoredClass:()=>Xu,RegisteredCharacters:()=>pG});var ne=class ne{static init(e){ne._getStepCounter=e.getStepCounter,ne._setStepCounter=e.setStepCounter,ne._getCurrentGameStepState=e.getCurrentGameStepState,ne._restoreGameStepState=e.restoreGameStepState,ne._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(ne._onGoNextEnd=e.onGoNextEnd),ne._getVariable=e.getVariable,ne._setVariable=e.setVariable,ne._removeVariable=e.removeVariable,ne._getFlag=e.getFlag,ne._setFlag=e.setFlag,e.onLabelClosing&&(ne._onLabelClosing=e.onLabelClosing),ne._addHistoryItem=e.addHistoryItem,ne._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,ne._getCharacter=e.getCharacter;}static get stepCounter(){return ne._getStepCounter()}static set stepCounter(e){ne._setStepCounter(e);}static get currentGameStepState(){return ne._getCurrentGameStepState()}static get restoreGameStepState(){return ne._restoreGameStepState}static get openedLabels(){return ne._getOpenedLabels()}static get onGoNextEnd(){return ne._onGoNextEnd}static get getVariable(){return ne._getVariable}static get setVariable(){return ne._setVariable}static get removeVariable(){return ne._removeVariable}static get getFlag(){return ne._getFlag}static get setFlag(){return ne._setFlag}static get onLabelClosing(){return ne._onLabelClosing}static get addHistoryItem(){return ne._addHistoryItem}static get currentStepsRunningNumber(){return ne._getCurrentStepsRunningNumber()}static get getCharacter(){return ne._getCharacter}};w(ne,"_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()")}),w(ne,"_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()")}),w(ne,"_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()")}),w(ne,"_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()")}),w(ne,"_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()")}),w(ne,"_onGoNextEnd",async()=>{}),w(ne,"_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()")}),w(ne,"_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()")}),w(ne,"_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()")}),w(ne,"_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()")}),w(ne,"_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()")}),w(ne,"_onLabelClosing",()=>{}),w(ne,"_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()")}),w(ne,"_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()")}),w(ne,"_getCharacter",()=>{throw A.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")}),w(ne,"onEnd"),w(ne,"onError");var W=ne;var wt=class wt{constructor(){}static clearOldTempVariables(e){wt.tempStorageDeadlines.forEach((t,i)=>{t>e&&(wt.tempStorage.delete(i),wt.tempStorageDeadlines.delete(i),wt.storage.cache.delete(i));});}static setVariable(e,t){let i=wt.tempStorage.has(e);t==null?(wt.storage.map.delete(e),!i&&wt.storage.cache.delete(e)):(wt.storage.map.set(e,t),!i&&wt.storage.cache.set(e,t));}static getVariable(e){let t=wt.storage.cache.get(e);return t===void 0&&(t=wt.tempStorage.get(e)),t===void 0&&(t=wt.storage.map.get(e)),pe(t)}static removeVariable(e){wt.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)}};w(wt,"storage",new Ct({cacheSize:20})),w(wt,"startingStorage",[]),w(wt,"flags",Array()),w(wt,"tempStorage",new Map),w(wt,"tempStorageDeadlines",new Map);var ue=wt;var bm=class{get storage(){return ue.storage.map}get cache(){return ue.storage.cache}get flags(){return ue.flags}get tempStorage(){return ue.tempStorage}get tempStorageDeadlines(){return ue.tempStorageDeadlines}set startingStorage(e){let t=[],i=W.stepCounter===0;Object.entries(e).forEach(([s,n])=>{t.push({key:s,value:n}),i&&ue.storage.set(s,n);}),ue.startingStorage=t;}setVariable(e,t){return ue.setVariable(e,t)}getVariable(e){return ue.getVariable(e)}removeVariable(e){return ue.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else ue.tempStorage.set(e,t),ue.storage.cache.set(e,t),ue.tempStorageDeadlines.has(e)||ue.tempStorageDeadlines.set(e,W.openedLabels);}removeTempVariable(e){ue.tempStorage.has(e)&&(ue.tempStorage.delete(e),ue.tempStorageDeadlines.delete(e),ue.storage.cache.delete(e));}setFlag(e,t){return ue.setFlag(e,t)}getFlag(e){return ue.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),ue.flags=[],ue.tempStorage.clear(),ue.tempStorageDeadlines.clear(),ue.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...ue.tempStorage.keys()].forEach(s=>{t.push({key:s,value:ue.tempStorage.get(s)});});let i=[];return [...ue.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:ue.tempStorageDeadlines.get(s)});}),pe({base:e,temp:t,tempDeadlines:i,flags:ue.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(([s,n])=>{ue.tempStorage.set(s,n);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([s,n])=>{ue.tempStorageDeadlines.set(s,n);});}else t.key==="___flags___"?t.value.forEach(s=>{ue.flags.push(s);}):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=>{ue.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{ue.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([s,n])=>{ue.tempStorage.set(s,n);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([s,n])=>{ue.tempStorageDeadlines.set(s,n);}):t==="___flags___"?i.forEach(s=>{ue.flags.push(s);}):this.storage.set(t,i);})):A.warn("No storage data found");}catch(t){A.error("Error importing data",t);}}};var kh=class{constructor(e,t){w(this,"_id");w(this,"categoryId");this.categoryId=e,this._id=t;}get id(){return this._id}setStorageProperty(e,t){let i=ue.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],ue.setVariable(this.categoryId,i);}getStorageProperty(e,t=this.id){let i=ue.getVariable(this.categoryId);if(i&&i.hasOwnProperty(t)&&i[t].hasOwnProperty(e))return i[t][e]}};var ci=new bm;var q5="@",Xu=class extends kh{constructor(t,i=""){super(he.CHARACTER_CATEGORY_KEY,t+(i?q5+i:""));w(this,"sourceId");this.sourceId=t;}getStorageProperty(t){let i=super.getStorageProperty(t);return i===void 0&&(i=super.getStorageProperty(t,this.sourceId)),i}};var ym=class extends Xu{constructor(t,i){super(typeof t=="string"?t:t.id,typeof t=="string"?"":t.emotion);w(this,"defaultName");w(this,"defaultSurname");w(this,"defaultAge");w(this,"_icon");w(this,"_color");this.defaultName=i.name,this.defaultSurname=i.surname,this.defaultAge=i.age,this._icon=i.icon,this._color=i.color;}get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(t){this.setStorageProperty("name",t);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(t){this.setStorageProperty("surname",t);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(t){this.setStorageProperty("age",t);}get icon(){return this._icon}get color(){return this._color}};var Yu=new Ct({cacheSize:10}),HP;(s=>{function r(n){try{let o=Yu.get(n);if(!o){A.warn(`Character "${n}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return o}catch(o){A.error(`Error while getting Character "${n}"`,o);return}}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}Yu.get(n.id)&&A.info(`Character id "${n.id}" already exists, it will be overwritten`),Yu.set(n.id,n);}s.add=e;function t(){return Array.from(Yu.values())}s.values=t;function i(n){return Yu.has(n)}s.has=i;})(HP||(HP={}));var pG=HP;var K5={Date:true,RegExp:true,String:true,Number:true};function Cv(r,e,t={cyclesFix:true},i=[]){let s=[],n=Array.isArray(r);for(let a in r){let u=r[a],l=n?+a:a;if(!(a in e)){s.push({type:"REMOVE",path:[l],oldValue:r[a]});continue}let c=e[a],h=typeof u=="object"&&typeof c=="object"&&Array.isArray(u)===Array.isArray(c);u&&c&&h&&!K5[Object.getPrototypeOf(u)?.constructor?.name]&&(!t.cyclesFix||!i.includes(u))?s.push.apply(s,Cv(u,c,t,t.cyclesFix?i.concat([u]):[]).map(d=>(d.path.unshift(l),d))):u!==c&&!(Number.isNaN(u)&&Number.isNaN(c))&&!(h&&(isNaN(u)?u+""==c+"":+u==+c))&&s.push({path:[l],type:"CHANGE",value:c,oldValue:u});}let o=Array.isArray(e);for(let a in e)a in r||s.push({type:"CREATE",path:[o?+a:a],value:e[a]});return s}function mG(r,e){let t=pe(r);return e.length>1&&"type"in e[0]&&(e=e.reverse()),e.forEach(i=>{"type"in i?Z5(t,i):Q5(t,i);}),t}function Z5(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===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 Q5(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===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 n=e.index;e.item.kind==="N"?t[i].splice(n,1):e.item.kind==="E"||e.item.kind==="D"?t[i][n]=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 Ni=class Ni{static get originalStepData(){return Ni._originalStepData?pe(Ni._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){Ni._originalStepData=pe(e);}};w(Ni,"_diffHistory",new Ct({cacheSize:5})),w(Ni,"_stepsInfoHistory",new Ct({cacheSize:5})),w(Ni,"_narrationHistory",new Ct({cacheSize:50})),w(Ni,"stepLimitSaved",20),w(Ni,"goBackRunning",false),w(Ni,"_originalStepData");var K=Ni;var vm=class{get stepsInfoMap(){return K._stepsInfoHistory}get diffMap(){return K._diffHistory}get narrationMap(){return K._narrationHistory}get size(){return K._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return K._stepsInfoHistory.keys()}get(e){let t=K._narrationHistory.get(e);if(!(t&&Object.keys(t).length===1&&t.stepIndex!==void 0))return t}delete(e){K._stepsInfoHistory.delete(e),K._diffHistory.delete(e),K._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 s=K._diffHistory.get(i);if(s)try{let n=mG(t,s);return W.stepCounter=i,this.delete(i),this.internalRestoreOldGameState(e-1,n)}catch(n){return A.error("Error applying diff",n),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(K._diffHistory.size<1){A.warn("You can't go back, there is no step to go back");return}if(K.goBackRunning){A.warn("Go back is already running");return}K.goBackRunning=true;try{let i=pe(this.internalRestoreOldGameState(t,K.originalStepData));if(i){await W.restoreGameStepState(i,e);let s=W.stepCounter-1,n=K._narrationHistory.get(s);if(n&&Object.keys(n).length===1&&n.stepIndex!==void 0){let o=K._stepsInfoHistory.get(s);if(o){let a=this.itemMapper({step:o});K._narrationHistory.set(o.index,a);}}}else A.error("Error going back");K.originalStepData=i,K.goBackRunning=!1;}catch(i){A.error("Error going back",i),K.goBackRunning=false;}}add(e,t={}){let i=K.originalStepData,{ignoreSameStep:s}=t,n=W.currentGameStepState;if(!s&&this.isSameStep(i,n))return;let o=this.lastKey;(async()=>{try{let u,l;if(typeof o=="number"&&(u=K._stepsInfoHistory.get(o),l=K._narrationHistory.get(o)),K._stepsInfoHistory.set(e.index,e),e.index!==0){let d=Cv(i,n);d?K._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(K._narrationHistory.set(e.index,h),u&&l&&typeof o=="number"){let d=this.itemMapper({...c,step:u},{});K._narrationHistory.set(o,d);}}catch(u){A.error("Error adding history step",u);}})(),K.originalStepData=n;}itemMapper(e,t){let{step:i,choiceIndexMade:s,inputValue:n,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||n){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);}s!==void 0&&(l[s].isResponse=true);}return {dialogue:a?{...a,character:a.character?W.getCharacter(a.character)||a.character:void 0}:void 0,playerMadeChoice:typeof s=="number",choices:l,stepIndex:i.index,inputValue:n}}return {stepIndex:i.index}}get narrativeHistory(){let e=[];return Array.from(this.keys()).sort((i,s)=>i-s).forEach(i=>{let s=this.get(i);s&&e.push(s);}),e}get currentLabelHistory(){let e=[],t=Array.from(this.keys()).sort((u,l)=>l-u);if(t.length===0)return e;let i=t[0];if(typeof i!="number")return e;let s=K._stepsInfoHistory.get(i);if(!s)return e;let n=s.openedLabels;if(!n||!Array.isArray(n)||n.length===0)return e;let o=n[0].currentStepIndex,a=n[0].label;return t.every((u,l)=>{let c=this.get(u);if(c){if(l===0)return e.push(c),true;let h=K._stepsInfoHistory.get(u);if(!h)return true;let d=h.openedLabels;if(!d||!Array.isArray(d)||d.length===0||d[0].label!==a||d[0].currentStepIndex>=o)return false;o=d[0].currentStepIndex,e.push(c);}return true}),e.reverse()}removeNarrativeHistory(e){if(e){let t=Array.from(this.keys()).sort((i,s)=>i-s);t=t.slice(0,e),t.forEach(i=>{K._narrationHistory.delete(i),K._stepsInfoHistory.delete(i),K._diffHistory.delete(i);});}else K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear();}get canGoBack(){let e=this.lastKey;return typeof e!="number"?false:K._diffHistory.has(e)}blockGoBack(){W.currentStepsRunningNumber===0&&K._diffHistory.clear();}isSameStep(e,t){if(e.openedLabels.length===t.openedLabels.length)try{let i=JSON.stringify(e.openedLabels),s=JSON.stringify(t.openedLabels);if(i===s&&e.path===t.path&&e.labelIndex===t.labelIndex)return !0}catch(i){return A.error("Error comparing opened labels",i),true}return false}clear(){K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear(),K._originalStepData=void 0;}get stepLimitSaved(){return K.stepLimitSaved}set stepLimitSaved(e){K.stepLimitSaved=e;}export(){let e=Array.from(this.keys()).sort((i,s)=>i-s);e.length>this.stepLimitSaved&&(e=e.slice(e.length-this.stepLimitSaved));let t=[];return e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n=K._diffHistory.get(i);t.push({...s,diff:n});}}),{stepsHistory:pe(t),originalStepData:pe(K._originalStepData)}}restoreNarrativeHistory(){let e=Array.from(this.keys()).sort((i,s)=>i-s),t={};e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n={...t};t={};let o=this.itemMapper({step:s,choiceIndexMade:n.choiceIndexMade,inputValue:n.inputValue,removeDialogue:n.removeDialogue},t);o&&K._narrationHistory.set(i,o);}});}async restore(e){this.clear();try{e.hasOwnProperty("stepsHistory")?(e.stepsHistory.forEach(i=>{i.diff&&K._diffHistory.set(i.index,i.diff);let s={...i,diff:void 0};K._stepsInfoHistory.set(i.index,s);}),this.restoreNarrativeHistory()):A.warn("Could not import stepsHistory data, so will be ignored"),e.hasOwnProperty("originalStepData")?K._originalStepData=e.originalStepData:A.warn("Could not import originalStepData data, so will be ignored");}catch(t){A.error("Error importing data",t);}}};var Co=new vm;var gG={};var YP={};vs(YP,{Close:()=>wv,Label:()=>$u,LabelAbstract:()=>ju,NarrationManagerStatic:()=>N,RegisteredLabels:()=>hi,narration:()=>Ks,newChoiceOption:()=>xG,newCloseChoiceOption:()=>_G,newLabel:()=>XP});var Tm=new Ct({cacheSize:10}),WP;(s=>{function r(n){let o=Tm.get(n);if(!o){A.error(`Label "${n}" not found`);return}return o}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}Tm.has(n.id)&&A.info(`Label "${n.id}" already exists, it will be overwritten`),Tm.set(n.id,n);}s.add=e;function t(){return Array.from(Tm.values())}s.values=t;function i(n){return Tm.has(n)}s.has=i;})(WP||(WP={}));var hi=WP;var Z=class Z{constructor(){}static get allOpenedLabels(){return W.getVariable(he.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(e){W.setVariable(he.OPENED_LABELS_COUNTER_KEY,e);}static getCurrentStepTimesCounterData(e=""){let t=Z.currentLabelStepIndex;if(t===null)return A.error("currentLabelStepIndex is null"),null;let i=`${t}${e}`,s=Z.currentLabelId,n=Z._currentLabel;if(!s||t===null||!n)return A.error("currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let o=n.getStepSha(t)||"error",a=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[s]||(a[s]={}),(!a[s][i]||a[s][i].stepSha1!=o)&&(a[s][i]={stepSha1:o}),a[s][i]}static setCurrentStepTimesCounterData(e="",t){let i=Z.currentLabelStepIndex,s=i+e,n=Z.currentLabelId;if(!n||i===null){A.error("currentLabelId or currentLabelStepIndex is null");return}let o=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[n]||(o[n]={}),o[n][s]=t,W.setVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static getCurrentStepTimesCounter(e=""){let t=Z._stepCounter,i=Z.getCurrentStepTimesCounterData(e);if(!i)return A.error("getCurrentStepTimesCounter obj is null"),0;let s=i.stepCounters||i.lastStepIndexs||[];return s.find(o=>o===t)||(s.push(t),delete i.lastStepIndexs,i.stepCounters=s,Z.setCurrentStepTimesCounterData(e,i)),s.length}static getRandomNumber(e,t,i={}){let s=i.nestedId||"";if(i.onceOnly||false){let o=Z.getCurrentStepTimesCounterData(s);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,Z.setCurrentStepTimesCounterData(s,o),c}return Math.floor(Math.random()*(t-e+1))+e}static resetCurrentStepTimesCounter(e=""){let t=Z.currentLabelStepIndex,i=t+e,s=Z.currentLabelId;if(!s||t===null){A.error("currentLabelId or currentLabelStepIndex is null");return}let n=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};n[s]||(n[s]={}),n[s][i]={stepCounters:[],stepSha1:""},W.setVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY,n);}static get allChoicesMade(){return W.getVariable(he.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(e){W.setVariable(he.ALL_CHOICES_MADE_KEY,e);}static increaseStepCounter(){Z._stepCounter++;}static get openedLabels(){return pe(Z._openedLabels)}static set openedLabels(e){Z._openedLabels=pe(e);}static get originalOpenedLabels(){return pe(Z._originalOpenedLabels)}static set originalOpenedLabels(e){Z._originalOpenedLabels=pe(e);}static get _currentLabel(){if(Z.currentLabelId)return hi.get(Z.currentLabelId)}static get currentLabelId(){if(Z._openedLabels.length>0)return Z._openedLabels[Z._openedLabels.length-1].label}static get currentLabelStepIndex(){return Z._openedLabels.length>0?Z._openedLabels[Z._openedLabels.length-1].currentStepIndex:null}static addLabelHistory(e,t){let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;(!s||s<t)&&(i[e]={biggestStep:t,openCount:n},Z.allOpenedLabels=i);}static addChoicesMade(e,t,i,s){let n=Z.allChoicesMade,o=n.findIndex(a=>a.labelId===e&&a.stepIndex===t&&a.choiceIndex===s&&a.stepSha1===i);o<0?n.push({labelId:e,stepIndex:t,choiceIndex:s,stepSha1:i,madeTimes:1}):n[o].madeTimes++,Z.allChoicesMade=n;}static pushNewLabel(e){if(!hi.get(e))throw new Error(`[Pixi\u2019VN] Label ${e} not found`);Z._openedLabels.push({label:e,currentStepIndex:0});let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;i[e]={biggestStep:s,openCount:n+1},Z.allOpenedLabels=i;}static increaseCurrentStepIndex(){if(Z._openedLabels.length>0){let e=Z._openedLabels[Z._openedLabels.length-1];Z._openedLabels[Z._openedLabels.length-1]={...e,currentStepIndex:e.currentStepIndex+1};}}static set onStepStart(e){Z._onStepStart=e;}static get onStepStart(){return async(e,t)=>{let i=[];return Z.onLoadingLabel&&e===0&&i.push(Z.onLoadingLabel(e,t)),Z._onStepStart&&i.push(Z._onStepStart(e,t)),await Promise.all(i)}}};w(Z,"stepsRunning",0),w(Z,"goNextRequests",0),w(Z,"choiceMadeTemp"),w(Z,"lastHistoryStep",null),w(Z,"_stepCounter",0),w(Z,"_openedLabels",[]),w(Z,"_originalOpenedLabels",[]),w(Z,"_onStepStart"),w(Z,"onLoadingLabel"),w(Z,"onStepEnd");var N=Z;var Sm=class{get currentStepTimesCounter(){return N.getCurrentStepTimesCounter()}set currentStepTimesCounter(e){N.resetCurrentStepTimesCounter();}getRandomNumber(e,t,i={}){return N.getRandomNumber(e,t,i)}get stepCounter(){return N._stepCounter}get openedLabels(){return N.openedLabels}get currentLabel(){return N._currentLabel}addStepHistory(e,t={}){let{choiceMade:i,ignoreSameStep:s}=t,n,o,a,u=W.getVariable(he.LAST_STEP_GLUED)===this.stepCounter;W.getVariable(he.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(n=W.getVariable(he.CURRENT_DIALOGUE_MEMORY_KEY)),W.getVariable(he.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(o=W.getVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY)),W.getVariable(he.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(a=W.getVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY));let l=N.openedLabels,c={currentLabel:N.currentLabelId,dialogue:n,choices:o,stepSha1:e,index:this.stepCounter,labelStepIndex:N.currentLabelStepIndex,choiceIndexMade:i,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices,isGlued:u,openedLabels:l};N.originalOpenedLabels=l,W.addHistoryItem(c,{ignoreSameStep:s}),N.lastHistoryStep=c,N.increaseStepCounter();}closeCurrentLabel(){if(!N.currentLabelId){A.warn("No label to close");return}if(!this.currentLabel){A.error("currentLabel not found");return}let e=N.openedLabels;e.pop(),N.openedLabels=e,W.onLabelClosing(this.openedLabels.length);}closeAllLabels(){for(;N.openedLabels.length>0;)this.closeCurrentLabel(),W.onLabelClosing(this.openedLabels.length);}isLabelAlreadyCompleted(e){let t;typeof e=="string"?t=e:t=e.id;let s=N.allOpenedLabels[t]?.biggestStep||0;if(s){let n=hi.get(t);if(n)return n.stepCount<=s}return false}get alreadyCurrentStepMadeChoicesObj(){let e=N.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"),N.allChoicesMade.filter(s=>s.labelId===t?.id&&s.stepIndex===e&&s.stepSha1===i)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(e=>e.choiceIndex)}get isCurrentStepAlreadyOpened(){let e=N.currentLabelId;if(e){let t=N.allOpenedLabels[e]?.openCount||0;if(N.currentLabelStepIndex&&t>=N.currentLabelStepIndex)return true}return false}getTimesLabelOpened(e){return N.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 N.stepsRunning!==0?false:this.getCanGoNext()}async onStepRun(e,t){let i=[];return e.onStepStart&&i.push(e.onStepStart(t,e)),N.onStepStart&&i.push(N.onStepStart(t,e)),await Promise.all(i)}async onStepEnd(e,t){let i=[];return e.onStepEnd&&i.push(e.onStepEnd(t,e)),N.onStepEnd&&i.push(N.onStepEnd(t,e)),await Promise.all(i)}async goNext(e,t={}){let{runNow:i=false}=t;if(!(!i&&!this.getCanGoNext({showWarn:true}))){if(!i&&N.stepsRunning!==0){N.goNextRequests++;return}try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(s){A.error("Error running onStepEnd",s);}return N.stepsRunning===0&&await W.onGoNextEnd(),N.increaseCurrentStepIndex(),await this.runCurrentStep(e,t)}}async runCurrentStep(e,t={}){let{choiceMade:i}=t;if(N.currentLabelId){let s=N.currentLabelStepIndex;if(s===null){A.error("currentLabelStepIndex is null");return}let n=N._currentLabel;if(!n){A.error("currentLabel not found");return}if(n.stepCount>s){try{await this.onStepRun(n,s);}catch(u){A.error("Error running onStepStart",u),this.onStepError&&this.onStepError(u,e);return}let o=n.getStepById(s);if(!o){A.error("step not found");return}let a=n.getStepSha(s);a||(A.warn("stepSha not found, setting to ERROR"),a="error");try{N.stepsRunning++;let u=await o(e,{labelId:n.id}),l=this.choiceMenuOptions;if(l?.length===1&&l[0].autoSelect){let h=l[0];u=await this.selectChoice(h,e);}let c=N.lastHistoryStep;if(i!==void 0&&c){let h=c.stepSha1;h||(A.warn("stepSha not found, setting to ERROR"),h="error"),N.addChoicesMade(c.currentLabel||"error",typeof c.labelStepIndex=="number"?c.labelStepIndex:-1,c.stepSha1||"error",i),N.choiceMadeTemp=i;}return N.stepsRunning--,N.stepsRunning===0&&(N.addLabelHistory(n.id,s),this.addStepHistory(a,{...t,choiceMade:N.choiceMadeTemp}),N.choiceMadeTemp=void 0,N.goNextRequests>0)?(N.goNextRequests--,await this.goNext(e)):u}catch(u){N.stepsRunning>0&&N.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 N.openedLabels=[],W.onEnd?await W.onEnd(e,{labelId:"end"}):void 0}}else if(this.openedLabels.length===0){if(N.openedLabels=N.originalOpenedLabels,W.onEnd)return await W.onEnd(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:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=hi.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(a){A.error("Error running onStepEnd",a);}N.pushNewLabel(o.id);}catch(o){A.error("Error calling label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}async jumpLabel(e,t,i){this.openedLabels.length>0&&this.closeCurrentLabel();let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=hi.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(a){A.error("Error running onStepEnd",a);}N.pushNewLabel(o.id);}catch(o){A.error("Error jumping label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}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 onStepError(){let e=W.onError;return e?(t,i)=>e("step",t,i):void 0}set onStepError(e){W.onError=(t,i,s)=>e(i,s);}get dialogue(){let e=W.getVariable(he.CURRENT_DIALOGUE_MEMORY_KEY);if(e)return {...e,character:e.character?W.getCharacter(e.character)||e.character:void 0}}set dialogue(e){if(!e){W.setVariable(he.CURRENT_DIALOGUE_MEMORY_KEY,void 0);return}if((typeof e=="string"||Array.isArray(e))&&(e={text:e}),this.dialogGlue){let t=W.getVariable(he.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;}W.setVariable(he.LAST_STEP_GLUED,this.stepCounter),this.dialogGlue=false;}try{W.setVariable(he.CURRENT_DIALOGUE_MEMORY_KEY,pe({...e,character:typeof e.character=="string"?e.character:e.character?.id})),W.setVariable(he.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=W.getVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(e){let t=[],i=e.map((n,o)=>({...n,choiceIndex:o})),s=this.alreadyCurrentStepMadeChoices;if(i=i.filter((n,o)=>n.oneTime&&s&&s.includes(o)?false:n.onlyHaveNoChoice?(t.push(n),false):true),i.length>0)return i;if(t.length>0)return [t[0]]}}set choiceMenuOptions(e){if(!e||e.length===0){W.setVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY,void 0);return}try{W.setVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY,pe(e)),W.setVariable(he.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw A.error("ChoiceInterface cannot contain functions or classes"),t}}get dialogGlue(){return W.getFlag(he.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(e){W.setFlag(he.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,e);}get inputValue(){return W.getVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(e){this.removeInputRequest(),W.setVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY,e),W.setVariable(he.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}get isRequiredInput(){return W.getVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return W.getVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(e,t){e.isRequired=true,W.setVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY,e),t!==void 0?W.setVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY,t):W.removeVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){W.removeVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY),W.removeVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){N.openedLabels=[],N._stepCounter=0;}export(){return {openedLabels:pe(N.openedLabels),stepCounter:this.stepCounter}}async onLoadingLabel(e){let t=this.openedLabels.map(async i=>{let s=[],n=hi.get(i.label);return n&&(n.onLoadingLabel&&s.push(n.onLoadingLabel(e,n)),N.onLoadingLabel&&s.push(N.onLoadingLabel(e,n))),await Promise.all(s)});return await Promise.all(t)}async restore(e,t){this.clear();try{N.lastHistoryStep=t,e.hasOwnProperty("openedLabels")?(N.openedLabels=e.openedLabels,N.originalOpenedLabels=N.openedLabels):A.warn("Could not import openedLabels data, so will be ignored"),e.hasOwnProperty("stepCounter")?N._stepCounter=e.stepCounter:e.hasOwnProperty("lastStepIndex")?N._stepCounter=e.lastStepIndex:A.warn("Could not import stepCounter data, so will be ignored");try{await this.onLoadingLabel(N.currentLabelStepIndex||0);}catch(i){A.error("Error running onLoadingLabel",i);}}catch(i){A.error("Error importing data",i);}}};function xG(r,e,t,i){let s=typeof e=="string"?e:e.id;return {...i,label:s,props:t,text:r,type:i?.type||"call"}}var wv="close";function _G(r,e){return {...e,type:wv,text:r}}var bG=Fh(Lw());var ju=class{constructor(e,t){w(this,"_id");w(this,"_onStepStart");w(this,"_onLoadingLabel");w(this,"_onStepEnd");this._id=e,this._onStepStart=t?.onStepStart,this._onLoadingLabel=t?.onLoadingLabel,this._onStepEnd=t?.onStepEnd;}get id(){return this._id}get onStepStart(){return async(e,t)=>{if(this._onLoadingLabel&&e===0&&await this._onLoadingLabel(e,t),this._onStepStart)return await this._onStepStart(e,t)}}get onLoadingLabel(){return this._onLoadingLabel}get onStepEnd(){return this._onStepEnd}};var $u=class extends ju{constructor(t,i,s){super(t,s);w(this,"_steps");this._steps=i;}get stepCount(){return this.steps.length}getStepById(t){return this.steps[t]}get steps(){return typeof this._steps=="function"?this._steps():this._steps}getStepSha(t){if(t<0||t>=this.steps.length)return A.warn("stepSha not found, setting to ERROR"),"error";try{let i=this.steps[t];return (0,bG.default)(i.toString().toLocaleLowerCase()).toString()}catch(i){return A.warn("stepSha not found, setting to ERROR",i),"error"}}};function XP(r,e,t){let i=new $u(r,e,t);return hi.add(i),i}var Ks=new Sm;var $P={};vs($P,{Sound:()=>wo,SoundManagerStatic:()=>oe,sound:()=>Po});var oe=class{constructor(){}};w(oe,"soundAliasesOrder",[]),w(oe,"soundsPlaying",{}),w(oe,"sounds",{});var wo=class r extends Gr{constructor(){super(...arguments);w(this,"alias");}pause(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=oe.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[this.alias]={...t,paused:true},super.pause()}resume(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=oe.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[this.alias]={options:t.options,stepIndex:W.stepCounter,paused:false},super.resume()}destroy(){return this.alias&&delete oe.soundsPlaying[this.alias],super.destroy()}stop(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return delete oe.soundsPlaying[this.alias],super.stop()}play(t){if(typeof t=="string"&&(this.alias=t),!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return oe.soundsPlaying[this.alias]={stepIndex:W.stepCounter,options:t,paused:false},super.play(t)}static from(t){let i=Gr.from(t);return new r(i.media,i.options)}};function Em(r){let e=[];for(let t of r)t.type==="TelephoneFilter"?e.push(new Xe.TelephoneFilter):t.type==="StreamFilter"?e.push(new Xe.StreamFilter):t.type==="StereoFilter"?e.push(new Xe.StereoFilter(t.pan)):t.type==="ReverbFilter"?e.push(new Xe.ReverbFilter(t.seconds,t.decay,t.reverse)):t.type==="MonoFilter"?e.push(new Xe.MonoFilter):t.type==="EqualizerFilter"?e.push(new Xe.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 Xe.DistortionFilter(t.amount)):A.error("Unknown sound filter type");return e}function jP(r){if(!r)return;let e=[];for(let t of r)t instanceof Xe.TelephoneFilter?e.push({type:"TelephoneFilter"}):t instanceof Xe.StreamFilter?e.push({type:"StreamFilter"}):t instanceof Xe.StereoFilter?e.push({type:"StereoFilter",pan:t.pan}):t instanceof Xe.ReverbFilter?e.push({type:"ReverbFilter",seconds:t.seconds,decay:t.decay,reverse:t.reverse}):t instanceof Xe.MonoFilter?e.push({type:"MonoFilter"}):t instanceof Xe.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 Xe.DistortionFilter?e.push({type:"DistortionFilter",amount:t.amount}):A.error("Unknown sound filter type");return e}var Am=class extends ih{constructor(){super();}get context(){return Ie.context}get filtersAll(){return Ie.filtersAll}set filtersAll(e){Ie.filtersAll=e.filter(t=>!(t instanceof Xe.Filter));}get supported(){return Ie.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 Gr&&(t=t.options);let i;if(t instanceof wo)i=t;else {let s=this.getOptions(t||{});i=wo.from(s);}return i.alias=e,!oe.soundAliasesOrder.includes(e)&&oe.soundAliasesOrder.push(e),oe.sounds[e]=i,Ie.add(e,i),i}get useLegacy(){return Ie.useLegacy}set useLegacy(e){Ie.useLegacy=e;}get disableAutoPause(){return Ie.disableAutoPause}set disableAutoPause(e){Ie.disableAutoPause=e;}remove(e){return oe.soundAliasesOrder=oe.soundAliasesOrder.filter(t=>t!==e),delete oe.soundsPlaying[e],delete oe.sounds[e],Ie.remove(e)}get volumeAll(){return Ie.volumeAll}set volumeAll(e){Ie.volumeAll=e;}get speedAll(){return Ie.speedAll}set speedAll(e){Ie.speedAll=e;}togglePauseAll(){return Ie.togglePauseAll()}pauseAll(){return Ie.pauseAll()}resumeAll(){return Ie.resumeAll()}toggleMuteAll(){return Ie.toggleMuteAll()}muteAll(){return Ie.muteAll()}unmuteAll(){return Ie.unmuteAll()}removeAll(){return oe.soundAliasesOrder=[],oe.soundsPlaying={},oe.sounds={},Ie.removeAll()}stopAll(){for(let e in oe.sounds)oe.sounds[e].stop();return oe.soundsPlaying={},Ie.stopAll()}exists(e,t){return Ie.exists(e,t)||e in oe.sounds}isPlaying(){return Ie.isPlaying()}find(e){let t=oe.sounds[e];return t||(t=Ie.find(e),t&&(oe.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 oe.soundsPlaying[e]={stepIndex:W.stepCounter,options:t,paused:false},Ie.play(e,t)}stop(e){return delete oe.soundsPlaying[e],Ie.stop(e)}pause(e){let t=oe.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[e]={...t,paused:true},Ie.pause(e)}resume(e){let t=oe.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[e]={options:t.options,stepIndex:W.stepCounter,paused:false},Ie.resume(e)}volume(e,t){return Ie.volume(e,t)}speed(e,t){return Ie.speed(e,t)}duration(e){return Ie.duration(e)}close(){return Ie.close()}clear(){this.stopAll();}export(){let e={};for(let t in oe.soundsPlaying){let i=oe.soundsPlaying[t],s=this.find(t);s&&(e[t]={...i,sound:{options:{...s.options,autoPlay:s.autoPlay,loop:s.loop,preload:s.preload,singleInstance:s.singleInstance,url:s.options.url,volume:s.options.volume},filters:jP(s.media.filters)}});}return {soundsPlaying:pe(e),soundAliasesOrder:pe(oe.soundAliasesOrder),filters:pe(jP(this.filtersAll))}}removeOldSoundAndExport(){return this.export()}restore(e){let t=W.stepCounter-1;this.clear();try{if(e.hasOwnProperty("soundAliasesOrder"))oe.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=Em(i));}if(e.hasOwnProperty("playInStepIndex")){let i=e.playInStepIndex;i&&(oe.soundsPlaying=i);}if(e.hasOwnProperty("sounds")){let i=e.sounds;for(let s in i){let n=i[s],o=!1,a=this.add(s,{...n.options,autoPlay:!1});if(s in oe.soundsPlaying){let u=oe.soundsPlaying[s];(n.options.loop||u.options&&typeof u.options=="object"&&u.options.loop||u.stepIndex===t)&&(o=!0),n.filters&&(a.filters=Em(n.filters)),o&&a.play();}}}if(e.hasOwnProperty("soundsPlaying")){let i=e.soundsPlaying;for(let s in i){let n=i[s];oe.soundsPlaying[s]={paused:n.paused,stepIndex:n.stepIndex,options:n.options};let o=i[s].sound,a=!1,u;if(this.exists(s)?(u=this.find(s),o.options.url=u.options.url,o.options.volume=u.options.volume,u.options=o.options,u.autoPlay=!1,u.filters=o.filters?Em(o.filters):[]):u=this.add(s,{...o.options,autoPlay:!1}),s in oe.soundsPlaying){let l=oe.soundsPlaying[s];(o.options.loop||l.options&&typeof l.options=="object"&&l.options.loop||l.stepIndex===t)&&(a=!0),o.filters&&(u.filters=Em(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 Po=new Am;Re();function yG(){console.info(`
|
|
3316
3316
|
_______ _ _ _ ____ ____ ____ _____
|
|
3317
3317
|
|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|
|
|
3318
3318
|
| |__) |__ _ __ __ \\_| \\ \\ / / | \\ | |
|