@drincs/pixi-vn 1.3.14 → 1.3.16

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.
Files changed (96) hide show
  1. package/dist/{classes/index.d.cts → CachedMap-DZLvJAnA.d.cts} +1 -1
  2. package/dist/{classes/index.d.ts → CachedMap-DZLvJAnA.d.ts} +1 -1
  3. package/dist/{OpenedLabel-DxlOwJKw.d.ts → HistoryChoiceMenuOption-BjnxDyK5.d.cts} +47 -2
  4. package/dist/{OpenedLabel-Dgkgemkv.d.cts → HistoryChoiceMenuOption-ZdrL_kYX.d.ts} +47 -2
  5. package/dist/{StorageElementType-DTGcnkzF.d.ts → StorageElementType-dAIVJeiw.d.cts} +1 -1
  6. package/dist/{StorageElementType-DTGcnkzF.d.cts → StorageElementType-dAIVJeiw.d.ts} +1 -1
  7. package/dist/canvas.cjs +1 -0
  8. package/dist/{index-B4F3XaWz.d.cts → canvas.d.cts} +715 -123
  9. package/dist/{index-DvpfJ2VQ.d.ts → canvas.d.ts} +715 -123
  10. package/dist/canvas.mjs +1 -0
  11. package/dist/chunk-GNJIUFU2.mjs +1 -0
  12. package/dist/chunk-JYY377ML.mjs +1 -0
  13. package/dist/chunk-QW6DZQUB.mjs +1 -0
  14. package/dist/history.cjs +1 -0
  15. package/dist/{history/index.d.ts → history.d.cts} +14 -8
  16. package/dist/{history/index.d.cts → history.d.ts} +14 -8
  17. package/dist/history.mjs +1 -0
  18. package/dist/index.cjs +2 -3316
  19. package/dist/index.d.cts +790 -266
  20. package/dist/index.d.ts +790 -266
  21. package/dist/index.mjs +2 -3316
  22. package/dist/narration.cjs +2 -0
  23. package/dist/{index-_rD16ks5.d.ts → narration.d.cts} +27 -44
  24. package/dist/{index-Bl9hiHQR.d.cts → narration.d.ts} +27 -44
  25. package/dist/narration.mjs +2 -0
  26. package/dist/pixi.js.cjs +3315 -0
  27. package/dist/pixi.js.d.cts +1 -0
  28. package/dist/pixi.js.d.ts +1 -0
  29. package/dist/pixi.js.mjs +3315 -0
  30. package/dist/sound.cjs +1 -0
  31. package/dist/sound.d.cts +170 -0
  32. package/dist/sound.d.ts +170 -0
  33. package/dist/sound.mjs +1 -0
  34. package/dist/storage.cjs +1 -0
  35. package/dist/{storage/index.d.ts → storage.d.cts} +75 -6
  36. package/dist/{storage/index.d.cts → storage.d.ts} +75 -6
  37. package/dist/storage.mjs +1 -0
  38. package/dist/unifier.cjs +1 -0
  39. package/dist/unifier.d.cts +230 -0
  40. package/dist/unifier.d.ts +230 -0
  41. package/dist/unifier.mjs +1 -0
  42. package/package.json +48 -2
  43. package/dist/ContainerMemory-CrY9QSo2.d.cts +0 -106
  44. package/dist/ContainerMemory-DrijxCcD.d.ts +0 -106
  45. package/dist/HistoryChoiceMenuOption-Kj_P28ke.d.ts +0 -49
  46. package/dist/HistoryChoiceMenuOption-unaLLfKR.d.cts +0 -49
  47. package/dist/HistoryGameState-i_gx3rGM.d.ts +0 -12
  48. package/dist/HistoryGameState-qeIMl_DH.d.cts +0 -12
  49. package/dist/NarrationGameState-CqDh48n_.d.ts +0 -24
  50. package/dist/NarrationGameState-Cu-OYzph.d.cts +0 -24
  51. package/dist/SoundGameState-BG_iPwjt.d.cts +0 -85
  52. package/dist/SoundGameState-BG_iPwjt.d.ts +0 -85
  53. package/dist/StorageGameState-B2kz-u_2.d.cts +0 -19
  54. package/dist/StorageGameState-Cnfj75sk.d.ts +0 -19
  55. package/dist/StoredClassModel-CjdhvNgB.d.cts +0 -56
  56. package/dist/StoredClassModel-CjdhvNgB.d.ts +0 -56
  57. package/dist/TickersSequence-Cf1Vcu22.d.cts +0 -133
  58. package/dist/TickersSequence-Cf1Vcu22.d.ts +0 -133
  59. package/dist/canvas/index.cjs +0 -3316
  60. package/dist/canvas/index.d.cts +0 -8
  61. package/dist/canvas/index.d.ts +0 -8
  62. package/dist/canvas/index.mjs +0 -3316
  63. package/dist/canvas/tickers/index.cjs +0 -3316
  64. package/dist/canvas/tickers/index.d.cts +0 -467
  65. package/dist/canvas/tickers/index.d.ts +0 -467
  66. package/dist/canvas/tickers/index.mjs +0 -3316
  67. package/dist/character/index.cjs +0 -572
  68. package/dist/character/index.d.cts +0 -3
  69. package/dist/character/index.d.ts +0 -3
  70. package/dist/character/index.mjs +0 -572
  71. package/dist/classes/index.cjs +0 -1
  72. package/dist/classes/index.mjs +0 -1
  73. package/dist/history/index.cjs +0 -1
  74. package/dist/history/index.mjs +0 -1
  75. package/dist/index-Cax-mGq_.d.cts +0 -216
  76. package/dist/index-Cvdua0o-.d.ts +0 -216
  77. package/dist/index-Czfdktw9.d.ts +0 -93
  78. package/dist/index-DZ1shoNp.d.cts +0 -93
  79. package/dist/interfaces/index.cjs +0 -1
  80. package/dist/interfaces/index.d.cts +0 -55
  81. package/dist/interfaces/index.d.ts +0 -55
  82. package/dist/narration/index.cjs +0 -573
  83. package/dist/narration/index.d.cts +0 -8
  84. package/dist/narration/index.d.ts +0 -8
  85. package/dist/narration/index.mjs +0 -573
  86. package/dist/sound/index.cjs +0 -572
  87. package/dist/sound/index.d.cts +0 -3
  88. package/dist/sound/index.d.ts +0 -3
  89. package/dist/sound/index.mjs +0 -572
  90. package/dist/storage/index.cjs +0 -1
  91. package/dist/storage/index.mjs +0 -1
  92. package/dist/utils/index.cjs +0 -1
  93. package/dist/utils/index.d.cts +0 -8
  94. package/dist/utils/index.d.ts +0 -8
  95. package/dist/utils/index.mjs +0 -1
  96. /package/dist/{interfaces/index.mjs → chunk-XSN6P5JL.mjs} +0 -0
@@ -20,4 +20,4 @@ declare class CachedMap<K extends {}, V extends {}> implements Map<K, V> {
20
20
  values(): MapIterator<V>;
21
21
  }
22
22
 
23
- export { CachedMap };
23
+ export { CachedMap as C };
@@ -20,4 +20,4 @@ declare class CachedMap<K extends {}, V extends {}> implements Map<K, V> {
20
20
  values(): MapIterator<V>;
21
21
  }
22
22
 
23
- export { CachedMap };
23
+ export { CachedMap as C };
@@ -1,7 +1,7 @@
1
1
  import { ChoiceInterface, CharacterInterface, GameStepState } from '@drincs/pixi-vn';
2
2
  import deepDiff from 'deep-diff';
3
3
  import { Difference } from 'microdiff';
4
- import { S as StorageElementType } from './StorageElementType-DTGcnkzF.js';
4
+ import { a as StorageElementType } from './StorageElementType-dAIVJeiw.cjs';
5
5
 
6
6
  type CloseType = "close";
7
7
  declare const Close: CloseType;
@@ -116,4 +116,49 @@ interface OpenedLabel {
116
116
  currentStepIndex: number;
117
117
  }
118
118
 
119
- export { type CloseType as C, type DialogueInterface as D, type HistoryStep as H, type LabelRunModeType as L, type OpenedLabel as O, type StoredChoiceInterface as S, type ChoiceOptionInterface as a, type CloseChoiceOptionInterface as b, type StoredIndexedChoiceInterface as c, Close as d, type LabelIdType as e };
119
+ interface NarrationHistory {
120
+ /**
121
+ * Dialogue to be shown in the game
122
+ */
123
+ dialogue?: DialogueInterface;
124
+ /**
125
+ * List of choices asked of the player
126
+ */
127
+ choices?: HistoryChoiceMenuOption[];
128
+ /**
129
+ * The player made a choice
130
+ */
131
+ playerMadeChoice?: boolean;
132
+ /**
133
+ * The index of the step in the history.
134
+ */
135
+ stepIndex: number;
136
+ /**
137
+ * The input value of the player
138
+ */
139
+ inputValue?: StorageElementType;
140
+ }
141
+
142
+ /**
143
+ * HistoryChoiceMenuOption is a type that contains the history information of a choice menu option.
144
+ */
145
+ type HistoryChoiceMenuOption = {
146
+ /**
147
+ * Text to be displayed in the menu
148
+ */
149
+ text: string | string[];
150
+ /**
151
+ * Method used to open the label, or close the menu.
152
+ */
153
+ type: CloseType | LabelRunModeType;
154
+ /**
155
+ * This choice is a response
156
+ */
157
+ isResponse: boolean;
158
+ /**
159
+ * The choice is hidden
160
+ */
161
+ hidden: boolean;
162
+ };
163
+
164
+ export { type ChoiceOptionInterface as C, type DialogueInterface as D, type HistoryStep as H, type LabelIdType as L, type NarrationHistory as N, type OpenedLabel as O, type StoredIndexedChoiceInterface as S, type LabelRunModeType as a, type CloseChoiceOptionInterface as b, type CloseType as c, type StoredChoiceInterface as d, Close as e, type HistoryChoiceMenuOption as f };
@@ -1,7 +1,7 @@
1
1
  import { ChoiceInterface, CharacterInterface, GameStepState } from '@drincs/pixi-vn';
2
2
  import deepDiff from 'deep-diff';
3
3
  import { Difference } from 'microdiff';
4
- import { S as StorageElementType } from './StorageElementType-DTGcnkzF.cjs';
4
+ import { a as StorageElementType } from './StorageElementType-dAIVJeiw.js';
5
5
 
6
6
  type CloseType = "close";
7
7
  declare const Close: CloseType;
@@ -116,4 +116,49 @@ interface OpenedLabel {
116
116
  currentStepIndex: number;
117
117
  }
118
118
 
119
- export { type CloseType as C, type DialogueInterface as D, type HistoryStep as H, type LabelRunModeType as L, type OpenedLabel as O, type StoredChoiceInterface as S, type ChoiceOptionInterface as a, type CloseChoiceOptionInterface as b, type StoredIndexedChoiceInterface as c, Close as d, type LabelIdType as e };
119
+ interface NarrationHistory {
120
+ /**
121
+ * Dialogue to be shown in the game
122
+ */
123
+ dialogue?: DialogueInterface;
124
+ /**
125
+ * List of choices asked of the player
126
+ */
127
+ choices?: HistoryChoiceMenuOption[];
128
+ /**
129
+ * The player made a choice
130
+ */
131
+ playerMadeChoice?: boolean;
132
+ /**
133
+ * The index of the step in the history.
134
+ */
135
+ stepIndex: number;
136
+ /**
137
+ * The input value of the player
138
+ */
139
+ inputValue?: StorageElementType;
140
+ }
141
+
142
+ /**
143
+ * HistoryChoiceMenuOption is a type that contains the history information of a choice menu option.
144
+ */
145
+ type HistoryChoiceMenuOption = {
146
+ /**
147
+ * Text to be displayed in the menu
148
+ */
149
+ text: string | string[];
150
+ /**
151
+ * Method used to open the label, or close the menu.
152
+ */
153
+ type: CloseType | LabelRunModeType;
154
+ /**
155
+ * This choice is a response
156
+ */
157
+ isResponse: boolean;
158
+ /**
159
+ * The choice is hidden
160
+ */
161
+ hidden: boolean;
162
+ };
163
+
164
+ export { type ChoiceOptionInterface as C, type DialogueInterface as D, type HistoryStep as H, type LabelIdType as L, type NarrationHistory as N, type OpenedLabel as O, type StoredIndexedChoiceInterface as S, type LabelRunModeType as a, type CloseChoiceOptionInterface as b, type CloseType as c, type StoredChoiceInterface as d, Close as e, type HistoryChoiceMenuOption as f };
@@ -11,4 +11,4 @@ type StorageElementType = StorageElementInternalType | Record<string | number |
11
11
  */
12
12
  type StorageObjectType = Record<string | number | symbol, StorageElementType>;
13
13
 
14
- export type { StorageElementType as S, StorageObjectType as a };
14
+ export type { StorageObjectType as S, StorageElementType as a };
@@ -11,4 +11,4 @@ type StorageElementType = StorageElementInternalType | Record<string | number |
11
11
  */
12
12
  type StorageObjectType = Record<string | number | symbol, StorageElementType>;
13
13
 
14
- export type { StorageElementType as S, StorageObjectType as a };
14
+ export type { StorageObjectType as S, StorageElementType as a };
@@ -0,0 +1 @@
1
+ 'use strict';var pixi_js=require('@drincs/pixi-vn/pixi.js'),devtools=require('@pixi/devtools'),motion=require('motion');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var pixi_js__namespace=/*#__PURE__*/_interopNamespace(pixi_js);var zi=Object.create;var Ft=Object.defineProperty;var Fi=Object.getOwnPropertyDescriptor;var Ni=Object.getOwnPropertyNames;var Yi=Object.getPrototypeOf,Vi=Object.prototype.hasOwnProperty;var ci=i=>{throw TypeError(i)};var Hi=(i,e,t)=>e in i?Ft(i,e,{enumerable:true,configurable:true,writable:true,value:t}):i[e]=t;var Nt=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var li=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var ji=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ni(e))!Vi.call(i,n)&&n!==t&&Ft(i,n,{get:()=>e[n],enumerable:!(r=Fi(e,n))||r.enumerable});return i};var qi=(i,e,t)=>(t=i!=null?zi(Yi(i)):{},ji(Ft(t,"default",{value:i,enumerable:true}),i));var m=(i,e,t)=>Hi(i,typeof e!="symbol"?e+"":e,t),Yt=(i,e,t)=>e.has(i)||ci("Cannot "+t);var a=(i,e,t)=>(Yt(i,e,"read from private field"),t?t.call(i):e.get(i)),M=(i,e,t)=>e.has(i)?ci("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),b=(i,e,t,r)=>(Yt(i,e,"write to private field"),e.set(i,t),t),_=(i,e,t)=>(Yt(i,e,"access private method"),t);var vt=(i,e,t,r)=>({set _(n){b(i,e,n);},get _(){return a(i,e,r)}});var ui=li((_t,hi)=>{(function(i,e){typeof _t=="object"?hi.exports=_t=e():typeof define=="function"&&define.amd?define([],e):i.CryptoJS=e();})(_t,function(){var i=i||(function(e,t){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 Nt=="function")try{r=Nt("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.")},s=Object.create||(function(){function h(){}return function(x){var w;return h.prototype=x,w=new h,h.prototype=null,w}})(),o={},c=o.lib={},l=c.Base=(function(){return {extend:function(h){var x=s(this);return h&&x.mixIn(h),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments);}),x.init.prototype=x,x.$super=this,x},create:function(){var h=this.extend();return h.init.apply(h,arguments),h},init:function(){},mixIn:function(h){for(var x in h)h.hasOwnProperty(x)&&(this[x]=h[x]);h.hasOwnProperty("toString")&&(this.toString=h.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),f=c.WordArray=l.extend({init:function(h,x){h=this.words=h||[],x!=t?this.sigBytes=x:this.sigBytes=h.length*4;},toString:function(h){return (h||g).stringify(this)},concat:function(h){var x=this.words,w=h.words,E=this.sigBytes,R=h.sigBytes;if(this.clamp(),E%4)for(var z=0;z<R;z++){var ye=w[z>>>2]>>>24-z%4*8&255;x[E+z>>>2]|=ye<<24-(E+z)%4*8;}else for(var q=0;q<R;q+=4)x[E+q>>>2]=w[q>>>2];return this.sigBytes+=R,this},clamp:function(){var h=this.words,x=this.sigBytes;h[x>>>2]&=4294967295<<32-x%4*8,h.length=e.ceil(x/4);},clone:function(){var h=l.clone.call(this);return h.words=this.words.slice(0),h},random:function(h){for(var x=[],w=0;w<h;w+=4)x.push(n());return new f.init(x,h)}}),p=o.enc={},g=p.Hex={stringify:function(h){for(var x=h.words,w=h.sigBytes,E=[],R=0;R<w;R++){var z=x[R>>>2]>>>24-R%4*8&255;E.push((z>>>4).toString(16)),E.push((z&15).toString(16));}return E.join("")},parse:function(h){for(var x=h.length,w=[],E=0;E<x;E+=2)w[E>>>3]|=parseInt(h.substr(E,2),16)<<24-E%8*4;return new f.init(w,x/2)}},S=p.Latin1={stringify:function(h){for(var x=h.words,w=h.sigBytes,E=[],R=0;R<w;R++){var z=x[R>>>2]>>>24-R%4*8&255;E.push(String.fromCharCode(z));}return E.join("")},parse:function(h){for(var x=h.length,w=[],E=0;E<x;E++)w[E>>>2]|=(h.charCodeAt(E)&255)<<24-E%4*8;return new f.init(w,x)}},v=p.Utf8={stringify:function(h){try{return decodeURIComponent(escape(S.stringify(h)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(h){return S.parse(unescape(encodeURIComponent(h)))}},A=c.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new f.init,this._nDataBytes=0;},_append:function(h){typeof h=="string"&&(h=v.parse(h)),this._data.concat(h),this._nDataBytes+=h.sigBytes;},_process:function(h){var x,w=this._data,E=w.words,R=w.sigBytes,z=this.blockSize,ye=z*4,q=R/ye;h?q=e.ceil(q):q=e.max((q|0)-this._minBufferSize,0);var ae=q*z,je=e.min(ae*4,R);if(ae){for(var zt=0;zt<ae;zt+=z)this._doProcessBlock(E,zt);x=E.splice(0,ae),w.sigBytes-=je;}return new f.init(x,je)},clone:function(){var h=l.clone.call(this);return h._data=this._data.clone(),h},_minBufferSize:0});c.Hasher=A.extend({cfg:l.extend(),init:function(h){this.cfg=this.cfg.extend(h),this.reset();},reset:function(){A.reset.call(this),this._doReset();},update:function(h){return this._append(h),this._process(),this},finalize:function(h){h&&this._append(h);var x=this._doFinalize();return x},blockSize:512/32,_createHelper:function(h){return function(x,w){return new h.init(w).finalize(x)}},_createHmacHelper:function(h){return function(x,w){return new P.HMAC.init(h,w).finalize(x)}}});var P=o.algo={};return o})(Math);return i});});var pi=li((Pt,di)=>{(function(i,e){typeof Pt=="object"?di.exports=Pt=e(ui()):typeof define=="function"&&define.amd?define(["./core"],e):e(i.CryptoJS);})(Pt,function(i){return (function(){var e=i,t=e.lib,r=t.WordArray,n=t.Hasher,s=e.algo,o=[],c=s.SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(l,f){for(var p=this._hash.words,g=p[0],S=p[1],v=p[2],A=p[3],I=p[4],P=0;P<80;P++){if(P<16)o[P]=l[f+P]|0;else {var h=o[P-3]^o[P-8]^o[P-14]^o[P-16];o[P]=h<<1|h>>>31;}var x=(g<<5|g>>>27)+I+o[P];P<20?x+=(S&v|~S&A)+1518500249:P<40?x+=(S^v^A)+1859775393:P<60?x+=(S&v|S&A|v&A)-1894007588:x+=(S^v^A)-899497514,I=A,A=v,v=S<<30|S>>>2,S=g,g=x;}p[0]=p[0]+g|0,p[1]=p[1]+S|0,p[2]=p[2]+v|0,p[3]=p[3]+A|0,p[4]=p[4]+I|0;},_doFinalize:function(){var l=this._data,f=l.words,p=this._nDataBytes*8,g=l.sigBytes*8;return f[g>>>5]|=128<<24-g%32,f[(g+64>>>9<<4)+14]=Math.floor(p/4294967296),f[(g+64>>>9<<4)+15]=p,l.sigBytes=f.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(c),e.HmacSHA1=n._createHmacHelper(c);})(),i.SHA1});});var rt="repeat";var fi=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],ce="__game_layer__",qe="Container",kt="ImageContainer",Vt="Image",Ue="Sprite",$e="Text",Ht="Video";var y;(n=>(n.log=(s,...o)=>console.log(`[Pixi\u2019VN] ${s}`,...o),n.warn=(s,...o)=>console.warn(`[Pixi\u2019VN] ${s}`,...o),n.error=(s,...o)=>console.error(`[Pixi\u2019VN] ${s}`,...o),n.info=(s,...o)=>console.info(`[Pixi\u2019VN] ${s}`,...o)))(y||(y={}));function H(i){try{if(typeof i>"u")return i;let e=JSON.stringify(i);return JSON.parse(e)}catch(e){throw y.error("Error creating exportable element",i,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}var gi=qi(pi());var Ui={extension:{type:"sceneProperties",name:"additional-positions"},testNode(i){return i instanceof O||i instanceof U||i instanceof B},testProp(i){switch(i){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(i,e,t){if(i instanceof O||i instanceof U||i instanceof B)switch(e){case "xAlign":i.xAlign=t/100;break;case "yAlign":i.yAlign=t/100;break;case "percentageX":i.percentageX=t/100;break;case "percentageY":i.percentageY=t/100;break}},getProperties(i){return [{value:i.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:i.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:i.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:i.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:i.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}}}]}},mi=Ui;function Xi(i,e){let t=0;return async(...r)=>{let n=Date.now();if(n-t>=e)return t=n,await i(...r)}}var k=class k{constructor(){}static get app(){if(!k._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return k._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(ce);return e||(e=new pixi_js.Container,e.label=ce,this.app.stage.addChild(e)),e}static async init(e,t,r,n,s){return k.canvasWidth=t,k.canvasHeight=r,k._app=new pixi_js.Application,k.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:r,...n}).then(()=>{let{app:o=k.app,extensions:c=[],...l}=s||{};devtools.initDevtools({app:o,extensions:[mi,...c],...l}),k._isInitialized=true,k.addCanvasIntoHTMLElement(e),window.addEventListener("resize",k.resize),k.resize(),k.gameLayer;})}static addCanvasIntoHTMLElement(e){k._isInitialized?e.appendChild(k.app.canvas):y.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,r={position:"absolute",pointerEvents:"none"}){let n=document.createElement("div");n.setAttribute("id",e),n.style.position=r.position,n.style.pointerEvents=r.pointerEvents;let s=t.appendChild(n);return k.htmlLayers.push(n),k.resize(),s}static removeHtmlLayer(e){let t=k.htmlLayers.find(r=>r.id===e);t&&(t.remove(),k.htmlLayers=k.htmlLayers.filter(r=>r.id!==e));}static getHtmlLayer(e){return k.htmlLayers.find(t=>t.id===e)}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/k.canvasWidth,t/k.canvasHeight)}static get screenWidth(){return Math.floor(k.screenScale*k.canvasWidth)}static get screenHeight(){return Math.floor(k.screenScale*k.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-k.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-k.screenHeight)/2}static async resize(){await Xi(async()=>{if(k._isInitialized){let r=k.app.canvas.style;r.width=`${k.screenWidth}px`,r.height=`${k.screenHeight}px`,r.marginLeft=`${k.horizontalMargin}px`,r.marginRight=`${k.horizontalMargin}px`,r.marginTop=`${k.verticalMargin}px`,r.marginBottom=`${k.verticalMargin}px`;}let t=k.htmlLayers.map(r=>{r.style.width=`${k.screenWidth}px`,r.style.height=`${k.screenHeight}px`,r.style.marginLeft=`${k.horizontalMargin}px`,r.style.marginRight=`${k.horizontalMargin}px`,r.style.marginTop=`${k.verticalMargin}px`,r.style.marginBottom=`${k.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return k.gameLayer.children.filter(e=>e.label).sort((e,t)=>k.gameLayer.getChildIndex(e)-k.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(k._currentTickers).filter(([e,t])=>!t.createdByTicketSteps).map(([e,t])=>[e,{id:t.ticker.id,args:t.ticker.args,canvasElementAliases:t.ticker.canvasElementAliases,priority:t.ticker.priority,duration:t.ticker.duration,paused:t.ticker.paused}]))}static generateTickerId(e){try{return (0,gi.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,r,n){typeof e=="string"&&(e=[e]),k._currentTickersTimeouts[r]={aliases:e,ticker:t,canBeDeletedBeforeEnd:n};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),k._currentTickersTimeouts[e]&&delete k._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),k.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(k._currentTickersTimeouts).forEach(([r,n])=>{let s=n.aliases.filter(o=>o!==e);if(s.length===0){let o=n.canBeDeletedBeforeEnd;(!t||o)&&k.removeTickerTimeout(r);}else k._currentTickersTimeouts[r].aliases=s;});}};m(k,"_app"),m(k,"htmlLayers",[]),m(k,"canvasWidth",300),m(k,"canvasHeight",300),m(k,"_isInitialized",false),m(k,"_currentTickers",{}),m(k,"_currentTickersSequence",{}),m(k,"_currentTickersTimeouts",{}),m(k,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),m(k,"_tickersOnPause",{});var d=k;var Ge=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,vi=new Set,jt=typeof process=="object"&&process?process:{},ki=(i,e,t,r)=>{typeof jt.emitWarning=="function"?jt.emitWarning(i,e,t,r):console.error(`[${t}] ${e}: ${i}`);},bt=globalThis.AbortController,yi=globalThis.AbortSignal;if(typeof bt>"u"){yi=class{constructor(){m(this,"onabort");m(this,"_onabort",[]);m(this,"reason");m(this,"aborted",false);}addEventListener(r,n){this._onabort.push(n);}},bt=class{constructor(){m(this,"signal",new yi);e();}abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=true;for(let n of this.signal._onabort)n(r);this.signal.onabort?.(r);}}};let i=jt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{i&&(i=false,ki("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 Zi=i=>!vi.has(i),Ie=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),_i=i=>Ie(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?Ke:null:null,Ke=class extends Array{constructor(e){super(e),this.fill(0);}},Xe,Re=class Re{constructor(e,t){m(this,"heap");m(this,"length");if(!a(Re,Xe))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=_i(e);if(!t)return [];b(Re,Xe,true);let r=new Re(e,t);return b(Re,Xe,false),r}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};Xe=new WeakMap,M(Re,Xe,false);var qt=Re,Ti,xi,le,J,fe,Be,he,Ze,Je,N,ue,F,L,C,$,Q,j,Y,de,V,pe,me,ee,ge,we,G,Qe,T,Ut,De,_e,st,te,Pi,Le,et,ot,be,Ee,$t,St,It,D,Gt,nt,Ce,Kt,Xt=class Xt{constructor(e){M(this,T);M(this,le);M(this,J);M(this,fe);M(this,Be);M(this,he);M(this,Ze);M(this,Je);m(this,"ttl");m(this,"ttlResolution");m(this,"ttlAutopurge");m(this,"updateAgeOnGet");m(this,"updateAgeOnHas");m(this,"allowStale");m(this,"noDisposeOnSet");m(this,"noUpdateTTL");m(this,"maxEntrySize");m(this,"sizeCalculation");m(this,"noDeleteOnFetchRejection");m(this,"noDeleteOnStaleGet");m(this,"allowStaleOnFetchAbort");m(this,"allowStaleOnFetchRejection");m(this,"ignoreFetchAbort");M(this,N);M(this,ue);M(this,F);M(this,L);M(this,C);M(this,$);M(this,Q);M(this,j);M(this,Y);M(this,de);M(this,V);M(this,pe);M(this,me);M(this,ee);M(this,ge);M(this,we);M(this,G);M(this,Qe);M(this,De,()=>{});M(this,_e,()=>{});M(this,st,()=>{});M(this,te,()=>false);M(this,Le,e=>{});M(this,et,(e,t,r)=>{});M(this,ot,(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});m(this,Ti,"LRUCache");let{max:t=0,ttl:r,ttlResolution:n=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:f,onInsert:p,disposeAfter:g,noDisposeOnSet:S,noUpdateTTL:v,maxSize:A=0,maxEntrySize:I=0,sizeCalculation:P,fetchMethod:h,memoMethod:x,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:z,ignoreFetchAbort:ye}=e;if(t!==0&&!Ie(t))throw new TypeError("max option must be a nonnegative integer");let q=t?_i(t):Array;if(!q)throw new Error("invalid max value: "+t);if(b(this,le,t),b(this,J,A),this.maxEntrySize=I||a(this,J),this.sizeCalculation=P,this.sizeCalculation){if(!a(this,J)&&!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(b(this,Je,x),h!==void 0&&typeof h!="function")throw new TypeError("fetchMethod must be a function if specified");if(b(this,Ze,h),b(this,we,!!h),b(this,F,new Map),b(this,L,new Array(t).fill(void 0)),b(this,C,new Array(t).fill(void 0)),b(this,$,new q(t)),b(this,Q,new q(t)),b(this,j,0),b(this,Y,0),b(this,de,qt.create(t)),b(this,N,0),b(this,ue,0),typeof f=="function"&&b(this,fe,f),typeof p=="function"&&b(this,Be,p),typeof g=="function"?(b(this,he,g),b(this,V,[])):(b(this,he,void 0),b(this,V,void 0)),b(this,ge,!!a(this,fe)),b(this,Qe,!!a(this,Be)),b(this,G,!!a(this,he)),this.noDisposeOnSet=!!S,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!ye,this.maxEntrySize!==0){if(a(this,J)!==0&&!Ie(a(this,J)))throw new TypeError("maxSize must be a positive integer if specified");if(!Ie(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");_(this,T,Pi).call(this);}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=Ie(n)||n===0?n:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!Ie(this.ttl))throw new TypeError("ttl must be a positive integer if specified");_(this,T,Ut).call(this);}if(a(this,le)===0&&this.ttl===0&&a(this,J)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!a(this,le)&&!a(this,J)){let ae="LRU_CACHE_UNBOUNDED";Zi(ae)&&(vi.add(ae),ki("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ae,Xt));}}static unsafeExposeInternals(e){return {starts:a(e,me),ttls:a(e,ee),sizes:a(e,pe),keyMap:a(e,F),keyList:a(e,L),valList:a(e,C),next:a(e,$),prev:a(e,Q),get head(){return a(e,j)},get tail(){return a(e,Y)},free:a(e,de),isBackgroundFetch:t=>{var r;return _(r=e,T,D).call(r,t)},backgroundFetch:(t,r,n,s)=>{var o;return _(o=e,T,It).call(o,t,r,n,s)},moveToTail:t=>{var r;return _(r=e,T,nt).call(r,t)},indexes:t=>{var r;return _(r=e,T,be).call(r,t)},rindexes:t=>{var r;return _(r=e,T,Ee).call(r,t)},isStale:t=>{var r;return a(r=e,te).call(r,t)}}}get max(){return a(this,le)}get maxSize(){return a(this,J)}get calculatedSize(){return a(this,ue)}get size(){return a(this,N)}get fetchMethod(){return a(this,Ze)}get memoMethod(){return a(this,Je)}get dispose(){return a(this,fe)}get onInsert(){return a(this,Be)}get disposeAfter(){return a(this,he)}getRemainingTTL(e){return a(this,F).has(e)?1/0:0}*entries(){for(let e of _(this,T,be).call(this))a(this,C)[e]!==void 0&&a(this,L)[e]!==void 0&&!_(this,T,D).call(this,a(this,C)[e])&&(yield [a(this,L)[e],a(this,C)[e]]);}*rentries(){for(let e of _(this,T,Ee).call(this))a(this,C)[e]!==void 0&&a(this,L)[e]!==void 0&&!_(this,T,D).call(this,a(this,C)[e])&&(yield [a(this,L)[e],a(this,C)[e]]);}*keys(){for(let e of _(this,T,be).call(this)){let t=a(this,L)[e];t!==void 0&&!_(this,T,D).call(this,a(this,C)[e])&&(yield t);}}*rkeys(){for(let e of _(this,T,Ee).call(this)){let t=a(this,L)[e];t!==void 0&&!_(this,T,D).call(this,a(this,C)[e])&&(yield t);}}*values(){for(let e of _(this,T,be).call(this))a(this,C)[e]!==void 0&&!_(this,T,D).call(this,a(this,C)[e])&&(yield a(this,C)[e]);}*rvalues(){for(let e of _(this,T,Ee).call(this))a(this,C)[e]!==void 0&&!_(this,T,D).call(this,a(this,C)[e])&&(yield a(this,C)[e]);}[(xi=Symbol.iterator,Ti=Symbol.toStringTag,xi)](){return this.entries()}find(e,t={}){for(let r of _(this,T,be).call(this)){let n=a(this,C)[r],s=_(this,T,D).call(this,n)?n.__staleWhileFetching:n;if(s!==void 0&&e(s,a(this,L)[r],this))return this.get(a(this,L)[r],t)}}forEach(e,t=this){for(let r of _(this,T,be).call(this)){let n=a(this,C)[r],s=_(this,T,D).call(this,n)?n.__staleWhileFetching:n;s!==void 0&&e.call(t,s,a(this,L)[r],this);}}rforEach(e,t=this){for(let r of _(this,T,Ee).call(this)){let n=a(this,C)[r],s=_(this,T,D).call(this,n)?n.__staleWhileFetching:n;s!==void 0&&e.call(t,s,a(this,L)[r],this);}}purgeStale(){let e=false;for(let t of _(this,T,Ee).call(this,{allowStale:true}))a(this,te).call(this,t)&&(_(this,T,Ce).call(this,a(this,L)[t],"expire"),e=true);return e}info(e){let t=a(this,F).get(e);if(t===void 0)return;let r=a(this,C)[t],n=_(this,T,D).call(this,r)?r.__staleWhileFetching:r;if(n===void 0)return;let s={value:n};if(a(this,ee)&&a(this,me)){let o=a(this,ee)[t],c=a(this,me)[t];if(o&&c){let l=o-(Ge.now()-c);s.ttl=l,s.start=Date.now();}}return a(this,pe)&&(s.size=a(this,pe)[t]),s}dump(){let e=[];for(let t of _(this,T,be).call(this,{allowStale:true})){let r=a(this,L)[t],n=a(this,C)[t],s=_(this,T,D).call(this,n)?n.__staleWhileFetching:n;if(s===void 0||r===void 0)continue;let o={value:s};if(a(this,ee)&&a(this,me)){o.ttl=a(this,ee)[t];let c=Ge.now()-a(this,me)[t];o.start=Math.floor(Date.now()-c);}a(this,pe)&&(o.size=a(this,pe)[t]),e.unshift([r,o]);}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let n=Date.now()-r.start;r.start=Ge.now()-n;}this.set(t,r.value,r);}}set(e,t,r={}){var S,v,A,I;if(t===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=r,{noUpdateTTL:f=this.noUpdateTTL}=r,p=a(this,ot).call(this,e,t,r.size||0,c);if(this.maxEntrySize&&p>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),_(this,T,Ce).call(this,e,"set"),this;let g=a(this,N)===0?void 0:a(this,F).get(e);if(g===void 0)g=a(this,N)===0?a(this,Y):a(this,de).length!==0?a(this,de).pop():a(this,N)===a(this,le)?_(this,T,St).call(this,false):a(this,N),a(this,L)[g]=e,a(this,C)[g]=t,a(this,F).set(e,g),a(this,$)[a(this,Y)]=g,a(this,Q)[g]=a(this,Y),b(this,Y,g),vt(this,N)._++,a(this,et).call(this,g,p,l),l&&(l.set="add"),f=false,a(this,Qe)&&((S=a(this,Be))==null||S.call(this,t,e,"add"));else {_(this,T,nt).call(this,g);let P=a(this,C)[g];if(t!==P){if(a(this,we)&&_(this,T,D).call(this,P)){P.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=P;h!==void 0&&!o&&(a(this,ge)&&((v=a(this,fe))==null||v.call(this,h,e,"set")),a(this,G)&&a(this,V)?.push([h,e,"set"]));}else o||(a(this,ge)&&((A=a(this,fe))==null||A.call(this,P,e,"set")),a(this,G)&&a(this,V)?.push([P,e,"set"]));if(a(this,Le).call(this,g),a(this,et).call(this,g,p,l),a(this,C)[g]=t,l){l.set="replace";let h=P&&_(this,T,D).call(this,P)?P.__staleWhileFetching:P;h!==void 0&&(l.oldValue=h);}}else l&&(l.set="update");a(this,Qe)&&this.onInsert?.(t,e,t===P?"update":"replace");}if(n!==0&&!a(this,ee)&&_(this,T,Ut).call(this),a(this,ee)&&(f||a(this,st).call(this,g,n,s),l&&a(this,_e).call(this,l,g)),!o&&a(this,G)&&a(this,V)){let P=a(this,V),h;for(;h=P?.shift();)(I=a(this,he))==null||I.call(this,...h);}return this}pop(){var e;try{for(;a(this,N);){let t=a(this,C)[a(this,j)];if(_(this,T,St).call(this,!0),_(this,T,D).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(a(this,G)&&a(this,V)){let t=a(this,V),r;for(;r=t?.shift();)(e=a(this,he))==null||e.call(this,...r);}}}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,s=a(this,F).get(e);if(s!==void 0){let o=a(this,C)[s];if(_(this,T,D).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(a(this,te).call(this,s))n&&(n.has="stale",a(this,_e).call(this,n,s));else return r&&a(this,De).call(this,s),n&&(n.has="hit",a(this,_e).call(this,n,s)),true}else n&&(n.has="miss");return false}peek(e,t={}){let{allowStale:r=this.allowStale}=t,n=a(this,F).get(e);if(n===void 0||!r&&a(this,te).call(this,n))return;let s=a(this,C)[n];return _(this,T,D).call(this,s)?s.__staleWhileFetching:s}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:p=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:S=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:I,forceRefresh:P=false,status:h,signal:x}=t;if(!a(this,we))return h&&(h.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:s,status:h});let w={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:f,noUpdateTTL:p,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:A,ignoreFetchAbort:v,status:h,signal:x},E=a(this,F).get(e);if(E===void 0){h&&(h.fetch="miss");let R=_(this,T,It).call(this,e,E,w,I);return R.__returned=R}else {let R=a(this,C)[E];if(_(this,T,D).call(this,R)){let je=r&&R.__staleWhileFetching!==void 0;return h&&(h.fetch="inflight",je&&(h.returnedStale=true)),je?R.__staleWhileFetching:R.__returned=R}let z=a(this,te).call(this,E);if(!P&&!z)return h&&(h.fetch="hit"),_(this,T,nt).call(this,E),n&&a(this,De).call(this,E),h&&a(this,_e).call(this,h,E),R;let ye=_(this,T,It).call(this,e,E,w,I),ae=ye.__staleWhileFetching!==void 0&&r;return h&&(h.fetch=z?"stale":"refresh",ae&&z&&(h.returnedStale=true)),ae?ye.__staleWhileFetching:ye.__returned=ye}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=a(this,Je);if(!r)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:s,...o}=t,c=this.get(e,o);if(!s&&c!==void 0)return c;let l=r(e,c,{options:o,context:n});return this.set(e,l,o),l}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=a(this,F).get(e);if(c!==void 0){let l=a(this,C)[c],f=_(this,T,D).call(this,l);return o&&a(this,_e).call(this,o,c),a(this,te).call(this,c)?(o&&(o.get="stale"),f?(o&&r&&l.__staleWhileFetching!==void 0&&(o.returnedStale=true),r?l.__staleWhileFetching:void 0):(s||_(this,T,Ce).call(this,e,"expire"),o&&r&&(o.returnedStale=true),r?l:void 0)):(o&&(o.get="hit"),f?l.__staleWhileFetching:(_(this,T,nt).call(this,c),n&&a(this,De).call(this,c),l))}else o&&(o.get="miss");}delete(e){return _(this,T,Ce).call(this,e,"delete")}clear(){return _(this,T,Kt).call(this,"delete")}};le=new WeakMap,J=new WeakMap,fe=new WeakMap,Be=new WeakMap,he=new WeakMap,Ze=new WeakMap,Je=new WeakMap,N=new WeakMap,ue=new WeakMap,F=new WeakMap,L=new WeakMap,C=new WeakMap,$=new WeakMap,Q=new WeakMap,j=new WeakMap,Y=new WeakMap,de=new WeakMap,V=new WeakMap,pe=new WeakMap,me=new WeakMap,ee=new WeakMap,ge=new WeakMap,we=new WeakMap,G=new WeakMap,Qe=new WeakMap,T=new WeakSet,Ut=function(){let e=new Ke(a(this,le)),t=new Ke(a(this,le));b(this,ee,e),b(this,me,t),b(this,st,(s,o,c=Ge.now())=>{if(t[s]=o!==0?c:0,e[s]=o,o!==0&&this.ttlAutopurge){let l=setTimeout(()=>{a(this,te).call(this,s)&&_(this,T,Ce).call(this,a(this,L)[s],"expire");},o+1);l.unref&&l.unref();}}),b(this,De,s=>{t[s]=e[s]!==0?Ge.now():0;}),b(this,_e,(s,o)=>{if(e[o]){let c=e[o],l=t[o];if(!c||!l)return;s.ttl=c,s.start=l,s.now=r||n();let f=s.now-l;s.remainingTTL=c-f;}});let r=0,n=()=>{let s=Ge.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref();}return s};this.getRemainingTTL=s=>{let o=a(this,F).get(s);if(o===void 0)return 0;let c=e[o],l=t[o];if(!c||!l)return 1/0;let f=(r||n())-l;return c-f},b(this,te,s=>{let o=t[s],c=e[s];return !!c&&!!o&&(r||n())-o>c});},De=new WeakMap,_e=new WeakMap,st=new WeakMap,te=new WeakMap,Pi=function(){let e=new Ke(a(this,le));b(this,ue,0),b(this,pe,e),b(this,Le,t=>{b(this,ue,a(this,ue)-e[t]),e[t]=0;}),b(this,ot,(t,r,n,s)=>{if(_(this,T,D).call(this,r))return 0;if(!Ie(n))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(n=s(r,t),!Ie(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}),b(this,et,(t,r,n)=>{if(e[t]=r,a(this,J)){let s=a(this,J)-e[t];for(;a(this,ue)>s;)_(this,T,St).call(this,true);}b(this,ue,a(this,ue)+e[t]),n&&(n.entrySize=r,n.totalCalculatedSize=a(this,ue));});},Le=new WeakMap,et=new WeakMap,ot=new WeakMap,be=function*({allowStale:e=this.allowStale}={}){if(a(this,N))for(let t=a(this,Y);!(!_(this,T,$t).call(this,t)||((e||!a(this,te).call(this,t))&&(yield t),t===a(this,j)));)t=a(this,Q)[t];},Ee=function*({allowStale:e=this.allowStale}={}){if(a(this,N))for(let t=a(this,j);!(!_(this,T,$t).call(this,t)||((e||!a(this,te).call(this,t))&&(yield t),t===a(this,Y)));)t=a(this,$)[t];},$t=function(e){return e!==void 0&&a(this,F).get(a(this,L)[e])===e},St=function(e){var s;let t=a(this,j),r=a(this,L)[t],n=a(this,C)[t];return a(this,we)&&_(this,T,D).call(this,n)?n.__abortController.abort(new Error("evicted")):(a(this,ge)||a(this,G))&&(a(this,ge)&&((s=a(this,fe))==null||s.call(this,n,r,"evict")),a(this,G)&&a(this,V)?.push([n,r,"evict"])),a(this,Le).call(this,t),e&&(a(this,L)[t]=void 0,a(this,C)[t]=void 0,a(this,de).push(t)),a(this,N)===1?(b(this,j,b(this,Y,0)),a(this,de).length=0):b(this,j,a(this,$)[t]),a(this,F).delete(r),vt(this,N)._--,t},It=function(e,t,r,n){let s=t===void 0?void 0:a(this,C)[t];if(_(this,T,D).call(this,s))return s;let o=new bt,{signal:c}=r;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:r,context:n},f=(I,P=false)=>{let{aborted:h}=o.signal,x=r.ignoreFetchAbort&&I!==void 0;if(r.status&&(h&&!P?(r.status.fetchAborted=true,r.status.fetchError=o.signal.reason,x&&(r.status.fetchAbortIgnored=true)):r.status.fetchResolved=true),h&&!x&&!P)return g(o.signal.reason);let w=v;return a(this,C)[t]===v&&(I===void 0?w.__staleWhileFetching?a(this,C)[t]=w.__staleWhileFetching:_(this,T,Ce).call(this,e,"fetch"):(r.status&&(r.status.fetchUpdated=true),this.set(e,I,l.options))),I},p=I=>(r.status&&(r.status.fetchRejected=true,r.status.fetchError=I),g(I)),g=I=>{let{aborted:P}=o.signal,h=P&&r.allowStaleOnFetchAbort,x=h||r.allowStaleOnFetchRejection,w=x||r.noDeleteOnFetchRejection,E=v;if(a(this,C)[t]===v&&(!w||E.__staleWhileFetching===void 0?_(this,T,Ce).call(this,e,"fetch"):h||(a(this,C)[t]=E.__staleWhileFetching)),x)return r.status&&E.__staleWhileFetching!==void 0&&(r.status.returnedStale=true),E.__staleWhileFetching;if(E.__returned===E)throw I},S=(I,P)=>{var x;let h=(x=a(this,Ze))==null?void 0:x.call(this,e,s,l);h&&h instanceof Promise&&h.then(w=>I(w===void 0?void 0:w),P),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(I(void 0),r.allowStaleOnFetchAbort&&(I=w=>f(w,true)));});};r.status&&(r.status.fetchDispatched=true);let v=new Promise(S).then(f,p),A=Object.assign(v,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,A,{...l.options,status:void 0}),t=a(this,F).get(e)):a(this,C)[t]=A,A},D=function(e){if(!a(this,we))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof bt},Gt=function(e,t){a(this,Q)[t]=e,a(this,$)[e]=t;},nt=function(e){e!==a(this,Y)&&(e===a(this,j)?b(this,j,a(this,$)[e]):_(this,T,Gt).call(this,a(this,Q)[e],a(this,$)[e]),_(this,T,Gt).call(this,a(this,Y),e),b(this,Y,e));},Ce=function(e,t){var n,s;let r=false;if(a(this,N)!==0){let o=a(this,F).get(e);if(o!==void 0)if(r=true,a(this,N)===1)_(this,T,Kt).call(this,t);else {a(this,Le).call(this,o);let c=a(this,C)[o];if(_(this,T,D).call(this,c)?c.__abortController.abort(new Error("deleted")):(a(this,ge)||a(this,G))&&(a(this,ge)&&((n=a(this,fe))==null||n.call(this,c,e,t)),a(this,G)&&a(this,V)?.push([c,e,t])),a(this,F).delete(e),a(this,L)[o]=void 0,a(this,C)[o]=void 0,o===a(this,Y))b(this,Y,a(this,Q)[o]);else if(o===a(this,j))b(this,j,a(this,$)[o]);else {let l=a(this,Q)[o];a(this,$)[l]=a(this,$)[o];let f=a(this,$)[o];a(this,Q)[f]=a(this,Q)[o];}vt(this,N)._--,a(this,de).push(o);}}if(a(this,G)&&a(this,V)?.length){let o=a(this,V),c;for(;c=o?.shift();)(s=a(this,he))==null||s.call(this,...c);}return r},Kt=function(e){var t,r;for(let n of _(this,T,Ee).call(this,{allowStale:true})){let s=a(this,C)[n];if(_(this,T,D).call(this,s))s.__abortController.abort(new Error("deleted"));else {let o=a(this,L)[n];a(this,ge)&&((t=a(this,fe))==null||t.call(this,s,o,e)),a(this,G)&&a(this,V)?.push([s,o,e]);}}if(a(this,F).clear(),a(this,C).fill(void 0),a(this,L).fill(void 0),a(this,ee)&&a(this,me)&&(a(this,ee).fill(0),a(this,me).fill(0)),a(this,pe)&&a(this,pe).fill(0),b(this,j,0),b(this,Y,0),a(this,de).length=0,b(this,ue,0),b(this,N,0),a(this,G)&&a(this,V)){let n=a(this,V),s;for(;s=n?.shift();)(r=a(this,he))==null||r.call(this,...s);}};var Et=Xt;var Te=class{constructor(e){m(this,"cache");m(this,"map",new Map);this.cache=new Et({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var at=new Te({cacheSize:5});function Ji(i){return function(e){Ct.add(e,i);}}var Ct;(n=>{function i(s,o){o||(o=s.name),at.get(o)&&y.warn(`CanvasElement "${o}" already registered`),s.prototype.pixivnId=o,at.set(o,s);}n.add=i;function e(s){try{let o=at.get(s);if(!o){y.error(`CanvasElement "${s}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){y.error(`Error while getting CanvasElement "${s}"`,o);return}}n.get=e;function t(){return Array.from(at.values())}n.values=t;function r(s){return at.has(s)}n.has=r;})(Ct||(Ct={}));var K=Ct;var tt=new Te({cacheSize:5});function Qi(i){return function(e){wt.add(e,i);}}var wt;(s=>{function i(o,c){c||(c=o.name),tt.get(c)&&y.info(`Event "${c}" already exists, it will be overwritten`),o.prototype.id=c,tt.set(c,o);}s.add=i;function e(o){try{let c=tt.get(o);if(!c){y.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new c,c}catch(c){y.error(`Error while getting Event "${o}"`,c);return}}s.get=e;function t(o){try{let c=tt.get(o);if(!c){y.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new c}catch(c){y.error(`Error while getting Event "${o}"`,c);return}}s.getInstance=t;function r(){return Array.from(tt.values())}s.values=r;function n(o){return tt.has(o)}s.has=n;})(wt||(wt={}));var Pe=wt;async function At(i){let e=er(i.pixivnId);if(e)await e.setMemory(i);else throw new Error("[Pixi\u2019VN] The element "+i.pixivnId+" could not be created");return e}function er(i){try{let e=K.get(i);return e?new e:void 0}catch(e){y.error(`Error while getting CanvasElement ${i}`,e);return}}function Zt(i){return "memory"in i?i.memory:i instanceof pixi_js.Text?Jt(i):i instanceof pixi_js.Sprite?ct(i):We(i)}function rr(i){return {width:i.width,height:i.height,isRenderGroup:i.isRenderGroup,blendMode:i.blendMode,tint:i.tint,alpha:i.alpha,angle:i.angle,renderable:i.renderable,rotation:i.rotation,scale:{x:i.scale.x,y:i.scale.y},pivot:{x:i.pivot.x,y:i.pivot.y},position:{x:i.position.x,y:i.position.y},skew:{x:i.skew.x,y:i.skew.y},visible:i.visible,x:i.x,y:i.y,boundsArea:i.boundsArea,cursor:i.cursor,eventMode:i.eventMode,interactive:i.interactive,interactiveChildren:i.interactiveChildren,hitArea:i.hitArea}}function Si(i,e){return {url:i.source.label,alias:e===i.source.label?void 0:e}}function We(i,e){let t=nr(i,qe),n=e?.childrenExport||false?i.children.sort((s,o)=>i.getChildIndex(s)-i.getChildIndex(o)).map(s=>Zt(s)):[];return {pixivnId:t,elements:n,...rr(i)}}function ct(i){let e=We(i),t=e.pixivnId??Ue,r=bi(i),n="textureAlias"in i?Si(i.texture,i.textureAlias):Si(i.texture);return {...e,pixivnId:t,textureData:n,anchor:{x:i.anchor.x,y:i.anchor.y},roundPixels:i.roundPixels,onEvents:r}}function Jt(i){let e=We(i),t=e.pixivnId??$e,r=bi(i);return {...e,pixivnId:t,anchor:{x:i.anchor.x,y:i.anchor.y},text:i.text,resolution:i.resolution,style:sr(i.style),roundPixels:i.roundPixels,onEvents:r}}function nr(i,e){return Object.prototype.hasOwnProperty.call(i,"pixivnId")?i.pixivnId:e}function bi(i){return "onEvents"in i?i.onEvents:{}}function Ii(i,e){if(typeof i!="object"||i===null)return i;y.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,i);}function sr(i){return {align:i.align,breakWords:i.breakWords,dropShadow:i.dropShadow,fill:Ii(i.stroke,"fill"),fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontVariant:i.fontVariant,fontWeight:i.fontWeight,leading:i.leading,letterSpacing:i.letterSpacing,lineHeight:i.lineHeight,padding:i.padding,stroke:Ii(i.stroke,"stroke"),textBaseline:i.textBaseline,trim:i.trim,whiteSpace:i.whiteSpace,wordWrap:i.wordWrap,wordWrapWidth:i.wordWrapWidth}}var ze=class extends pixi_js.Container{constructor(t){super(t);m(this,"pixivnId",qe);m(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||qe;}get memory(){return We(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await xe(this,t)}async importChildren(t){for(let r=0;r<t.elements.length;r++){let n=t.elements[r],s=await At(n);this.addChild(s);}}get onEvents(){return this._onEvents}onEvent(t,r){let n=r.prototype.id,s=Pe.getInstance(n);return this._onEvents[t]=n,s?super.on(t,()=>{s.fn(t,this);}):y.error(`Event ${n} not found`),this}on(t,r,n){return super.on(t,r,n)}};K.add(ze,qe);async function xe(i,e,t){let r=t?.ignoreScale||false,n=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(i.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(i.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(i.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(i.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(i.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(i.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(i.rotation=e.rotation),!r&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?i.scale.set(e.scale,e.scale):i.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?i.pivot.set(e.pivot,e.pivot):i.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&i.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&i.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(i.visible=e.visible),"x"in e&&e.x!==void 0&&(i.x=e.x),"y"in e&&e.y!==void 0&&(i.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(i.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(i.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(i.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(i.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(i.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(i.hitArea=e.hitArea),n&&await n(),r||("width"in e&&e.width!==void 0&&(i.width=e.width),"height"in e&&e.height!==void 0&&(i.height=e.height));}var lt=class lt{static init(e){lt._getScreen=e.getScreen;}static get screen(){return lt._getScreen()}};m(lt,"_getScreen");var Z=lt;function ie(i,e,t,r,n,s=0){return r=r*(n?-1:1),i==="width"?e*(Z.screen.width-t)+r+s*t+(n?t:0):e*(Z.screen.height-t)+r+s*t+(n?t:0)}function ve(i,e,t,r,n,s=0){return r=r*(n?-1:1),i==="width"?(e-r-s*t-(n?t:0))/(Z.screen.width-t):(e-r-s*t-(n?t:0))/(Z.screen.height-t)}function re(i,e){return i==="width"?e*Z.screen.width:e*Z.screen.height}function ke(i,e){return i==="width"?e/Z.screen.width:e/Z.screen.height}function W(i,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:i.x,y:i.y};if(e===90)return {x:-i.y,y:i.x};if(e===180)return {x:-i.x,y:-i.y};if(e===270)return {x:i.y,y:-i.x};if(e>0&&e<90){let t=e*Math.PI/180,r=Math.cos(t),n=Math.sin(t),s=i.x*r-i.y*n,o=i.x*n+i.y*r;return i.x!==0&&Math.sign(s)!==Math.sign(i.x)&&(s=-s),i.y!==0&&Math.sign(o)!==Math.sign(i.y)&&(o=-o),{x:s,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,r=Math.cos(t),n=Math.sin(t),s=-i.y*n-i.x*r,o=i.y*r-i.x*n;return i.x!==0&&Math.sign(s)!==Math.sign(i.x)&&(s=-s),i.y!==0&&Math.sign(o)!==Math.sign(i.y)&&(o=-o),{x:s,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,r=Math.cos(t),n=Math.sin(t),s=-i.x*r+i.y*n,o=-i.x*n-i.y*r;return i.x!==0&&Math.sign(s)!==Math.sign(i.x)&&(s=-s),i.y!==0&&Math.sign(o)!==Math.sign(i.y)&&(o=-o),{x:s,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,r=Math.cos(t),n=Math.sin(t),s=i.y*n-i.x*r,o=-i.y*r-i.x*n;return i.x!==0&&Math.sign(s)!==Math.sign(i.x)&&(s=-s),i.y!==0&&Math.sign(o)!==Math.sign(i.y)&&(o=-o),{x:s,y:o}}return {x:0,y:0}}function Qt(i,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:i.x,y:i.y};if(e===90)return {x:i.y,y:-i.x};if(e===180)return {x:-i.x,y:-i.y};if(e===270)return {x:-i.y,y:i.x};if(e>0&&e<90){let t=e*Math.PI/180,r=Math.cos(t),n=Math.sin(t);return {x:i.x*r+i.y*n,y:-i.x*n+i.y*r}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,r=Math.cos(t),n=Math.sin(t);return {x:i.y*r-i.x*n,y:-i.y*n-i.x*r}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,r=Math.cos(t),n=Math.sin(t);return {x:-i.x*r-i.y*n,y:i.x*n-i.y*r}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,r=Math.cos(t),n=Math.sin(t);return {x:-i.y*r+i.x*n,y:i.y*n+i.x*r}}return {x:0,y:0}}function ne(i){let e=i.width,t=i.height,r=i.angle%360;return r<0&&(r+=360),r===0||r===180?e:r===90||r===270?t:Math.abs(e*Math.cos(r*Math.PI/180))+Math.abs(t*Math.sin(r*Math.PI/180))}function se(i){let e=i.width,t=i.height,r=i.angle%360;return r<0&&(r+=360),r===0||r===180?t:r===90||r===270?e:Math.abs(t*Math.cos(r*Math.PI/180))+Math.abs(e*Math.sin(r*Math.PI/180))}var cr=new RegExp(`(${fi.join("|")})$`);function ft(i){let e=pixi_js.Assets.cache.has(i)?pixi_js.Assets.get(i):null;return e instanceof pixi_js.Texture&&(i=e.source?.label||i),cr.test(i)}function Fe(i){return i&&(typeof i.align!="number"&&(i.xAlign!=null&&(i.align===void 0?(i.align={x:i.xAlign},delete i.xAlign):(i.align.x=i.xAlign,delete i.xAlign)),i.yAlign!=null&&(i.align===void 0?(i.align={y:i.yAlign},delete i.yAlign):(i.align.y=i.yAlign,delete i.yAlign))),typeof i.percentagePosition!="number"&&(i.xPercentagePosition!=null&&i.percentageX===void 0&&(i.percentageX=i.xPercentagePosition),i.yPercentagePosition!=null&&i.percentageY===void 0&&(i.percentageY=i.yPercentagePosition),i.percentageX!=null&&(i.percentagePosition===void 0?(i.percentagePosition={x:i.percentageX},delete i.percentageX):(i.percentagePosition.x=i.percentageX,delete i.percentageX)),i.percentageY!=null&&(i.percentagePosition===void 0?(i.percentagePosition={y:i.percentageY},delete i.percentageY):(i.percentagePosition.y=i.percentageY,delete i.percentageY))),i)}async function it(i){if(i!=="EMPTY"){if(!i){y.error("Texture not found",i);return}if(pixi_js.Assets.cache.has(i)){let e=pixi_js.Assets.get(i);if(e)return e}return pixi_js.Assets.load(i).then(e=>{if(!e){y.error("Texture not found",i);return}if(!(e instanceof pixi_js.Texture)){y.error("File not is a file",i);return}return e}).catch(e=>{y.error("Error loading file",e);})}}var Se=class i extends pixi_js.Sprite{constructor(t){super(t);m(this,"pixivnId",Ue);m(this,"_textureAlias");m(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Ue;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return ct(this)}set memory(t){}async setMemory(t){return this.memory=t,await ht(this,t)}get onEvents(){return this._onEvents}onEvent(t,r){let n=r.prototype.id,s=Pe.getInstance(n);return this._onEvents[t]=n,s?(super.on(t,()=>{s.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):y.error(`Event ${n} not found`),this}on(t,r,n){return super.on(t,r,n)}static from(t,r){let n=pixi_js.Sprite.from(t,r),s=new i;return s.texture=n.texture,s}};K.add(Se,Ue);async function ht(i,e,t){let r=t?.ignoreTexture||false;if(await xe(i,e),!r){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let s=await it(e.textureImage.image);s&&(i.texture=s);}if("textureData"in e&&(e.textureData.alias&&(i.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let s=e.textureData.url;e.textureData.alias&&pixi_js.Assets.resolver.hasKey(e.textureData.alias)&&(s=e.textureData.alias);let o=await it(s);o&&(i.texture=o);}}let n=t?.half;if(n?await n():"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?i.anchor.set(e.anchor,e.anchor):i.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(i.roundPixels=e.roundPixels),"onEvents"in e)for(let s in e.onEvents){let o=e.onEvents[s],c=Pe.get(o);c&&i.onEvent(s,c);}}var O=class i extends Se{constructor(t,r){t=Fe(t);let n,s;t&&"align"in t&&t?.align!==void 0&&(n=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(s=t.percentagePosition,delete t.percentagePosition);super(t);m(this,"pixivnId",Vt);m(this,"_loadIsStarted",false);m(this,"_align");m(this,"_percentagePosition");r&&(this.textureAlias=r),n&&(this.align=n),s&&(this.percentagePosition=s);}get memory(){return {...ct(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await ut(this,t),this.reloadPosition();}static from(t,r){let n=pixi_js.Sprite.from(t,r),s=new i;return s.texture=n.texture,s}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,it(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,y.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=W(this.pivot,this.angle),r=W(this.scale,this.angle);return {x:ve("width",this.x,ne(this),t.x,r.x<0,this.anchor.x),y:ve("height",this.y,se(this),t.y,r.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=W(this.pivot,this.angle),r=W(this.scale,this.angle);return ve("width",this.x,ne(this),t.x,r.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=W(this.pivot,this.angle),r=W(this.scale,this.angle);return ve("height",this.y,se(this),t.y,r.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:ke("width",this.x),y:ke("height",this.y)}}get percentageX(){return ke("width",this.x)}set percentageX(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageY(){return ke("height",this.y)}set percentageY(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=W(this.pivot,this.angle),r=W(this.scale,this.angle);this._align.x!==void 0&&(super.x=ie("width",this._align.x,ne(this),t.x,r.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=ie("height",this._align.y,se(this),t.y,r.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=re("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=re("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};K.add(O,Vt);async function ut(i,e,t){let r=t?.ignoreTexture||false;return e=Fe(e),await ht(i,e,{half:async()=>{r||"imageLink"in e&&e.imageLink!==void 0&&(i.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await i.load(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?i.anchor.set(e.anchor,e.anchor):i.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(i.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(i.percentagePosition=e.percentagePosition);},ignoreTexture:t?.ignoreTexture})}var U=class i extends O{constructor(t,r){let n,s,o;t&&"loop"in t&&t?.loop!==void 0&&(n=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(s=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,r);m(this,"pixivnId",Ht);m(this,"_looop",false);m(this,"_paused",false);m(this,"_currentTime",0);n&&(this.loop=n),s&&(this.paused=s),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await ti(this,t)}static from(t,r){let n=pixi_js.Sprite.from(t,r),s=new i;return s.texture=n.texture,s}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let r=this.duration;r&&t>=r&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};K.add(U,Ht);async function ti(i,e,t){await ut(i,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(i.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(i.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(i.paused=e.paused);}var B=class extends ze{constructor(t,r=[]){t=Fe(t);let n,s,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(n=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(s=t.percentagePosition,delete t.percentagePosition);super(t);m(this,"pixivnId",kt);m(this,"_loadIsStarted",false);m(this,"_anchor");m(this,"_align");m(this,"_percentagePosition");t=Fe(t),r&&r.forEach(c=>{let l;ft(c)?l=new U(void 0,c):l=new O(void 0,c),this.addChild(l);}),o&&(this.anchor=o),n&&(this.align=n),s&&(this.percentagePosition=s);}get memory(){return {...super.memory,pixivnId:kt,anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await ii(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let r=0;r<this.children.length;r++)t[r]=this.children[r].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(r=>{this._loadIsStarted=false,y.error("Error into ImageContainer.load()",r);})}get texture(){return this.children.length>0?this.children[0].texture:new pixi_js.Texture}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,r=super.pivot.y/this.height;return {x:t,y:r}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=W(this.pivot,this.angle),r=W(this.scale,this.angle);return {x:ve("width",this.x,ne(this),t.x,r.x<0,this.anchor.x),y:ve("height",this.y,se(this),t.y,r.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=W(this.pivot,this.angle),r=W(this.scale,this.angle);return ve("width",this.x,ne(this),t.x,r.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=W(this.pivot,this.angle),r=W(this.scale,this.angle);return ve("height",this.y,se(this),t.y,r.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:ke("width",this.x),y:ke("height",this.y)}}set percentageX(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageX(){return ke("width",this.x)}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}set percentageY(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get percentageY(){return ke("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=W(this.pivot,this.angle),r=W(this.scale,this.angle);this._align.x!==void 0&&(super.x=ie("width",this._align.x,ne(this),t.x,r.x<0)),this._align.y!==void 0&&(super.y=ie("height",this._align.y,se(this),t.y,r.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=re("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=re("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};K.add(B,kt);async function ii(i,e,t){e=Fe(e),xe(i,e,{...t,end:async()=>{"align"in e&&e.align!==void 0&&(i.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(i.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await i.load();}});}var Ne=class extends pixi_js.Text{constructor(t){super(t);m(this,"pixivnId",$e);m(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||$e;}get memory(){return Jt(this)}set memory(t){}async setMemory(t){return this.memory=t,await ri(this,t)}get onEvents(){return this._onEvents}onEvent(t,r){let n=r.prototype.id,s=Pe.getInstance(n);return this._onEvents[t]=n,s?(super.on(t,()=>{s.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):y.error(`Event ${n} not found`),this}on(t,r,n){return super.on(t,r,n)}};K.add(Ne,$e);async function ri(i,e){if(await xe(i,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?i.anchor.set(e.anchor,e.anchor):i.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(i.text=e.text),"resolution"in e&&e.resolution!==void 0&&(i.resolution=e.resolution),"style"in e&&e.style!==void 0&&(i.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(i.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let r=e.onEvents[t],n=Pe.get(r);n&&i.onEvent(t,n);}}var Ye=class{constructor(e,t,r){m(this,"_args");m(this,"duration");m(this,"priority");m(this,"ticker",new pixi_js.Ticker);m(this,"animation");m(this,"stopped",false);m(this,"ignoreOnComplete",true);m(this,"tickerId");m(this,"canvasElementAliases",[]);m(this,"timeout",50);m(this,"onComplete",()=>{if(this.ignoreOnComplete)return;let e=this.tickerId;if(!e){y.warn("MotionTicker.complete() called without tickerId set. This may cause issues.");return}let t=this._args.options?.aliasToRemoveAfter||[];typeof t=="string"&&(t=[t]);let r=this._args.options?.tickerAliasToResume||[];typeof r=="string"&&(r=[r]);let n=this._args.options?.tickerIdToResume||[];typeof n=="string"&&(n=[n]),u.onTickerComplete(e,{aliasToRemoveAfter:t,tickerAliasToResume:r,tickerIdToResume:n,stopTicker:false});});this._args=e,this.duration=t,this.priority=r;}get args(){return {...this._args,time:this.animation?.time}}getItemByAlias(e){if(!this.canvasElementAliases.includes(e))return;let t=u.find(e);if(t)return t}async complete(){if(!this.animation){y.warn("MotionTicker.complete() called without animation set. This may cause issues.");return}this.animation.complete(),await new Promise(e=>setTimeout(e,this.timeout));}stop(){if(this.stopped=true,!this.animation){y.warn("MotionTicker.stop() called without animation set. This may cause issues.");return}this.animation.stop();}start(e){if(this.tickerId=e,this._args.options.autoplay!==false)return this.initialize()}createItem(e){return new Proxy({alias:e},{set:({alias:t},r,n)=>{if(this.stopped||this._args.startState&&this._args.startState[r]===n)return true;let s=this.getItemByAlias(t);if(!s)return true;switch(this.ignoreOnComplete&&setTimeout(()=>{this.ignoreOnComplete=false;},10),r){case "pivotX":s.pivot.x=n;break;case "pivotY":s.pivot.y=n;break;case "scaleX":s.scale.x=n;break;case "scaleY":s.scale.y=n;break;default:s[r]=n;break}return true},get:({alias:t},r)=>{if(this._args.startState||(this._args.startState={}),r in this._args.startState)return this._args.startState[r];let n=this.getItemByAlias(t);if(!n)return;let s;switch(r){case "pivotX":s=n.pivot.x;break;case "pivotY":s=n.pivot.y;break;case "scaleX":s=n.scale.x;break;case "scaleY":s=n.scale.y;break;default:s=n[r];break}return this._args.startState={...this._args.startState,[r]:s},s},has:({alias:t},r)=>{let n=this.getItemByAlias(t);if(!n)return false;switch(r){case "pivotX":return "pivot"in n&&"x"in n.pivot;case "pivotY":return "pivot"in n&&"y"in n.pivot;case "scaleX":return "scale"in n&&"x"in n.scale;case "scaleY":return "scale"in n&&"y"in n.scale;default:return r in n}},ownKeys:({alias:t})=>{let r=this.getItemByAlias(t);return r?Object.keys(r):[]}})}pause(){this.animation&&this.animation.pause();}play(){if(this.animation||this.initialize(),!this.animation){y.warn("MotionTicker.play() called without animation set. This may cause issues.");return}this.animation.play();}get paused(){return this.animation?this.animation.state==="paused":true}};var Ve=class extends Ye{constructor(){super(...arguments);m(this,"id","motion-sequence");}initialize(){let t=this.canvasElementAliases[0],r=this.createItem(t),n=this._args.sequence.map((s,o)=>[r,s[0],{...s[1]||{},ticker:this.ticker,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat,onComplete:o===this._args.sequence.length-1?()=>this.onComplete():void 0}]);this.animation=dt(n,{...this._args.options,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat}),this._args.time&&(this.animation.time=this._args.time);}};var He=class extends Ye{constructor(){super(...arguments);m(this,"id","motion");}initialize(){let t=this.canvasElementAliases.map(r=>this.createItem(r));this.animation=dt(t,this._args.keyframes,{...this._args.options,repeat:this._args.options?.repeat===null?1/0:this._args.options?.repeat,onComplete:()=>this.onComplete(),ticker:this.ticker}),this._args.time&&(this.animation.time=this._args.time);}};var Ae=new Te({cacheSize:5});Ae.set("motion",He);Ae.set("motion-sequence",Ve);function gr(i){return function(e){Mt.add(e,i);}}var Mt;(s=>{function i(o,c){c||(c=o.name),Ae.get(c)&&y.info(`Ticker "${c}" already exists, it will be overwritten`),o.prototype.id=c,Ae.set(c,o);}s.add=i;function e(o){try{let c=Ae.get(o);if(!c){y.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return c}catch(c){y.error(`Error while getting Event "${o}"`,c);return}}s.get=e;function t(o,c,l,f){try{let p=Ae.get(o);if(!p){y.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new p(c,l,f)}catch(p){y.error(`Error while getting Ticker "${o}"`,p);return}}s.getInstance=t;function r(){return Array.from(Ae.values())}s.values=r;function n(o){return Ae.has(o)}s.has=n;})(Mt||(Mt={}));var X=Mt;var wi="aliasToRemoveAfter";var pt=class{get app(){return d.app}get gameLayer(){return d.gameLayer}get isInitialized(){return d._isInitialized}get width(){return d.canvasWidth}get canvasWidth(){return d.canvasWidth}get height(){return d.canvasHeight}get canvasHeight(){return d.canvasHeight}set width(e){d.canvasWidth=e;}set canvasWidth(e){d.canvasWidth=e;}set height(e){d.canvasHeight=e;}set canvasHeight(e){d.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,r,n,s){if(typeof t=="number"&&typeof r=="number")return await d.init(e,t,r,n,s);if(typeof t!="number"&&typeof r!="number")return await d.init(e,t.width,t.height,t,r);throw new Error("Invalid parameters")}get children(){return d.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let r=this.find(t);if(r)t=r;else {y.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let r=this.find(e);if(r)e=r;else {y.error(`Canvas element ${e} not found`);return}}e instanceof pixi_js.Container&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof U?await ti(t,e,{ignoreTexture:true}):t instanceof O?await ut(t,e,{ignoreTexture:true}):t instanceof Se?await ht(t,e,{ignoreTexture:true}):t instanceof Ne?await ri(t,e):t instanceof B?await ii(t,e):t instanceof pixi_js.Container&&await xe(t,e);}add(e,t,r={}){if(e===ce){y.error(`The alias ${ce} is reserved`);return}let n=this.find(e),s=r?.ignoreOldStyle;n&&!s&&this.copyCanvasElementProperty(n,t);let o=r.zIndex;n&&!this.gameLayer.children.includes(n)?y.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):n&&(o===void 0&&(o=this.gameLayer.getChildIndex(n)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===ce){y.error(`The alias ${ce} is reserved`);return}let r=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(n=>{this.gameLayer.getChildrenByLabel(n).forEach(s=>{this.gameLayer.removeChild(s),!r&&this.unlinkComponentFromTicker(n);});});}find(e){if(e===ce)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,t,r={}){let n=this.find(e);n&&(n.label=t),!r.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return d._currentTickers}get currentTickersSteps(){return d._currentTickersSequence}findTicker(e){let t=d._currentTickers[e];if(t)return t.ticker}addTicker(e,t,r){let n=t.id;if(typeof e=="string"&&(e=[e]),t.canvasElementAliases=e,!X.has(n)){y.error(`Ticker ${n} not found`);return}let s={ticker:t},{id:o=d.generateTickerId(s)}=r||{};if(d._currentTickers[o]=s,s.ticker.start(o),t.duration){let c=setTimeout(()=>{d.removeTickerTimeoutInfo(c),d._currentTickersTimeouts[c.toString()]&&s.ticker.complete({ignoreTickerSteps:true});},t.duration*1e3);d.addTickerTimeoutInfo(e,n,c.toString(),true);}return o}addTickersSequence(e,t,r=0){if(t.length==0){y.warn("The steps of the tickers is empty");return}e in d._currentTickersSequence||(d._currentTickersSequence[e]={});let n={currentStepNumber:r,steps:t.map(o=>o===rt||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:H(o.args),duration:o.duration})},s=d.generateTickerId(n);return d._currentTickersSequence[e][s]=n,this.runTickersSequence(e,s),s}runTickersSequence(e,t){if(!d._currentTickersSequence[e]||!d._currentTickersSequence[e][t])return;let r=d._currentTickersSequence[e][t].steps[d._currentTickersSequence[e][t].currentStepNumber];if(r===rt&&(r=d._currentTickersSequence[e][t].steps[0],d._currentTickersSequence[e][t].currentStepNumber=0,r===rt)){y.error("TikersSteps has a RepeatType in the first step");return}if(r.hasOwnProperty("type")&&r.type==="pause"){let l=setTimeout(()=>{let f=d._currentTickersTimeouts[l.toString()];f&&f.aliases.forEach(p=>{this.nextTickerStep(p,t);}),d.removeTickerTimeoutInfo(l);},r.duration*1e3);d.addTickerTimeoutInfo(e,"steps",l.toString(),false);return}let n=X.getInstance(r.ticker,r.args,r.duration,r.priority);if(!n){y.error(`Ticker ${r.ticker} not found`);return}n.canvasElementAliases=[e];let s=n.id,o={createdByTicketSteps:{canvasElementAlias:e,id:t},ticker:n},c=d.generateTickerId(o);if(d._currentTickers[c]=o,o.ticker.start(c),n.duration){let l=setTimeout(()=>{let f=d._currentTickersTimeouts[l.toString()];f&&(o.ticker.complete({ignoreTickerSteps:true}),f.aliases.forEach(p=>{this.nextTickerStep(p,t);})),d.removeTickerTimeoutInfo(l);},n.duration*1e3);d.addTickerTimeoutInfo(e,s,l.toString(),false);}}nextTickerStep(e,t){if(d._currentTickersSequence[e]&&d._currentTickersSequence[e][t]){let r=d._currentTickersSequence[e][t];r.currentStepNumber+1<r.steps.length?(r.currentStepNumber++,d._currentTickersSequence[e][t]=r,this.runTickersSequence(e,t)):t&&d._currentTickersSequence[e]&&d._currentTickersSequence[e][t]&&(delete d._currentTickersSequence[e][t],Object.entries(d._currentTickers).forEach(([n,s])=>{s.createdByTicketSteps?.canvasElementAlias===e&&s.createdByTicketSteps.id===t&&this.removeTicker(n);}));}}onEndOfTicker(e,t){return this.onTickerComplete(e,t)}onTickerComplete(e,t){let{stopTicker:r=true,aliasToRemoveAfter:n,tickerAliasToResume:s,tickerIdToResume:o}=t,c=d._currentTickers[e],l=t.ignoreTickerSteps||false;this.remove(n),s.forEach(f=>this.resumeTicker({canvasAlias:f})),this.resumeTicker({id:o}),c&&(this.removeTicker(e,{stopTicker:r}),!l&&c.ticker.duration==null&&c.createdByTicketSteps&&this.nextTickerStep(c.createdByTicketSteps.canvasElementAlias,c.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(n=>{Object.entries(d._currentTickers).forEach(([s,o])=>{o.ticker.canvasElementAliases.includes(n)&&(o.ticker.canvasElementAliases.length===1?this.removeTicker(s):o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(c=>c!==n));}),d._currentTickersSequence[n]&&delete d._currentTickersSequence[n],d.removeTickerTimeoutsByAlias(n,false);});return}let r;typeof t=="string"?r=t:r=t.prototype.id,e.forEach(n=>{d._currentTickersSequence[n]&&Object.entries(d._currentTickersSequence[n]).forEach(([s,o])=>{o.steps.find(c=>typeof c=="object"&&"ticker"in c&&c.ticker===r)&&delete d._currentTickersSequence[n][s];});}),Object.entries(d._currentTickers).forEach(([n,s])=>{s.ticker.id===r&&(d._currentTickers[n].ticker.canvasElementAliases=s.ticker.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(d._currentTickersTimeouts).forEach(([n,s])=>{s.ticker===r&&s.canBeDeletedBeforeEnd&&(d._currentTickersTimeouts[n].aliases=s.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(d._currentTickers).forEach(([e,t])=>{t.ticker.canvasElementAliases=t.ticker.canvasElementAliases.filter(r=>this.find(r)),t.ticker.canvasElementAliases.length===0&&t.ticker.complete({ignoreTickerSteps:true});}),Object.entries(d._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete d._currentTickersSequence[e];}),Object.entries(d._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&d.removeTickerTimeout(e);});}removeAllTickers(){d._currentTickersSequence={},Object.keys(d._currentTickers).forEach(e=>{this.removeTicker(e);}),d._currentTickers={};for(let e in d._currentTickersTimeouts)d.removeTickerTimeout(e);d._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},d._tickersOnPause={};}removeTicker(e,t={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(r=>{let n=d._currentTickers[r];n&&(t.stopTicker&&n.ticker.stop(),delete d._currentTickers[r]);});}pauseTicker(e){let t=[];if("canvasAlias"in e){let{canvasAlias:r,tickerIdsExcluded:n=[]}=e;Object.entries(d._currentTickers).forEach(([s,o])=>{o.ticker.canvasElementAliases.includes(r)&&!n.includes(o.ticker.id)&&o.ticker.paused===false&&(o.ticker.pause(),t.push(s));});}else if("id"in e){let{id:r}=e;typeof r=="string"&&(r=[r]),r.forEach(n=>{let s=d._currentTickers[n];s?s.ticker.paused===false&&(s.ticker.pause(),t.push(n)):y.error(`Ticker with id ${n} not found`);});}return t}resumeTicker(e){if("canvasAlias"in e){let{canvasAlias:t}=e;Object.values(d._currentTickers).forEach(r=>{r.ticker.canvasElementAliases.includes(t)&&r.ticker.play();}),delete d._tickersOnPause[t];}else if("id"in e){let{id:t}=e;typeof t=="string"&&(t=[t]),t.forEach(r=>{let n=d._currentTickers[r];n?n.ticker.play():y.error(`Ticker with id ${r} not found`);});}}isTickerPaused(e,t){let r=d._tickersOnPause[e];if(r){if(t){if("tickerIdsIncluded"in r&&r.tickerIdsIncluded)return r.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in r&&r.tickerIdsExcluded)return !r.tickerIdsExcluded.includes(t)}return true}return false}transferTickers(e,t,r="move"){d._currentTickersSequence[e]&&(r==="move"?d._currentTickersSequence[t]=H(d._currentTickersSequence[e]):r==="duplicate"&&(d._currentTickersSequence[t]=H(d._currentTickersSequence[e]))),Object.entries(d._currentTickers).forEach(([n,s])=>{if(s.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(n),s.ticker.canvasElementAliases.includes(e)){let o=X.getInstance(s.ticker.id,H(s.ticker.args),s.ticker.duration,s.ticker.priority);if(o?(o.canvasElementAliases=[t],this.addTicker(t,o),s.ticker.paused&&o.pause()):y.error(`Ticker ${s.ticker.id} not found`),r==="move"&&(s.ticker.canvasElementAliases=s.ticker.canvasElementAliases.filter(c=>c!==e)),s.ticker.args.hasOwnProperty(wi)){let c=s.ticker.args.aliasToRemoveAfter;typeof c=="string"&&(c=[c]),Array.isArray(c)&&(r==="move"?s.ticker.args.aliasToRemoveAfter=c.map(l=>l===e?t:l):r==="duplicate"&&c.find(l=>l===e)&&(s.ticker.args.aliasToRemoveAfter=[...c,t]));}}}),Object.values(d._currentTickersTimeouts).forEach(n=>{n.aliases.includes(e)&&(r==="move"?n.aliases=n.aliases.map(s=>s===e?t:s):r==="duplicate"&&n.aliases.find(s=>s===e)&&n.aliases.push(t));}),d._currentTickersSequence[t]&&Object.keys(d._currentTickersSequence[t]).forEach(n=>{this.runTickersSequence(t,n);}),r==="duplicate"&&d._currentTickersSequence[e]&&Object.keys(d._currentTickersSequence[e]).forEach(n=>{this.runTickersSequence(e,n);});}completeTickerOnStepEnd(e){e.alias?d._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):d._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,t){if(t){let r=d._currentTickersSequence[t];if(r&&r[e])if(r[e].steps.includes(rt))y.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,r[e]);else {let n=r[e].steps.map(s=>{if(typeof s=="object"&&"ticker"in s){let o=X.getInstance(s.ticker,s.args,s.duration,s.priority);if(o)return o.canvasElementAliases=[t],o.complete()}});await Promise.all(n);}}else {let r=d._currentTickers[e];r&&await r.ticker.complete();}}animate(e,t,r,n){try{t=H(t);}catch(f){throw y.error("animate keyframes cannot contain functions or classes"),f}try{r=H(r);}catch(f){throw y.error("animate options cannot contain functions or classes"),f}let s=[];typeof e=="string"?s=[e]:Array.isArray(e)?s=e.map(f=>typeof f=="string"?f:f.label):s=[e.label];let o;Array.isArray(t)?o=new Ve({sequence:t,options:r},void 0,n):o=new He({keyframes:t,options:r},void 0,n);let c=this.addTicker(s,o),{forceCompleteBeforeNext:l}=r||{};return c&&l&&this.completeTickerOnStepEnd({id:c}),c}addLayer(e,t){if(e===ce){y.error(`The alias ${ce} is reserved`);return}return t.label=e,d.app.stage.addChild(t)}getLayer(e){return d.app.stage.getChildByLabel(e)}removeLayer(e){let t=d.app.stage.getChildByLabel(e);t&&d.app.stage.removeChild(t);}addHtmlLayer(e,t,r){return d.addHtmlLayer(e,t,r)}removeHtmlLayer(e){return d.removeHtmlLayer(e)}getHtmlLayer(e){return d.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.app.stage)).src}clear(){this.removeAllTickers(),this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=Zt(t));}),{tickers:H(d.currentTickersWithoutCreatedBySteps),tickersSteps:H(d._currentTickersSequence),elements:H(e),stage:H(We(this.gameLayer)),elementAliasesOrder:H(d.childrenAliasesOrder),tickersOnPause:H(d._tickersOnPause),tickersToCompleteOnStepEnd:H(d._tickersToCompleteOnStepEnd)}}async restore(e){this.clear();try{if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let t=e.elementAliasesOrder,r={},n=Object.entries(e.elements).map(async([s,o])=>{r[s]=await At(o);});await Promise.all(n),t.forEach(s=>{let o=r[s];o&&this.add(s,o);});}else {y.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?xe(this.gameLayer,e.stage,{ignoreScale:!0}):y.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let t=e.tickers;Object.entries(t).forEach(([r,n])=>{let s=n.canvasElementAliases;if(s.length!==0){let o=X.getInstance(n.id,n.args,n.duration,n.priority);o?(o.canvasElementAliases=s,this.addTicker(s,o,{id:r}),n.paused&&o.pause()):y.error(`Ticker ${n.id} not found`);}});}if(e.hasOwnProperty("tickersSteps")){let t=e.tickersSteps;Object.entries(t).forEach(([r,n])=>{d._currentTickersSequence[r]=n,Object.keys(n).forEach(s=>{this.runTickersSequence(r,s);});});}if(e.hasOwnProperty("tickersOnPause")){let t=e.tickersOnPause;Object.keys(t).forEach(r=>{let n=t[r];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(t[r].tickerIdsExcluded=n.tickerIdsExcluded),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(t[r].tickerIdsIncluded=n.tickerIdsIncluded);}),d._tickersOnPause=t;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let t=e.tickersToCompleteOnStepEnd,r=t.tikersIds,n=t.stepAlias.map(s=>({id:s.id,alias:s.alias}));d._tickersToCompleteOnStepEnd={tikersIds:r,stepAlias:n};}}catch(t){y.error("Error importing data",t);}}};var Ot=class{constructor(){m(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var Rt=class{constructor(){m(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};async function yr(i,e={},t){let r=u.find(i);if(!r){y.error(`The element with the alias ${i} does not exist. So the shake effect can't be applied.`);return}let n={x:r.position.x,y:r.position.y},{shakeType:s="horizontal",maxShockSize:o=10,shocksNumber:c=10,...l}=e,f=c-1;if(f<2){y.error("The number of shocks must be at least 3.");return}let p=Math.floor(f/2),g=Math.ceil(f/2),S=[];for(let I=0;I<p;I++){let P=o*(I+1)/p;s==="horizontal"?I%2!==0?S.push(n.x+P):S.push(n.x-P):I%2!==0?S.push(n.y+P):S.push(n.y-P);}let v=p%2===0;for(let I=g;I>0;I--){let P=o*(I+1)/(g-1);s==="horizontal"?I%2===0&&!v||I%2!==0&&v?S.push(n.x-P):S.push(n.x+P):I%2===0&&!v||I%2!==0&&v?S.push(n.y-P):S.push(n.y+P);}let A;if(s==="horizontal"?(S.push(n.x),A=u.animate(i,{x:S},l,t)):(S.push(n.y),A=u.animate(i,{y:S},l,t)),A)return [A]}function Bt(i,e,t){let r={...u.find(i)?.memory,...t},n=new B(t,e);return r&&u.copyCanvasElementProperty(r,n),u.add(i,n,{ignoreOldStyle:true}),n}async function Tr(i,e,t){let r={...u.find(i)?.memory,...t},n=new B(t,e);return await n.load(),r&&u.copyCanvasElementProperty(r,n),u.add(i,n,{ignoreOldStyle:true}),n}function Dt(i,e,t){if(!e)if(pixi_js.Assets.resolver.hasKey(i))e=i;else throw new Error(`The image ${i} does not exist in the cache.`);let r={...u.find(i)?.memory,...t},n=new O(t,e);return r&&u.copyCanvasElementProperty(r,n),u.add(i,n,{ignoreOldStyle:true}),n}async function xr(i,e,t){if(!e)if(pixi_js.Assets.resolver.hasKey(i))e=i;else throw new Error(`The image ${i} does not exist in the cache.`);let r={...u.find(i)?.memory,...t},n=new O(t,e);return await n.load(),r&&u.copyCanvasElementProperty(r,n),u.add(i,n,{ignoreOldStyle:true}),n}function Lt(i,e,t){if(!e)if(pixi_js.Assets.resolver.hasKey(i))e=i;else throw new Error(`The video ${i} does not exist in the cache.`);let r={...u.find(i)?.memory,...t},n=new U(t,e);return r&&u.copyCanvasElementProperty(r,n),u.add(i,n,{ignoreOldStyle:true}),n}async function vr(i,e,t){if(!e)if(pixi_js.Assets.resolver.hasKey(i))e=i;else throw new Error(`The video ${i} does not exist in the cache.`);let r={...u.find(i)?.memory,...t},n=new U(t,e);return await n.load(),r&&u.copyCanvasElementProperty(r,n),u.add(i,n,{ignoreOldStyle:true}),n}function ni(i,e){if(i.type==="align"){let t,r;e instanceof pixi_js.Sprite&&(t=e.anchor.x,r=e.anchor.y);let n=W(e.pivot,e.angle),s=W(e.scale,e.angle);i.x=ie("width",i.x,ne(e),n.x,s.x<0,t),i.y=ie("height",i.y,se(e),n.y,s.y<0,r);}return i.type==="percentage"&&(i.x=re("width",i.x),i.y=re("height",i.y)),{x:i.x,y:i.y}}function mt(i,e){if(typeof e=="string")return ft(e)?Lt(i,e):Dt(i,e);if(Array.isArray(e))return Bt(i,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return ft(e.value)?Lt(i,e.value,e.options):Dt(i,e.value,e.options);if(Array.isArray(e.value))return Bt(i,e.value,e.options)}return u.add(i,e),e}async function Ri(i,e,t={},r){let{forceCompleteBeforeNext:n=true,tickerIdToResume:s=[],...o}=t,c=[];e||(e=i),typeof s=="string"&&(s=[s]);let l;if(u.find(i)&&(l=i+"_temp_disolve",u.editAlias(i,l)),e=mt(i,e),l&&u.copyCanvasElementProperty(l,i),l&&u.transferTickers(l,i,"duplicate"),e.alpha=0,l){let p=Wt(l,{...t,autoplay:false,forceCompleteBeforeNext:n},r);p&&(c.push(...p),s.push(...p));}let f=u.animate(i,{alpha:1},{...o,tickerIdToResume:s,forceCompleteBeforeNext:n},r);if(f&&c.push(f),(e instanceof O||e instanceof B)&&e.haveEmptyTexture&&await e.load(),c.length>0)return c}function Wt(i,e={},t){let{forceCompleteBeforeNext:r=true,aliasToRemoveAfter:n=[],...s}=e;typeof n=="string"&&(n=[n]),n.push(i);let o=u.animate(i,{alpha:0},{...s,aliasToRemoveAfter:n,forceCompleteBeforeNext:r},t);if(o)return [o]}async function _r(i,e,t={},r){let{forceCompleteBeforeNext:n=true,aliasToRemoveAfter:s=[],...o}=t,c=[];if(e||(e=i),typeof s=="string"&&(s=[s]),!u.find(i))return Ri(i,e,t,r);let l=i+"_temp_fade";u.editAlias(i,l),s.push(l),e=mt(i,e),l&&u.copyCanvasElementProperty(l,i),l&&u.transferTickers(l,i,"duplicate"),e.alpha=0;let f=u.animate(i,{alpha:1},{...o,aliasToRemoveAfter:s,forceCompleteBeforeNext:n},r);if(f){let p=Wt(l,{...t,tickerIdToResume:f,forceCompleteBeforeNext:n},r);p&&c.push(...p),c.push(f),u.pauseTicker({id:f});}if((e instanceof O||e instanceof B)&&e.haveEmptyTexture&&await e.load(),c.length>0)return c}function Pr(i,e={},t){return Wt(i,e,t)}async function Sr(i,e,t={},r){let{direction:n="right",forceCompleteBeforeNext:s=true,tickerIdToResume:o=[],aliasToRemoveAfter:c=[],removeOldComponentWithMoveOut:l,...f}=t,p=[];e||(e=i),typeof o=="string"&&(o=[o]),typeof c=="string"&&(c=[c]);let g;u.find(i)&&(g=i+"_temp_movein",u.editAlias(i,g)),e=mt(i,e),g&&u.copyCanvasElementProperty(g,i),g&&u.transferTickers(g,i,"move");let S;if(e instanceof O||e instanceof B?S=e.positionInfo:S={x:e.x,y:e.y,type:"pixel"},g)if(l){let I=si(g,{...t,autoplay:false,forceCompleteBeforeNext:s},r);I&&(p.push(...I),o.push(...I));}else c.push(g);switch((e instanceof O||e instanceof B)&&e.haveEmptyTexture&&await e.load(),n){case "up":e.y=u.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=u.width+e.width;break;case "right":e.x=-e.width;break}let v=u.pauseTicker({canvasAlias:i});o.push(...v);let A=u.animate(i,ni(S,e),{...f,tickerIdToResume:o,aliasToRemoveAfter:c,forceCompleteBeforeNext:s},r);if(A&&p.push(A),p.length>0)return p}function si(i,e={},t){let{direction:r="right",forceCompleteBeforeNext:n=true,aliasToRemoveAfter:s=[],...o}=e;typeof s=="string"&&(s=[s]),s.push(i);let c=u.find(i);if(!c){y.warn(`The canvas component "${i}" is not found.`);return}let l={x:c.x,y:c.y};switch(r){case "up":l.y=-c.height;break;case "down":l.y=u.height+c.height;break;case "left":l.x=-c.width;break;case "right":l.x=u.width+c.width;break}u.pauseTicker({canvasAlias:i});let f=u.animate(i,l,{...o,aliasToRemoveAfter:s,forceCompleteBeforeNext:n},t);if(f)return [f]}async function Ir(i,e,t={},r){let{direction:n="right",forceCompleteBeforeNext:s=true,tickerIdToResume:o=[],aliasToRemoveAfter:c=[],...l}=t,f=[];e||(e=i),typeof o=="string"&&(o=[o]),typeof c=="string"&&(c=[c]);let p;u.find(i)&&(p=i+"_temp_zoom",u.editAlias(i,p)),e=mt(i,e),p&&u.copyCanvasElementProperty(p,i),p&&u.transferTickers(p,i,"move");let g;e instanceof O||e instanceof B?g=e.positionInfo:g={x:e.x,y:e.y,type:"pixel"};let S={x:e.pivot.x,y:e.pivot.y},v={x:e.scale.x,y:e.scale.y};if(p)if(t.removeOldComponentWithZoomOut){let P=Bi(p,{...t,autoplay:false,forceCompleteBeforeNext:s},r);P&&(f.push(...P),o.push(...P));}else c.push(p);(e instanceof O||e instanceof B)&&e.haveEmptyTexture&&await e.load(),n=="up"?(e.pivot.y=u.height-e.y,e.pivot.x=u.width/2-e.x,e.y=u.height,e.x=u.width/2):n=="down"?(e.pivot.y=0-e.y,e.pivot.x=u.width/2-e.x,e.y=0,e.x=u.width/2):n=="left"?(e.pivot.x=u.width-e.x,e.pivot.y=u.height/2-e.y,e.x=u.width,e.y=u.height/2):n=="right"&&(e.pivot.x=0-e.x,e.pivot.y=u.height/2-e.y,e.x=0,e.y=u.height/2),e.pivot=Qt(e.pivot,e.angle),e.scale.set(0);let A=u.pauseTicker({canvasAlias:i});o.push(...A);let I=u.animate(i,{...ni(g,e),pivotX:S.x,pivotY:S.y,scaleX:v.x,scaleY:v.y},{...l,tickerIdToResume:o,aliasToRemoveAfter:c,forceCompleteBeforeNext:s},r);if(I&&f.push(I),f.length>0)return f}function Bi(i,e={},t){let{direction:r="right",forceCompleteBeforeNext:n=true,aliasToRemoveAfter:s=[],...o}=e;typeof s=="string"&&(s=[s]),s.push(i);let c=u.find(i);if(!c){y.warn(`The canvas component "${i}" is not found.`);return}let l={x:c.x,y:c.y},f={x:c.pivot.x,y:c.pivot.y};r=="down"?(l.y=u.height,l.x=u.width/2,f.y=u.height-l.y,f.x=u.width/2-l.x):r=="up"?(l.y=0,l.x=u.width/2,f.y=0-l.y,f.x=u.width/2-l.x):r=="right"?(l.x=u.width,l.y=u.height/2,f.x=u.width-l.x,f.y=u.height/2-l.y):r=="left"&&(l.x=0,l.y=u.height/2,f.x=0-l.x,f.y=u.height/2-l.y),f=Qt(f,c.angle),u.pauseTicker({canvasAlias:i});let p=u.animate(i,{...l,pivotX:f.x,pivotY:f.y,scaleX:0,scaleY:0},{...o,aliasToRemoveAfter:s,forceCompleteBeforeNext:n},t);if(p)return [p]}async function br(i,e,t={},r){let{direction:n="right",forceCompleteBeforeNext:s=true,tickerIdToResume:o=[],...c}=t,l=[];e||(e=i),typeof o=="string"&&(o=[o]);let f;u.find(i)&&(f=i+"_temp_push",u.editAlias(i,f)),e=mt(i,e),f&&u.copyCanvasElementProperty(f,i),f&&u.transferTickers(f,i,"move");let p;switch((e instanceof O||e instanceof B)&&e.haveEmptyTexture?p=e.positionInfo:p={x:e.x,y:e.y,type:"pixel"},n){case "up":e.y=u.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=u.width+e.width;break;case "right":e.x=-e.width;break}let g=u.pauseTicker({canvasAlias:i});if(o.push(...g),f){let v=Di(f,{...t,direction:n,forceCompleteBeforeNext:s});v&&l.push(...v);}let S=u.animate(i,ni(p,e),{...c,tickerIdToResume:o,forceCompleteBeforeNext:s},r);if(S&&l.push(S),(e instanceof O||e instanceof B)&&e.haveEmptyTexture&&await e.load(),l.length>0)return l}function Di(i,e={direction:"right"},t){return si(i,e,t)}var oe=class{constructor(e,t,r){m(this,"id","ticker_id_not_set");m(this,"args");m(this,"duration");m(this,"priority");m(this,"ticker",new pixi_js.Ticker);m(this,"tickerId");m(this,"canvasElementAliases",[]);m(this,"fnValue");this.args=e,this.duration=t,this.priority=r,this.id=this.constructor.prototype.id;}complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){y.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(e){this.tickerId=e;let t=()=>{let{createdByTicketSteps:r}=d._currentTickers[e],n=this.canvasElementAliases;if(r){if(u.isTickerPaused(r.canvasElementAlias,r.id))return}else n=n.filter(s=>!u.isTickerPaused(s,e));return this.fn(this.ticker,this.args,n,e)};this.fnValue=t,this.ticker.add(t,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};function Me(i){return (i instanceof O||i instanceof B)&&i.haveEmptyTexture?false:!(i instanceof pixi_js.Sprite&&i.texture?.label=="EMPTY")}function Oe(i,e,t){let{limit:r}=t;i[e]===void 0||!t||i[e]===r||(typeof i[e]=="number"?t.type==="linear"?i[e]=oi(i[e],t):t.type==="exponential"&&(i[e]=ai(i[e],t)):i[e]!==void 0&&typeof i[e]=="object"&&i[e].haveOwnProperty("x")&&i[e].haveOwnProperty("y")&&typeof i[e].x=="number"&&typeof i[e].y=="number"&&(t.type==="linear"?(i[e].x=oi(i[e].x,t),i[e].y=oi(i[e].y,t)):t.type==="exponential"&&(i[e].x=ai(i[e].x,t),i[e].y=ai(i[e].y,t))));}function oi(i,e){let{limit:t,amt:r}=e;if(t!==void 0){if(i>t&&r>0)return t;if(i<t&&r<0)return t}return i+r}function ai(i,e){let{limit:t}=e;if(t!==void 0){if(i>t&&e.percentage>0)return t;if(i<t&&e.percentage<0)return t}return i+i*e.percentage}var Ar=5,gt=class extends oe{constructor(e={},t,r){super(e,t,r);}fn(e,t,r,n){t.speed===void 0&&(t.duration===void 0?t.speed=Ar:t.speed=600/(t.duration*60));let{type:s="hide",startOnlyIfHaveTexture:o,speedProgression:c}=t,l=this.speedConvert(t.speed),f=this.getLimit(t);s==="hide"&&f<0&&(f=0),s==="show"&&f>1&&(f=1),r.filter(p=>{let g=u.find(p);return !(!g||o&&!Me(g))}).forEach(p=>{let g=u.find(p);if(g&&g instanceof pixi_js.Container){if(s==="show"&&g.alpha<f?g.alpha+=l*e.deltaTime:s==="hide"&&g.alpha>f&&(g.alpha-=l*e.deltaTime),s==="show"&&g.alpha>=f){this.complete();return}else if(s==="hide"&&g.alpha<=f){this.complete();return}if(l<1e-5&&!(c&&c.type=="linear"&&c.amt!=0)){y.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.complete();return}}}),c&&Oe(t,"speed",c);}onComplete(e,t,r){typeof e=="string"&&(e=[e]),e.forEach(n=>{let s=u.find(n);if(s){let o=this.getLimit(r);s.alpha=o;}});}getLimit(e){let{type:t="hide",limit:r=t==="hide"?0:1}=e;return r}speedConvert(e){return e/600}complete(e){let{ignoreTickerSteps:t}=e||{},r=this.tickerId;if(!r){y.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,r,this.args);let n="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof n=="string"&&(n=[n]);let s="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof s=="string"&&(s=[s]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),u.onTickerComplete(r,{aliasToRemoveAfter:n,tickerAliasToResume:s,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};X.add(gt);var Rr=10;function Br(i,e){let t=H(i.destination);if(t.type==="align"){let r,n;e instanceof pixi_js.Sprite&&(r=e.anchor.x,n=e.anchor.y);let s=W(e.pivot,e.angle),o=W(e.scale,e.angle);t.x=ie("width",t.x,ne(e),s.x,o.x<0,r),t.y=ie("height",t.y,se(e),s.y,o.y<0,n);}return t.type==="percentage"&&(t.x=re("width",t.x),t.y=re("height",t.y)),t}var yt=class extends oe{fn(e,t,r,n){t.speed===void 0&&(t.speed=Rr);let{speed:s,startOnlyIfHaveTexture:o,speedProgression:c}=t;r.filter(l=>{let f=u.find(l);return !(!f||o&&!Me(f))}).forEach(l=>{let f=u.find(l);if(f&&f instanceof pixi_js.Container){let p=Br(t,f),g=p.x-f.x,S=p.y-f.y,v=g>0?1:-1,A=S>0?1:-1,I,P;if(typeof s=="number"){let h=this.speedConvert(s);g===0||S===0?I=P=h:(I=Math.abs(g/(g+S))*h,P=Math.abs(S/(g+S))*h);}else I=this.speedConvert(s.x),P=this.speedConvert(s.y);if(I>0){f.x+=v*I*e.deltaTime;let h=p.x-f.x;(v<0&&h>0||v>0&&h<0)&&(f.x=p.x);}if(P>0){f.y+=A*P*e.deltaTime;let h=p.y-f.y;(A<0&&h>0||A>0&&h<0)&&(f.y=p.y);}if(f.x==p.x&&f.y==p.y){this.complete();return}else if(I<1e-5&&P<1e-5&&!(c&&c.type=="linear"&&c.amt!=0)){y.warn("The speed of the MoveTicker must be greater than 0."),this.complete();return}}}),c&&Oe(t,"speed",c);}onComplete(e,t,r){typeof e=="string"&&(e=[e]),e.forEach(n=>{let s=u.find(n);if(s){let o=r.destination;s instanceof O||s instanceof B?s.positionInfo=o:(s.x=o.x,s.y=o.y);}});}speedConvert(e){return e*(66/400)}complete(e){let{ignoreTickerSteps:t}=e||{},r=this.tickerId;if(!r){y.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,r,this.args);let n="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof n=="string"&&(n=[n]);let s="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof s=="string"&&(s=[s]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),u.onTickerComplete(r,{aliasToRemoveAfter:n,tickerAliasToResume:s,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};X.add(yt);var Lr=1,Tt=class extends oe{constructor(e={},t,r){super(e,t,r);}fn(e,t,r,n){t.speed===void 0&&(t.speed=Lr);let{clockwise:s=true,speedProgression:o,limit:c}=t,l=this.speedConvert(t.speed);r.filter(f=>{let p=u.find(f);return !(!p||t.startOnlyIfHaveTexture&&!Me(p))}).forEach(f=>{let p=u.find(f);if(p&&p instanceof pixi_js.Container&&(s?p.rotation+=l*e.deltaTime:p.rotation-=l*e.deltaTime,c!==void 0&&(s&&p.angle>=c?(p.angle=c,this.complete()):!s&&p.angle<=c&&(p.angle=c,this.complete())),l<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){y.warn("The speed of the RotateTicker must be greater than 0."),this.complete();return}}),o&&Oe(t,"speed",o);}onComplete(e,t,r){let{limit:n}=r;typeof e=="string"&&(e=[e]),e.forEach(s=>{let o=u.find(s);o&&n!==void 0&&(o.angle=n);});}speedConvert(e){return e/100}complete(e){let{ignoreTickerSteps:t}=e||{},r=this.tickerId;if(!r){y.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,r,this.args);let n="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof n=="string"&&(n=[n]);let s="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof s=="string"&&(s=[s]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),u.onTickerComplete(r,{aliasToRemoveAfter:n,tickerAliasToResume:s,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};X.add(Tt);var zr=10,xt=class extends oe{constructor(e={},t,r){super(e,t,r);}fn(e,t,r,n){t.speed===void 0&&(t.speed=zr);let{speed:s,type:o="zoom",startOnlyIfHaveTexture:c,speedProgression:l}=t,f,p;typeof s=="number"?(f=this.speedConvert(s),p=this.speedConvert(s)):(f=this.speedConvert(s.x),p=this.speedConvert(s.y));let g=this.getLimit(t);r.filter(S=>{let v=u.find(S);return !(!v||c&&!Me(v))}).forEach(S=>{let v=u.find(S);if(v&&v instanceof pixi_js.Container){if(o==="zoom"&&(v.scale.x<g.x||v.scale.y<g.y)?(v.scale.x+=f*e.deltaTime,v.scale.y+=p*e.deltaTime):o==="unzoom"&&(v.scale.x>g.x||v.scale.y>g.y)&&(v.scale.x-=f*e.deltaTime,v.scale.y-=p*e.deltaTime),o==="zoom"){if(v.scale.x>g.x&&(v.scale.x=g.x),v.scale.y>g.y&&(v.scale.y=g.y),v.scale.x>=g.x&&v.scale.y>=g.y){this.complete();return}}else if(o==="unzoom"&&(v.scale.x<g.x&&(v.scale.x=g.x),v.scale.y<g.y&&(v.scale.y=g.y),v.scale.x<=g.x&&v.scale.y<=g.y)){this.complete();return}if((f<1e-5&&p<1e-5||f<1e-5&&v.scale.y==g.y||p<1e-5&&v.scale.x==g.x)&&!(l&&l.type=="linear"&&l.amt!=0)){y.warn("The speed of the ZoomTicker must be greater than 0."),this.complete();return}}}),l&&Oe(t,"speed",l);}speedConvert(e){return e/600}onComplete(e,t,r){let{isZoomInOut:n}=r;typeof e=="string"&&(e=[e]),e.forEach(s=>{let o=u.find(s);if(o){let c=this.getLimit(r);if(o.scale.x=c.x,o.scale.y=c.y,n){let{pivot:l,position:f}=n;o.pivot=l.x,o.position=f;}}});}getLimit(e){let{type:t="zoom",limit:r}=e,n=t==="zoom"?1/0:0,s=t==="zoom"?1/0:0;return r&&(typeof r=="number"?(n=r,s=r):(n=r.x,s=r.y)),{x:n,y:s}}complete(e){let{ignoreTickerSteps:t}=e||{},r=this.tickerId;if(!r){y.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,r,this.args);let n="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof n=="string"&&(n=[n]);let s="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof s=="string"&&(s=[s]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),u.onTickerComplete(r,{aliasToRemoveAfter:n,tickerAliasToResume:s,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};X.add(xt);function Fr(i,e,t){if(Array.isArray(i)&&Array.isArray(i[0])){let r=i.map(n=>{let{ticker:s=new pixi_js.Ticker,...o}=n[2]||{};return [n[0],n[1],{driver:c=>{let l=({lastTime:f})=>c(f);return {start:(f=true)=>{s.add(l),s.start();},stop:()=>s.remove(l),now:()=>s.lastTime}},...o}]});return motion.animate(r,e)}else {let{ticker:r=new pixi_js.Ticker}=t||{};return motion.animate(i,e,{driver:n=>{let s=({lastTime:o})=>n(o);return {start:(o=true)=>{r.add(s),r.start();},stop:()=>r.remove(s),now:()=>r.lastTime}},...t||{}})}}var dt=Fr;var u=new pt;Z.init({getScreen:()=>u.screen});exports.PIXI=pixi_js__namespace;exports.CanvasBaseItem=Rt;exports.CanvasEvent=Ot;exports.CanvasManagerStatic=d;exports.Container=ze;exports.FadeAlphaTicker=gt;exports.ImageContainer=B;exports.ImageSprite=O;exports.MoveTicker=yt;exports.RegisteredCanvasComponents=K;exports.RegisteredEvents=Pe;exports.RegisteredTickers=X;exports.RotateTicker=Tt;exports.Sprite=Se;exports.Text=Ne;exports.TickerBase=oe;exports.VideoSprite=U;exports.ZoomTicker=xt;exports.addImage=Dt;exports.addImageCointainer=Bt;exports.addVideo=Lt;exports.animate=dt;exports.canvas=u;exports.canvasComponentDecorator=Ji;exports.eventDecorator=Qi;exports.getTexture=it;exports.moveIn=Sr;exports.moveOut=si;exports.pushIn=br;exports.pushOut=Di;exports.removeWithDissolve=Wt;exports.removeWithFade=Pr;exports.shakeEffect=yr;exports.showImage=xr;exports.showImageContainer=Tr;exports.showVideo=vr;exports.showWithDissolve=Ri;exports.showWithFade=_r;exports.tickerDecorator=gr;exports.zoomIn=Ir;exports.zoomOut=Bi;