@drincs/pixi-vn 1.9.3 → 1.9.5
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/README.md +1 -1
- package/dist/{ContainerMemory-BpDgacyr.d.cts → ContainerMemory-DNqSVzLY.d.cts} +12 -116
- package/dist/{ContainerMemory-BpDgacyr.d.ts → ContainerMemory-DNqSVzLY.d.ts} +12 -116
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +1375 -562
- package/dist/canvas.d.ts +1375 -562
- package/dist/canvas.mjs +2 -2
- package/dist/characters.mjs +1 -1
- package/dist/{chunk-7P46CLKX.mjs → chunk-5MVDNAT4.mjs} +1 -1
- package/dist/chunk-6OABTG5R.mjs +1 -0
- package/dist/chunk-AW5XWF24.mjs +1 -0
- package/dist/chunk-HD353M4B.mjs +1 -0
- package/dist/chunk-LXIKP2K5.mjs +1 -0
- package/dist/chunk-S7HZUIEI.mjs +1 -0
- package/dist/chunk-XLRCR56W.mjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +63 -1
- package/dist/core.d.ts +63 -1
- package/dist/core.mjs +1 -1
- package/dist/filters.cjs +1 -0
- package/dist/filters.d.cts +196 -0
- package/dist/filters.d.ts +196 -0
- package/dist/filters.mjs +1 -0
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.d.cts +35 -8
- package/dist/motion.d.ts +35 -8
- package/dist/motion.mjs +1 -1
- package/dist/narration.mjs +1 -1
- package/dist/pixi/browser.js +170 -169
- package/dist/sound.mjs +1 -1
- package/dist/storage.mjs +1 -1
- package/dist/tickers.cjs +1 -0
- package/dist/tickers.d.cts +625 -0
- package/dist/tickers.d.ts +625 -0
- package/dist/tickers.mjs +1 -0
- package/dist/vite.cjs +6 -6
- package/dist/vite.mjs +6 -6
- package/dist/worker.cjs +1 -1
- package/dist/worker.mjs +1 -1
- package/package.json +22 -1
- package/dist/chunk-AWU37VV6.mjs +0 -1
- package/dist/chunk-QOBPVPCY.mjs +0 -1
- package/dist/chunk-U5BSF6X3.mjs +0 -1
- package/dist/chunk-YBA63R27.mjs +0 -1
package/dist/canvas.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var core=require('@drincs/pixi-vn/core'),be=require('@drincs/pixi-vn/pixi.js'),devtools=require('@pixi/devtools');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var be__default=/*#__PURE__*/_interopDefault(be);var bi=Object.create;var Ct=Object.defineProperty;var Ei=Object.getOwnPropertyDescriptor;var wi=Object.getOwnPropertyNames;var Mi=Object.getPrototypeOf,Oi=Object.prototype.hasOwnProperty;var Gt=t=>{throw TypeError(t)};var Ri=(t,e,i)=>e in t?Ct(t,e,{enumerable:true,configurable:true,writable:true,value:i}):t[e]=i;var _t=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var jt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Bi=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of wi(e))!Oi.call(t,n)&&n!==i&&Ct(t,n,{get:()=>e[n],enumerable:!(r=Ei(e,n))||r.enumerable});return t};var $t=(t,e,i)=>(i=t!=null?bi(Mi(t)):{},Bi(Ct(i,"default",{value:t,enumerable:true}),t));var Y=(t,e,i)=>Ri(t,typeof e!="symbol"?e+"":e,i),kt=(t,e,i)=>e.has(t)||Gt("Cannot "+i);var s=(t,e,i)=>(kt(t,e,"read from private field"),i?i.call(t):e.get(t)),M=(t,e,i)=>e.has(t)?Gt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),k=(t,e,i,r)=>(kt(t,e,"write to private field"),e.set(t,i),i),S=(t,e,i)=>(kt(t,e,"access private method"),i);var it=(t,e,i,r)=>({set _(n){k(t,e,n);},get _(){return s(t,e,r)}});var Jt=jt((nt,qt)=>{(function(t,e){typeof nt=="object"?qt.exports=nt=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e();})(nt,function(){var t=t||(function(e,i){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof global<"u"&&global.crypto&&(r=global.crypto),!r&&typeof _t=="function")try{r=_t("crypto");}catch{}var n=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||(function(){function f(){}return function(P){var E;return f.prototype=P,E=new f,f.prototype=null,E}})(),o={},h=o.lib={},l=h.Base=(function(){return {extend:function(f){var P=a(this);return f&&P.mixIn(f),(!P.hasOwnProperty("init")||this.init===P.init)&&(P.init=function(){P.$super.init.apply(this,arguments);}),P.init.prototype=P,P.$super=this,P},create:function(){var f=this.extend();return f.init.apply(f,arguments),f},init:function(){},mixIn:function(f){for(var P in f)f.hasOwnProperty(P)&&(this[P]=f[P]);f.hasOwnProperty("toString")&&(this.toString=f.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),c=h.WordArray=l.extend({init:function(f,P){f=this.words=f||[],P!=i?this.sigBytes=P:this.sigBytes=f.length*4;},toString:function(f){return (f||p).stringify(this)},concat:function(f){var P=this.words,E=f.words,b=this.sigBytes,w=f.sigBytes;if(this.clamp(),b%4)for(var L=0;L<w;L++){var ue=E[L>>>2]>>>24-L%4*8&255;P[b+L>>>2]|=ue<<24-(b+L)%4*8;}else for(var V=0;V<w;V+=4)P[b+V>>>2]=E[V>>>2];return this.sigBytes+=w,this},clamp:function(){var f=this.words,P=this.sigBytes;f[P>>>2]&=4294967295<<32-P%4*8,f.length=e.ceil(P/4);},clone:function(){var f=l.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var P=[],E=0;E<f;E+=4)P.push(n());return new c.init(P,f)}}),d=o.enc={},p=d.Hex={stringify:function(f){for(var P=f.words,E=f.sigBytes,b=[],w=0;w<E;w++){var L=P[w>>>2]>>>24-w%4*8&255;b.push((L>>>4).toString(16)),b.push((L&15).toString(16));}return b.join("")},parse:function(f){for(var P=f.length,E=[],b=0;b<P;b+=2)E[b>>>3]|=parseInt(f.substr(b,2),16)<<24-b%8*4;return new c.init(E,P/2)}},u=d.Latin1={stringify:function(f){for(var P=f.words,E=f.sigBytes,b=[],w=0;w<E;w++){var L=P[w>>>2]>>>24-w%4*8&255;b.push(String.fromCharCode(L));}return b.join("")},parse:function(f){for(var P=f.length,E=[],b=0;b<P;b++)E[b>>>2]|=(f.charCodeAt(b)&255)<<24-b%4*8;return new c.init(E,P)}},x=d.Utf8={stringify:function(f){try{return decodeURIComponent(escape(u.stringify(f)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(f){return u.parse(unescape(encodeURIComponent(f)))}},T=h.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0;},_append:function(f){typeof f=="string"&&(f=x.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes;},_process:function(f){var P,E=this._data,b=E.words,w=E.sigBytes,L=this.blockSize,ue=L*4,V=w/ue;f?V=e.ceil(V):V=e.max((V|0)-this._minBufferSize,0);var ie=V*L,Be=e.min(ie*4,w);if(ie){for(var St=0;St<ie;St+=L)this._doProcessBlock(b,St);P=b.splice(0,ie),E.sigBytes-=Be;}return new c.init(P,Be)},clone:function(){var f=l.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0});h.Hasher=T.extend({cfg:l.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset();},reset:function(){T.reset.call(this),this._doReset();},update:function(f){return this._append(f),this._process(),this},finalize:function(f){f&&this._append(f);var P=this._doFinalize();return P},blockSize:512/32,_createHelper:function(f){return function(P,E){return new f.init(E).finalize(P)}},_createHmacHelper:function(f){return function(P,E){return new _.HMAC.init(f,E).finalize(P)}}});var _=o.algo={};return o})(Math);return t});});var At=jt((st,Zt)=>{(function(t,e){typeof st=="object"?Zt.exports=st=e(Jt()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS);})(st,function(t){return (function(){var e=t,i=e.lib,r=i.WordArray,n=i.Hasher,a=e.algo,o=[],h=a.SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(l,c){for(var d=this._hash.words,p=d[0],u=d[1],x=d[2],T=d[3],I=d[4],_=0;_<80;_++){if(_<16)o[_]=l[c+_]|0;else {var f=o[_-3]^o[_-8]^o[_-14]^o[_-16];o[_]=f<<1|f>>>31;}var P=(p<<5|p>>>27)+I+o[_];_<20?P+=(u&x|~u&T)+1518500249:_<40?P+=(u^x^T)+1859775393:_<60?P+=(u&x|u&T|x&T)-1894007588:P+=(u^x^T)-899497514,I=T,T=x,x=u<<30|u>>>2,u=p,p=P;}d[0]=d[0]+p|0,d[1]=d[1]+u|0,d[2]=d[2]+x|0,d[3]=d[3]+T|0,d[4]=d[4]+I|0;},_doFinalize:function(){var l=this._data,c=l.words,d=this._nDataBytes*8,p=l.sigBytes*8;return c[p>>>5]|=128<<24-p%32,c[(p+64>>>9<<4)+14]=Math.floor(d/4294967296),c[(p+64>>>9<<4)+15]=d,l.sigBytes=c.length*4,this._process(),this._hash},clone:function(){var l=n.clone.call(this);return l._hash=this._hash.clone(),l}});e.SHA1=n._createHelper(h),e.HmacSHA1=n._createHmacHelper(h);})(),t.SHA1});});var Li={extension:{type:"sceneProperties",name:"additional-positions"},testNode(t){return "xAlign"in t||"yAlign"in t||"percentageX"in t||"percentageY"in t||"positionType"in t},testProp(t){switch(t){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(t,e,i){switch(e){case "xAlign":"xAlign"in t&&(t.xAlign=i/100);break;case "yAlign":"yAlign"in t&&(t.yAlign=i/100);break;case "percentageX":"percentageX"in t&&(t.percentageX=i/100);break;case "percentageY":"percentageY"in t&&(t.percentageY=i/100);break}},getProperties(t){return [{value:t.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:t.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:t.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:t.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:t.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}}}]}},Xt=Li;var re="__game_layer__",Le="Container",rt="ImageContainer",De="Image",ze="Sprite",He="Text",We="Video";var C;(n=>(n.log=(a,...o)=>console.log(`[Pixi\u2019VN] ${a}`,...o),n.warn=(a,...o)=>console.warn(`[Pixi\u2019VN] ${a}`,...o),n.error=(a,...o)=>console.error(`[Pixi\u2019VN] ${a}`,...o),n.info=(a,...o)=>console.info(`[Pixi\u2019VN] ${a}`,...o)))(C||={});function Kt(t,e){let i=0;return async(...r)=>{let n=Date.now();if(n-i>=e)return i=n,await t(...r)}}var ti=$t(At()),y=class t{constructor(){}static _app=void 0;static get app(){if(!t._app)throw C.error("The canvas is not initialized"),new core.PixiError("invalid_usage","CanvasManagerStatic.app is undefined");return t._app}static get gameLayer(){let e=t.app.stage.getChildByLabel(re);return e||(e=new be__default.default.Container,e.label=re,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,i,r){let{id:n="pixi-vn-canvas",width:a=800,height:o=600,resolution:h=1,autoDensity:l=true,resizeMode:c="contain",...d}=i||{};return t.canvasWidth=a,t.canvasHeight=o,t._app=new be__default.default.Application,t.app.init({width:a,height:o,resolution:h,autoDensity:l,...d}).then(()=>{let{app:p=t.app,extensions:u=[],...x}=r||{};if(devtools.initDevtools({app:p,extensions:[Xt,...u],...x}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,n),c==="contain"){let T=Kt(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(T).observe(e),t.resize(),setTimeout(()=>t.resize(),750);}t.gameLayer;})}static addCanvasIntoHTMLElement(e,i){t._isInitialized?(e.appendChild(t.app.canvas),t.app.canvas.id=i):C.error("GameWindowManager is not initialized");}static addHtmlLayer(e,i,r={}){let{position:n="absolute",pointerEvents:a="none",userSelect:o="none"}=r,h=document.createElement("div");h.setAttribute("id",e),h.style.position=n,h.style.pointerEvents=a,h.style.userSelect=o;let l=i.appendChild(h);return t.htmlLayers.push(h),t.resize(),l}static removeHtmlLayer(e){let i=t.htmlLayers.find(r=>r.id===e);i&&(i.remove(),t.htmlLayers=t.htmlLayers.filter(r=>r.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(i=>i.id===e)}static async resize(){let e=t.canvasWidth,i=t.canvasHeight,r=t.app.resizeTo,n=t.app.canvas.style;r instanceof HTMLElement||(r=document.documentElement);let a,o;if(r===document.body||r===document.documentElement)a=document.documentElement.clientWidth||window.innerWidth,o=document.documentElement.clientHeight||window.innerHeight;else {let u=r.getBoundingClientRect();a=u.width||r.clientWidth,o=u.height||r.clientHeight;}let h=Math.min(a/e,o/i),l=Math.floor(h*e),c=Math.floor(h*i);n.width=`${l}px`,n.height=`${c}px`;let d=(a-l)/2,p=(o-c)/2;n.marginLeft=`${d}px`,n.marginRight=`${d}px`,n.marginTop=`${p}px`,n.marginBottom=`${p}px`,t.htmlLayers.forEach(u=>{u.style.width=`${l}px`,u.style.height=`${c}px`,u.style.marginLeft=`${d}px`,u.style.marginRight=`${d}px`,u.style.marginTop=`${p}px`,u.style.marginBottom=`${p}px`;});}static get childrenAliasesOrder(){return t.gameLayer.children.filter(e=>e.label).sort((e,i)=>t.gameLayer.getChildIndex(e)-t.gameLayer.getChildIndex(i)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Array.from(t._currentTickers.entries()).filter(([e,i])=>!i.createdByTicketSteps).map(([e,i])=>[e,{id:i.ticker.alias,args:i.ticker.args,canvasElementAliases:i.ticker.canvasElementAliases,priority:i.ticker.priority,duration:i.ticker.duration,paused:i.ticker.paused}]))}static _currentTickers=new Map;static _currentTickersSequence=new Map;static get currentTickersSequence(){return Object.fromEntries(Array.from(t._currentTickersSequence.entries()).map(([e,i])=>[e,Object.fromEntries(i)]))}static _currentTickersTimeouts=new Map;static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static generateTickerId(...e){try{return `${(0,ti.default)(JSON.stringify(e)).toString()}_${Math.random().toString(36).substring(7)}`}catch(i){throw new core.PixiError("not_json_serializable",`Error to generate ticker id: ${i}`)}}static addTickerTimeoutInfo(e,i,r,n){typeof e=="string"&&(e=[e]),t._currentTickersTimeouts.set(r,{aliases:e,ticker:i,canBeDeletedBeforeEnd:n});}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),t._currentTickersTimeouts.delete(e);}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),t.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,i){t._currentTickersTimeouts.forEach((r,n)=>{let a=r.aliases.filter(o=>o!==e);if(a.length===0){let o=r.canBeDeletedBeforeEnd;(!i||o)&&t.removeTickerTimeout(n);}else r.aliases=a;});}};var zi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,si=new Set,bt=typeof process=="object"&&process?process:{},oi=(t,e,i,r)=>{typeof bt.emitWarning=="function"?bt.emitWarning(t,e,i,r):console.error(`[${i}] ${e}: ${t}`);},lt=globalThis.AbortController,ii=globalThis.AbortSignal;if(typeof lt>"u"){ii=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,r){this._onabort.push(r);}},lt=class{constructor(){e();}signal=new ii;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let r of this.signal._onabort)r(i);this.signal.onabort?.(i);}}};let t=bt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=false,oi("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 Hi=t=>!si.has(t);var ve=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ai=t=>ve(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ot:null:null,ot=class extends Array{constructor(t){super(t),this.fill(0);}},fe,Fe,Wi=(fe=class{heap;length;static create(e){let i=ai(e);if(!i)return [];k(fe,Fe,true);let r=new fe(e,i);return k(fe,Fe,false),r}constructor(e,i){if(!s(fe,Fe))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},Fe=new WeakMap,M(fe,Fe,false),fe),ri,ni,Q,X,ne,Ce,se,Ne,Ve,oe,H,ae,D,R,A,j,K,G,W,ce,F,le,he,q,J,de,Se,$,Ye,v,Et,_e,me,Ke,Z,li,ke,Ue,qe,Te,Pe,wt,at,ct,O,Mt,Xe,Ie,Ot,Ge,ci=(Ge=class{constructor(e){M(this,v);M(this,Q);M(this,X);M(this,ne);M(this,Ce);M(this,se);M(this,Ne);M(this,Ve);M(this,oe);Y(this,"ttl");Y(this,"ttlResolution");Y(this,"ttlAutopurge");Y(this,"updateAgeOnGet");Y(this,"updateAgeOnHas");Y(this,"allowStale");Y(this,"noDisposeOnSet");Y(this,"noUpdateTTL");Y(this,"maxEntrySize");Y(this,"sizeCalculation");Y(this,"noDeleteOnFetchRejection");Y(this,"noDeleteOnStaleGet");Y(this,"allowStaleOnFetchAbort");Y(this,"allowStaleOnFetchRejection");Y(this,"ignoreFetchAbort");M(this,H);M(this,ae);M(this,D);M(this,R);M(this,A);M(this,j);M(this,K);M(this,G);M(this,W);M(this,ce);M(this,F);M(this,le);M(this,he);M(this,q);M(this,J);M(this,de);M(this,Se);M(this,$);M(this,Ye);M(this,_e,()=>{});M(this,me,()=>{});M(this,Ke,()=>{});M(this,Z,()=>false);M(this,ke,e=>{});M(this,Ue,(e,i,r)=>{});M(this,qe,(e,i,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Y(this,ri,"LRUCache");let{max:i=0,ttl:r,ttlResolution:n=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:l,dispose:c,onInsert:d,disposeAfter:p,noDisposeOnSet:u,noUpdateTTL:x,maxSize:T=0,maxEntrySize:I=0,sizeCalculation:_,fetchMethod:f,memoMethod:P,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:L,ignoreFetchAbort:ue,perf:V}=e;if(V!==void 0&&typeof V?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(k(this,oe,V??zi),i!==0&&!ve(i))throw new TypeError("max option must be a nonnegative integer");let ie=i?ai(i):Array;if(!ie)throw new Error("invalid max value: "+i);if(k(this,Q,i),k(this,X,T),this.maxEntrySize=I||s(this,X),this.sizeCalculation=_,this.sizeCalculation){if(!s(this,X)&&!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(P!==void 0&&typeof P!="function")throw new TypeError("memoMethod must be a function if defined");if(k(this,Ve,P),f!==void 0&&typeof f!="function")throw new TypeError("fetchMethod must be a function if specified");if(k(this,Ne,f),k(this,Se,!!f),k(this,D,new Map),k(this,R,new Array(i).fill(void 0)),k(this,A,new Array(i).fill(void 0)),k(this,j,new ie(i)),k(this,K,new ie(i)),k(this,G,0),k(this,W,0),k(this,ce,Wi.create(i)),k(this,H,0),k(this,ae,0),typeof c=="function"&&k(this,ne,c),typeof d=="function"&&k(this,Ce,d),typeof p=="function"?(k(this,se,p),k(this,F,[])):(k(this,se,void 0),k(this,F,void 0)),k(this,de,!!s(this,ne)),k(this,Ye,!!s(this,Ce)),k(this,$,!!s(this,se)),this.noDisposeOnSet=!!u,this.noUpdateTTL=!!x,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!ue,this.maxEntrySize!==0){if(s(this,X)!==0&&!ve(s(this,X)))throw new TypeError("maxSize must be a positive integer if specified");if(!ve(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");S(this,v,li).call(this);}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=ve(n)||n===0?n:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!ve(this.ttl))throw new TypeError("ttl must be a positive integer if specified");S(this,v,Et).call(this);}if(s(this,Q)===0&&this.ttl===0&&s(this,X)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!s(this,Q)&&!s(this,X)){let Be="LRU_CACHE_UNBOUNDED";Hi(Be)&&(si.add(Be),oi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Be,Ge));}}get perf(){return s(this,oe)}static unsafeExposeInternals(e){return {starts:s(e,he),ttls:s(e,q),autopurgeTimers:s(e,J),sizes:s(e,le),keyMap:s(e,D),keyList:s(e,R),valList:s(e,A),next:s(e,j),prev:s(e,K),get head(){return s(e,G)},get tail(){return s(e,W)},free:s(e,ce),isBackgroundFetch:i=>{var r;return S(r=e,v,O).call(r,i)},backgroundFetch:(i,r,n,a)=>{var o;return S(o=e,v,ct).call(o,i,r,n,a)},moveToTail:i=>{var r;return S(r=e,v,Xe).call(r,i)},indexes:i=>{var r;return S(r=e,v,Te).call(r,i)},rindexes:i=>{var r;return S(r=e,v,Pe).call(r,i)},isStale:i=>{var r;return s(r=e,Z).call(r,i)}}}get max(){return s(this,Q)}get maxSize(){return s(this,X)}get calculatedSize(){return s(this,ae)}get size(){return s(this,H)}get fetchMethod(){return s(this,Ne)}get memoMethod(){return s(this,Ve)}get dispose(){return s(this,ne)}get onInsert(){return s(this,Ce)}get disposeAfter(){return s(this,se)}getRemainingTTL(e){return s(this,D).has(e)?1/0:0}*entries(){for(let e of S(this,v,Te).call(this))s(this,A)[e]!==void 0&&s(this,R)[e]!==void 0&&!S(this,v,O).call(this,s(this,A)[e])&&(yield [s(this,R)[e],s(this,A)[e]]);}*rentries(){for(let e of S(this,v,Pe).call(this))s(this,A)[e]!==void 0&&s(this,R)[e]!==void 0&&!S(this,v,O).call(this,s(this,A)[e])&&(yield [s(this,R)[e],s(this,A)[e]]);}*keys(){for(let e of S(this,v,Te).call(this)){let i=s(this,R)[e];i!==void 0&&!S(this,v,O).call(this,s(this,A)[e])&&(yield i);}}*rkeys(){for(let e of S(this,v,Pe).call(this)){let i=s(this,R)[e];i!==void 0&&!S(this,v,O).call(this,s(this,A)[e])&&(yield i);}}*values(){for(let e of S(this,v,Te).call(this))s(this,A)[e]!==void 0&&!S(this,v,O).call(this,s(this,A)[e])&&(yield s(this,A)[e]);}*rvalues(){for(let e of S(this,v,Pe).call(this))s(this,A)[e]!==void 0&&!S(this,v,O).call(this,s(this,A)[e])&&(yield s(this,A)[e]);}[(ni=Symbol.iterator,ri=Symbol.toStringTag,ni)](){return this.entries()}find(e,i={}){for(let r of S(this,v,Te).call(this)){let n=s(this,A)[r],a=S(this,v,O).call(this,n)?n.__staleWhileFetching:n;if(a!==void 0&&e(a,s(this,R)[r],this))return this.get(s(this,R)[r],i)}}forEach(e,i=this){for(let r of S(this,v,Te).call(this)){let n=s(this,A)[r],a=S(this,v,O).call(this,n)?n.__staleWhileFetching:n;a!==void 0&&e.call(i,a,s(this,R)[r],this);}}rforEach(e,i=this){for(let r of S(this,v,Pe).call(this)){let n=s(this,A)[r],a=S(this,v,O).call(this,n)?n.__staleWhileFetching:n;a!==void 0&&e.call(i,a,s(this,R)[r],this);}}purgeStale(){let e=false;for(let i of S(this,v,Pe).call(this,{allowStale:true}))s(this,Z).call(this,i)&&(S(this,v,Ie).call(this,s(this,R)[i],"expire"),e=true);return e}info(e){let i=s(this,D).get(e);if(i===void 0)return;let r=s(this,A)[i],n=S(this,v,O).call(this,r)?r.__staleWhileFetching:r;if(n===void 0)return;let a={value:n};if(s(this,q)&&s(this,he)){let o=s(this,q)[i],h=s(this,he)[i];if(o&&h){let l=o-(s(this,oe).now()-h);a.ttl=l,a.start=Date.now();}}return s(this,le)&&(a.size=s(this,le)[i]),a}dump(){let e=[];for(let i of S(this,v,Te).call(this,{allowStale:true})){let r=s(this,R)[i],n=s(this,A)[i],a=S(this,v,O).call(this,n)?n.__staleWhileFetching:n;if(a===void 0||r===void 0)continue;let o={value:a};if(s(this,q)&&s(this,he)){o.ttl=s(this,q)[i];let h=s(this,oe).now()-s(this,he)[i];o.start=Math.floor(Date.now()-h);}s(this,le)&&(o.size=s(this,le)[i]),e.unshift([r,o]);}return e}load(e){this.clear();for(let[i,r]of e){if(r.start){let n=Date.now()-r.start;r.start=s(this,oe).now()-n;}this.set(i,r.value,r);}}set(e,i,r={}){var u,x,T,I;if(i===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:l}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,d=s(this,qe).call(this,e,i,r.size||0,h);if(this.maxEntrySize&&d>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),S(this,v,Ie).call(this,e,"set"),this;let p=s(this,H)===0?void 0:s(this,D).get(e);if(p===void 0)p=s(this,H)===0?s(this,W):s(this,ce).length!==0?s(this,ce).pop():s(this,H)===s(this,Q)?S(this,v,at).call(this,false):s(this,H),s(this,R)[p]=e,s(this,A)[p]=i,s(this,D).set(e,p),s(this,j)[s(this,W)]=p,s(this,K)[p]=s(this,W),k(this,W,p),it(this,H)._++,s(this,Ue).call(this,p,d,l),l&&(l.set="add"),c=false,s(this,Ye)&&((u=s(this,Ce))==null||u.call(this,i,e,"add"));else {S(this,v,Xe).call(this,p);let _=s(this,A)[p];if(i!==_){if(s(this,Se)&&S(this,v,O).call(this,_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=_;f!==void 0&&!o&&(s(this,de)&&((x=s(this,ne))==null||x.call(this,f,e,"set")),s(this,$)&&s(this,F)?.push([f,e,"set"]));}else o||(s(this,de)&&((T=s(this,ne))==null||T.call(this,_,e,"set")),s(this,$)&&s(this,F)?.push([_,e,"set"]));if(s(this,ke).call(this,p),s(this,Ue).call(this,p,d,l),s(this,A)[p]=i,l){l.set="replace";let f=_&&S(this,v,O).call(this,_)?_.__staleWhileFetching:_;f!==void 0&&(l.oldValue=f);}}else l&&(l.set="update");s(this,Ye)&&this.onInsert?.(i,e,i===_?"update":"replace");}if(n!==0&&!s(this,q)&&S(this,v,Et).call(this),s(this,q)&&(c||s(this,Ke).call(this,p,n,a),l&&s(this,me).call(this,l,p)),!o&&s(this,$)&&s(this,F)){let _=s(this,F),f;for(;f=_?.shift();)(I=s(this,se))==null||I.call(this,...f);}return this}pop(){var e;try{for(;s(this,H);){let i=s(this,A)[s(this,G)];if(S(this,v,at).call(this,!0),S(this,v,O).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(s(this,$)&&s(this,F)){let i=s(this,F),r;for(;r=i?.shift();)(e=s(this,se))==null||e.call(this,...r);}}}has(e,i={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=i,a=s(this,D).get(e);if(a!==void 0){let o=s(this,A)[a];if(S(this,v,O).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(s(this,Z).call(this,a))n&&(n.has="stale",s(this,me).call(this,n,a));else return r&&s(this,_e).call(this,a),n&&(n.has="hit",s(this,me).call(this,n,a)),true}else n&&(n.has="miss");return false}peek(e,i={}){let{allowStale:r=this.allowStale}=i,n=s(this,D).get(e);if(n===void 0||!r&&s(this,Z).call(this,n))return;let a=s(this,A)[n];return S(this,v,O).call(this,a)?a.__staleWhileFetching:a}async fetch(e,i={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:l=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:x=this.ignoreFetchAbort,allowStaleOnFetchAbort:T=this.allowStaleOnFetchAbort,context:I,forceRefresh:_=false,status:f,signal:P}=i;if(!s(this,Se))return f&&(f.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:a,status:f});let E={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:h,size:l,sizeCalculation:c,noUpdateTTL:d,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:T,ignoreFetchAbort:x,status:f,signal:P},b=s(this,D).get(e);if(b===void 0){f&&(f.fetch="miss");let w=S(this,v,ct).call(this,e,b,E,I);return w.__returned=w}else {let w=s(this,A)[b];if(S(this,v,O).call(this,w)){let ie=r&&w.__staleWhileFetching!==void 0;return f&&(f.fetch="inflight",ie&&(f.returnedStale=true)),ie?w.__staleWhileFetching:w.__returned=w}let L=s(this,Z).call(this,b);if(!_&&!L)return f&&(f.fetch="hit"),S(this,v,Xe).call(this,b),n&&s(this,_e).call(this,b),f&&s(this,me).call(this,f,b),w;let ue=S(this,v,ct).call(this,e,b,E,I),V=ue.__staleWhileFetching!==void 0&&r;return f&&(f.fetch=L?"stale":"refresh",V&&L&&(f.returnedStale=true)),V?ue.__staleWhileFetching:ue.__returned=ue}}async forceFetch(e,i={}){let r=await this.fetch(e,i);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,i={}){let r=s(this,Ve);if(!r)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:a,...o}=i,h=this.get(e,o);if(!a&&h!==void 0)return h;let l=r(e,h,{options:o,context:n});return this.set(e,l,o),l}get(e,i={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=i,h=s(this,D).get(e);if(h!==void 0){let l=s(this,A)[h],c=S(this,v,O).call(this,l);return o&&s(this,me).call(this,o,h),s(this,Z).call(this,h)?(o&&(o.get="stale"),c?(o&&r&&l.__staleWhileFetching!==void 0&&(o.returnedStale=true),r?l.__staleWhileFetching:void 0):(a||S(this,v,Ie).call(this,e,"expire"),o&&r&&(o.returnedStale=true),r?l:void 0)):(o&&(o.get="hit"),c?l.__staleWhileFetching:(S(this,v,Xe).call(this,h),n&&s(this,_e).call(this,h),l))}else o&&(o.get="miss");}delete(e){return S(this,v,Ie).call(this,e,"delete")}clear(){return S(this,v,Ot).call(this,"delete")}},Q=new WeakMap,X=new WeakMap,ne=new WeakMap,Ce=new WeakMap,se=new WeakMap,Ne=new WeakMap,Ve=new WeakMap,oe=new WeakMap,H=new WeakMap,ae=new WeakMap,D=new WeakMap,R=new WeakMap,A=new WeakMap,j=new WeakMap,K=new WeakMap,G=new WeakMap,W=new WeakMap,ce=new WeakMap,F=new WeakMap,le=new WeakMap,he=new WeakMap,q=new WeakMap,J=new WeakMap,de=new WeakMap,Se=new WeakMap,$=new WeakMap,Ye=new WeakMap,v=new WeakSet,Et=function(){let e=new ot(s(this,Q)),i=new ot(s(this,Q));k(this,q,e),k(this,he,i);let r=this.ttlAutopurge?new Array(s(this,Q)):void 0;k(this,J,r),k(this,Ke,(h,l,c=s(this,oe).now())=>{i[h]=l!==0?c:0,e[h]=l,n(h,l);}),k(this,_e,h=>{i[h]=e[h]!==0?s(this,oe).now():0,n(h,e[h]);});let n=this.ttlAutopurge?(h,l)=>{if(r?.[h]&&(clearTimeout(r[h]),r[h]=void 0),l&&l!==0&&r){let c=setTimeout(()=>{s(this,Z).call(this,h)&&S(this,v,Ie).call(this,s(this,R)[h],"expire");},l+1);c.unref&&c.unref(),r[h]=c;}}:()=>{};k(this,me,(h,l)=>{if(e[l]){let c=e[l],d=i[l];if(!c||!d)return;h.ttl=c,h.start=d,h.now=a||o();let p=h.now-d;h.remainingTTL=c-p;}});let a=0,o=()=>{let h=s(this,oe).now();if(this.ttlResolution>0){a=h;let l=setTimeout(()=>a=0,this.ttlResolution);l.unref&&l.unref();}return h};this.getRemainingTTL=h=>{let l=s(this,D).get(h);if(l===void 0)return 0;let c=e[l],d=i[l];if(!c||!d)return 1/0;let p=(a||o())-d;return c-p},k(this,Z,h=>{let l=i[h],c=e[h];return !!c&&!!l&&(a||o())-l>c});},_e=new WeakMap,me=new WeakMap,Ke=new WeakMap,Z=new WeakMap,li=function(){let e=new ot(s(this,Q));k(this,ae,0),k(this,le,e),k(this,ke,i=>{k(this,ae,s(this,ae)-e[i]),e[i]=0;}),k(this,qe,(i,r,n,a)=>{if(S(this,v,O).call(this,r))return 0;if(!ve(n))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(n=a(r,i),!ve(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n}),k(this,Ue,(i,r,n)=>{if(e[i]=r,s(this,X)){let a=s(this,X)-e[i];for(;s(this,ae)>a;)S(this,v,at).call(this,true);}k(this,ae,s(this,ae)+e[i]),n&&(n.entrySize=r,n.totalCalculatedSize=s(this,ae));});},ke=new WeakMap,Ue=new WeakMap,qe=new WeakMap,Te=function*({allowStale:e=this.allowStale}={}){if(s(this,H))for(let i=s(this,W);!(!S(this,v,wt).call(this,i)||((e||!s(this,Z).call(this,i))&&(yield i),i===s(this,G)));)i=s(this,K)[i];},Pe=function*({allowStale:e=this.allowStale}={}){if(s(this,H))for(let i=s(this,G);!(!S(this,v,wt).call(this,i)||((e||!s(this,Z).call(this,i))&&(yield i),i===s(this,W)));)i=s(this,j)[i];},wt=function(e){return e!==void 0&&s(this,D).get(s(this,R)[e])===e},at=function(e){var a;let i=s(this,G),r=s(this,R)[i],n=s(this,A)[i];return s(this,Se)&&S(this,v,O).call(this,n)?n.__abortController.abort(new Error("evicted")):(s(this,de)||s(this,$))&&(s(this,de)&&((a=s(this,ne))==null||a.call(this,n,r,"evict")),s(this,$)&&s(this,F)?.push([n,r,"evict"])),s(this,ke).call(this,i),s(this,J)?.[i]&&(clearTimeout(s(this,J)[i]),s(this,J)[i]=void 0),e&&(s(this,R)[i]=void 0,s(this,A)[i]=void 0,s(this,ce).push(i)),s(this,H)===1?(k(this,G,k(this,W,0)),s(this,ce).length=0):k(this,G,s(this,j)[i]),s(this,D).delete(r),it(this,H)._--,i},ct=function(e,i,r,n){let a=i===void 0?void 0:s(this,A)[i];if(S(this,v,O).call(this,a))return a;let o=new lt,{signal:h}=r;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let l={signal:o.signal,options:r,context:n},c=(I,_=false)=>{let{aborted:f}=o.signal,P=r.ignoreFetchAbort&&I!==void 0,E=r.ignoreFetchAbort||!!(r.allowStaleOnFetchAbort&&I!==void 0);if(r.status&&(f&&!_?(r.status.fetchAborted=true,r.status.fetchError=o.signal.reason,P&&(r.status.fetchAbortIgnored=true)):r.status.fetchResolved=true),f&&!P&&!_)return p(o.signal.reason,E);let b=x,w=s(this,A)[i];return (w===x||P&&_&&w===void 0)&&(I===void 0?b.__staleWhileFetching!==void 0?s(this,A)[i]=b.__staleWhileFetching:S(this,v,Ie).call(this,e,"fetch"):(r.status&&(r.status.fetchUpdated=true),this.set(e,I,l.options))),I},d=I=>(r.status&&(r.status.fetchRejected=true,r.status.fetchError=I),p(I,false)),p=(I,_)=>{let{aborted:f}=o.signal,P=f&&r.allowStaleOnFetchAbort,E=P||r.allowStaleOnFetchRejection,b=E||r.noDeleteOnFetchRejection,w=x;if(s(this,A)[i]===x&&(!b||!_&&w.__staleWhileFetching===void 0?S(this,v,Ie).call(this,e,"fetch"):P||(s(this,A)[i]=w.__staleWhileFetching)),E)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=true),w.__staleWhileFetching;if(w.__returned===w)throw I},u=(I,_)=>{var P;let f=(P=s(this,Ne))==null?void 0:P.call(this,e,a,l);f&&f instanceof Promise&&f.then(E=>I(E===void 0?void 0:E),_),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(I(void 0),r.allowStaleOnFetchAbort&&(I=E=>c(E,true)));});};r.status&&(r.status.fetchDispatched=true);let x=new Promise(u).then(c,d),T=Object.assign(x,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return i===void 0?(this.set(e,T,{...l.options,status:void 0}),i=s(this,D).get(e)):s(this,A)[i]=T,T},O=function(e){if(!s(this,Se))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof lt},Mt=function(e,i){s(this,K)[i]=e,s(this,j)[e]=i;},Xe=function(e){e!==s(this,W)&&(e===s(this,G)?k(this,G,s(this,j)[e]):S(this,v,Mt).call(this,s(this,K)[e],s(this,j)[e]),S(this,v,Mt).call(this,s(this,W),e),k(this,W,e));},Ie=function(e,i){var n,a;let r=false;if(s(this,H)!==0){let o=s(this,D).get(e);if(o!==void 0)if(s(this,J)?.[o]&&(clearTimeout(s(this,J)?.[o]),s(this,J)[o]=void 0),r=true,s(this,H)===1)S(this,v,Ot).call(this,i);else {s(this,ke).call(this,o);let h=s(this,A)[o];if(S(this,v,O).call(this,h)?h.__abortController.abort(new Error("deleted")):(s(this,de)||s(this,$))&&(s(this,de)&&((n=s(this,ne))==null||n.call(this,h,e,i)),s(this,$)&&s(this,F)?.push([h,e,i])),s(this,D).delete(e),s(this,R)[o]=void 0,s(this,A)[o]=void 0,o===s(this,W))k(this,W,s(this,K)[o]);else if(o===s(this,G))k(this,G,s(this,j)[o]);else {let l=s(this,K)[o];s(this,j)[l]=s(this,j)[o];let c=s(this,j)[o];s(this,K)[c]=s(this,K)[o];}it(this,H)._--,s(this,ce).push(o);}}if(s(this,$)&&s(this,F)?.length){let o=s(this,F),h;for(;h=o?.shift();)(a=s(this,se))==null||a.call(this,...h);}return r},Ot=function(e){var i,r;for(let n of S(this,v,Pe).call(this,{allowStale:true})){let a=s(this,A)[n];if(S(this,v,O).call(this,a))a.__abortController.abort(new Error("deleted"));else {let o=s(this,R)[n];s(this,de)&&((i=s(this,ne))==null||i.call(this,a,o,e)),s(this,$)&&s(this,F)?.push([a,o,e]);}}if(s(this,D).clear(),s(this,A).fill(void 0),s(this,R).fill(void 0),s(this,q)&&s(this,he)){s(this,q).fill(0),s(this,he).fill(0);for(let n of s(this,J)??[])n!==void 0&&clearTimeout(n);s(this,J)?.fill(void 0);}if(s(this,le)&&s(this,le).fill(0),k(this,G,0),k(this,W,0),s(this,ce).length=0,k(this,ae,0),k(this,H,0),s(this,$)&&s(this,F)){let n=s(this,F),a;for(;a=n?.shift();)(r=s(this,se))==null||r.call(this,...a);}},Ge);var ee=class{cache;map=new Map;constructor(e){this.cache=new ci({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Rt=Symbol("SerializableEvent"),je=new ee({cacheSize:5});function Fi(t){return (e,i,r)=>{let n=r.value;Bt.add(n,t||`${i}`);}}var Bt;(a=>{function t(o,h){o[Rt]=h,je.get(h)&&C.info(`Event "${h}" already exists, it will be overwritten`),je.set(h,o);}a.add=t;function e(o){try{let h=je.get(o);if(!h){C.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return h}catch(h){C.error(`Error while getting Event "${o}"`,h);return}}a.get=e;function i(){return Array.from(je.values())}a.values=i;function r(o){return je.has(o)}a.has=r;function n(){return Array.from(je.keys())}a.keys=n;})(Bt||={});var Lt=Bt;async function hi(t,e){if("onEvents"in e)for(let i in e.onEvents){let r=e.onEvents[i],n=Lt.get(r);n&&t.on(i,n);}}function di(t){let{onEventsHandlers:e={}}=t;return e}function Ae(t,e,i){let r=i[Rt];return r&&typeof r=="string"?(e.onEventsHandlers[t]=r,true):(C.warn(`The event handler for event "${t}" is not registered with the eventDecorator, it will not be saved in the memory and it will not work after loading the game. Please register the event handler with the eventDecorator to avoid this warning. Read more about it here: https://pixi-vn.com/start/canvas-functions#add-a-listener-to-an-event`),false)}var $e=new ee({cacheSize:5}),pi=new ee({cacheSize:2}),ui=new ee({cacheSize:2});function Ni(t={}){return e=>{Dt.add(e,t);}}async function te(t,e,i){let r=i?.ignoreScale||false,n=i?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(t.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(t.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(t.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(t.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(t.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(t.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(t.rotation=e.rotation),!r&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?t.scale.set(e.scale,e.scale):t.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?t.pivot.set(e.pivot,e.pivot):t.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&t.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&t.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(t.visible=e.visible),"x"in e&&e.x!==void 0&&(t.x=e.x),"y"in e&&e.y!==void 0&&(t.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(t.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(t.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(t.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(t.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(t.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(t.hitArea=e.hitArea),hi(t,e),"align"in e&&e.align!==void 0&&"align"in t&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&"percentagePosition"in t&&(t.percentagePosition=e.percentagePosition),n&&await n(),r||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var Dt;(h=>{function t(l,c={}){let{name:d=l.name,getInstance:p=async(x,T)=>{let I=new x;return await I.setMemory(T),I},copyProperty:u=async(x,T)=>{await x.setMemory(T);}}=c;$e.get(d)&&C.warn(`CanvasElement "${d}" already registered`),l.prototype.pixivnId=d,$e.set(d,l),pi.set(d,p),ui.set(d,u);}h.add=t;function e(l){let c=$e.get(l);if(!c){C.error(`CanvasElement "${l}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return c}h.get=e;async function i(l,c){let d=e(l),p=pi.get(l);if(!d||!p){C.error(`CanvasElement "${l}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await p(d,c)}catch(u){C.error(`Error while getting CanvasElement instance "${l}"`,u);}}h.getInstance=i;async function r(l,c,d){let p=ui.get(l);if(!p){C.error(`CanvasElement "${l}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await p(c,d);}catch(u){C.error(`Error while copying properties of CanvasElement "${l}"`,u);}}h.copyProperty=r;function n(){return Array.from($e.values())}h.values=n;function a(l){return $e.has(l)}h.has=a;function o(){return Array.from($e.keys())}h.keys=o;})(Dt||={});var U=Dt;async function ht(t){let e=await U.getInstance(t.pixivnId,t);if(!e)throw new core.PixiError("unregistered_element",`The element ${t.pixivnId} could not be created`,"canvas",t);return e}function Ht(t){return "memory"in t?t.memory:t instanceof be__default.default.Text?Ft(t):t instanceof be__default.default.Sprite?Wt(t):Ee(t)}function Yi(t){let e=t.parent;return {width:t.width,height:t.height,isRenderGroup:t.isRenderGroup,blendMode:t.blendMode,tint:t.tint,alpha:t.alpha,angle:t.angle,renderable:t.renderable,rotation:t.rotation,scale:{x:t.scale.x,y:t.scale.y},pivot:{x:t.pivot.x,y:t.pivot.y},position:{x:t.position.x,y:t.position.y},skew:{x:t.skew.x,y:t.skew.y},visible:t.visible,x:t.x,y:t.y,boundsArea:t.boundsArea,cursor:t.cursor,eventMode:t.eventMode,interactive:t.interactive,interactiveChildren:t.interactiveChildren,hitArea:t.hitArea,index:e?.getChildIndex(t),parentLabel:e?.label,label:t.label}}function zt(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function Ee(t,e){let i=Ui(t,Le),n=e?.childrenExport||false?t.children.sort((a,o)=>t.getChildIndex(a)-t.getChildIndex(o)).map(a=>Ht(a)):[];return {pixivnId:i,elements:n,onEvents:di(t),...Yi(t)}}function Wt(t){let e=Ee(t),i=e.pixivnId??ze,r="assetsAliases"in t&&Array.isArray(t.assetsAliases)?zt(t.texture,t.assetsAliases[0]):"textureAlias"in t?zt(t.texture,t.textureAlias):zt(t.texture);return {...e,pixivnId:i,textureData:r,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function Ft(t){let e=Ee(t),i=e.pixivnId??He;return {...e,pixivnId:i,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:Xi(t.style),roundPixels:t.roundPixels}}function Ui(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function dt(t){switch(t.type){case "linear":return {type:"linear",colorStops:t.colorStops,end:{x:t.end.x,y:t.end.y},start:{x:t.start.x,y:t.start.y},textureSpace:t.textureSpace,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height};case "radial":return {type:"radial",colorStops:t.colorStops,textureSpace:t.textureSpace,center:{x:t.center.x,y:t.center.y},innerRadius:t.innerRadius,outerCenter:{x:t.outerCenter.x,y:t.outerCenter.y},outerRadius:t.outerRadius,rotation:t.rotation,scale:t.scale,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height}}}function Gi(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof be__default.default.FillGradient)return dt(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof be__default.default.FillPattern))return dt(t.fill)}}C.warn("Unsupported property type for Text.style.fill.",t);}}function ji(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof be__default.default.Color)return t.toNumber();C.warn("Unsupported color type.",t);}function $i(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof be__default.default.FillGradient)return dt(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:ji(t.color),join:t.join,miterLimit:t.miterLimit,width:t.width,cap:t.cap,pixelLine:t.pixelLine,textureSpace:t.textureSpace};if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof be__default.default.FillPattern))return dt(t.fill)}}C.warn("Unsupported property type for Text.style.stroke.",t);}}function Xi(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:Gi(t.fill),fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontVariant:t.fontVariant,fontWeight:t.fontWeight,leading:t.leading,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,padding:t.padding,stroke:$i(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}var fi=$t(At());var pt=class{constructor(e,i){this.alias=this.constructor.prototype.id;let{duration:r,priority:n,id:a=this.generateTickerId(this.alias,i),canvasElementAliases:o=[]}=i||{};this.args=e,this.duration=r,this.priority=n,this.id=a,this.canvasElementAliases=o;}alias;id;args;duration;priority;ticker=new be__default.default.Ticker;canvasElementAliases=[];generateTickerId(...e){try{return (0,fi.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(i){throw new core.PixiError("not_json_serializable",`Error to generate ticker id: ${i}`)}}fnValue;complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){C.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(){let e=this.id,i=()=>this.fn(this.ticker,this.args,this.canvasElementAliases,e);this.fnValue=i,this.ticker.add(i,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};var we=new ee({cacheSize:5});function Ji(t){return function(e){Nt.add(e,t);}}var Nt;(o=>{function t(h,l){l||(l=h.name),we.get(l)&&C.info(`Ticker "${l}" already exists, it will be overwritten`),h.prototype.id=l,we.set(l,h);}o.add=t;function e(h){try{let l=we.get(h);if(!l){C.error(`Event "${h}" not found, did you forget to register it with the tickerDecorator?`);return}return l}catch(l){C.error(`Error while getting Event "${h}"`,l);return}}o.get=e;function i(h,l,c){try{let d=we.get(h);if(!d){C.error(`Ticker "${h}" not found, did you forget to register it with the tickerDecorator?`);return}return new d(l,c)}catch(d){C.error(`Error while getting Ticker "${h}"`,d);return}}o.getInstance=i;function r(){return Array.from(we.values())}o.values=r;function n(h){return we.has(h)}o.has=n;function a(){return Array.from(we.keys())}o.keys=a;})(Nt||={});var Me=Nt;var gi="aliasToRemoveAfter";function ge(t){try{if(typeof t>"u")return t;let e=JSON.stringify(t);return JSON.parse(e)}catch(e){throw C.error("Error creating exportable element",t,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var Je=class{tickersPausedByGameLayerRender=[];get app(){return y.app}get gameLayer(){return y.gameLayer}get isInitialized(){return y._isInitialized}get width(){return y.canvasWidth}get height(){return y.canvasHeight}get screen(){return this.app.screen}async init(e,i,r){return await y.init(e,i,r)}get children(){return y.gameLayer.children}async copyCanvasElementProperty(e,i,r={}){let n=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:a=l=>l}=r;if(typeof i=="string"){let l=this.find(i);if(l)i=l;else {C.error(`Canvas element ${i} not found`);return}}if(typeof e=="string"){let l=this.find(e);if(l)e=l;else {C.error(`Canvas element ${e} not found`);return}}e instanceof be__default.default.Container&&(e=e.memory);let o=a(n),h={...e};o.forEach(l=>{l in h&&delete h[l];}),await U.copyProperty(i.pixivnId,i,h);}add(e,i,r={}){if(e===re){C.error(`The alias ${re} is reserved`);return}let n=this.find(e),a=r?.ignoreOldStyle;n&&!a&&this.copyCanvasElementProperty(n,i);let{zIndex:o=n?.parent?.getChildIndex(n)}=r;n&&!this.canvasElementIsOnCanvas(n)?C.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):n&&this.remove(e,{ignoreTickers:true}),o!==void 0?(i.label=e,this.gameLayer.addChildAt(i,o)):(i.label=e,this.gameLayer.addChild(i));}remove(e,i={}){if(e===re){C.error(`The alias ${re} is reserved`);return}let r=i.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(n=>{this.gameLayer.getChildrenByLabel(n).forEach(a=>{this.gameLayer.removeChild(a),!r&&this.unlinkComponentFromTickerInternal(n);});});}find(e){if(e===re)return this.gameLayer;let i=this.gameLayer.getChildByLabel(e);if(i)return i}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,i,r={}){let n=this.find(e);n&&(n.label=i),!r.ignoreTickers&&this.transferTickersInternal(e,i,"move");}get currentTickers(){return this.tickers.currentTickers}get currentTickersSteps(){return this.tickers.currentTickersSteps}findTicker(e){return this.findTickerInternal(e)}findTickerInternal(e){let i=y._currentTickers.get(e);if(i)return i.ticker}addTicker(e,i){return this.addTickerInternal(e,i)}addTickerInternal(e,i){let r=i.id,n=i.alias;if(typeof e=="string"&&(e=[e]),i.canvasElementAliases=e,!Me.has(n)){C.error(`Ticker ${n} not found`);return}let a={ticker:i};if(y._currentTickers.set(r,a),a.ticker.start(),i.duration){let o=setTimeout(()=>{y.removeTickerTimeoutInfo(o),y._currentTickersTimeouts.get(o.toString())&&a.ticker.complete({ignoreTickerSteps:true});},i.duration*1e3);y.addTickerTimeoutInfo(e,n,o.toString(),true);}return r}addTickersSequence(e,i,r=0){if(i.length===0){C.warn("The steps of the tickers is empty");return}y._currentTickersSequence.has(e)||y._currentTickersSequence.set(e,new Map);let n={currentStepNumber:r,steps:i.map(o=>({ticker:o.alias,args:ge(o.args),duration:o.duration}))},a=y.generateTickerId(n);return y._currentTickersSequence.get(e)?.set(a,n),this.runTickersSequence(e,a),a}runTickersSequence(e,i){let r=y._currentTickersSequence.get(e);if(!r?.has(i))return;let n=r.get(i).steps[r.get(i).currentStepNumber],a=Me.getInstance(n.ticker,n.args,{canvasElementAliases:[e],duration:n.duration,priority:n.priority});if(!a){C.error(`Ticker ${n.ticker} not found`);return}let o=a.alias,h=a.id;a.canvasElementAliases=[e];let l={createdByTicketSteps:{canvasElementAlias:e,id:i},ticker:a};if(y._currentTickers.set(h,l),l.ticker.start(),a.duration){let c=setTimeout(()=>{let d=y._currentTickersTimeouts.get(c.toString());d&&(l.ticker.complete({ignoreTickerSteps:true}),d.aliases.forEach(p=>{this.nextTickerStep(p,i);})),y.removeTickerTimeoutInfo(c);},a.duration*1e3);y.addTickerTimeoutInfo(e,o,c.toString(),false);}}nextTickerStep(e,i){let r=y._currentTickersSequence.get(e);if(r?.has(i)){let n=r.get(i);n.currentStepNumber+1<n.steps.length?(n.currentStepNumber++,r.set(i,n),this.runTickersSequence(e,i)):i&&r.has(i)&&(r.delete(i),y._currentTickers.forEach((a,o)=>{a.createdByTicketSteps?.canvasElementAlias===e&&a.createdByTicketSteps.id===i&&this.removeTickerInternal(o);}));}}onTickerComplete(e,i){return this.onTickerCompleteInternal(e,i)}onTickerCompleteInternal(e,i){let{stopTicker:r=true,aliasToRemoveAfter:n,tickerAliasToResume:a,tickerIdToResume:o}=i,h=y._currentTickers.get(e),l=i.ignoreTickerSteps||false;this.remove(n),a.forEach(c=>{this.resumeTickerInternal({canvasAlias:c});}),this.resumeTickerInternal({id:o}),h&&(this.removeTickerInternal(e,{stopTicker:r}),!l&&h.ticker.duration===void 0&&h.createdByTicketSteps&&this.nextTickerStep(h.createdByTicketSteps.canvasElementAlias,h.createdByTicketSteps.id));}unlinkComponentFromTicker(e,i){return this.unlinkComponentFromTickerInternal(e,i)}unlinkComponentFromTickerInternal(e,i){if(typeof e=="string"&&(e=[e]),!i){e.forEach(n=>{y._currentTickers.forEach((a,o)=>{a.ticker.canvasElementAliases.includes(n)&&(a.ticker.canvasElementAliases.length===1?this.removeTickerInternal(o):a.ticker.canvasElementAliases=a.ticker.canvasElementAliases.filter(h=>h!==n));}),y._currentTickersSequence.has(n)&&y._currentTickersSequence.delete(n),y.removeTickerTimeoutsByAlias(n,false);});return}let r;typeof i=="string"?r=i:r=i.prototype.id,e.forEach(n=>{let a=y._currentTickersSequence.get(n);a&&a.forEach((o,h)=>{o.steps.find(l=>typeof l=="object"&&"ticker"in l&&l.ticker===r)&&a.delete(h);});}),y._currentTickers.forEach(n=>{n.ticker.alias===r&&(n.ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(a=>!e.includes(a)));}),y._currentTickersTimeouts.forEach(n=>{n.ticker===r&&n.canBeDeletedBeforeEnd&&(n.aliases=n.aliases.filter(a=>!e.includes(a)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){y._currentTickers.forEach(e=>{e.ticker.canvasElementAliases=e.ticker.canvasElementAliases.filter(i=>this.find(i)),e.ticker.canvasElementAliases.length===0&&e.ticker.complete({ignoreTickerSteps:true});}),y._currentTickersSequence.forEach((e,i)=>{e===void 0&&y._currentTickersSequence.delete(i);}),Array.from(y._currentTickersTimeouts.keys()).forEach(e=>{let i=y._currentTickersTimeouts.get(e);i&&i.aliases.length===0&&y.removeTickerTimeout(e);});}removeAllTickers(){return this.removeAllTickersInternal()}removeAllTickersInternal(){this.tickersPausedByGameLayerRender=[],y._currentTickersSequence.clear(),Array.from(y._currentTickers.keys()).forEach(e=>{this.removeTickerInternal(e);}),y._currentTickers.clear(),Array.from(y._currentTickersTimeouts.keys()).forEach(e=>{y.removeTickerTimeout(e);}),y._tickersToCompleteOnStepEnd.tikersIds.length=0,y._tickersToCompleteOnStepEnd.stepAlias.length=0;}removeTicker(e,i={stopTicker:true}){return this.removeTickerInternal(e,i)}removeTickerInternal(e,i={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(r=>{let n=y._currentTickers.get(r);n&&(i.stopTicker&&n.ticker.stop(),y._currentTickers.delete(r));});}pauseTicker(e){return this.pauseTickerInternal(e)}pauseTickerInternal(e){let i=[];if("canvasAlias"in e){let{canvasAlias:r,tickerIdsExcluded:n=[]}=e;y._currentTickers.forEach((a,o)=>{a.ticker.canvasElementAliases.includes(r)&&!n.includes(a.ticker.alias)&&a.ticker.paused===false&&(a.ticker.pause(),i.push(o));});}else if("id"in e){let{id:r}=e;typeof r=="string"&&(r=[r]),[...new Set(r)].forEach(n=>{let a=y._currentTickers.get(n);a?a.ticker.paused===false&&(a.ticker.pause(),i.push(n)):C.error(`Ticker with id ${n} not found`);});}return i}resumeTicker(e){return this.resumeTickerInternal(e)}resumeTickerInternal(e){if("canvasAlias"in e){let{canvasAlias:i}=e;y._currentTickers.forEach(r=>{r.ticker.canvasElementAliases.includes(i)&&r.ticker.play();});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),[...new Set(i)].forEach(r=>{let n=y._currentTickers.get(r);n?n.ticker.play():C.error(`Ticker with id ${r} not found`);});}}isTickerPaused(e,i){return this.isTickerPausedInternal(e,i)}isTickerPausedInternal(e,i){return false}pause(){this.gameLayer.renderable!==false&&(this.gameLayer.renderable=false,this.tickersPausedByGameLayerRender=this.pauseTickerInternal({id:Array.from(y._currentTickers.keys())}));}resume(){if(this.gameLayer.renderable===true)return;this.gameLayer.renderable=true;let e=this.tickersPausedByGameLayerRender.filter(i=>y._currentTickers.has(i));e.length>0&&this.resumeTickerInternal({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,i,r="move"){return this.transferTickersInternal(e,i,r)}transferTickersInternal(e,i,r="move"){let n=y._currentTickersSequence.get(e);if(n){let o=new Map(Array.from(n.entries()).map(([h,l])=>[h,ge(l)]));y._currentTickersSequence.set(i,o);}y._currentTickers.forEach((o,h)=>{if(o.createdByTicketSteps?.canvasElementAlias===e&&this.removeTickerInternal(h),o.ticker.canvasElementAliases.includes(e)){let l=Me.getInstance(o.ticker.alias,ge(o.ticker.args),{duration:o.ticker.duration,priority:o.ticker.priority,canvasElementAliases:[i]});if(l?(this.addTickerInternal(i,l),o.ticker.paused&&l.pause()):C.error(`Ticker ${o.ticker.alias} not found`),r==="move"&&(o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(c=>c!==e)),Object.hasOwn(o.ticker.args,gi)){let c=o.ticker.args.aliasToRemoveAfter;typeof c=="string"&&(c=[c]),Array.isArray(c)&&(r==="move"?o.ticker.args.aliasToRemoveAfter=c.map(d=>d===e?i:d):r==="duplicate"&&c.find(d=>d===e)&&(o.ticker.args.aliasToRemoveAfter=[...c,i]));}}}),y._currentTickersTimeouts.forEach(o=>{o.aliases.includes(e)&&(r==="move"?o.aliases=o.aliases.map(h=>h===e?i:h):r==="duplicate"&&o.aliases.find(h=>h===e)&&o.aliases.push(i));});let a=y._currentTickersSequence.get(i);if(a&&a.forEach((o,h)=>{this.runTickersSequence(i,h);}),r==="duplicate"){let o=y._currentTickersSequence.get(e);o&&o.forEach((h,l)=>{this.runTickersSequence(e,l);});}}completeTickerOnStepEnd(e){return this.completeTickerOnStepEndInternal(e)}completeTickerOnStepEndInternal(e){e.alias?y._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):y._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,i){return this.forceCompletionOfTickerInternal(e,i)}async forceCompletionOfTickerInternal(e,i){if(i){let r=y._currentTickersSequence.get(i),n=r?.get(e);if(r&&n){let a=n.steps.map(o=>{if(typeof o=="object"&&"ticker"in o){let h=Me.getInstance(o.ticker,o.args,{duration:o.duration,canvasElementAliases:[i],priority:o.priority});if(h)return h.complete()}return Promise.resolve()});await Promise.all(a);}}else {let r=y._currentTickers.get(e);r&&await r.ticker.complete();}}tickers={transfer:(e,i,r)=>this.transferTickersInternal(e,i,r),get currentTickers(){return y._currentTickers},get currentTickersSteps(){return y._currentTickersSequence},find:e=>this.findTickerInternal(e),add:(e,i)=>this.addTickerInternal(e,i),addSequence:(e,i,r)=>this.addTickersSequence(e,i,r),unlinkComponent:(e,i)=>this.unlinkComponentFromTickerInternal(e,i),removeAll:()=>this.removeAllTickersInternal(),remove:e=>this.removeTickerInternal(e),pause:e=>this.pauseTickerInternal(e),resume:e=>this.resumeTickerInternal(e),isPaused:(e,i)=>this.isTickerPausedInternal(e,i),completeOnStepEnd:e=>this.completeTickerOnStepEndInternal(e),forceCompletion:(e,i)=>this.forceCompletionOfTickerInternal(e,i),onComplete:(e,i)=>this.onTickerCompleteInternal(e,i)};animate(e,i,r,n){return core.GameUnifier.animate(e,i,r,n)}addLayerInternal(e,i){if(e===re){C.error(`The alias ${re} is reserved`);return}return i.label=e,y.app.stage.addChild(i)}getLayerInternal(e){return y.app.stage.getChildByLabel(e)}removeLayerInternal(e){let i=y.app.stage.getChildByLabel(e);i&&y.app.stage.removeChild(i);}addHtmlLayerInternal(e,i,r){return y.addHtmlLayer(e,i,r)}removeHtmlLayerInternal(e){return y.removeHtmlLayer(e)}getHtmlLayerInternal(e){return y.getHtmlLayer(e)}addLayer(e,i){return this.addLayerInternal(e,i)}getLayer(e){return this.getLayerInternal(e)}removeLayer(e){return this.removeLayerInternal(e)}addHtmlLayer(e,i,r){return this.addHtmlLayerInternal(e,i,r)}removeHtmlLayer(e){return this.removeHtmlLayerInternal(e)}getHtmlLayer(e){return this.getHtmlLayerInternal(e)}layers={get gameLayer(){return y.gameLayer},add:(e,i)=>this.addLayerInternal(e,i),get:e=>this.getLayerInternal(e),remove:e=>this.removeLayerInternal(e)};htmlLayers={add:(e,i,r)=>this.addHtmlLayerInternal(e,i,r),get:e=>this.getHtmlLayerInternal(e),remove:e=>this.removeHtmlLayerInternal(e)};async extractImage(){let e=this.gameLayer.renderable===false;e&&this.resume();let i;try{i=this.app.renderer.extract.image(this.app.stage);}finally{e&&this.pause();}return (await i).src}clear(){this.removeAllTickersInternal(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let i={};return this.children.forEach(r=>{r.label&&(i[r.label]=Ht(r));}),{tickers:ge(y.currentTickersWithoutCreatedBySteps),tickersSteps:ge(y.currentTickersSequence),elements:ge(i),stage:ge(Ee(this.gameLayer)),elementAliasesOrder:ge(y.childrenAliasesOrder),tickersToCompleteOnStepEnd:ge(y._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let i=e.elementAliasesOrder,r={},n=Object.entries(e.elements).map(async([a,o])=>{r[a]=await ht(o);});await Promise.all(n),i.forEach(a=>{let o=r[a];o&&this.add(a,o);});}else {C.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?te(this.gameLayer,e.stage,{ignoreScale:!0}):C.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let i=e.tickers;Object.entries(i).forEach(([r,n])=>{let a=n.canvasElementAliases;if(a.length!==0){let o=Me.getInstance(n.id,n.args,{duration:n.duration,priority:n.priority,id:r,canvasElementAliases:a});o?(o.canvasElementAliases=a,this.addTickerInternal(a,o),n.paused&&o.pause()):C.error(`Ticker ${n.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([r,n])=>{y._currentTickersSequence.set(r,new Map(Object.entries(n))),Object.keys(n).forEach(a=>{this.runTickersSequence(r,a);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,r=i.tikersIds,n=i.stepAlias.map(a=>({id:a.id,alias:a.alias}));y._tickersToCompleteOnStepEnd.tikersIds.length=0,y._tickersToCompleteOnStepEnd.tikersIds.push(...r),y._tickersToCompleteOnStepEnd.stepAlias.length=0,y._tickersToCompleteOnStepEnd.stepAlias.push(...n);}}catch(i){C.error("Error importing data",i);}}};var N=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};exports.CanvasPropertyUtility=void 0;(l=>{function t(c,d,p,u,x,T=0){return x?c==="width"?d*(N.screen.width-p)+p-u-T*p:d*(N.screen.height-p)+p-u-T*p:c==="width"?d*(N.screen.width-p)+u+T*p:d*(N.screen.height-p)+u+T*p}l.calculatePositionByAlign=t;function e(c,d,p,u,x,T=0){return x?c==="width"?(d-p+u+T*p)/(N.screen.width-p):(d-p+u+T*p)/(N.screen.height-p):c==="width"?(d-u-T*p)/(N.screen.width-p):(d-u-T*p)/(N.screen.height-p)}l.calculateAlignByPosition=e;function i(c,d){return c==="width"?d*N.screen.width:d*N.screen.height}l.calculatePositionByPercentagePosition=i;function r(c,d){return c==="width"?d/N.screen.width:d/N.screen.height}l.calculatePercentagePositionByPosition=r;function n(c,d){if(d=d%360,d<0&&(d+=360),d===0)return {x:c.x,y:c.y};if(d===90)return {x:-c.y,y:c.x};if(d===180)return {x:-c.x,y:-c.y};if(d===270)return {x:c.y,y:-c.x};if(d>0&&d<90){let p=d*Math.PI/180,u=Math.cos(p),x=Math.sin(p),T=c.x*u-c.y*x,I=c.x*x+c.y*u;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(I)!==Math.sign(c.y)&&(I=-I),{x:T,y:I}}else if(d>90&&d<180){let p=(d-90)*Math.PI/180,u=Math.cos(p),x=Math.sin(p),T=-c.y*x-c.x*u,I=c.y*u-c.x*x;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(I)!==Math.sign(c.y)&&(I=-I),{x:T,y:I}}else if(d>180&&d<270){let p=(d-180)*Math.PI/180,u=Math.cos(p),x=Math.sin(p),T=-c.x*u+c.y*x,I=-c.x*x-c.y*u;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(I)!==Math.sign(c.y)&&(I=-I),{x:T,y:I}}else if(d>270&&d<360){let p=(d-270)*Math.PI/180,u=Math.cos(p),x=Math.sin(p),T=c.y*x-c.x*u,I=-c.y*u-c.x*x;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(I)!==Math.sign(c.y)&&(I=-I),{x:T,y:I}}return {x:0,y:0}}l.getSuperPoint=n;function a(c,d){if(d=d%360,d<0&&(d+=360),d===0)return {x:c.x,y:c.y};if(d===90)return {x:c.y,y:-c.x};if(d===180)return {x:-c.x,y:-c.y};if(d===270)return {x:-c.y,y:c.x};if(d>0&&d<90){let p=d*Math.PI/180,u=Math.cos(p),x=Math.sin(p);return {x:c.x*u+c.y*x,y:-c.x*x+c.y*u}}else if(d>90&&d<180){let p=(d-90)*Math.PI/180,u=Math.cos(p),x=Math.sin(p);return {x:c.y*u-c.x*x,y:-c.y*x-c.x*u}}else if(d>180&&d<270){let p=(d-180)*Math.PI/180,u=Math.cos(p),x=Math.sin(p);return {x:-c.x*u-c.y*x,y:c.x*x-c.y*u}}else if(d>270&&d<360){let p=(d-270)*Math.PI/180,u=Math.cos(p),x=Math.sin(p);return {x:-c.y*u+c.x*x,y:c.y*x+c.x*u}}return {x:0,y:0}}l.getPointBySuperPoint=a;function o(c){let d=c.width,p=c.height,u=c.angle%360;return u<0&&(u+=360),u===0||u===180?d:u===90||u===270?p:Math.abs(d*Math.cos(u*Math.PI/180))+Math.abs(p*Math.sin(u*Math.PI/180))}l.getSuperWidth=o;function h(c){let d=c.width,p=c.height,u=c.angle%360;return u<0&&(u+=360),u===0||u===180?p:u===90||u===270?d:Math.abs(p*Math.cos(u*Math.PI/180))+Math.abs(d*Math.sin(u*Math.PI/180))}l.getSuperHeight=h;})(exports.CanvasPropertyUtility||={});async function Ze(t){if(t!=="EMPTY"){if(!t)throw C.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(be__default.default.Assets.cache.has(t)){let e=be__default.default.Assets.get(t);if(e)return e}return be__default.default.Assets.load(t).then(e=>{if(!e)throw C.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(!(e instanceof be__default.default.Texture))throw C.error("File is not a Texture",t),new core.PixiError("unregistered_asset","File is not a Texture");return e}).catch(e=>{throw C.error("Error loading file",e),new core.PixiError("unknown_element","Error loading file")})}}function pe(t){return t&&(typeof t.align!="number"&&(t.xAlign!==void 0&&(t.align===void 0?(t.align={x:t.xAlign},delete t.xAlign):(t.align.x=t.xAlign,delete t.xAlign)),t.yAlign!==void 0&&(t.align===void 0?(t.align={y:t.yAlign},delete t.yAlign):(t.align.y=t.yAlign,delete t.yAlign))),typeof t.percentagePosition!="number"&&(t.percentageX!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={x:t.percentageX},delete t.percentageX):(t.percentagePosition.x=t.percentageX,delete t.percentageX)),t.percentageY!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={y:t.percentageY},delete t.percentageY):(t.percentagePosition.y=t.percentageY,delete t.percentageY))),t)}var Oe=class t extends be__default.default.Sprite{constructor(e){if(e instanceof be__default.default.Texture)super(e);else {let{align:i,percentagePosition:r,...n}=pe(e)||{};super(n),i&&(this.align=i),r&&(this.percentagePosition=r);}this.pixivnId=this.constructor.prototype.pixivnId||ze;}pixivnId=ze;get memory(){return {...Wt(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await yt(this,e)}static from(e,i){let r=be__default.default.Sprite.from(e,i),n=new t;return n.texture=r.texture,n}onEventsHandlers={};on(e,i,r){return Ae(e,this,i),super.on(e,(...n)=>i(...n,this),r)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};U.add(Oe,{name:ze,copyProperty:async(t,e)=>{await yt(t,e,{ignoreTexture:true});}});async function yt(t,e,i){e=pe(e);let r=i?.ignoreTexture||false;if(await te(t,e),!r){let a;if("textureData"in e&&e.textureData&&(a=e.textureData),a&&a.url!=="EMPTY"){let o=a.url;a.alias&&be__default.default.Assets.resolver.hasKey(a.alias)&&(o=a.alias);try{let h=await Ze(o);h&&(t.texture=h);}catch(h){C.error("Error in Sprite.setMemorySprite() while loading texture"),h=new core.PixiError("unregistered_asset",`Error loading image ${o}`,"canvas",e),core.GameUnifier.runOnError(h,{});}}}let n=i?.half;n&&await n(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}var B=class t extends Oe{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=De;constructor(e,i){super(e),i&&(this._textureAlias=i);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loadIsStarted:this._loadIsStarted}}async setMemory(e){let i;"textureData"in e&&e.textureData&&(i=e.textureData),"assetsData"in e&&Array.isArray(e.assetsData)&&e.assetsData.length>0&&(i=e.assetsData[0]),i&&i.alias&&(this._textureAlias=i.alias),await mt(this,e),this.reloadPosition();}static from(e,i){let r=be__default.default.Sprite.from(e,i),n=new t;return n.texture=r.texture,n}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Ze(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,C.error("Error into ImageSprite.load()"),e=new core.PixiError("unregistered_asset",`Error loading image ${this.textureAlias}`,"canvas",{...this.memory,label:this.textureAlias},this),core.GameUnifier.runOnError(e,{});})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}};U.add(B,{name:De,copyProperty:async(t,e)=>{await mt(t,e,{ignoreTexture:true});}});async function mt(t,e,i){return await yt(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:i?.ignoreTexture})}var ye=class t extends B{constructor(e,i){if(e instanceof be__default.default.Texture){super(e,i);return}let{loop:r,paused:n,currentTime:a,...o}=e||{};super(o,i),r&&(this.loop=r),n&&(this.paused=n),a&&(this.currentTime=a);}pixivnId=We;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await mi(this,e),this.reloadPosition();}static from(e,i){let r=be__default.default.Sprite.from(e,i),n=new t;return n.texture=r.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource?.play&&typeof this.texture.source.resource.play=="function"&&this.texture.source.resource.play();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let i=this.duration;i&&e>=i&&(e=0),this._currentTime=e,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=e);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};U.add(ye,{name:We,getInstance:async(t,e)=>{let i;"textureData"in e&&e.textureData&&(i=e.textureData);let r=new t(void 0,i?.alias);return await r.setMemory(e),r},copyProperty:async(t,e)=>{await mi(t,e,{ignoreTexture:true});}});async function mi(t,e,i){await mt(t,e,{ignoreTexture:i?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(t.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(t.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(t.paused=e.paused);}var xe=class extends be.Container{constructor(e){let{anchor:i,align:r,percentagePosition:n,...a}=pe(e)||{};super(a),this.pixivnId=this.constructor.prototype.pixivnId||Le,i&&(this.anchor=i),r&&(this.align=r),n&&(this.percentagePosition=n);}pixivnId=Le;get memory(){return {...Ee(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await te(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let i=0;i<e.elements.length;i++){let r=e.elements[i],n=await ht(r);this.addChild(n);}}onEventsHandlers={};on(e,i,r){return Ae(e,this,i),super.on(e,(...n)=>i(...n,this),r)}_anchor;get anchor(){let e=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:e,y:i}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(e){this._anchor=void 0,super.pivot=e;}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}set percentageX(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageY(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};U.add(xe,{name:Le,copyProperty:async(t,e)=>await te(t,e)});var ar=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function Qe(t){let e=be__default.default.Assets.cache.has(t)?be__default.default.Assets.get(t):null;return e instanceof be__default.default.Texture&&(t=e.source?.label||t),cr(t)}function cr(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&ar.has(e)}var z=class extends xe{constructor(e,i){let{anchor:r,align:n,percentagePosition:a,...o}=pe(e)||{};super(o),i&&i.forEach(h=>{Qe(h)?this.addChild(new ye(void 0,h)):this.addChild(new B(void 0,h));}),r&&(this.anchor=r),n&&(this.align=n),a&&(this.percentagePosition=a);}get memory(){return {...super.memory,pixivnId:rt,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await xi(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=rt;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=this.children.map(i=>i.load());return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,C.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new be__default.default.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};U.add(z,{name:rt,copyProperty:async(t,e)=>await xi(t,e)});async function xi(t,e){e=pe(e)||{},te(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var xt=class{constructor(...e){}get memory(){throw new core.PixiError("not_implemented","The method CanvasBaseItem.memory must be overridden")}setMemory(e){throw new core.PixiError("not_implemented","The method CanvasBaseItem.setMemory must be overridden")}pixivnId="canvas_element_id_not_set"};var Re=class extends be__default.default.Text{constructor(e){let{align:i,percentagePosition:r,...n}=pe(e)||{};super(n),this.pixivnId=this.constructor.prototype.pixivnId||He,i&&(this.align=i),r&&(this.percentagePosition=r);}pixivnId=He;get memory(){return {...Ft(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await dr(this,e),this.reloadPosition();}onEventsHandlers={};on(e,i,r){return Ae(e,this,i),super.on(e,(...n)=>i(...n,this),r)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};U.add(Re,{name:He});async function dr(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await te(t,e,{end:()=>{"style"in e&&e.style!==void 0&&(t.style=e.style);}}),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"resolution"in e&&e.resolution!==void 0&&(t.resolution=e.resolution),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}async function pr(t,e={},i){let r=g.find(t);if(!r){C.error(`The element with the alias ${t} does not exist. So the shake effect can't be applied.`);return}let n={x:r.position.x,y:r.position.y},{shakeType:a="horizontal",maxShockSize:o=10,shocksNumber:h=10,...l}=e,c=h-1;if(c<2){C.error("The number of shocks must be at least 3.");return}let d=Math.floor(c/2),p=Math.ceil(c/2),u=[];for(let I=0;I<d;I++){let _=o*(I+1)/d;a==="horizontal"?I%2!==0?u.push(n.x+_):u.push(n.x-_):I%2!==0?u.push(n.y+_):u.push(n.y-_);}let x=d%2===0;for(let I=p;I>0;I--){let _=o*(I+1)/(p-1);a==="horizontal"?I%2===0&&!x||I%2!==0&&x?u.push(n.x-_):u.push(n.x+_):I%2===0&&!x||I%2!==0&&x?u.push(n.y-_):u.push(n.y+_);}let T;if(a==="horizontal"?(u.push(n.x),T=g.animate(t,{x:u},l,i)):(u.push(n.y),T=g.animate(t,{y:u},l,i)),T)return [T]}function vt(t,e,i){let r={...g.find(t)?.memory,...i},n=new z(i,e);return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}async function ur(t,e,i){let r={...g.find(t)?.memory,...i},n=new z(i,e);return n.label=t,await n.load(),r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}function Tt(t,e,i){if(!e)if(be__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:De,...i,label:t});let r={...g.find(t)?.memory,...i},n=new B(i,e);return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}async function fr(t,e,i){if(!e)if(be__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:De,...i,label:t});let r={...g.find(t)?.memory,...i},n=new B(i,e);return n.label=t,await n.load(),r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}function Pt(t,e,i){if(!e)if(be__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:We,...i,label:t});let r={...g.find(t)?.memory,...i},n=new ye(i,e);return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}async function gr(t,e,i){if(!e)if(be__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:We,...i,label:t});let r={...g.find(t)?.memory,...i},n=new ye(i,e);return n.label=t,await n.load(),r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}function Yt(t){switch(t.type){case "align":return {xAlign:t.x,yAlign:t.y};case "percentage":return {percentageX:t.x,percentageY:t.y};default:return {x:t.x,y:t.y}}}function et(t,e,i){if(typeof e=="string")return Qe(e)?Pt(t,e,i):Tt(t,e,i);if(Array.isArray(e))return vt(t,e,i);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Qe(e.value)?Pt(t,e.value,{...e.options,zIndex:i.zIndex}):Tt(t,e.value,{...e.options,zIndex:i.zIndex});if(Array.isArray(e.value))return vt(t,e.value,{...e.options,zIndex:i.zIndex})}return g.add(t,e,i),e}async function Ci(t,e,i={},r){let{completeOnContinue:n=true,tickerIdToResume:a=[],...o}=i,h=[];e||(e=t),typeof a=="string"&&(a=[a]);let l,c=g.find(t);if(c&&(l=`${t}_temp_disolve`,g.editAlias(t,l)),e=et(t,e,{zIndex:c?c.parent?.getChildIndex(c):void 0}),c?.parent?.setChildIndex(c,c.parent.getChildIndex(c)-.1),l&&g.copyCanvasElementProperty(l,t),l&&g.tickers.transfer(l,t,"duplicate"),e.alpha=0,l){let p=It(l,{...i,autoplay:false,completeOnContinue:n},r);p&&(h.push(...p),a.push(...p));}let d=g.animate(t,{alpha:1},{...o,tickerIdToResume:a,completeOnContinue:n},r);if(d&&h.push(d),(e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),h.length>0)return h}function It(t,e={},i){let{completeOnContinue:r=true,aliasToRemoveAfter:n=[],...a}=e;typeof n=="string"&&(n=[n]),n.push(t);let o=g.animate(t,{alpha:0},{...a,aliasToRemoveAfter:n,completeOnContinue:r},i);if(o)return [o]}async function yr(t,e,i={},r){let{completeOnContinue:n=true,aliasToRemoveAfter:a=[],...o}=i,h=[];e||(e=t),typeof a=="string"&&(a=[a]);let l=g.find(t);if(!l)return Ci(t,e,i,r);let c=`${t}_temp_fade`;g.editAlias(t,c),a.push(c),e=et(t,e,{zIndex:l?l.parent?.getChildIndex(l):void 0}),l?.parent?.setChildIndex(l,l.parent.getChildIndex(l)-.1),c&&g.copyCanvasElementProperty(c,t),c&&g.tickers.transfer(c,t,"duplicate"),e.alpha=0;let d=g.animate(t,{alpha:1},{...o,aliasToRemoveAfter:a,completeOnContinue:n},r);if(d){let p=It(c,{...i,tickerIdToResume:d,completeOnContinue:n},r);p&&h.push(...p),h.push(d),g.tickers.pause({id:d});}if((e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),h.length>0)return h}function mr(t,e={},i){return It(t,e,i)}async function xr(t,e,i={},r){let{direction:n="right",completeOnContinue:a=true,tickerIdToResume:o=[],aliasToRemoveAfter:h=[],removeOldComponentWithMoveOut:l,...c}=i,d=[],p;e||(e=t),typeof o=="string"&&(o=[o]),typeof h=="string"&&(h=[h]);let u,x=g.find(t);if(x&&(u=`${t}_temp_movein`,g.editAlias(t,u),x instanceof B||x instanceof z?p=x.positionInfo:p={x:x.x,y:x.y,type:"pixel"}),e=et(t,e,{zIndex:x?x.parent?.getChildIndex(x):void 0}),x?.parent?.setChildIndex(x,x.parent.getChildIndex(x)-.1),u&&g.copyCanvasElementProperty(u,t),u&&g.tickers.transfer(u,t,"move"),p||(e instanceof B||e instanceof z?p=e.positionInfo:p={x:e.x,y:e.y,type:"pixel"}),u)if(l){let _=Ut(u,{...i,autoplay:false,completeOnContinue:a},r);_&&(d.push(..._),o.push(..._));}else h.push(u);switch((e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),n){case "up":e.y=g.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=g.width+e.width;break;case "right":e.x=-e.width;break}let T=g.tickers.pause({canvasAlias:t});o.push(...T);let I=g.animate(t,Yt(p),{...c,tickerIdToResume:o,aliasToRemoveAfter:h,completeOnContinue:a},r);if(I&&d.push(I),d.length>0)return d}function Ut(t,e={},i){let{direction:r="right",completeOnContinue:n=true,aliasToRemoveAfter:a=[],...o}=e;typeof a=="string"&&(a=[a]),a.push(t);let h=g.find(t);if(!h){C.warn(`The canvas component "${t}" is not found.`);return}let l={x:h.x,y:h.y};switch(r){case "up":l.y=-h.height;break;case "down":l.y=g.height+h.height;break;case "left":l.x=-h.width;break;case "right":l.x=g.width+h.width;break}g.tickers.pause({canvasAlias:t});let c=g.animate(t,l,{...o,aliasToRemoveAfter:a,completeOnContinue:n},i);if(c)return [c]}async function vr(t,e,i={},r){let{direction:n="right",completeOnContinue:a=true,tickerIdToResume:o=[],aliasToRemoveAfter:h=[],...l}=i,c=[],d;e||(e=t),typeof o=="string"&&(o=[o]),typeof h=="string"&&(h=[h]);let p,u=g.find(t);u&&(p=`${t}_temp_zoom`,g.editAlias(t,p),u instanceof B||u instanceof z?d=u.positionInfo:d={x:u.x,y:u.y,type:"pixel"}),e=et(t,e,{zIndex:u?u.parent?.getChildIndex(u):void 0}),u?.parent?.setChildIndex(u,u.parent.getChildIndex(u)-.1),p&&g.copyCanvasElementProperty(p,t),p&&g.tickers.transfer(p,t,"move"),d||(e instanceof B||e instanceof z?d=e.positionInfo:d={x:e.x,y:e.y,type:"pixel"});let x={x:e.pivot.x,y:e.pivot.y},T={x:e.scale.x,y:e.scale.y};if(p)if(i.removeOldComponentWithZoomOut){let f=_i(p,{...i,autoplay:false,completeOnContinue:a},r);f&&(c.push(...f),o.push(...f));}else h.push(p);(e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),n==="up"?(e.pivot.y=g.height-e.y,e.pivot.x=g.width/2-e.x,e.y=g.height,e.x=g.width/2):n==="down"?(e.pivot.y=0-e.y,e.pivot.x=g.width/2-e.x,e.y=0,e.x=g.width/2):n==="left"?(e.pivot.x=g.width-e.x,e.pivot.y=g.height/2-e.y,e.x=g.width,e.y=g.height/2):n==="right"&&(e.pivot.x=0-e.x,e.pivot.y=g.height/2-e.y,e.x=0,e.y=g.height/2),e.pivot=exports.CanvasPropertyUtility.getPointBySuperPoint(e.pivot,e.angle),e.scale.set(0);let I=g.tickers.pause({canvasAlias:t});o.push(...I);let _=g.animate(t,{...Yt(d),pivotX:x.x,pivotY:x.y,scaleX:T.x,scaleY:T.y},{...l,tickerIdToResume:o,aliasToRemoveAfter:h,completeOnContinue:a},r);if(_&&c.push(_),c.length>0)return c}function _i(t,e={},i){let{direction:r="right",completeOnContinue:n=true,aliasToRemoveAfter:a=[],...o}=e;typeof a=="string"&&(a=[a]),a.push(t);let h=g.find(t);if(!h){C.warn(`The canvas component "${t}" is not found.`);return}let l={x:h.x,y:h.y},c={x:h.pivot.x,y:h.pivot.y};r==="down"?(l.y=g.height,l.x=g.width/2,c.y=g.height-l.y,c.x=g.width/2-l.x):r==="up"?(l.y=0,l.x=g.width/2,c.y=0-l.y,c.x=g.width/2-l.x):r==="right"?(l.x=g.width,l.y=g.height/2,c.x=g.width-l.x,c.y=g.height/2-l.y):r==="left"&&(l.x=0,l.y=g.height/2,c.x=0-l.x,c.y=g.height/2-l.y),c=exports.CanvasPropertyUtility.getPointBySuperPoint(c,h.angle),g.tickers.pause({canvasAlias:t});let d=g.animate(t,{...l,pivotX:c.x,pivotY:c.y,scaleX:0,scaleY:0},{...o,aliasToRemoveAfter:a,completeOnContinue:n},i);if(d)return [d]}async function Tr(t,e,i={},r){let{direction:n="right",completeOnContinue:a=true,tickerIdToResume:o=[],...h}=i,l=[],c;e||(e=t),typeof o=="string"&&(o=[o]);let d,p=g.find(t);switch(p&&(d=`${t}_temp_push`,g.editAlias(t,d),p instanceof B||p instanceof z?c=p.positionInfo:c={x:p.x,y:p.y,type:"pixel"}),e=et(t,e,{zIndex:p?p.parent?.getChildIndex(p):void 0}),p?.parent?.setChildIndex(p,p.parent.getChildIndex(p)-.1),d&&g.copyCanvasElementProperty(d,t),d&&g.tickers.transfer(d,t,"move"),c||((e instanceof B||e instanceof z)&&e.haveEmptyTexture?c=e.positionInfo:c={x:e.x,y:e.y,type:"pixel"}),(e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),n){case "up":e.y=g.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=g.width+e.width;break;case "right":e.x=-e.width;break}let u=g.tickers.pause({canvasAlias:t});if(o.push(...u),d){let T=ki(d,{...i,direction:n,completeOnContinue:a});T&&l.push(...T);}let x=g.animate(t,Yt(c),{...h,tickerIdToResume:o,completeOnContinue:a},r);if(x&&l.push(x),l.length>0)return l}function ki(t,e={direction:"right"},i){return Ut(t,e,i)}var tt=class extends xe{constructor(i){super(i);this._memory=i;this.pixivnId=i.pixivnId;}_memory;pixivnId;get memory(){return {...this._memory,...super.memory,elements:[],pixivnId:this.pixivnId}}};function Pr(){return async(e,i)=>{try{let r=e.canvasElementInfo;if(r){let n=new tt(r),a=r.zIndex;n.groupColor=16711680;let o=new be__default.default.Graphics;o.rect(0,0,300,100).fill({color:16711680,alpha:.5}),n.addChild(o);let h=new be__default.default.Text({text:`Error: ${r.label}`,x:10,y:10});n.addChild(h);let l=e.parent;if(l&&"addChild"in l)a!==void 0?l.addChildAt(n,a):l.addChild(n);else {let c=r.parentLabel?g.find(r.parentLabel):void 0;if(c)a!==void 0?c.addChildAt(n,a):c.addChild(n);else {let d=r.label??r.pixivnId;g.add(d,n,{zIndex:a});}}}}catch{}}}function Ir(t,e,i){let r={...g.find(t)?.memory,...i},n=new Re({text:e,...i});return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}var {Assets:Do,Color:zo,Rectangle:Ho,TextStyle:Wo,Texture:Fo,UPDATE_PRIORITY:No}=be__default.default,g=new Je;N.init({getScreen:()=>g.screen});core.GameUnifier.addOnPreContinue(async()=>{try{let t=y._tickersToCompleteOnStepEnd.tikersIds,e=y._tickersToCompleteOnStepEnd.stepAlias,i=(async()=>{for(;t.length;){let{id:n}=t.pop()||{};n&&await g.tickers.forceCompletion(n);}})(),r=(async()=>{for(;e.length;){let{alias:n,id:a}=e.pop()||{};n&&a&&await g.tickers.forceCompletion(a,n);}})();await Promise.all([i,r]),y._tickersToCompleteOnStepEnd.tikersIds.length=0,y._tickersToCompleteOnStepEnd.stepAlias.length=0;}catch{}});
|
|
2
|
-
exports.Assets=
|
|
1
|
+
'use strict';var core=require('@drincs/pixi-vn/core'),ht=require('@drincs/pixi-vn/pixi.js'),tickers=require('@drincs/pixi-vn/tickers'),devtools=require('@pixi/devtools'),filters=require('@drincs/pixi-vn/filters');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ht__default=/*#__PURE__*/_interopDefault(ht);var wi=Object.defineProperty;var Nn=t=>{throw TypeError(t)};var Si=(t,e,n)=>e in t?wi(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var Ie=(t,e,n)=>Si(t,typeof e!="symbol"?e+"":e,n),gn=(t,e,n)=>e.has(t)||Nn("Cannot "+n);var o=(t,e,n)=>(gn(t,e,"read from private field"),n?n.call(t):e.get(t)),ne=(t,e,n)=>e.has(t)?Nn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),U=(t,e,n,i)=>(gn(t,e,"write to private field"),e.set(t,n),n),F=(t,e,n)=>(gn(t,e,"access private method"),n);var Xt=(t,e,n,i)=>({set _(s){U(t,e,s);},get _(){return o(t,e,i)}});var Ai={extension:{type:"sceneProperties",name:"additional-positions"},testNode(t){return "xAlign"in t||"yAlign"in t||"percentageX"in t||"percentageY"in t||"positionType"in t},testProp(t){switch(t){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(t,e,n){switch(e){case "xAlign":"xAlign"in t&&(t.xAlign=n/100);break;case "yAlign":"yAlign"in t&&(t.yAlign=n/100);break;case "percentageX":"percentageX"in t&&(t.percentageX=n/100);break;case "percentageY":"percentageY"in t&&(t.percentageY=n/100);break}},getProperties(t){return [{value:t.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:t.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:t.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:t.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:t.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}}}]}},Vn=Ai;var Le="__game_layer__",Pt="Container",$t="ImageContainer",vt="Image",Tt="Sprite",It="Text",Ct="Video";var B;(s=>(s.log=(l,...c)=>console.log(`[Pixi\u2019VN] ${l}`,...c),s.warn=(l,...c)=>console.warn(`[Pixi\u2019VN] ${l}`,...c),s.error=(l,...c)=>console.error(`[Pixi\u2019VN] ${l}`,...c),s.info=(l,...c)=>console.info(`[Pixi\u2019VN] ${l}`,...c)))(B||={});function Xn(t,e){let n=0;return async(...i)=>{let s=Date.now();if(s-n>=e)return n=s,await t(...i)}}var fe=class t{constructor(){}static _app=void 0;static get app(){if(!t._app)throw B.error("The canvas is not initialized"),new core.PixiError("invalid_usage","CanvasManagerStatic.app is undefined");return t._app}static get gameLayer(){let e=t.app.stage.getChildByLabel(Le);return e||(e=new ht__default.default.Container,e.label=Le,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,n,i){let{id:s="pixi-vn-canvas",width:l=800,height:c=600,resolution:y=1,autoDensity:m=true,resizeMode:f="contain",...x}=n||{};return t.canvasWidth=l,t.canvasHeight=c,t._app=new ht__default.default.Application,t.app.init({width:l,height:c,resolution:y,autoDensity:m,...x}).then(()=>{let{app:T=t.app,extensions:A=[],...z}=i||{};if(devtools.initDevtools({app:T,extensions:[Vn,...A],...z}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,s),f==="contain"){let Y=Xn(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(Y).observe(e),t.resize(),setTimeout(()=>t.resize(),750);}t.gameLayer;})}static addCanvasIntoHTMLElement(e,n){t._isInitialized?(e.appendChild(t.app.canvas),t.app.canvas.id=n):B.error("GameWindowManager is not initialized");}static addHtmlLayer(e,n,i={}){let{position:s="absolute",pointerEvents:l="none",userSelect:c="none"}=i,y=document.createElement("div");y.setAttribute("id",e),y.style.position=s,y.style.pointerEvents=l,y.style.userSelect=c;let m=n.appendChild(y);return t.htmlLayers.push(y),t.resize(),m}static removeHtmlLayer(e){let n=t.htmlLayers.find(i=>i.id===e);n&&(n.remove(),t.htmlLayers=t.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(n=>n.id===e)}static async resize(){let e=t.canvasWidth,n=t.canvasHeight,i=t.app.resizeTo,s=t.app.canvas.style;i instanceof HTMLElement||(i=document.documentElement);let l,c;if(i===document.body||i===document.documentElement)l=document.documentElement.clientWidth||window.innerWidth,c=document.documentElement.clientHeight||window.innerHeight;else {let A=i.getBoundingClientRect();l=A.width||i.clientWidth,c=A.height||i.clientHeight;}let y=Math.min(l/e,c/n),m=Math.floor(y*e),f=Math.floor(y*n);s.width=`${m}px`,s.height=`${f}px`;let x=(l-m)/2,T=(c-f)/2;s.marginLeft=`${x}px`,s.marginRight=`${x}px`,s.marginTop=`${T}px`,s.marginBottom=`${T}px`,t.htmlLayers.forEach(A=>{A.style.width=`${m}px`,A.style.height=`${f}px`,A.style.marginLeft=`${x}px`,A.style.marginRight=`${x}px`,A.style.marginTop=`${T}px`,A.style.marginBottom=`${T}px`;});}static get childrenAliasesOrder(){return t.gameLayer.children.filter(e=>e.label).sort((e,n)=>t.gameLayer.getChildIndex(e)-t.gameLayer.getChildIndex(n)).map(e=>e.label)}};var _i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Zn=new Set,mn=typeof process=="object"&&process?process:{},Jn=(t,e,n,i)=>{typeof mn.emitWarning=="function"?mn.emitWarning(t,e,n,i):console.error(`[${n}] ${e}: ${t}`);},Zt=globalThis.AbortController,jn=globalThis.AbortSignal;if(typeof Zt>"u"){jn=class{onabort;_onabort=[];reason;aborted=false;addEventListener(n,i){this._onabort.push(i);}},Zt=class{constructor(){e();}signal=new jn;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=true;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n);}}};let t=mn.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=false,Jn("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 Mi=t=>!Zn.has(t);var tt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Qn=t=>tt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?jt:null:null,jt=class extends Array{constructor(t){super(t),this.fill(0);}},$e,bt,Ri=($e=class{heap;length;static create(e){let n=Qn(e);if(!n)return [];U($e,bt,true);let i=new $e(e,n);return U($e,bt,false),i}constructor(e,n){if(!o($e,bt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},bt=new WeakMap,ne($e,bt,false),$e),Kn,qn,ke,Oe,ze,ct,Ye,wt,St,Ue,me,We,pe,ue,Z,Se,Ee,be,xe,He,Pe,Ge,Ne,_e,Me,Ve,st,Ae,At,D,yn,dt,Je,Bt,Re,ti,ut,Ot,Ft,nt,it,xn,Kt,qt,de,Pn,kt,rt,vn,Et,ei=(Et=class{constructor(e){ne(this,D);ne(this,ke);ne(this,Oe);ne(this,ze);ne(this,ct);ne(this,Ye);ne(this,wt);ne(this,St);ne(this,Ue);Ie(this,"ttl");Ie(this,"ttlResolution");Ie(this,"ttlAutopurge");Ie(this,"updateAgeOnGet");Ie(this,"updateAgeOnHas");Ie(this,"allowStale");Ie(this,"noDisposeOnSet");Ie(this,"noUpdateTTL");Ie(this,"maxEntrySize");Ie(this,"sizeCalculation");Ie(this,"noDeleteOnFetchRejection");Ie(this,"noDeleteOnStaleGet");Ie(this,"allowStaleOnFetchAbort");Ie(this,"allowStaleOnFetchRejection");Ie(this,"ignoreFetchAbort");ne(this,me);ne(this,We);ne(this,pe);ne(this,ue);ne(this,Z);ne(this,Se);ne(this,Ee);ne(this,be);ne(this,xe);ne(this,He);ne(this,Pe);ne(this,Ge);ne(this,Ne);ne(this,_e);ne(this,Me);ne(this,Ve);ne(this,st);ne(this,Ae);ne(this,At);ne(this,dt,()=>{});ne(this,Je,()=>{});ne(this,Bt,()=>{});ne(this,Re,()=>false);ne(this,ut,e=>{});ne(this,Ot,(e,n,i)=>{});ne(this,Ft,(e,n,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ie(this,Kn,"LRUCache");let{max:n=0,ttl:i,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:y,allowStale:m,dispose:f,onInsert:x,disposeAfter:T,noDisposeOnSet:A,noUpdateTTL:z,maxSize:Y=0,maxEntrySize:G=0,sizeCalculation:re,fetchMethod:C,memoMethod:X,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:$,ignoreFetchAbort:K,perf:J}=e;if(J!==void 0&&typeof J?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(U(this,Ue,J??_i),n!==0&&!tt(n))throw new TypeError("max option must be a nonnegative integer");let H=n?Qn(n):Array;if(!H)throw new Error("invalid max value: "+n);if(U(this,ke,n),U(this,Oe,Y),this.maxEntrySize=G||o(this,Oe),this.sizeCalculation=re,this.sizeCalculation){if(!o(this,Oe)&&!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(X!==void 0&&typeof X!="function")throw new TypeError("memoMethod must be a function if defined");if(U(this,St,X),C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(U(this,wt,C),U(this,st,!!C),U(this,pe,new Map),U(this,ue,new Array(n).fill(void 0)),U(this,Z,new Array(n).fill(void 0)),U(this,Se,new H(n)),U(this,Ee,new H(n)),U(this,be,0),U(this,xe,0),U(this,He,Ri.create(n)),U(this,me,0),U(this,We,0),typeof f=="function"&&U(this,ze,f),typeof x=="function"&&U(this,ct,x),typeof T=="function"?(U(this,Ye,T),U(this,Pe,[])):(U(this,Ye,void 0),U(this,Pe,void 0)),U(this,Ve,!!o(this,ze)),U(this,At,!!o(this,ct)),U(this,Ae,!!o(this,Ye)),this.noDisposeOnSet=!!A,this.noUpdateTTL=!!z,this.noDeleteOnFetchRejection=!!N,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!$,this.ignoreFetchAbort=!!K,this.maxEntrySize!==0){if(o(this,Oe)!==0&&!tt(o(this,Oe)))throw new TypeError("maxSize must be a positive integer if specified");if(!tt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");F(this,D,ti).call(this);}if(this.allowStale=!!m,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!y,this.ttlResolution=tt(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=i||0,this.ttl){if(!tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");F(this,D,yn).call(this);}if(o(this,ke)===0&&this.ttl===0&&o(this,Oe)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!o(this,ke)&&!o(this,Oe)){let W="LRU_CACHE_UNBOUNDED";Mi(W)&&(Zn.add(W),Jn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",W,Et));}}get perf(){return o(this,Ue)}static unsafeExposeInternals(e){return {starts:o(e,Ne),ttls:o(e,_e),autopurgeTimers:o(e,Me),sizes:o(e,Ge),keyMap:o(e,pe),keyList:o(e,ue),valList:o(e,Z),next:o(e,Se),prev:o(e,Ee),get head(){return o(e,be)},get tail(){return o(e,xe)},free:o(e,He),isBackgroundFetch:n=>{var i;return F(i=e,D,de).call(i,n)},backgroundFetch:(n,i,s,l)=>{var c;return F(c=e,D,qt).call(c,n,i,s,l)},moveToTail:n=>{var i;return F(i=e,D,kt).call(i,n)},indexes:n=>{var i;return F(i=e,D,nt).call(i,n)},rindexes:n=>{var i;return F(i=e,D,it).call(i,n)},isStale:n=>{var i;return o(i=e,Re).call(i,n)}}}get max(){return o(this,ke)}get maxSize(){return o(this,Oe)}get calculatedSize(){return o(this,We)}get size(){return o(this,me)}get fetchMethod(){return o(this,wt)}get memoMethod(){return o(this,St)}get dispose(){return o(this,ze)}get onInsert(){return o(this,ct)}get disposeAfter(){return o(this,Ye)}getRemainingTTL(e){return o(this,pe).has(e)?1/0:0}*entries(){for(let e of F(this,D,nt).call(this))o(this,Z)[e]!==void 0&&o(this,ue)[e]!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield [o(this,ue)[e],o(this,Z)[e]]);}*rentries(){for(let e of F(this,D,it).call(this))o(this,Z)[e]!==void 0&&o(this,ue)[e]!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield [o(this,ue)[e],o(this,Z)[e]]);}*keys(){for(let e of F(this,D,nt).call(this)){let n=o(this,ue)[e];n!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield n);}}*rkeys(){for(let e of F(this,D,it).call(this)){let n=o(this,ue)[e];n!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield n);}}*values(){for(let e of F(this,D,nt).call(this))o(this,Z)[e]!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield o(this,Z)[e]);}*rvalues(){for(let e of F(this,D,it).call(this))o(this,Z)[e]!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield o(this,Z)[e]);}[(qn=Symbol.iterator,Kn=Symbol.toStringTag,qn)](){return this.entries()}find(e,n={}){for(let i of F(this,D,nt).call(this)){let s=o(this,Z)[i],l=F(this,D,de).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,o(this,ue)[i],this))return this.get(o(this,ue)[i],n)}}forEach(e,n=this){for(let i of F(this,D,nt).call(this)){let s=o(this,Z)[i],l=F(this,D,de).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,o(this,ue)[i],this);}}rforEach(e,n=this){for(let i of F(this,D,it).call(this)){let s=o(this,Z)[i],l=F(this,D,de).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,o(this,ue)[i],this);}}purgeStale(){let e=false;for(let n of F(this,D,it).call(this,{allowStale:true}))o(this,Re).call(this,n)&&(F(this,D,rt).call(this,o(this,ue)[n],"expire"),e=true);return e}info(e){let n=o(this,pe).get(e);if(n===void 0)return;let i=o(this,Z)[n],s=F(this,D,de).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let l={value:s};if(o(this,_e)&&o(this,Ne)){let c=o(this,_e)[n],y=o(this,Ne)[n];if(c&&y){let m=c-(o(this,Ue).now()-y);l.ttl=m,l.start=Date.now();}}return o(this,Ge)&&(l.size=o(this,Ge)[n]),l}dump(){let e=[];for(let n of F(this,D,nt).call(this,{allowStale:true})){let i=o(this,ue)[n],s=o(this,Z)[n],l=F(this,D,de).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||i===void 0)continue;let c={value:l};if(o(this,_e)&&o(this,Ne)){c.ttl=o(this,_e)[n];let y=o(this,Ue).now()-o(this,Ne)[n];c.start=Math.floor(Date.now()-y);}o(this,Ge)&&(c.size=o(this,Ge)[n]),e.unshift([i,c]);}return e}load(e){this.clear();for(let[n,i]of e){if(i.start){let s=Date.now()-i.start;i.start=o(this,Ue).now()-s;}this.set(n,i.value,i);}}set(e,n,i={}){var A,z,Y,G;if(n===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:y=this.sizeCalculation,status:m}=i,{noUpdateTTL:f=this.noUpdateTTL}=i,x=o(this,Ft).call(this,e,n,i.size||0,y);if(this.maxEntrySize&&x>this.maxEntrySize)return m&&(m.set="miss",m.maxEntrySizeExceeded=true),F(this,D,rt).call(this,e,"set"),this;let T=o(this,me)===0?void 0:o(this,pe).get(e);if(T===void 0)T=o(this,me)===0?o(this,xe):o(this,He).length!==0?o(this,He).pop():o(this,me)===o(this,ke)?F(this,D,Kt).call(this,false):o(this,me),o(this,ue)[T]=e,o(this,Z)[T]=n,o(this,pe).set(e,T),o(this,Se)[o(this,xe)]=T,o(this,Ee)[T]=o(this,xe),U(this,xe,T),Xt(this,me)._++,o(this,Ot).call(this,T,x,m),m&&(m.set="add"),f=false,o(this,At)&&((A=o(this,ct))==null||A.call(this,n,e,"add"));else {F(this,D,kt).call(this,T);let re=o(this,Z)[T];if(n!==re){if(o(this,st)&&F(this,D,de).call(this,re)){re.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:C}=re;C!==void 0&&!c&&(o(this,Ve)&&((z=o(this,ze))==null||z.call(this,C,e,"set")),o(this,Ae)&&o(this,Pe)?.push([C,e,"set"]));}else c||(o(this,Ve)&&((Y=o(this,ze))==null||Y.call(this,re,e,"set")),o(this,Ae)&&o(this,Pe)?.push([re,e,"set"]));if(o(this,ut).call(this,T),o(this,Ot).call(this,T,x,m),o(this,Z)[T]=n,m){m.set="replace";let C=re&&F(this,D,de).call(this,re)?re.__staleWhileFetching:re;C!==void 0&&(m.oldValue=C);}}else m&&(m.set="update");o(this,At)&&this.onInsert?.(n,e,n===re?"update":"replace");}if(s!==0&&!o(this,_e)&&F(this,D,yn).call(this),o(this,_e)&&(f||o(this,Bt).call(this,T,s,l),m&&o(this,Je).call(this,m,T)),!c&&o(this,Ae)&&o(this,Pe)){let re=o(this,Pe),C;for(;C=re?.shift();)(G=o(this,Ye))==null||G.call(this,...C);}return this}pop(){var e;try{for(;o(this,me);){let n=o(this,Z)[o(this,be)];if(F(this,D,Kt).call(this,!0),F(this,D,de).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(o(this,Ae)&&o(this,Pe)){let n=o(this,Pe),i;for(;i=n?.shift();)(e=o(this,Ye))==null||e.call(this,...i);}}}has(e,n={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=n,l=o(this,pe).get(e);if(l!==void 0){let c=o(this,Z)[l];if(F(this,D,de).call(this,c)&&c.__staleWhileFetching===void 0)return false;if(o(this,Re).call(this,l))s&&(s.has="stale",o(this,Je).call(this,s,l));else return i&&o(this,dt).call(this,l),s&&(s.has="hit",o(this,Je).call(this,s,l)),true}else s&&(s.has="miss");return false}peek(e,n={}){let{allowStale:i=this.allowStale}=n,s=o(this,pe).get(e);if(s===void 0||!i&&o(this,Re).call(this,s))return;let l=o(this,Z)[s];return F(this,D,de).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:y=this.noDisposeOnSet,size:m=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:x=this.noUpdateTTL,noDeleteOnFetchRejection:T=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:A=this.allowStaleOnFetchRejection,ignoreFetchAbort:z=this.ignoreFetchAbort,allowStaleOnFetchAbort:Y=this.allowStaleOnFetchAbort,context:G,forceRefresh:re=false,status:C,signal:X}=n;if(!o(this,st))return C&&(C.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});let N={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:y,size:m,sizeCalculation:f,noUpdateTTL:x,noDeleteOnFetchRejection:T,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:Y,ignoreFetchAbort:z,status:C,signal:X},R=o(this,pe).get(e);if(R===void 0){C&&(C.fetch="miss");let k=F(this,D,qt).call(this,e,R,N,G);return k.__returned=k}else {let k=o(this,Z)[R];if(F(this,D,de).call(this,k)){let H=i&&k.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",H&&(C.returnedStale=true)),H?k.__staleWhileFetching:k.__returned=k}let $=o(this,Re).call(this,R);if(!re&&!$)return C&&(C.fetch="hit"),F(this,D,kt).call(this,R),s&&o(this,dt).call(this,R),C&&o(this,Je).call(this,C,R),k;let K=F(this,D,qt).call(this,e,R,N,G),J=K.__staleWhileFetching!==void 0&&i;return C&&(C.fetch=$?"stale":"refresh",J&&$&&(C.returnedStale=true)),J?K.__staleWhileFetching:K.__returned=K}}async forceFetch(e,n={}){let i=await this.fetch(e,n);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,n={}){let i=o(this,St);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:l,...c}=n,y=this.get(e,c);if(!l&&y!==void 0)return y;let m=i(e,y,{options:c,context:s});return this.set(e,m,c),m}get(e,n={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,y=o(this,pe).get(e);if(y!==void 0){let m=o(this,Z)[y],f=F(this,D,de).call(this,m);return c&&o(this,Je).call(this,c,y),o(this,Re).call(this,y)?(c&&(c.get="stale"),f?(c&&i&&m.__staleWhileFetching!==void 0&&(c.returnedStale=true),i?m.__staleWhileFetching:void 0):(l||F(this,D,rt).call(this,e,"expire"),c&&i&&(c.returnedStale=true),i?m:void 0)):(c&&(c.get="hit"),f?m.__staleWhileFetching:(F(this,D,kt).call(this,y),s&&o(this,dt).call(this,y),m))}else c&&(c.get="miss");}delete(e){return F(this,D,rt).call(this,e,"delete")}clear(){return F(this,D,vn).call(this,"delete")}},ke=new WeakMap,Oe=new WeakMap,ze=new WeakMap,ct=new WeakMap,Ye=new WeakMap,wt=new WeakMap,St=new WeakMap,Ue=new WeakMap,me=new WeakMap,We=new WeakMap,pe=new WeakMap,ue=new WeakMap,Z=new WeakMap,Se=new WeakMap,Ee=new WeakMap,be=new WeakMap,xe=new WeakMap,He=new WeakMap,Pe=new WeakMap,Ge=new WeakMap,Ne=new WeakMap,_e=new WeakMap,Me=new WeakMap,Ve=new WeakMap,st=new WeakMap,Ae=new WeakMap,At=new WeakMap,D=new WeakSet,yn=function(){let e=new jt(o(this,ke)),n=new jt(o(this,ke));U(this,_e,e),U(this,Ne,n);let i=this.ttlAutopurge?new Array(o(this,ke)):void 0;U(this,Me,i),U(this,Bt,(y,m,f=o(this,Ue).now())=>{n[y]=m!==0?f:0,e[y]=m,s(y,m);}),U(this,dt,y=>{n[y]=e[y]!==0?o(this,Ue).now():0,s(y,e[y]);});let s=this.ttlAutopurge?(y,m)=>{if(i?.[y]&&(clearTimeout(i[y]),i[y]=void 0),m&&m!==0&&i){let f=setTimeout(()=>{o(this,Re).call(this,y)&&F(this,D,rt).call(this,o(this,ue)[y],"expire");},m+1);f.unref&&f.unref(),i[y]=f;}}:()=>{};U(this,Je,(y,m)=>{if(e[m]){let f=e[m],x=n[m];if(!f||!x)return;y.ttl=f,y.start=x,y.now=l||c();let T=y.now-x;y.remainingTTL=f-T;}});let l=0,c=()=>{let y=o(this,Ue).now();if(this.ttlResolution>0){l=y;let m=setTimeout(()=>l=0,this.ttlResolution);m.unref&&m.unref();}return y};this.getRemainingTTL=y=>{let m=o(this,pe).get(y);if(m===void 0)return 0;let f=e[m],x=n[m];if(!f||!x)return 1/0;let T=(l||c())-x;return f-T},U(this,Re,y=>{let m=n[y],f=e[y];return !!f&&!!m&&(l||c())-m>f});},dt=new WeakMap,Je=new WeakMap,Bt=new WeakMap,Re=new WeakMap,ti=function(){let e=new jt(o(this,ke));U(this,We,0),U(this,Ge,e),U(this,ut,n=>{U(this,We,o(this,We)-e[n]),e[n]=0;}),U(this,Ft,(n,i,s,l)=>{if(F(this,D,de).call(this,i))return 0;if(!tt(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(i,n),!tt(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}),U(this,Ot,(n,i,s)=>{if(e[n]=i,o(this,Oe)){let l=o(this,Oe)-e[n];for(;o(this,We)>l;)F(this,D,Kt).call(this,true);}U(this,We,o(this,We)+e[n]),s&&(s.entrySize=i,s.totalCalculatedSize=o(this,We));});},ut=new WeakMap,Ot=new WeakMap,Ft=new WeakMap,nt=function*({allowStale:e=this.allowStale}={}){if(o(this,me))for(let n=o(this,xe);!(!F(this,D,xn).call(this,n)||((e||!o(this,Re).call(this,n))&&(yield n),n===o(this,be)));)n=o(this,Ee)[n];},it=function*({allowStale:e=this.allowStale}={}){if(o(this,me))for(let n=o(this,be);!(!F(this,D,xn).call(this,n)||((e||!o(this,Re).call(this,n))&&(yield n),n===o(this,xe)));)n=o(this,Se)[n];},xn=function(e){return e!==void 0&&o(this,pe).get(o(this,ue)[e])===e},Kt=function(e){var l;let n=o(this,be),i=o(this,ue)[n],s=o(this,Z)[n];return o(this,st)&&F(this,D,de).call(this,s)?s.__abortController.abort(new Error("evicted")):(o(this,Ve)||o(this,Ae))&&(o(this,Ve)&&((l=o(this,ze))==null||l.call(this,s,i,"evict")),o(this,Ae)&&o(this,Pe)?.push([s,i,"evict"])),o(this,ut).call(this,n),o(this,Me)?.[n]&&(clearTimeout(o(this,Me)[n]),o(this,Me)[n]=void 0),e&&(o(this,ue)[n]=void 0,o(this,Z)[n]=void 0,o(this,He).push(n)),o(this,me)===1?(U(this,be,U(this,xe,0)),o(this,He).length=0):U(this,be,o(this,Se)[n]),o(this,pe).delete(i),Xt(this,me)._--,n},qt=function(e,n,i,s){let l=n===void 0?void 0:o(this,Z)[n];if(F(this,D,de).call(this,l))return l;let c=new Zt,{signal:y}=i;y?.addEventListener("abort",()=>c.abort(y.reason),{signal:c.signal});let m={signal:c.signal,options:i,context:s},f=(G,re=false)=>{let{aborted:C}=c.signal,X=i.ignoreFetchAbort&&G!==void 0,N=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&G!==void 0);if(i.status&&(C&&!re?(i.status.fetchAborted=true,i.status.fetchError=c.signal.reason,X&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),C&&!X&&!re)return T(c.signal.reason,N);let R=z,k=o(this,Z)[n];return (k===z||X&&re&&k===void 0)&&(G===void 0?R.__staleWhileFetching!==void 0?o(this,Z)[n]=R.__staleWhileFetching:F(this,D,rt).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,G,m.options))),G},x=G=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=G),T(G,false)),T=(G,re)=>{let{aborted:C}=c.signal,X=C&&i.allowStaleOnFetchAbort,N=X||i.allowStaleOnFetchRejection,R=N||i.noDeleteOnFetchRejection,k=z;if(o(this,Z)[n]===z&&(!R||!re&&k.__staleWhileFetching===void 0?F(this,D,rt).call(this,e,"fetch"):X||(o(this,Z)[n]=k.__staleWhileFetching)),N)return i.status&&k.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),k.__staleWhileFetching;if(k.__returned===k)throw G},A=(G,re)=>{var X;let C=(X=o(this,wt))==null?void 0:X.call(this,e,l,m);C&&C instanceof Promise&&C.then(N=>G(N===void 0?void 0:N),re),c.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(G(void 0),i.allowStaleOnFetchAbort&&(G=N=>f(N,true)));});};i.status&&(i.status.fetchDispatched=true);let z=new Promise(A).then(f,x),Y=Object.assign(z,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,Y,{...m.options,status:void 0}),n=o(this,pe).get(e)):o(this,Z)[n]=Y,Y},de=function(e){if(!o(this,st))return false;let n=e;return !!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Zt},Pn=function(e,n){o(this,Ee)[n]=e,o(this,Se)[e]=n;},kt=function(e){e!==o(this,xe)&&(e===o(this,be)?U(this,be,o(this,Se)[e]):F(this,D,Pn).call(this,o(this,Ee)[e],o(this,Se)[e]),F(this,D,Pn).call(this,o(this,xe),e),U(this,xe,e));},rt=function(e,n){var s,l;let i=false;if(o(this,me)!==0){let c=o(this,pe).get(e);if(c!==void 0)if(o(this,Me)?.[c]&&(clearTimeout(o(this,Me)?.[c]),o(this,Me)[c]=void 0),i=true,o(this,me)===1)F(this,D,vn).call(this,n);else {o(this,ut).call(this,c);let y=o(this,Z)[c];if(F(this,D,de).call(this,y)?y.__abortController.abort(new Error("deleted")):(o(this,Ve)||o(this,Ae))&&(o(this,Ve)&&((s=o(this,ze))==null||s.call(this,y,e,n)),o(this,Ae)&&o(this,Pe)?.push([y,e,n])),o(this,pe).delete(e),o(this,ue)[c]=void 0,o(this,Z)[c]=void 0,c===o(this,xe))U(this,xe,o(this,Ee)[c]);else if(c===o(this,be))U(this,be,o(this,Se)[c]);else {let m=o(this,Ee)[c];o(this,Se)[m]=o(this,Se)[c];let f=o(this,Se)[c];o(this,Ee)[f]=o(this,Ee)[c];}Xt(this,me)._--,o(this,He).push(c);}}if(o(this,Ae)&&o(this,Pe)?.length){let c=o(this,Pe),y;for(;y=c?.shift();)(l=o(this,Ye))==null||l.call(this,...y);}return i},vn=function(e){var n,i;for(let s of F(this,D,it).call(this,{allowStale:true})){let l=o(this,Z)[s];if(F(this,D,de).call(this,l))l.__abortController.abort(new Error("deleted"));else {let c=o(this,ue)[s];o(this,Ve)&&((n=o(this,ze))==null||n.call(this,l,c,e)),o(this,Ae)&&o(this,Pe)?.push([l,c,e]);}}if(o(this,pe).clear(),o(this,Z).fill(void 0),o(this,ue).fill(void 0),o(this,_e)&&o(this,Ne)){o(this,_e).fill(0),o(this,Ne).fill(0);for(let s of o(this,Me)??[])s!==void 0&&clearTimeout(s);o(this,Me)?.fill(void 0);}if(o(this,Ge)&&o(this,Ge).fill(0),U(this,be,0),U(this,xe,0),o(this,He).length=0,U(this,We,0),U(this,me,0),o(this,Ae)&&o(this,Pe)){let s=o(this,Pe),l;for(;l=s?.shift();)(i=o(this,Ye))==null||i.call(this,...l);}},Et);var je=class{cache;map=new Map;constructor(e){this.cache=new ei({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let n=this.map.delete(e);return n&&this.cache.delete(e),n}get forEach(){return this.map.forEach}get(e){let n=this.cache.get(e);return n||this.map.get(e)}has(e){return this.map.has(e)}set(e,n){return this.map.set(e,n),this.cache.set(e,n),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Tn=Symbol("SerializableEvent"),_t=new je({cacheSize:5});function Di(t){return (e,n,i)=>{let s=i.value;In.add(s,t||`${n}`);}}var In;(l=>{function t(c,y){c[Tn]=y,_t.get(y)&&B.info(`Event "${y}" already exists, it will be overwritten`),_t.set(y,c);}l.add=t;function e(c){try{let y=_t.get(c);if(!y){B.error(`Event "${c}" not found, did you forget to register it with the eventDecorator?`);return}return y}catch(y){B.error(`Error while getting Event "${c}"`,y);return}}l.get=e;function n(){return Array.from(_t.values())}l.values=n;function i(c){return _t.has(c)}l.has=i;function s(){return Array.from(_t.keys())}l.keys=s;})(In||={});var Cn=In;async function ni(t,e){if("onEvents"in e)for(let n in e.onEvents){let i=e.onEvents[n],s=Cn.get(i);s&&t.on(n,s);}}function ii(t){let{onEventsHandlers:e={}}=t;return e}function ft(t,e,n){let i=n[Tn];return i&&typeof i=="string"?(e.onEventsHandlers[t]=i,true):(B.warn(`The event handler for event "${t}" is not registered with the eventDecorator, it will not be saved in the memory and it will not work after loading the game. Please register the event handler with the eventDecorator to avoid this warning. Read more about it here: https://pixi-vn.com/start/canvas-functions#add-a-listener-to-an-event`),false)}var Mt=new je({cacheSize:5}),ri=new je({cacheSize:2}),si=new je({cacheSize:2});function Bi(t={}){return e=>{bn.add(e,t);}}async function Be(t,e,n){let i=n?.ignoreScale||false,s=n?.end;if("isRenderGroup"in e&&e.isRenderGroup!==void 0&&(t.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(t.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(t.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(t.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(t.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(t.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(t.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?t.scale.set(e.scale,e.scale):t.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?t.pivot.set(e.pivot,e.pivot):t.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&t.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&t.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(t.visible=e.visible),"x"in e&&e.x!==void 0&&(t.x=e.x),"y"in e&&e.y!==void 0&&(t.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(t.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(t.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(t.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(t.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(t.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(t.hitArea=e.hitArea),ni(t,e),"pixivnFilters"in e&&e.pixivnFilters!==void 0){let l=e.pixivnFilters.map(c=>filters.RegisteredFilters.getInstance(c.filterId,c.args,c.padding)).filter(c=>!!c);t.filters=l.length>0?l:null;}"align"in e&&e.align!==void 0&&"align"in t&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&"percentagePosition"in t&&(t.percentagePosition=e.percentagePosition),s&&await s(),i||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var bn;(y=>{function t(m,f={}){let{name:x=m.name,getInstance:T=async(z,Y)=>{let G=new z;return await G.setMemory(Y),G},copyProperty:A=async(z,Y)=>{await z.setMemory(Y);}}=f;Mt.get(x)&&B.warn(`CanvasElement "${x}" already registered`),m.prototype.pixivnId=x,Mt.set(x,m),ri.set(x,T),si.set(x,A);}y.add=t;function e(m){let f=Mt.get(m);if(!f){B.error(`CanvasElement "${m}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return f}y.get=e;async function n(m,f){let x=e(m),T=ri.get(m);if(!x||!T){B.error(`CanvasElement "${m}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await T(x,f)}catch(A){B.error(`Error while getting CanvasElement instance "${m}"`,A);}}y.getInstance=n;async function i(m,f,x){let T=si.get(m);if(!T){B.error(`CanvasElement "${m}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await T(f,x);}catch(A){B.error(`Error while copying properties of CanvasElement "${m}"`,A);}}y.copyProperty=i;function s(){return Array.from(Mt.values())}y.values=s;function l(m){return Mt.has(m)}y.has=l;function c(){return Array.from(Mt.keys())}y.keys=c;})(bn||={});var Ce=bn;async function Jt(t){let e=await Ce.getInstance(t.pixivnId,t);if(!e)throw new core.PixiError("unregistered_element",`The element ${t.pixivnId} could not be created`,"canvas",t);return e}function Sn(t){return "memory"in t?t.memory:t instanceof ht__default.default.Text?On(t):t instanceof ht__default.default.Sprite?An(t):pt(t)}function zi(t){let e=t.parent;return {width:t.width,height:t.height,isRenderGroup:t.isRenderGroup,blendMode:t.blendMode,tint:t.tint,alpha:t.alpha,angle:t.angle,renderable:t.renderable,rotation:t.rotation,scale:{x:t.scale.x,y:t.scale.y},pivot:{x:t.pivot.x,y:t.pivot.y},position:{x:t.position.x,y:t.position.y},skew:{x:t.skew.x,y:t.skew.y},visible:t.visible,x:t.x,y:t.y,boundsArea:t.boundsArea,cursor:t.cursor,eventMode:t.eventMode,interactive:t.interactive,interactiveChildren:t.interactiveChildren,hitArea:t.hitArea,index:e?.getChildIndex(t),parentLabel:e?.label,label:t.label,pixivnFilters:Yi(t.filters)}}function Yi(t){if(!t)return;let e=Array.isArray(t)?t:[t],n=[];for(let i of e){let s=i.pixivnFilterId;if(!s){B.warn("A Filter instance without a registered pixivnFilterId can't be saved and will be skipped. Register it with filterDecorator/RegisteredFilters to make it save-compatible.",i);continue}let l=filters.RegisteredFilters.toMemory(s,i);l&&n.push(l);}return n}function wn(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function pt(t,e){let n=Ui(t,Pt),s=e?.childrenExport||false?t.children.sort((l,c)=>t.getChildIndex(l)-t.getChildIndex(c)).map(l=>Sn(l)):[];return {pixivnId:n,elements:s,onEvents:ii(t),...zi(t)}}function An(t){let e=pt(t),n=e.pixivnId??Tt,i="assetsAliases"in t&&Array.isArray(t.assetsAliases)?wn(t.texture,t.assetsAliases[0]):"textureAlias"in t?wn(t.texture,t.textureAlias):wn(t.texture);return {...e,pixivnId:n,textureData:i,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function On(t){let e=pt(t),n=e.pixivnId??It;return {...e,pixivnId:n,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:Ni(t.style),roundPixels:t.roundPixels}}function Ui(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function Qt(t){switch(t.type){case "linear":return {type:"linear",colorStops:t.colorStops,end:{x:t.end.x,y:t.end.y},start:{x:t.start.x,y:t.start.y},textureSpace:t.textureSpace,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height};case "radial":return {type:"radial",colorStops:t.colorStops,textureSpace:t.textureSpace,center:{x:t.center.x,y:t.center.y},innerRadius:t.innerRadius,outerCenter:{x:t.outerCenter.x,y:t.outerCenter.y},outerRadius:t.outerRadius,rotation:t.rotation,scale:t.scale,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height}}}function Wi(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof ht__default.default.FillGradient)return Qt(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof ht__default.default.FillPattern))return Qt(t.fill)}}B.warn("Unsupported property type for Text.style.fill.",t);}}function Hi(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof ht__default.default.Color)return t.toNumber();B.warn("Unsupported color type.",t);}function Gi(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof ht__default.default.FillGradient)return Qt(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:Hi(t.color),join:t.join,miterLimit:t.miterLimit,width:t.width,cap:t.cap,pixelLine:t.pixelLine,textureSpace:t.textureSpace};if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof ht__default.default.FillPattern))return Qt(t.fill)}}B.warn("Unsupported property type for Text.style.stroke.",t);}}function Ni(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:Wi(t.fill),fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontVariant:t.fontVariant,fontWeight:t.fontWeight,leading:t.leading,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,padding:t.padding,stroke:Gi(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}function gt(t){try{if(typeof t>"u")return t;let e=JSON.stringify(t);return JSON.parse(e)}catch(e){throw B.error("Error creating exportable element",t,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var Lt=class{tickersPausedByGameLayerRender=[];get app(){return fe.app}get gameLayer(){return fe.gameLayer}get isInitialized(){return fe._isInitialized}get width(){return fe.canvasWidth}get height(){return fe.canvasHeight}get screen(){return this.app.screen}async init(e,n,i){return await fe.init(e,n,i)}get children(){return fe.gameLayer.children}async copyCanvasElementProperty(e,n,i={}){let s=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:l=m=>m}=i;if(typeof n=="string"){let m=this.find(n);if(m)n=m;else {B.error(`Canvas element ${n} not found`);return}}if(typeof e=="string"){let m=this.find(e);if(m)e=m;else {B.error(`Canvas element ${e} not found`);return}}e instanceof ht__default.default.Container&&(e=e.memory);let c=l(s),y={...e};c.forEach(m=>{m in y&&delete y[m];}),await Ce.copyProperty(n.pixivnId,n,y);}add(e,n,i={}){if(e===Le){B.error(`The alias ${Le} is reserved`);return}let s=this.find(e),l=i?.ignoreOldStyle;s&&!l&&this.copyCanvasElementProperty(s,n);let{zIndex:c=s?.parent?.getChildIndex(s)}=i;s&&!this.canvasElementIsOnCanvas(s)?B.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&this.remove(e,{ignoreTickers:true}),c!==void 0?(n.label=e,this.gameLayer.addChildAt(n,c)):(n.label=e,this.gameLayer.addChild(n));}remove(e,n={}){if(e===Le){B.error(`The alias ${Le} is reserved`);return}let i=n.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(l=>{this.gameLayer.removeChild(l),!i&&tickers.tickers.unlinkComponent(s);});});}find(e){if(e===Le)return this.gameLayer;let n=this.gameLayer.getChildByLabel(e);if(n)return n}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,n,i={}){let s=this.find(e);s&&(s.label=n),!i.ignoreTickers&&tickers.tickers.transfer(e,n,"move");}get currentTickers(){return this.tickers.currentTickers}get currentTickersSteps(){return this.tickers.currentTickersSteps}findTicker(e){return tickers.tickers.find(e)}addTicker(e,n){return tickers.tickers.add(e,n)}addTickersSequence(e,n,i=0){return tickers.tickers.addSequence(e,n,i)}onTickerComplete(e,n){return tickers.tickers.onComplete(e,n)}unlinkComponentFromTicker(e,n){return tickers.tickers.unlinkComponent(e,n)}removeAllTickers(){return tickers.tickers.removeAll()}removeTicker(e,n={stopTicker:true}){return tickers.removeTicker(e,n)}pauseTicker(e){return tickers.tickers.pause(e)}resumeTicker(e){return tickers.tickers.resume(e)}isTickerPaused(e,n){return tickers.tickers.isPaused(e,n)}pause(){this.gameLayer.renderable!==false&&(this.gameLayer.renderable=false,this.tickersPausedByGameLayerRender=tickers.tickers.pause({id:Array.from(tickers.TickersManagerStatic._currentTickers.keys())}));}resume(){if(this.gameLayer.renderable===true)return;this.gameLayer.renderable=true;let e=this.tickersPausedByGameLayerRender.filter(n=>tickers.TickersManagerStatic._currentTickers.has(n));e.length>0&&tickers.tickers.resume({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,n,i="move"){return tickers.tickers.transfer(e,n,i)}completeTickerOnStepEnd(e){return tickers.tickers.completeOnStepEnd(e)}async forceCompletionOfTicker(e,n){return tickers.tickers.forceCompletion(e,n)}tickers=tickers.tickers;animate(e,n,i,s){return core.GameUnifier.animate(e,n,i,s)}addLayerInternal(e,n){if(e===Le){B.error(`The alias ${Le} is reserved`);return}return n.label=e,fe.app.stage.addChild(n)}getLayerInternal(e){return fe.app.stage.getChildByLabel(e)}removeLayerInternal(e){let n=fe.app.stage.getChildByLabel(e);n&&fe.app.stage.removeChild(n);}addHtmlLayerInternal(e,n,i){return fe.addHtmlLayer(e,n,i)}removeHtmlLayerInternal(e){return fe.removeHtmlLayer(e)}getHtmlLayerInternal(e){return fe.getHtmlLayer(e)}addLayer(e,n){return this.addLayerInternal(e,n)}getLayer(e){return this.getLayerInternal(e)}removeLayer(e){return this.removeLayerInternal(e)}addHtmlLayer(e,n,i){return this.addHtmlLayerInternal(e,n,i)}removeHtmlLayer(e){return this.removeHtmlLayerInternal(e)}getHtmlLayer(e){return this.getHtmlLayerInternal(e)}layers={get gameLayer(){return fe.gameLayer},add:(e,n)=>this.addLayerInternal(e,n),get:e=>this.getLayerInternal(e),remove:e=>this.removeLayerInternal(e)};htmlLayers={add:(e,n,i)=>this.addHtmlLayerInternal(e,n,i),get:e=>this.getHtmlLayerInternal(e),remove:e=>this.removeHtmlLayerInternal(e)};async extractImage(){let e=this.gameLayer.renderable===false;e&&this.resume();let n;try{n=this.app.renderer.extract.image(this.app.stage);}finally{e&&this.pause();}return (await n).src}clear(){this.tickersPausedByGameLayerRender=[],tickers.tickers.removeAll(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let n={};return this.children.forEach(i=>{i.label&&(n[i.label]=Sn(i));}),{tickers:gt(tickers.TickersManagerStatic.currentTickersWithoutCreatedBySteps()),tickersSteps:gt(tickers.TickersManagerStatic.currentTickersSequence()),elements:gt(n),stage:gt(pt(this.gameLayer)),elementAliasesOrder:gt(fe.childrenAliasesOrder),tickersToCompleteOnStepEnd:gt(tickers.TickersManagerStatic._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let n=e.elementAliasesOrder,i={},s=Object.entries(e.elements).map(async([l,c])=>{i[l]=await Jt(c);});await Promise.all(s),n.forEach(l=>{let c=i[l];c&&this.add(l,c);});}else {B.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?Be(this.gameLayer,e.stage,{ignoreScale:!0}):B.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let n=e.tickers;Object.entries(n).forEach(([i,s])=>{let l=s.canvasElementAliases;if(l.length!==0){let c=tickers.RegisteredTickers.getInstance(s.id,s.args,{duration:s.duration,priority:s.priority,id:i,canvasElementAliases:l});c?(c.canvasElementAliases=l,tickers.tickers.add(l,c),s.paused&&c.pause()):B.error(`Ticker ${s.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let n=e.tickersSteps;Object.entries(n).forEach(([i,s])=>{tickers.TickersManagerStatic._currentTickersSequence.set(i,new Map(Object.entries(s))),Object.keys(s).forEach(l=>{tickers.runTickersSequence(i,l);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let n=e.tickersToCompleteOnStepEnd,i=n.tikersIds,s=n.stepAlias.map(l=>({id:l.id,alias:l.alias}));tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.length=0,tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.push(...i),tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.length=0,tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.push(...s);}}catch(n){B.error("Error importing data",n);}}};var ve=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};exports.CanvasPropertyUtility=void 0;(m=>{function t(f,x,T,A,z,Y=0){return z?f==="width"?x*(ve.screen.width-T)+T-A-Y*T:x*(ve.screen.height-T)+T-A-Y*T:f==="width"?x*(ve.screen.width-T)+A+Y*T:x*(ve.screen.height-T)+A+Y*T}m.calculatePositionByAlign=t;function e(f,x,T,A,z,Y=0){return z?f==="width"?(x-T+A+Y*T)/(ve.screen.width-T):(x-T+A+Y*T)/(ve.screen.height-T):f==="width"?(x-A-Y*T)/(ve.screen.width-T):(x-A-Y*T)/(ve.screen.height-T)}m.calculateAlignByPosition=e;function n(f,x){return f==="width"?x*ve.screen.width:x*ve.screen.height}m.calculatePositionByPercentagePosition=n;function i(f,x){return f==="width"?x/ve.screen.width:x/ve.screen.height}m.calculatePercentagePositionByPosition=i;function s(f,x){if(x=x%360,x<0&&(x+=360),x===0)return {x:f.x,y:f.y};if(x===90)return {x:-f.y,y:f.x};if(x===180)return {x:-f.x,y:-f.y};if(x===270)return {x:f.y,y:-f.x};if(x>0&&x<90){let T=x*Math.PI/180,A=Math.cos(T),z=Math.sin(T),Y=f.x*A-f.y*z,G=f.x*z+f.y*A;return f.x!==0&&Math.sign(Y)!==Math.sign(f.x)&&(Y=-Y),f.y!==0&&Math.sign(G)!==Math.sign(f.y)&&(G=-G),{x:Y,y:G}}else if(x>90&&x<180){let T=(x-90)*Math.PI/180,A=Math.cos(T),z=Math.sin(T),Y=-f.y*z-f.x*A,G=f.y*A-f.x*z;return f.x!==0&&Math.sign(Y)!==Math.sign(f.x)&&(Y=-Y),f.y!==0&&Math.sign(G)!==Math.sign(f.y)&&(G=-G),{x:Y,y:G}}else if(x>180&&x<270){let T=(x-180)*Math.PI/180,A=Math.cos(T),z=Math.sin(T),Y=-f.x*A+f.y*z,G=-f.x*z-f.y*A;return f.x!==0&&Math.sign(Y)!==Math.sign(f.x)&&(Y=-Y),f.y!==0&&Math.sign(G)!==Math.sign(f.y)&&(G=-G),{x:Y,y:G}}else if(x>270&&x<360){let T=(x-270)*Math.PI/180,A=Math.cos(T),z=Math.sin(T),Y=f.y*z-f.x*A,G=-f.y*A-f.x*z;return f.x!==0&&Math.sign(Y)!==Math.sign(f.x)&&(Y=-Y),f.y!==0&&Math.sign(G)!==Math.sign(f.y)&&(G=-G),{x:Y,y:G}}return {x:0,y:0}}m.getSuperPoint=s;function l(f,x){if(x=x%360,x<0&&(x+=360),x===0)return {x:f.x,y:f.y};if(x===90)return {x:f.y,y:-f.x};if(x===180)return {x:-f.x,y:-f.y};if(x===270)return {x:-f.y,y:f.x};if(x>0&&x<90){let T=x*Math.PI/180,A=Math.cos(T),z=Math.sin(T);return {x:f.x*A+f.y*z,y:-f.x*z+f.y*A}}else if(x>90&&x<180){let T=(x-90)*Math.PI/180,A=Math.cos(T),z=Math.sin(T);return {x:f.y*A-f.x*z,y:-f.y*z-f.x*A}}else if(x>180&&x<270){let T=(x-180)*Math.PI/180,A=Math.cos(T),z=Math.sin(T);return {x:-f.x*A-f.y*z,y:f.x*z-f.y*A}}else if(x>270&&x<360){let T=(x-270)*Math.PI/180,A=Math.cos(T),z=Math.sin(T);return {x:-f.y*A+f.x*z,y:f.y*z+f.x*A}}return {x:0,y:0}}m.getPointBySuperPoint=l;function c(f){let x=f.width,T=f.height,A=f.angle%360;return A<0&&(A+=360),A===0||A===180?x:A===90||A===270?T:Math.abs(x*Math.cos(A*Math.PI/180))+Math.abs(T*Math.sin(A*Math.PI/180))}m.getSuperWidth=c;function y(f){let x=f.width,T=f.height,A=f.angle%360;return A<0&&(A+=360),A===0||A===180?T:A===90||A===270?x:Math.abs(T*Math.cos(A*Math.PI/180))+Math.abs(x*Math.sin(A*Math.PI/180))}m.getSuperHeight=y;})(exports.CanvasPropertyUtility||={});async function zt(t){if(t!=="EMPTY"){if(!t)throw B.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(ht__default.default.Assets.cache.has(t)){let e=ht__default.default.Assets.get(t);if(e)return e}return ht__default.default.Assets.load(t).then(e=>{if(!e)throw B.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(!(e instanceof ht__default.default.Texture))throw B.error("File is not a Texture",t),new core.PixiError("unregistered_asset","File is not a Texture");return e}).catch(e=>{throw B.error("Error loading file",e),new core.PixiError("unknown_element","Error loading file")})}}function Xe(t){return t&&(typeof t.align!="number"&&(t.xAlign!==void 0&&(t.align===void 0?(t.align={x:t.xAlign},delete t.xAlign):(t.align.x=t.xAlign,delete t.xAlign)),t.yAlign!==void 0&&(t.align===void 0?(t.align={y:t.yAlign},delete t.yAlign):(t.align.y=t.yAlign,delete t.yAlign))),typeof t.percentagePosition!="number"&&(t.percentageX!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={x:t.percentageX},delete t.percentageX):(t.percentagePosition.x=t.percentageX,delete t.percentageX)),t.percentageY!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={y:t.percentageY},delete t.percentageY):(t.percentagePosition.y=t.percentageY,delete t.percentageY))),t)}var mt=class t extends ht__default.default.Sprite{constructor(e){if(e instanceof ht__default.default.Texture)super(e);else {let{align:n,percentagePosition:i,...s}=Xe(e)||{};super(s),n&&(this.align=n),i&&(this.percentagePosition=i);}this.pixivnId=this.constructor.prototype.pixivnId||Tt;}pixivnId=Tt;get memory(){return {...An(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await rn(this,e)}static from(e,n){let i=ht__default.default.Sprite.from(e,n),s=new t;return s.texture=i.texture,s}onEventsHandlers={};on(e,n,i){return ft(e,this,n),super.on(e,(...s)=>n(...s,this),i)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0,this.anchor.x),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};Ce.add(mt,{name:Tt,copyProperty:async(t,e)=>{await rn(t,e,{ignoreTexture:true});}});async function rn(t,e,n){e=Xe(e);let i=n?.ignoreTexture||false;if(await Be(t,e),!i){let l;if("textureData"in e&&e.textureData&&(l=e.textureData),l&&l.url!=="EMPTY"){let c=l.url;l.alias&&ht__default.default.Assets.resolver.hasKey(l.alias)&&(c=l.alias);try{let y=await zt(c);y&&(t.texture=y);}catch(y){B.error("Error in Sprite.setMemorySprite() while loading texture"),y=new core.PixiError("unregistered_asset",`Error loading image ${c}`,"canvas",e),core.GameUnifier.runOnError(y,{});}}}let s=n?.half;s&&await s(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}var oe=class t extends mt{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=vt;constructor(e,n){super(e),n&&(this._textureAlias=n);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loadIsStarted:this._loadIsStarted}}async setMemory(e){let n;"textureData"in e&&e.textureData&&(n=e.textureData),"assetsData"in e&&Array.isArray(e.assetsData)&&e.assetsData.length>0&&(n=e.assetsData[0]),n&&n.alias&&(this._textureAlias=n.alias),await sn(this,e),this.reloadPosition();}static from(e,n){let i=ht__default.default.Sprite.from(e,n),s=new t;return s.texture=i.texture,s}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,zt(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,B.error("Error into ImageSprite.load()"),e=new core.PixiError("unregistered_asset",`Error loading image ${this.textureAlias}`,"canvas",{...this.memory,label:this.textureAlias},this),core.GameUnifier.runOnError(e,{});})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}};Ce.add(oe,{name:vt,copyProperty:async(t,e)=>{await sn(t,e,{ignoreTexture:true});}});async function sn(t,e,n){return await rn(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:n?.ignoreTexture})}var qe=class t extends oe{constructor(e,n){if(e instanceof ht__default.default.Texture){super(e,n);return}let{loop:i,paused:s,currentTime:l,...c}=e||{};super(c,n),i&&(this.loop=i),s&&(this.paused=s),l&&(this.currentTime=l);}pixivnId=Ct;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await ai(this,e),this.reloadPosition();}static from(e,n){let i=ht__default.default.Sprite.from(e,n),s=new t;return s.texture=i.texture,s}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource?.play&&typeof this.texture.source.resource.play=="function"&&this.texture.source.resource.play();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let n=this.duration;n&&e>=n&&(e=0),this._currentTime=e,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=e);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};Ce.add(qe,{name:Ct,getInstance:async(t,e)=>{let n;"textureData"in e&&e.textureData&&(n=e.textureData);let i=new t(void 0,n?.alias);return await i.setMemory(e),i},copyProperty:async(t,e)=>{await ai(t,e,{ignoreTexture:true});}});async function ai(t,e,n){await sn(t,e,{ignoreTexture:n?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(t.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(t.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(t.paused=e.paused);}var Qe=class extends ht.Container{constructor(e){let{anchor:n,align:i,percentagePosition:s,...l}=Xe(e)||{};super(l),this.pixivnId=this.constructor.prototype.pixivnId||Pt,n&&(this.anchor=n),i&&(this.align=i),s&&(this.percentagePosition=s);}pixivnId=Pt;get memory(){return {...pt(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await Be(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let n=0;n<e.elements.length;n++){let i=e.elements[n],s=await Jt(i);this.addChild(s);}}onEventsHandlers={};on(e,n,i){return ft(e,this,n),super.on(e,(...s)=>n(...s,this),i)}_anchor;get anchor(){let e=super.pivot.x/this.width,n=super.pivot.y/this.height;return {x:e,y:n}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(e){this._anchor=void 0,super.pivot=e;}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.y<0)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.y<0)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}set percentageX(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageY(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};Ce.add(Qe,{name:Pt,copyProperty:async(t,e)=>await Be(t,e)});var ir=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function Yt(t){let e=ht__default.default.Assets.cache.has(t)?ht__default.default.Assets.get(t):null;return e instanceof ht__default.default.Texture&&(t=e.source?.label||t),rr(t)}function rr(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&ir.has(e)}var ae=class extends Qe{constructor(e,n){let{anchor:i,align:s,percentagePosition:l,...c}=Xe(e)||{};super(c),n&&n.forEach(y=>{Yt(y)?this.addChild(new qe(void 0,y)):this.addChild(new oe(void 0,y));}),i&&(this.anchor=i),s&&(this.align=s),l&&(this.percentagePosition=l);}get memory(){return {...super.memory,pixivnId:$t,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await li(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=$t;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=this.children.map(n=>n.load());return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(n=>{this._loadIsStarted=false,B.error("Error into ImageContainer.load()",n);})}get texture(){return this.children.length>0?this.children[0].texture:new ht__default.default.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};Ce.add(ae,{name:$t,copyProperty:async(t,e)=>await li(t,e)});async function li(t,e){e=Xe(e)||{},Be(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var on=class{constructor(...e){}get memory(){throw new core.PixiError("not_implemented","The method CanvasBaseItem.memory must be overridden")}setMemory(e){throw new core.PixiError("not_implemented","The method CanvasBaseItem.setMemory must be overridden")}pixivnId="canvas_element_id_not_set"};var yt=class extends ht__default.default.Text{constructor(e){let{align:n,percentagePosition:i,...s}=Xe(e)||{};super(s),this.pixivnId=this.constructor.prototype.pixivnId||It,n&&(this.align=n),i&&(this.percentagePosition=i);}pixivnId=It;get memory(){return {...On(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await ar(this,e),this.reloadPosition();}onEventsHandlers={};on(e,n,i){return ft(e,this,n),super.on(e,(...s)=>n(...s,this),i)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0,this.anchor.x),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};Ce.add(yt,{name:It});async function ar(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await Be(t,e,{end:()=>{"style"in e&&e.style!==void 0&&(t.style=e.style);}}),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"resolution"in e&&e.resolution!==void 0&&(t.resolution=e.resolution),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}function Ut(t,e,n){let i=[0],s=t;for(let l=0;l<n;l++)i.push(s,-s*.6,s*.3,0),s*=e;return i}function di(t,e,n,i){let s=n.reduce((x,T)=>T.enabled?x+T.padding:x,0),l=t.x,c=t.y,y=t.x+t.width,m=t.y+t.height;i&&(l=Math.max(l,0),c=Math.max(c,0),y=Math.min(y,i.width),m=Math.min(m,i.height));let f={x:l-s,y:c-s,width:y-l+s*2,height:m-c+s*2};return {x:t.x+e.x*t.width-f.x,y:t.y+e.y*t.height-f.y,area:f}}function _n(t,e,n,i){return Math.max(0,Math.ceil(e-Math.min(t.x,t.y,n-t.x,i-t.y)))}function an(t,e,n,i){let s=Math.min(Math.max(e,0),.5),l=Math.hypot(Math.max(t.x,n-t.x),Math.max(t.y,i-t.y));return Math.ceil(l*s/(1-s))}function ln(t,e,n,i){return i>0?i:Math.hypot(Math.max(t.x,e.width-t.x),Math.max(t.y,e.height-t.y))+n/2}function Mn(t){let e=t.filters;return e?Array.isArray(e)?[...e]:[e]:[]}function dr(t,e){t.filters=[...Mn(t),...e];}function ur(t,e){let n=Mn(t).filter(i=>!e.includes(i));t.filters=n.length>0?n:null;}function le(t,e,n,i,s,l,c){dr(e,[n]),c?.();let y=filters.filters.animate(t,n,i,{duration:s.duration??1,delay:s.delay,ease:s.ease,times:s.times,aliasToRemoveAfter:s.aliasToRemoveAfter,autoplay:s.autoplay},l,void 0,()=>{ur(e,[n]),n.destroy();});return y&&(s.completeOnContinue??true)&&tickers.tickers.completeOnStepEnd({id:y}),y}function ot(t,e){let n;try{n=g.screen;}catch{n=void 0;}return di(t.getBounds(),e,Mn(t),n)}async function fr(t,e={},n){return exports.effects.shakeEffect(t,e,n)}function ui(t){switch(t){case "up":return {axis:"y",sign:-1};case "down":return {axis:"y",sign:1};case "left":return {axis:"x",sign:-1};default:return {axis:"x",sign:1}}}function cn(t,e,n){let i=[0],s=t;for(let l=0;l<n;l++)i.push(l%2===0?s:-s,0),s*=e;return i}function Rt(t,e,n,i){let s=[t],l=e;for(let c=0;c<i;c++)s.push(t+l,t),l*=n;return s}exports.effects=void 0;(re=>{async function t(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the shake effect can't be applied.`);return}let k={x:R.position.x,y:R.position.y},{shakeType:$="horizontal",maxShockSize:K=10,shocksNumber:J=10,...H}=X,W=J-1;if(W<2){B.error("The number of shocks must be at least 3.");return}let Q=Math.floor(W/2),q=Math.ceil(W/2),j=[];for(let se=0;se<Q;se++){let he=K*(se+1)/Q;$==="horizontal"?se%2!==0?j.push(k.x+he):j.push(k.x-he):se%2!==0?j.push(k.y+he):j.push(k.y-he);}let ie=Q%2===0;for(let se=q;se>0;se--){let he=K*(se+1)/(q-1);$==="horizontal"?se%2===0&&!ie||se%2!==0&&ie?j.push(k.x-he):j.push(k.x+he):se%2===0&&!ie||se%2!==0&&ie?j.push(k.y-he):j.push(k.y+he);}let ce;if($==="horizontal"?(j.push(k.x),ce=g.animate(C,{x:j},H,N)):(j.push(k.y),ce=g.animate(C,{y:j},H,N)),ce)return [ce]}re.shakeEffect=t;async function e(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the bounce effect can't be applied.`);return}let{direction:k="up",distance:$=30,bounces:K=4,decay:J=.5,...H}=X,{axis:W,sign:Q}=ui(k),q=W==="x"?R.position.x:R.position.y,j=[q],ie=$;for(let se=0;se<K;se++)j.push(q+Q*ie,q),ie*=J;let ce=g.animate(C,{[W]:j},H,N);if(ce)return [ce]}re.bounceEffect=e;async function n(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the pulse effect can't be applied.`);return}let{scale:k=1.2,pulses:$=3,decay:K=.6,...J}=X,H=R.scale.x,W=R.scale.y,Q=[H],q=[W],j=k-1;for(let ce=0;ce<$;ce++)Q.push(H*(1+j),H),q.push(W*(1+j),W),j*=K;let ie=g.animate(C,{scaleX:Q,scaleY:q},J,N);if(ie)return [ie]}re.pulseEffect=n;async function i(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the hop effect can't be applied.`);return}let{direction:k="up",distance:$=40,secondaryHops:K=0,decay:J=.5,...H}=X,{axis:W,sign:Q}=ui(k),q=W==="x"?R.position.x:R.position.y,j=[q],ie=$;for(let se=0;se<1+K;se++)j.push(q+Q*ie,q),ie*=J;let ce=g.animate(C,{[W]:j},H,N);if(ce)return [ce]}re.hopEffect=i;async function s(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the wiggle effect can't be applied.`);return}let{angle:k=15,repetitions:$=3,decay:K=.5,...J}=X,H=R.rotation,W=k*Math.PI/180,Q=cn(W,K,$).map(j=>H+j),q=g.animate(C,{rotation:Q},J,N);if(q)return [q]}re.wiggleEffect=s;async function l(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the nod effect can't be applied.`);return}let{axis:k="horizontal",distance:$=15,repetitions:K=3,decay:J=.5,...H}=X,W=k==="horizontal"?"x":"y",Q=k==="horizontal"?R.position.x:R.position.y,q=cn($,J,K).map(ie=>Q+ie),j=g.animate(C,{[W]:q},H,N);if(j)return [j]}re.nodEffect=l;async function c(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the sway effect can't be applied.`);return}let{axis:k="horizontal",distance:$=10,angle:K=5,repetitions:J=3,decay:H=0,ease:W="easeInOut",...Q}=X,q=k==="horizontal"?"x":"y",j=k==="horizontal"?R.position.x:R.position.y,ie=R.rotation,ce=K*Math.PI/180,se=cn($,H||1,J).map(Ze=>j+Ze),he=cn(ce,H||1,J).map(Ze=>ie+Ze),De=g.animate(C,{[q]:se,rotation:he},{ease:W,...Q},N);if(De)return [De]}re.swayEffect=c;async function y(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the punch effect can't be applied.`);return}let{mode:k="scale",strength:$=.3,overshoot:K=.3,...J}=X,H;if(k==="scale"){let W=Q=>[Q,Q*(1+$),Q*(1-$*K),Q];H=g.animate(C,{scaleX:W(R.scale.x),scaleY:W(R.scale.y)},J,N);}else {let W=k==="rotation"?R.rotation:k==="x"?R.position.x:R.position.y,Q=k==="rotation"?$*Math.PI/180:$,q=[W,W+Q,W-Q*K,W];H=g.animate(C,{[k]:q},J,N);}if(H)return [H]}re.punchEffect=y;async function m(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the glitch effect can't be applied.`);return}let{strength:k=40,bursts:$=3,slices:K=8,direction:J=0,rgbSplit:H=6,decay:W=.5,ease:Q="linear",...q}=X,j=new filters.filters.GlitchFilter({slices:K,direction:J,offset:0});j.refresh(),j.padding=Math.ceil(Math.abs(k));let ie=[],ce=le(C,R,j,{offset:Ut(k,W,$)},{ease:Q,...q},N);if(ce&&ie.push(ce),H!==0){let se=Ut(H,W,$),he=new filters.filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});he.padding=Math.ceil(Math.abs(H));let De=le(C,R,he,{redX:se,blueX:se.map(Ze=>-Ze)},{ease:Q,...q},N);De&&ie.push(De);}if(ie.length>0)return ie}re.glitchEffect=m;async function f(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the chromatic aberration effect can't be applied.`);return}let{strength:k=8,axis:$="horizontal",bursts:K=1,decay:J=.5,...H}=X,W=new filters.filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});W.padding=Math.ceil(Math.abs(k));let Q=$==="horizontal"?"redX":"redY",q=$==="horizontal"?"blueX":"blueY",j={[Q]:Rt(0,k,J,K),[q]:Rt(0,-k,J,K)},ie=le(C,R,W,j,H,N);if(ie)return [ie]}re.chromaticAberrationEffect=f;async function x(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the shockwave effect can't be applied.`);return}let{origin:k={x:.5,y:.5},amplitude:$=30,wavelength:K=160,brightness:J=1,radius:H=-1,speed:W=500,strength:Q,...q}=X,{width:j,height:ie}=R.getBounds(),ce=Q??ln({x:k.x*j,y:k.y*ie},{width:j,height:ie},K,H)/W,se=new filters.filters.ShockwaveFilter({center:{x:0,y:0},amplitude:$,wavelength:K,brightness:J,radius:H,speed:W,time:0});se.padding=Math.ceil(Math.abs($)*1.25);let he=le(C,R,se,{time:[0,ce]},q,N,()=>{let{x:De,y:Ze}=ot(R,k);se.center={x:De,y:Ze};});if(he)return [he]}re.shockwaveEffect=x;async function T(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the radial blur effect can't be applied.`);return}let{strength:k=.5,bursts:$=1,origin:K={x:.5,y:.5},innerRadius:J=0,radius:H=-1,decay:W=.5,...Q}=X,q=new filters.filters.ZoomBlurFilter({center:{x:0,y:0},innerRadius:J,radius:H,strength:0}),{width:j,height:ie}=R.getBounds();q.padding=an({x:K.x*j,y:K.y*ie},k,j,ie);let ce=Rt(0,k,W,$),se=le(C,R,q,{strength:ce},Q,N,()=>{let{x:he,y:De}=ot(R,K);q.center={x:he,y:De};});if(se)return [se]}re.radialBlurEffect=T;async function A(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the blur pulse effect can't be applied.`);return}let{strength:k=8,pulses:$=3,quality:K,decay:J=.5,...H}=X,W=new filters.filters.BlurFilter({strength:0,quality:K}),Q=Rt(0,k,J,$),q=le(C,R,W,{strength:Q},H,N);if(q)return [q]}re.blurPulseEffect=A;async function z(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the vignette pulse effect can't be applied.`);return}let{strength:k=1,pulses:$=1,radius:K=.5,blur:J=.5,decay:H=.5,...W}=X,Q=new filters.filters.CRTFilter({curvature:0,lineWidth:0,lineContrast:0,noise:0,vignetting:K,vignettingBlur:J,vignettingAlpha:0}),q=Rt(0,k,H,$),j=le(C,R,Q,{vignettingAlpha:q},W,N);if(j)return [j]}re.vignettePulseEffect=z;async function Y(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the desaturate effect can't be applied.`);return}let{amount:k=0,duration:$=1,holdDuration:K=0,...J}=X,H=$*2+K,W=[0,$/H,($+K)/H,1],Q=new filters.filters.AdjustmentFilter({saturation:1}),q=le(C,R,Q,{saturation:[1,k,k,1]},{...J,duration:H,times:W},N);if(q)return [q]}re.desaturateEffect=Y;async function G(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the glow pulse effect can't be applied.`);return}let{strength:k=4,pulses:$=3,color:K=16777215,distance:J=10,innerStrength:H=0,decay:W=.5,...Q}=X,q=new filters.filters.GlowFilter({outerStrength:0,innerStrength:H,distance:J,color:K}),j=Rt(0,k,W,$),ie=le(C,R,q,{outerStrength:j},Q,N);if(ie)return [ie]}re.glowPulseEffect=G;})(exports.effects||={});function xt(t){let e=t.getLocalBounds();return {x:e.x,y:e.y,width:e.width,height:e.height}}function Dn(t,e){return e.graphics||(e.graphics=new ht.Graphics,e.graphics.label="",t.parent?.addChild(e.graphics),t.mask=e.graphics),pr(t,e.graphics),e.graphics}function pr(t,e){e.position.copyFrom(t.position),e.scale.copyFrom(t.scale),e.pivot.copyFrom(t.pivot),e.skew.copyFrom(t.skew),e.rotation=t.rotation;}function gr(t,e){e.graphics&&(t.mask===e.graphics&&(t.mask=null),e.graphics.parent?.removeChild(e.graphics),e.graphics.destroy({children:true}),e.graphics=void 0);}function mr(t,e,n,i){let s=e.invert?1-n:n,{bounds:l}=e,c=Dn(t,i),y=l.x+l.width/2,m=l.y+l.height/2,f=Math.sqrt(l.width**2+l.height**2)||1,x=Math.max(s,0)*f*2,T=e.angle*Math.PI/180;if(c.clear(),x>0){let A=Math.cos(-T),z=Math.sin(-T),Y=[[-f,-f],[-f+x,-f],[-f+x,f],[-f,f]].flatMap(([G,re])=>[y+G*A-re*z,m+G*z+re*A]);c.poly(Y).fill(16777215);}}function yr(t,e,n,i){let s=e.invert?1-n:n,{bounds:l}=e,c=Dn(t,i),y=l.x+l.width*e.originX,m=l.y+l.height*e.originY,f=Math.max(y-l.x,l.x+l.width-y),x=Math.max(m-l.y,l.y+l.height-m),T=Math.sqrt(f**2+x**2)||1,A=Math.max(s,0)*T,z=e.aspect>0?e.aspect:1;if(c.clear(),e.outside){let Y=T*Math.max(z,1)*2;c.rect(l.x-Y,l.y-Y,l.width+Y*2,l.height+Y*2).fill(16777215),A>0&&c.ellipse(y,m,A*z,A).cut();}else A>0&&c.ellipse(y,m,A*z,A).fill(16777215);}function xr(t,e,n,i){let s=e.invert?1-n:n,l=1-s,{bounds:c}=e,y=Dn(t,i);if(y.clear(),e.direction==="outward"){if(s>0)if(e.orientation==="horizontal"){let m=c.x+c.width*e.origin;y.rect(m-(m-c.x)*s,c.y,c.width*s,c.height).fill(16777215);}else {let m=c.y+c.height*e.origin;y.rect(c.x,m-(m-c.y)*s,c.width,c.height*s).fill(16777215);}return}if(e.orientation==="horizontal"){let m=c.x+c.width*e.origin,f=m-c.x,x=c.x+c.width-m,T=c.x-l*f,A=m+l*x;f>0&&y.rect(T,c.y,f,c.height).fill(16777215),x>0&&y.rect(A,c.y,x,c.height).fill(16777215);}else {let m=c.y+c.height*e.origin,f=m-c.y,x=c.y+c.height-m,T=c.y-l*f,A=m+l*x;f>0&&y.rect(c.x,T,c.width,f).fill(16777215),x>0&&y.rect(c.x,A,c.width,x).fill(16777215);}}function Pr(t,e,n){switch(e.kind){case "wipe":case "iris":case "split":gr(t,n);break}}function vr(t,e,n,i){switch(e.kind){case "wipe":return mr(t,e,n,i);case "iris":return yr(t,e,n,i);case "split":return xr(t,e,n,i)}}function kn(t,e){let n={};return {apply(i){let s=g.find(t);s&&(n.component=s,vr(s,e,i,n));},cleanup(){let i=n.component??g.find(t);i&&Pr(i,e,n);}}}function dn(t,e,n){let i={...g.find(t)?.memory,...n},s=new ae(n,e);return i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}async function Tr(t,e,n){let i={...g.find(t)?.memory,...n},s=new ae(n,e);return s.label=t,await s.load(),i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}function un(t,e,n){if(!e)if(ht__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:vt,...n,label:t});let i={...g.find(t)?.memory,...n},s=new oe(n,e);return i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}async function Ir(t,e,n){if(!e)if(ht__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:vt,...n,label:t});let i={...g.find(t)?.memory,...n},s=new oe(n,e);return s.label=t,await s.load(),i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}function fn(t,e,n){if(!e)if(ht__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:Ct,...n,label:t});let i={...g.find(t)?.memory,...n},s=new qe(n,e);return i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}async function Cr(t,e,n){if(!e)if(ht__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:Ct,...n,label:t});let i={...g.find(t)?.memory,...n},s=new qe(n,e);return s.label=t,await s.load(),i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}async function br(t,e,n={},i){return exports.transitions.showWithDissolve(t,e,n,i)}function wr(t,e={},n){return exports.transitions.removeWithDissolve(t,e,n)}async function Sr(t,e,n={},i){return exports.transitions.showWithFade(t,e,n,i)}function Ar(t,e={},n){return exports.transitions.removeWithFade(t,e,n)}async function Or(t,e,n={},i){return exports.transitions.moveIn(t,e,n,i)}function Er(t,e={},n){return exports.transitions.moveOut(t,e,n)}async function _r(t,e,n={},i){return exports.transitions.zoomIn(t,e,n,i)}function Mr(t,e={},n){return exports.transitions.zoomOut(t,e,n)}async function Rr(t,e,n={},i){return exports.transitions.pushIn(t,e,n,i)}function Dr(t,e={direction:"right"},n){return exports.transitions.pushOut(t,e,n)}exports.transitions=void 0;(jr=>{function t(a){switch(a.type){case "align":return {xAlign:a.x,yAlign:a.y};case "percentage":return {percentageX:a.x,percentageY:a.y};default:return {x:a.x,y:a.y}}}function e(a,r,d){if(typeof r=="string")return Yt(r)?fn(a,r,{...d.properties,zIndex:d.zIndex}):un(a,r,{...d.properties,zIndex:d.zIndex});if(Array.isArray(r))return dn(a,r,{...d.properties,zIndex:d.zIndex});if(typeof r=="object"&&"value"in r&&"options"in r){if(typeof r.value=="string")return Yt(r.value)?fn(a,r.value,{...r.options,...d.properties,zIndex:d.zIndex}):un(a,r.value,{...r.options,...d.properties,zIndex:d.zIndex});if(Array.isArray(r.value))return dn(a,r.value,{...r.options,...d.properties,zIndex:d.zIndex})}return g.add(a,r,d),r}function n(a){let r=a;return {x:r.x,y:r.y,anchor:r.anchor,scale:r.scale,pivot:r.pivot,skew:r.skew,rotation:r.rotation,angle:r.angle}}function i(a,r,d){let u,h=g.find(a);h&&(u=`${a}_temp_${d}`,g.editAlias(a,u));let p=e(a,r,{zIndex:h?h.parent?.getChildIndex(h):void 0,properties:h?n(h):void 0});return h?.parent?.setChildIndex(h,h.parent.getChildIndex(h)-.1),u&&g.copyCanvasElementProperty(u,a),u&&tickers.tickers.transfer(u,a,"duplicate"),{component:p,oldComponentAlias:u}}function s(a,r,d,u){return a?r?u(a)??[]:(d.push(a),[]):[]}function l(a){let{aliasToRemoveAfter:r,animateOldComponentOut:d,...u}=a;return u}function c(a,r){let d=a?[a,...r]:r;return d.length>0?d:void 0}function y(a){switch(a){case "up":return 90;case "down":return 270;case "left":return 180;default:return 0}}function m(a,r,d){let{apply:u,cleanup:h}=kn(a,r.config),p=filters.filters.animate(a,void 0,{value:[r.from,r.to]},{duration:r.duration??1,delay:r.delay,ease:r.ease,aliasToRemoveAfter:r.aliasToRemoveAfter,tickerIdToResume:r.tickerIdToResume},d,u,h,{alias:a,config:r.config});return p&&u(r.from),p&&(r.completeOnContinue??true)&&tickers.tickers.completeOnStepEnd({id:p}),p}function f(a,r,d,u,h,p){let I=Math.max(u,0)/4;d==="in"?(r&&(r.alpha=0),g.animate(a,{alpha:[0,1]},{duration:I,delay:p,completeOnContinue:false},h)):g.animate(a,{alpha:[1,0]},{duration:I,delay:typeof p=="function"?(E,P)=>p(E,P)+Math.max(u-I,0):(p??0)+Math.max(u-I,0),completeOnContinue:false},h);}function x(a,r,d,u,h=false){let p=Math.max(u,1),I=r*2+d,E=h?r+d:I,P=Math.max(I*(p-1)+E,.001),O=[0],w=[0],S=0;for(let b=0;b<p;b++){let v=b===p-1;S+=r,O.push(a),w.push(S/P),S+=d,O.push(a),w.push(S/P),(!v||!h)&&(S+=r,O.push(0),w.push(Math.min(S/P,1)));}return {values:O,times:w,total:P}}async function T(a,r,d={},u){let{completeOnContinue:h=true,tickerIdToResume:p=[],...I}=d,E=[];r||(r=a),typeof p=="string"&&(p=[p]);let P,O=g.find(a);if(O&&(P=`${a}_temp_disolve`,g.editAlias(a,P)),r=e(a,r,{zIndex:O?O.parent?.getChildIndex(O):void 0,properties:O?n(O):void 0}),O?.parent?.setChildIndex(O,O.parent.getChildIndex(O)-.1),P&&g.copyCanvasElementProperty(P,a),P&&tickers.tickers.transfer(P,a,"duplicate"),r.alpha=0,P){let S=A(P,{...d,autoplay:false,completeOnContinue:h},u);S&&(E.push(...S),p.push(...S));}let w=g.animate(a,{alpha:1},{...I,tickerIdToResume:p,completeOnContinue:h},u);if(w&&E.push(w),E.length>0)return E}jr.showWithDissolve=T;function A(a,r={},d){let{completeOnContinue:u=true,aliasToRemoveAfter:h=[],...p}=r;typeof h=="string"&&(h=[h]),h.push(a);let I=g.animate(a,{alpha:0},{...p,aliasToRemoveAfter:h,completeOnContinue:u},d);if(I)return [I]}jr.removeWithDissolve=A;async function z(a,r,d={},u){let{completeOnContinue:h=true,aliasToRemoveAfter:p=[],...I}=d,E=[];r||(r=a),typeof p=="string"&&(p=[p]);let P=g.find(a);if(!P)return T(a,r,d,u);let O=`${a}_temp_fade`;g.editAlias(a,O),p.push(O),r=e(a,r,{zIndex:P?P.parent?.getChildIndex(P):void 0,properties:n(P)}),P?.parent?.setChildIndex(P,P.parent.getChildIndex(P)-.1),O&&g.copyCanvasElementProperty(O,a),O&&tickers.tickers.transfer(O,a,"duplicate"),r.alpha=0;let w=g.animate(a,{alpha:1},{...I,aliasToRemoveAfter:p,completeOnContinue:h},u);if(w){let S=A(O,{...d,tickerIdToResume:w,completeOnContinue:h},u);S&&E.push(...S),E.push(w),tickers.tickers.pause({id:w});}if((r instanceof oe||r instanceof ae)&&r.haveEmptyTexture&&await r.load(),E.length>0)return E}jr.showWithFade=z;function Y(a,r={},d){return A(a,r,d)}jr.removeWithFade=Y;async function G(a,r,d={},u){let{direction:h="right",completeOnContinue:p=true,tickerIdToResume:I=[],aliasToRemoveAfter:E=[],removeOldComponentWithMoveOut:P,animateOldComponentOut:O=P??false,motionBlur:w,...S}=d,b=[],v;r||(r=a),typeof I=="string"&&(I=[I]),typeof E=="string"&&(E=[E]);let _,L=g.find(a);if(L&&(_=`${a}_temp_movein`,g.editAlias(a,_),L instanceof oe||L instanceof ae?v=L.positionInfo:v={x:L.x,y:L.y,type:"pixel"}),r=e(a,r,{zIndex:L?L.parent?.getChildIndex(L):void 0}),L?.parent?.setChildIndex(L,L.parent.getChildIndex(L)-.1),_&&g.copyCanvasElementProperty(_,a),_&&tickers.tickers.transfer(_,a,"move"),(r instanceof oe||r instanceof ae)&&r.haveEmptyTexture&&await r.load(),v||(r instanceof oe||r instanceof ae?v=r.positionInfo:v={x:r.x,y:r.y,type:"pixel"}),_)if(O){let ge=re(_,{...S,direction:h,motionBlur:w,autoplay:false,completeOnContinue:p},u);ge&&(b.push(...ge),I.push(...ge));}else E.push(_);switch(h){case "up":r.y=g.height+r.height;break;case "down":r.y=-r.height;break;case "left":r.x=g.width+r.width;break;case "right":r.x=-r.width;break}let V=tickers.tickers.pause({canvasAlias:a});I.push(...V);let ee=g.animate(a,t(v),{...S,tickerIdToResume:I,aliasToRemoveAfter:E,completeOnContinue:p},u);ee&&b.push(ee);let te=hn(a,r,h,w,{...S,completeOnContinue:p},u);if(te&&b.push(te),b.length>0)return b}jr.moveIn=G;function re(a,r={},d){let{direction:u="right",completeOnContinue:h=true,aliasToRemoveAfter:p=[],motionBlur:I,...E}=r;typeof p=="string"&&(p=[p]),p.push(a);let P=g.find(a);if(!P){B.warn(`The canvas component "${a}" is not found.`);return}let O={x:P.x,y:P.y};switch(u){case "up":O.y=-P.height;break;case "down":O.y=g.height+P.height;break;case "left":O.x=-P.width;break;case "right":O.x=g.width+P.width;break}tickers.tickers.pause({canvasAlias:a});let w=g.animate(a,O,{...E,aliasToRemoveAfter:p,completeOnContinue:h},d),S=hn(a,P,u,I,{...E,completeOnContinue:h},d);return Ht([w,S])}jr.moveOut=re;async function C(a,r,d={},u){let{direction:h="right",completeOnContinue:p=true,tickerIdToResume:I=[],aliasToRemoveAfter:E=[],removeOldComponentWithZoomOut:P,animateOldComponentOut:O=P??false,...w}=d,S=[],b;r||(r=a),typeof I=="string"&&(I=[I]),typeof E=="string"&&(E=[E]);let v,_=g.find(a);_&&(v=`${a}_temp_zoom`,g.editAlias(a,v),_ instanceof oe||_ instanceof ae?b=_.positionInfo:b={x:_.x,y:_.y,type:"pixel"}),r=e(a,r,{zIndex:_?_.parent?.getChildIndex(_):void 0}),_?.parent?.setChildIndex(_,_.parent.getChildIndex(_)-.1),v&&g.copyCanvasElementProperty(v,a),v&&tickers.tickers.transfer(v,a,"move"),(r instanceof oe||r instanceof ae)&&r.haveEmptyTexture&&await r.load(),b||(r instanceof oe||r instanceof ae?b=r.positionInfo:b={x:r.x,y:r.y,type:"pixel"});let L={x:r.pivot.x,y:r.pivot.y},V={x:r.scale.x,y:r.scale.y};if(v)if(O){let ge=X(v,{...w,direction:h,autoplay:false,completeOnContinue:p},u);ge&&(S.push(...ge),I.push(...ge));}else E.push(v);(r instanceof oe||r instanceof ae)&&r.haveEmptyTexture&&await r.load(),h==="up"?(r.pivot.y=g.height-r.y,r.pivot.x=g.width/2-r.x,r.y=g.height,r.x=g.width/2):h==="down"?(r.pivot.y=0-r.y,r.pivot.x=g.width/2-r.x,r.y=0,r.x=g.width/2):h==="left"?(r.pivot.x=g.width-r.x,r.pivot.y=g.height/2-r.y,r.x=g.width,r.y=g.height/2):h==="right"&&(r.pivot.x=0-r.x,r.pivot.y=g.height/2-r.y,r.x=0,r.y=g.height/2),r.pivot=exports.CanvasPropertyUtility.getPointBySuperPoint(r.pivot,r.angle),r.scale.set(0);let ee=tickers.tickers.pause({canvasAlias:a});I.push(...ee);let te=g.animate(a,{pivotX:L.x,pivotY:L.y,scaleX:V.x,scaleY:V.y,...t(b)},{...w,tickerIdToResume:I,aliasToRemoveAfter:E,completeOnContinue:p},u);if(te&&S.push(te),S.length>0)return S}jr.zoomIn=C;function X(a,r={},d){let{direction:u="right",completeOnContinue:h=true,aliasToRemoveAfter:p=[],...I}=r;typeof p=="string"&&(p=[p]),p.push(a);let E=g.find(a);if(!E){B.warn(`The canvas component "${a}" is not found.`);return}let P={x:E.x,y:E.y},O={x:E.pivot.x,y:E.pivot.y};u==="down"?(P.y=g.height,P.x=g.width/2,O.y=g.height-P.y,O.x=g.width/2-P.x):u==="up"?(P.y=0,P.x=g.width/2,O.y=0-P.y,O.x=g.width/2-P.x):u==="right"?(P.x=g.width,P.y=g.height/2,O.x=g.width-P.x,O.y=g.height/2-P.y):u==="left"&&(P.x=0,P.y=g.height/2,O.x=0-P.x,O.y=g.height/2-P.y),O=exports.CanvasPropertyUtility.getPointBySuperPoint(O,E.angle),tickers.tickers.pause({canvasAlias:a});let w=g.animate(a,{...P,pivotX:O.x,pivotY:O.y,scaleX:0,scaleY:0},{...I,aliasToRemoveAfter:p,completeOnContinue:h},d);if(w)return [w]}jr.zoomOut=X;async function N(a,r,d={},u){let{direction:h="right",completeOnContinue:p=true,tickerIdToResume:I=[],aliasToRemoveAfter:E=[],animateOldComponentOut:P=true,motionBlur:O,...w}=d,S=[],b;r||(r=a),typeof I=="string"&&(I=[I]),typeof E=="string"&&(E=[E]);let v,_=g.find(a);switch(_&&(v=`${a}_temp_push`,g.editAlias(a,v),_ instanceof oe||_ instanceof ae?b=_.positionInfo:b={x:_.x,y:_.y,type:"pixel"}),r=e(a,r,{zIndex:_?_.parent?.getChildIndex(_):void 0}),_?.parent?.setChildIndex(_,_.parent.getChildIndex(_)-.1),v&&g.copyCanvasElementProperty(v,a),v&&tickers.tickers.transfer(v,a,"move"),b||((r instanceof oe||r instanceof ae)&&r.haveEmptyTexture?b=r.positionInfo:b={x:r.x,y:r.y,type:"pixel"}),(r instanceof oe||r instanceof ae)&&r.haveEmptyTexture&&await r.load(),h){case "up":r.y=g.height+r.height;break;case "down":r.y=-r.height;break;case "left":r.x=g.width+r.width;break;case "right":r.x=-r.width;break}let L=tickers.tickers.pause({canvasAlias:a});if(I.push(...L),v)if(P){let te=R(v,{...w,direction:h,motionBlur:O,completeOnContinue:p});te&&S.push(...te);}else E.push(v);let V=g.animate(a,t(b),{...w,tickerIdToResume:I,aliasToRemoveAfter:E,completeOnContinue:p},u);V&&S.push(V);let ee=hn(a,r,h,O,{...w,completeOnContinue:p},u);if(ee&&S.push(ee),S.length>0)return S}jr.pushIn=N;function R(a,r={direction:"right"},d){return re(a,r,d)}jr.pushOut=R;async function k(a,r,d={},u){let{angle:h,direction:p="right",invert:I=false,duration:E,delay:P,ease:O,completeOnContinue:w=true,animateOldComponentOut:S=true}=d,{aliasToRemoveAfter:b=[]}=d;r||(r=a),typeof b=="string"&&(b=[b]);let{component:v,oldComponentAlias:_}=i(a,r,"wipe"),L=s(_,S,b,te=>$(te,{...l(d),angle:(h??y(p))+180},u));(v instanceof oe||v instanceof ae)&&v.haveEmptyTexture&&await v.load();let V={kind:"wipe",angle:h??y(p),invert:I,bounds:xt(v)},ee=m(a,{config:V,from:0,to:1,duration:E,delay:P,ease:O,completeOnContinue:w,aliasToRemoveAfter:b},u);return c(ee,L)}jr.wipeIn=k;function $(a,r={},d){let{angle:u,direction:h="right",invert:p=false,duration:I,delay:E,ease:P,completeOnContinue:O=true}=r,{aliasToRemoveAfter:w=[]}=r;typeof w=="string"&&(w=[w]),w.push(a);let S=g.find(a);if(!S){B.warn(`The canvas component "${a}" is not found.`);return}let b={kind:"wipe",angle:u??y(h),invert:p,bounds:xt(S)},v=m(a,{config:b,from:1,to:0,duration:I,delay:E,ease:P,completeOnContinue:O,aliasToRemoveAfter:w},d);if(v)return [v]}jr.wipeOut=$;async function K(a,r,d={},u){let{origin:h={},aspect:p=1,invert:I=false,duration:E,delay:P,ease:O,completeOnContinue:w=true,animateOldComponentOut:S=true,direction:b="expand"}=d,{aliasToRemoveAfter:v=[]}=d;r||(r=a),typeof v=="string"&&(v=[v]);let{component:_,oldComponentAlias:L}=i(a,r,"iris"),V=s(L,S,v,ge=>J(ge,{...l(d),direction:b==="contract"?"expand":"contract"},u));(_ instanceof oe||_ instanceof ae)&&_.haveEmptyTexture&&await _.load();let ee={kind:"iris",outside:b==="contract",originX:h.x??.5,originY:h.y??.5,aspect:p,invert:I,bounds:xt(_)},te=m(a,{config:ee,from:b==="contract"?1:0,to:b==="contract"?0:1,duration:E,delay:P,ease:O,completeOnContinue:w,aliasToRemoveAfter:v},u);return c(te,V)}jr.irisIn=K;function J(a,r={},d){let{origin:u={},aspect:h=1,invert:p=false,duration:I,delay:E,ease:P,completeOnContinue:O=true,direction:w="expand"}=r,{aliasToRemoveAfter:S=[]}=r;typeof S=="string"&&(S=[S]),S.push(a);let b=g.find(a);if(!b){B.warn(`The canvas component "${a}" is not found.`);return}let v={kind:"iris",outside:w==="contract",originX:u.x??.5,originY:u.y??.5,aspect:h,invert:p,bounds:xt(b)},_=m(a,{config:v,from:w==="contract"?0:1,to:w==="contract"?1:0,duration:I,delay:E,ease:P,completeOnContinue:O,aliasToRemoveAfter:S},d);if(_)return [_]}jr.irisOut=J;async function H(a,r,d={},u){let{orientation:h="vertical",direction:p="inward",origin:I=.5,invert:E=false,duration:P,delay:O,ease:w,completeOnContinue:S=true,animateOldComponentOut:b=true}=d,{aliasToRemoveAfter:v=[]}=d;r||(r=a),typeof v=="string"&&(v=[v]);let{component:_,oldComponentAlias:L}=i(a,r,"split"),V=s(L,b,v,ge=>W(ge,{...l(d),direction:p==="inward"?"outward":"inward"},u));(_ instanceof oe||_ instanceof ae)&&_.haveEmptyTexture&&await _.load();let ee={kind:"split",orientation:h,direction:p,origin:I,invert:E,bounds:xt(_)},te=m(a,{config:ee,from:0,to:1,duration:P,delay:O,ease:w,completeOnContinue:S,aliasToRemoveAfter:v},u);return c(te,V)}jr.splitIn=H;function W(a,r={},d){let{orientation:u="vertical",direction:h="inward",origin:p=.5,invert:I=false,duration:E,delay:P,ease:O,completeOnContinue:w=true}=r,{aliasToRemoveAfter:S=[]}=r;typeof S=="string"&&(S=[S]),S.push(a);let b=g.find(a);if(!b){B.warn(`The canvas component "${a}" is not found.`);return}let v={kind:"split",orientation:u,direction:h,origin:p,invert:I,bounds:xt(b)},_=m(a,{config:v,from:1,to:0,duration:E,delay:P,ease:O,completeOnContinue:w,aliasToRemoveAfter:S},d);if(_)return [_]}jr.splitOut=W;async function Q(a,r,d={},u){let{strength:h=32,quality:p=4,duration:I,delay:E,ease:P,completeOnContinue:O=true,fadeComponent:w=true,animateOldComponentOut:S=true}=d,{aliasToRemoveAfter:b=[]}=d;r||(r=a),typeof b=="string"&&(b=[b]);let{component:v,oldComponentAlias:_}=i(a,r,"blur"),L=s(_,S,b,ge=>q(ge,l(d),u));(v instanceof oe||v instanceof ae)&&v.haveEmptyTexture&&await v.load();let V=I??1;w&&f(a,v,"in",V,u);let ee=new filters.filters.BlurFilter({strength:h,quality:p}),te=le(a,v,ee,{strength:[h,0]},{duration:V,delay:E,ease:P,completeOnContinue:O,aliasToRemoveAfter:b},u);return c(te,L)}jr.blurIn=Q;function q(a,r={},d){let{strength:u=32,quality:h=4,duration:p,delay:I,ease:E,completeOnContinue:P=true,fadeComponent:O=true}=r,{aliasToRemoveAfter:w=[]}=r;typeof w=="string"&&(w=[w]),w.push(a);let S=g.find(a);if(!S){B.warn(`The canvas component "${a}" is not found.`);return}let b=p??1;O&&f(a,S,"out",b,d);let v=new filters.filters.BlurFilter({strength:0,quality:h}),_=le(a,S,v,{strength:[0,u]},{duration:b,delay:I,ease:E,completeOnContinue:P,aliasToRemoveAfter:w},d);if(_)return [_]}jr.blurOut=q;async function j(a,r,d={},u){let{pixelSize:h=32,direction:p="up-left",duration:I,delay:E,ease:P,completeOnContinue:O=true,fadeComponent:w=false,animateOldComponentOut:S=true}=d,{aliasToRemoveAfter:b=[]}=d;r||(r=a),typeof b=="string"&&(b=[b]);let{component:v,oldComponentAlias:_}=i(a,r,"pixelate"),L=s(_,S,b,Nt=>ie(Nt,l(d),u));(v instanceof oe||v instanceof ae)&&v.haveEmptyTexture&&await v.load();let V=I??1;w&&f(a,v,"in",V,u);let ee=ce(h,p,"in"),te=new filters.filters.PixelateFilter([ee.sizeX[0],ee.sizeY[0]]),ge=le(a,v,te,ee,{duration:V,delay:E,ease:P,completeOnContinue:O,aliasToRemoveAfter:b},u);return c(ge,L)}jr.pixelateIn=j;function ie(a,r={},d){let{pixelSize:u=32,direction:h="up-left",duration:p,delay:I,ease:E,completeOnContinue:P=true,fadeComponent:O=false}=r,{aliasToRemoveAfter:w=[]}=r;typeof w=="string"&&(w=[w]),w.push(a);let S=g.find(a);if(!S){B.warn(`The canvas component "${a}" is not found.`);return}let b=p??1;O&&f(a,S,"out",b,d);let v=ce(u,h,"out"),_=new filters.filters.PixelateFilter([v.sizeX[0],v.sizeY[0]]),L=le(a,S,_,v,{duration:b,delay:I,ease:E,completeOnContinue:P,aliasToRemoveAfter:w},d);if(L)return [L]}jr.pixelateOut=ie;function ce(a,r,d){let u=d==="in"?1:-1,h=(r.endsWith("left")?1:-1)*u,p=(r.startsWith("up")?1:-1)*u,I=Math.max(1,Math.abs(a)),E=d==="in"?[I,1]:[1,I];return {sizeX:E.map(P=>P*h),sizeY:E.map(P=>P*p)}}async function se(a,r,d={},u){let{color:h=16777215,maxAlpha:p=1,duration:I=.3,holdDuration:E=0,pulses:P=1,completeOnContinue:O=true,fadeComponent:w=true,...S}=d;r||(r=a);let b=g.find(a);if(b)return Ze(a,b,r,{color:h,maxAlpha:p,fadeDuration:I,holdDuration:E,pulses:P,completeOnContinue:O,rest:S,priority:u});let{component:v}=i(a,r,"flash");(v instanceof oe||v instanceof ae)&&v.haveEmptyTexture&&await v.load(),w&&f(a,v,"in",I,u);let _=[],L=De(v,{color:h,maxAlpha:p,fadeDuration:I,holdDuration:E,pulses:P,completeOnContinue:O,aliasToRemoveAfter:[],rest:S,priority:u});if(L&&_.push(L),_.length>0)return _}jr.flashIn=se;function he(a,r={},d){let{color:u=16777215,maxAlpha:h=1,duration:p=.3,holdDuration:I=0,pulses:E=1,completeOnContinue:P=true,fadeComponent:O=true,...w}=r,S=g.find(a);if(!S){B.warn(`The canvas component "${a}" is not found.`);return}if(O){let{total:v}=x(h,p,I,E);f(a,S,"out",v,d);}let b=De(S,{color:u,maxAlpha:h,fadeDuration:p,holdDuration:I,pulses:E,completeOnContinue:P,aliasToRemoveAfter:[a],rest:w,priority:d});if(b)return [b]}jr.flashOut=he;function De(a,r){let{values:d,times:u,total:h}=x(r.maxAlpha,r.fadeDuration,r.holdDuration,r.pulses,r.endAtPeak??false),p=new filters.filters.ColorOverlayFilter({color:r.color,alpha:0});return le(a.label,a,p,{alpha:d},{duration:h,times:u,delay:r.rest.delay,ease:r.rest.ease,aliasToRemoveAfter:r.aliasToRemoveAfter,completeOnContinue:r.completeOnContinue},r.priority)}async function Ze(a,r,d,u){let{component:h,oldComponentAlias:p}=i(a,d,"flash");if(!p)return;let I=h.alpha,E=r.alpha;h.alpha=0,(h instanceof oe||h instanceof ae)&&h.haveEmptyTexture&&await h.load();let{values:P,times:O,total:w}=x(u.maxAlpha,u.fadeDuration,u.holdDuration,u.pulses,true),S=w+u.fadeDuration,b=w/S,v={duration:S,delay:u.rest.delay,ease:u.rest.ease,completeOnContinue:u.completeOnContinue},_=le(p,r,new filters.filters.ColorOverlayFilter({color:u.color,alpha:0}),{alpha:[...P,u.maxAlpha]},{...v,times:[...O.map(ge=>ge*b),1],aliasToRemoveAfter:[p]},u.priority),L=le(a,h,new filters.filters.ColorOverlayFilter({color:u.color,alpha:u.maxAlpha}),{alpha:[u.maxAlpha,u.maxAlpha,0]},{...v,times:[0,b,1],aliasToRemoveAfter:u.rest.aliasToRemoveAfter},u.priority),V={duration:S,delay:u.rest.delay,times:[0,b,b,1],ease:"linear"},ee=g.animate(p,{alpha:[E,E,0,0]},V,u.priority),te=g.animate(a,{alpha:[0,0,I,I]},V,u.priority);return u.completeOnContinue&&(ee&&tickers.tickers.completeOnStepEnd({id:ee}),te&&tickers.tickers.completeOnStepEnd({id:te})),Ht([_,L,ee,te])}function hn(a,r,d,u,h,p){if(!u)return;let I=u===true?40:u,E=d==="up"||d==="down"?"velocityY":"velocityX",P=d==="up"||d==="left"?-1:1,O=new filters.filters.MotionBlurFilter({velocity:{x:0,y:0},kernelSize:15});return le(a,r,O,{[E]:[0,P*I,0]},{duration:h.duration??.3,delay:h.delay,ease:h.ease,completeOnContinue:h.completeOnContinue,autoplay:h.autoplay},p)}function Ht(a){let r=a.filter(d=>!!d);return r.length>0?r:void 0}async function at(a,r,d,u,h,p,I,E,P=false){let{duration:O,delay:w,ease:S,completeOnContinue:b=true,fadeComponent:v=h,animateOldComponentOut:_=true}=u,{aliasToRemoveAfter:L=[]}=u;typeof L=="string"&&(L=[L]);let{component:V,oldComponentAlias:ee}=i(a,r??a,d),te=P&&!!ee&&_,ge=V.alpha;te&&(V.alpha=0);let Nt=()=>s(ee,_,L,E),pn=te?[]:Nt();(V instanceof oe||V instanceof ae)&&V.haveEmptyTexture&&await V.load(),te&&pn.push(...Nt());let Dt=O??1,Gn=P&&pn.length>0?typeof w=="function"?(Ci,bi)=>w(Ci,bi)+Dt:(w??0)+Dt:w,Vt;return te?(Vt=g.animate(a,{alpha:[0,ge]},{duration:v?Dt/4:0,delay:Gn},p),Vt&&b&&tickers.tickers.completeOnStepEnd({id:Vt})):v&&f(a,V,"in",Dt,p),Ht([...I(V,{duration:Dt,delay:Gn,ease:S,completeOnContinue:b},L),...pn,Vt])}function lt(a,r,d,u,h){let{duration:p,delay:I,ease:E,completeOnContinue:P=true,fadeComponent:O=d}=r,{aliasToRemoveAfter:w=[]}=r;typeof w=="string"&&(w=[w]),w.push(a);let S=g.find(a);if(!S){B.warn(`The canvas component "${a}" is not found.`);return}let b=p??1;return O&&f(a,S,"out",b,u,I),Ht(h(S,{duration:b,delay:I,ease:E,completeOnContinue:P},w))}function Bn(a){let{width:r,height:d}=a.getBounds();return Math.hypot(r,d)/2}function Gt(a){return {x:a?.x??.5,y:a?.y??.5}}function Fn(a,r,d,u,h,p,I){let{strength:E=40,bursts:P=3,slices:O=8,rgbSplit:w=6}=u,S=L=>{let V=Ut(L,.5,P);return d==="in"?V:V.reverse()},b={...h,ease:h.ease??"linear"},v=new filters.filters.GlitchFilter({slices:O,offset:0});v.refresh(),v.padding=Math.ceil(Math.abs(E));let _=[le(a,r,v,{offset:S(E)},{...b,aliasToRemoveAfter:p},I)];if(w!==0){let L=S(w),V=new filters.filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});V.padding=Math.ceil(Math.abs(w)),_.push(le(a,r,V,{redX:L,blueX:L.map(ee=>-ee)},b,I));}return _}async function Yr(a,r,d={},u){return at(a,r,"glitch",d,true,u,(h,p,I)=>Fn(a,h,"in",d,p,I,u),h=>xi(h,l(d),u),true)}jr.glitchIn=Yr;function xi(a,r={},d){return lt(a,r,true,d,(u,h,p)=>Fn(a,u,"out",r,h,p,d))}jr.glitchOut=xi;function Ln(a,r,d,u,h,p,I){let{angle:E=540,radius:P=Bn(r),origin:O}=u,w=Gt(O),S=E*Math.PI/180,b=d==="in"?[S,0]:[0,S],v=new filters.filters.TwistFilter({radius:P,angle:b[0],offset:{x:0,y:0}}),{width:_,height:L}=r.getBounds();return v.padding=Math.max(v.padding,_n({x:w.x*_,y:w.y*L},P,_,L)),[le(a,r,v,{angle:b},{...h,aliasToRemoveAfter:p},I,()=>{let{x:ee,y:te}=ot(r,w);v.offsetX=ee,v.offsetY=te;})]}async function Ur(a,r,d={},u){return at(a,r,"twist",d,true,u,(h,p,I)=>Ln(a,h,"in",d,p,I,u),h=>Pi(h,{...l(d),angle:-(d.angle??540)},u))}jr.twistIn=Ur;function Pi(a,r={},d){return lt(a,r,true,d,(u,h,p)=>Ln(a,u,"out",r,h,p,d))}jr.twistOut=Pi;function zn(a,r,d,u,h,p,I){let{strength:E=.6,origin:P}=u,O=Gt(P),w=d==="in"?[E,0]:[0,E],S=new filters.filters.ZoomBlurFilter({center:{x:0,y:0},strength:w[0]}),{width:b,height:v}=r.getBounds();return S.padding=an({x:O.x*b,y:O.y*v},E,b,v),[le(a,r,S,{strength:w},{...h,aliasToRemoveAfter:p},I,()=>{let{x:L,y:V}=ot(r,O);S.center={x:L,y:V};})]}async function Wr(a,r,d={},u){return at(a,r,"warp",d,true,u,(h,p,I)=>zn(a,h,"in",d,p,I,u),h=>vi(h,l(d),u),true)}jr.warpIn=Wr;function vi(a,r={},d){return lt(a,r,true,d,(u,h,p)=>zn(a,u,"out",r,h,p,d))}jr.warpOut=vi;function Yn(a,r,d,u,h,p){let{origin:I,amplitude:E=30,wavelength:P=160,speed:O=500}=d,w=Gt(I),{width:S,height:b}=r.getBounds(),v=new filters.filters.ShockwaveFilter({center:{x:0,y:0},amplitude:E,wavelength:P,speed:O,time:0});v.padding=Math.ceil(Math.abs(E)*1.25);let _=ln({x:w.x*S,y:w.y*b},{width:S,height:b},P,-1)/O;return [le(a,r,v,{time:[0,_]},{...u,aliasToRemoveAfter:h},p,()=>{let{x:V,y:ee}=ot(r,w);v.center={x:V,y:ee};})]}async function Hr(a,r,d={},u){return at(a,r,"ripple",d,true,u,(h,p,I)=>Yn(a,h,d,p,I,u),h=>A(h,{duration:d.duration,delay:d.delay,ease:d.ease,completeOnContinue:d.completeOnContinue},u))}jr.rippleIn=Hr;function Gr(a,r={},d){return lt(a,r,true,d,(u,h,p)=>Yn(a,u,r,h,p,d))}jr.rippleOut=Gr;function Un(a,r,d,u,h,p,I){let{edge:E="hard",noiseScale:P=8,seed:O=Math.random()*1e3}=u,[w,S]=E==="hard"?[.25,.75]:[0,1],b=d==="in"?[w,S]:[S,w],v=new filters.filters.SimplexNoiseFilter({strength:b[0],noiseScale:P,offsetZ:O,step:E==="hard"?.5:0});return [le(a,r,v,{strength:b},{...h,aliasToRemoveAfter:p},I)]}async function Nr(a,r,d={},u){return at(a,r,"noise",d,false,u,(h,p,I)=>Un(a,h,"in",d,p,I,u),h=>Ti(h,l(d),u))}jr.noiseDissolveIn=Nr;function Ti(a,r={},d){return lt(a,r,false,d,(u,h,p)=>Un(a,u,"out",r,h,p,d))}jr.noiseDissolveOut=Ti;function Wn(a,r,d,u,h,p,I){let{lineThickness:E=.02,brightness:P=3,scanlines:O=true}=u,w=r.scale.x,S=r.scale.y,b=S*E,v=d==="in"?[0,.45,1]:[0,.55,1],_=d==="in"?[0,w,w]:[w,w,0],L=d==="in"?[b,b,S]:[S,b,b],V=d==="in"?[P,P,1]:[1,P,P];d==="in"&&r.scale.set(0,b);let ee=[g.animate(a,{scaleX:_,scaleY:L},{duration:h.duration,delay:h.delay,ease:h.ease,times:v,completeOnContinue:h.completeOnContinue,aliasToRemoveAfter:p},I),le(a,r,new filters.filters.AdjustmentFilter({brightness:V[0]}),{brightness:V},{...h,times:v},I)];if(O){let te=d==="in"?[.5,.5,0]:[0,.5,.5];ee.push(le(a,r,new filters.filters.CRTFilter({curvature:0,vignettingAlpha:0,lineWidth:3,lineContrast:te[0],noise:te[0]}),{lineContrast:te,noise:te},{...h,times:v},I));}return ee}async function Vr(a,r,d={},u){return at(a,r,"tv",d,false,u,(h,p,I)=>Wn(a,h,"in",d,p,I,u),h=>Ii(h,l(d),u),true)}jr.tvIn=Vr;function Ii(a,r={},d){return lt(a,r,false,d,(u,h,p)=>Wn(a,u,"out",r,h,p,d))}jr.tvOut=Ii;function Hn(a,r,d,u,h,p,I){let{strength:E=1,mode:P="pinch",radius:O=Bn(r),origin:w}=u,S=(P==="bulge"?1:-1)*E,b=Gt(w),v=d==="in"?[S,0]:[0,S],_=new filters.filters.BulgePinchFilter({center:b,radius:O,strength:v[0]});if(P==="bulge"){let{width:V,height:ee}=r.getBounds();_.padding=_n({x:b.x*V,y:b.y*ee},O,V,ee);}return [le(a,r,_,{strength:v},{...h,aliasToRemoveAfter:p},I,()=>{let{x:V,y:ee,area:te}=ot(r,b);_.center={x:V/te.width,y:ee/te.height};})]}async function Xr(a,r,d={},u){return at(a,r,"pinch",d,true,u,(h,p,I)=>Hn(a,h,"in",d,p,I,u),h=>A(h,{duration:d.duration,delay:d.delay,ease:d.ease,completeOnContinue:d.completeOnContinue},u))}jr.pinchIn=Xr;function $r(a,r={},d){return lt(a,r,true,d,(u,h,p)=>Hn(a,u,"out",r,h,p,d))}jr.pinchOut=$r;})(exports.transitions||={});var Wt=class extends Qe{constructor(n){super(n);this._memory=n;this.pixivnId=n.pixivnId;}_memory;pixivnId;get memory(){return {...this._memory,...super.memory,elements:[],pixivnId:this.pixivnId}}};function kr(){return async(e,n)=>{try{let i=e.canvasElementInfo;if(i){let s=new Wt(i),l=i.zIndex;s.groupColor=16711680;let c=new ht__default.default.Graphics;c.rect(0,0,300,100).fill({color:16711680,alpha:.5}),s.addChild(c);let y=new ht__default.default.Text({text:`Error: ${i.label}`,x:10,y:10});s.addChild(y);let m=e.parent;if(m&&"addChild"in m)l!==void 0?m.addChildAt(s,l):m.addChild(s);else {let f=i.parentLabel?g.find(i.parentLabel):void 0;if(f)l!==void 0?f.addChildAt(s,l):f.addChild(s);else {let x=i.label??i.pixivnId;g.add(x,s,{zIndex:l});}}}}catch{}}}function Br(t,e,n){let i={...g.find(t)?.memory,...n},s=new yt({text:e,...n});return i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}var {Assets:ul,Color:fl,Rectangle:hl,TextStyle:pl,Texture:gl,UPDATE_PRIORITY:ml}=ht__default.default,g=new Lt;ve.init({getScreen:()=>g.screen});core.GameUnifier.addOnPreContinue(async()=>{try{let{tikersIds:t,stepAlias:e}=tickers.drainCompleteOnStepEndQueue(),n=(async()=>{for(;t.length;){let{id:s}=t.pop()||{};s&&await tickers.tickers.forceCompletion(s);}})(),i=(async()=>{for(;e.length;){let{alias:s,id:l}=e.pop()||{};s&&l&&await tickers.tickers.forceCompletion(l,s);}})();await Promise.all([n,i]);}catch{}});
|
|
2
|
+
exports.Assets=ul;exports.CanvasBaseItem=on;exports.CanvasManagerStatic=fe;exports.Color=fl;exports.Container=Qe;exports.ImageContainer=ae;exports.ImageSprite=oe;exports.Rectangle=hl;exports.RegisteredCanvasComponents=Ce;exports.RegisteredEvents=Cn;exports.Sprite=mt;exports.Text=yt;exports.TextStyle=pl;exports.Texture=gl;exports.UPDATE_PRIORITY=ml;exports.VideoSprite=qe;exports.addImage=un;exports.addImageCointainer=dn;exports.addListenerHandler=ft;exports.addVideo=fn;exports.analizePositionsExtensionProps=Xe;exports.canvas=g;exports.canvasComponentDecorator=Bi;exports.createFilterTransitionApplier=kn;exports.drawCanvasErrorHandler=kr;exports.eventDecorator=Di;exports.getTexture=zt;exports.moveIn=Or;exports.moveOut=Er;exports.pushIn=Rr;exports.pushOut=Dr;exports.removeWithDissolve=wr;exports.removeWithFade=Ar;exports.setMemoryContainer=Be;exports.shakeEffect=fr;exports.showImage=Ir;exports.showImageContainer=Tr;exports.showText=Br;exports.showVideo=Cr;exports.showWithDissolve=br;exports.showWithFade=Sr;exports.zoomIn=_r;exports.zoomOut=Mr;Object.keys(tickers).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return tickers[k]}})});
|