vendor: 3,657 bytes, lines 1-3
1"use strict"; 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8b866658-35c4-503b-a291-ceca4c24c50c")}catch(e){}}(); 3(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[84732],{9187:function(t){function e(t,e,r){r=r||2;var n,o,a,h,c,d,p,m=e&&e.length,g=m?e[0]*r:t.length,_=i(t,0,g,r,!0),x=[];if(!_||_.next===_.prev)return x;if(m&&(_=function(t,e,r,s){var n,o,a,h=[];for(n=0,o=e.length;n<o;n++)(a=i(t,e[n]*s,n<o-1?e[n+1]*s:t.length,s,!1))===a.next&&(a.steiner=!0),h.push(f(a));for(h.sort(l),n=0;n<h.length;n++)r=u(h[n],r);return r}(t,e,_,r)),t.length>80*r){n=a=t[0],o=h=t[1];for(var v=r;v<g;v+=r)(c=t[v])<n&&(n=c),(d=t[v+1])<o&&(o=d),c>a&&(a=c),d>h&&(h=d);p=0!==(p=Math.max(a-n,h-o))?32767/p:0}return s(_,x,r,n,o,p,0),x}function i(t,e,i,r,s){var n,o;if(s===S(t,e,i,r)>0)for(n=e;n<i;n+=r)o=E(n,t[n],t[n+1],o);else for(n=i-r;n>=e;n-=r)o=E(n,t[n],t[n+1],o);return o&&_(o,o.next)&&(A(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!_(r,r.next)&&0!==g(r.prev,r,r.next))r=r.next;else{if(A(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function s(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,r){var s=t;do{0===s.z&&(s.z=d(s.x,s.y,e,i,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,r,s,n,o,a,h,l=1;do{for(i=t,t=null,n=null,o=0;i;){for(o++,r=i,a=0,e=0;e<l&&(a++,r=r.nextZ);e++);for(h=l;a>0||h>0&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(s=i,i=i.nextZ,a--):(s=r,r=r.nextZ,h--),n?n.nextZ=s:t=s,s.prevZ=n,n=s;i=r}n.nextZ=null,l*=2}while(o>1)}(s)}(t,l,u,c);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),A(t),t=m.next,g=m.next;else if((t=m)===g){f?1===f?s(t=a(r(t),e,i),e,i,l,u,c,2):2===f&&h(t,e,i,l,u,c):s(r(t),e,i,l,u,c,1);break}}}function n(t){var e=t.prev,i=t,r=t.next;if(g(e,i,r)>=0)return!1;for(var s=e.x,n=i.x,o=r.x,a=e.y,h=i.y,l=r.y,u=s<n?s<o?s:o:n<o?n:o,c=a<h?a<l?a:l:h<l?h:l,d=s>n?s>o?s:o:n>o?n:o,f=a>h?a>l?a:l:h>l?h:l,m=r.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&p(s,a,n,h,o,l,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,i,r){var s=t.prev,n=t,o=t.next;if(g(s,n,o)>=0)return!1;for(var a=s.x,h=n.x,l=o.x,u=s.y,c=n.y,f=o.y,m=a<h?a<l?a:l:h<l?h:l,_=u<c?u<f?u:f:c<f?c:f,x=a>h?a>l?a:l:h>l?h:l,v=u>c?u>f?u:f:c>f?c:f,y=d(m,_,e,i,r),T=d(x,v,e,i,r),b=t.prevZ,E=t.nextZ;b&&b.z>=y&&E&&E.z<=T;){if(b.x>=m&&b.x<=x&&b.y>=_&&b.y<=v&&b!==s&&b!==o&&p(a,u,h,c,l,f,b.x,b.y)&&g(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,E.x>=m&&E.x<=x&&E.y>=_&&E.y<=v&&E!==s&&E!==o&&p(a,u,h,c,l,f,E.x,E.y)&&g(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(;b&&b.z>=y;){if(b.x>=m&&b.x<=x&&b.y>=_&&b.y<=v&&b!==s&&b!==o&&p(a,u,h,c,l,f,b.x,b.y)&&g(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;E&&E.z<=T;){if(E.x>=m&&E.x<=x&&E.y>=_&&E.y<=v&&E!==s&&E!==o&&p(a,u,h,c,l,f,E.x,E.y)&&g(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function a(t,e,i){var s=t;do{var n=s.prev,o=s.next.next;!_(n,o)&&x(n,s,s.next,o)&&T(n,o)&&T(o,n)&&(e.push(n.i/i|0),e.push(s.i/i|0),e.push(o.i/i|0),A(s),A(s.next),s=t=o),s=s.next}while(s!==t);return r(s)}function h(t,e,i,n,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&m(h,l)){var u=b(h,l);return h=r(h,h.next),u=r(u,u.next),s(h,e,i,n,o,a,0),void s(u,e,i,n,o,a,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,r=e,s=t.x,n=t.y,o=-1/0;do{if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){var a=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y
vendor: 5,193 bytes, line 3
3);if(a<=s&&a>o&&(o=a,i=r.x<r.next.x?r:r.next,a===s))return i}r=r.next}while(r!==e);if(!i)return null;var h,l=i,u=i.x,d=i.y,f=1/0;r=i;do{s>=r.x&&r.x>=u&&s!==r.x&&p(n<d?s:o,n,u,d,n<d?o:s,n,r.x,r.y)&&(h=Math.abs(n-r.y)/(s-r.x),T(r,t)&&(h<f||h===f&&(r.x>i.x||r.x===i.x&&c(i,r)))&&(i=r,f=h)),r=r.next}while(r!==l);return i}(t,e);if(!i)return e;var s=b(i,t);return r(s,s.next),r(i,i.next)}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,i,r,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function p(t,e,i,r,s,n,o,a){return(s-o)*(e-a)>=(t-o)*(n-a)&&(t-o)*(r-a)>=(i-o)*(e-a)&&(i-o)*(n-a)>=(s-o)*(r-a)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(T(t,e)&&T(e,t)&&function(t,e){var i=t,r=!1,s=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!==i.next.y>n&&i.next.y!==i.y&&s<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||_(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function _(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,r){var s=y(g(t,e,i)),n=y(g(t,e,r)),o=y(g(i,r,t)),a=y(g(i,r,e));return s!==n&&o!==a||(!(0!==s||!v(t,i,e))||(!(0!==n||!v(t,r,e))||(!(0!==o||!v(i,t,r))||!(0!==a||!v(i,e,r)))))}function v(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function y(t){return t>0?1:t<0?-1:0}function T(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function b(t,e){var i=new w(t.i,t.x,t.y),r=new w(e.i,e.x,e.y),s=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,r.next=i,i.prev=r,n.next=r,r.prev=n,r}function E(t,e,i,r){var s=new w(t,e,i);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function w(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,i,r){for(var s=0,n=e,o=i-r;n<i;n+=r)s+=(t[o]-t[n])*(t[n+1]+t[o+1]),o=n;return s}t.exports=e,t.exports.default=e,e.deviation=function(t,e,i,r){var s=e&&e.length,n=s?e[0]*i:t.length,o=Math.abs(S(t,0,n,i));if(s)for(var a=0,h=e.length;a<h;a++){var l=e[a]*i,u=a<h-1?e[a+1]*i:t.length;o-=Math.abs(S(t,l,u,i))}var c=0;for(a=0;a<r.length;a+=3){var d=r[a]*i,f=r[a+1]*i,p=r[a+2]*i;c+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},e.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,s=0;s<t.length;s++){for(var n=0;n<t[s].length;n++)for(var o=0;o<e;o++)i.vertices.push(t[s][n][o]);s>0&&(r+=t[s-1].length,i.holes.push(r))}return i}},26729:function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,r,n,o){if("function"!==typeof r)throw new TypeError("The listener must be a function");var a=new s(r,n||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,r,s=[];if(0===this._eventsCount)return s;for(r in t=this._events)e.call(t,r)&&s.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,o=new Array(n);s<n;s++)o[s]=r[s].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,r=this._events[e];return r?r.fn?1:r.length:0},a.prototype.emit=function(t,e,r,s,n,o){var a=i?i+t:t;if(!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,s),!0;case 5:return u.fn.call(u.context,e,r,s,n),!0;case 6:return u.fn.call(u.context,e,r,s,n,o),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var d,f=u.length;for(l=0;l<f;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,s);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];u[l].fn.apply(u[l].context,h)}}return!0}
3,a.prototype.on=function(t,e,i){return n(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return n(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,r,s){var n=i?i+t:t;if(!this._events[n])return this;if(!e)return o(this,n),this;var a=this._events[n];if(a.fn)a.fn!==e||s&&!a.once||r&&a.context!==r||o(this,n);else{for(var h=0,l=[],u=a.length;h<u;h++)(a[h].fn!==e||s&&!a[h].once||r&&a[h].context!==r)&&l.push(a[h]);l.length?this._events[n]=1===l.length?l[0]:l:o(this,n)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a},89804:function(t,e,i){i.d(e,{M:function(){return o}});var r=i(67767),s=i(68276);const n=class t{constructor(e){this.stage=new s.W2,e=Object.assign({forceCanvas:!1},e),this.renderer=(0,r.e6)(e),t._plugins.forEach((t=>{t.init.call(this,e)}))}render(){this.renderer.render(this.stage)}get view(){return this.renderer?.view}get screen(){return this.renderer?.screen}destroy(e,i){const r=t._plugins.slice(0);r.reverse(),r.forEach((t=>{t.destroy.call(this)})),this.stage.destroy(i),this.stage=null,this.renderer.destroy(e),this.renderer=null}};n._plugins=[];let o=n;r.Rw.handleByList(r.nw.Application,o._plugins);class a{static init(t){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame((()=>this.resize())))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;let t,e;if(this.cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,e=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:r}=this._resizeTo;t=i,e=r}this.renderer.resize(t,e),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}a.extension=r.nw.Application,r.Rw.add(a)},10787:function(t,e,i){i.d(e,{Q2:function(){return c},gN:function(){return o},uz:function(){return Q},cU:function(){return R}});var r=i(67767);const s={loader:r.nw.LoadParser,resolver:r.nw.ResolveParser,cache:r.nw.CacheParser,detection:r.nw.DetectionParser};r.Rw.handle(r.nw.Asset,(t=>{const e=t.ref;Object.entries(s).filter((([t])=>!!e[t])).forEach((([t,i])=>r.Rw.add(Object.assign(e[t],{extension:e[t].extension??i}))))}),(t=>{const e=t.ref;Object.keys(s).filter((t=>!!e[t])).forEach((t=>r.Rw.remove(e[t])))}));class n{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach((t=>{this._assetList.push(t)})),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i<e;i++)t.push(this._assetList.pop());await this._loader.load(t),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}function o(t,e){const i=t.split("?")[0],s=r.P6.path.extname(i).toLowerCase();return Array.isArray(e)?e.includes(s):s===e}const a=(t,e,i=!1)=>(Array.isArray(t)||(t=[t]),e?t.map((t=>"string"==typeof t||i?e(t):t)):t);const h=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const i=a(t);let s;for(let r=0;r<this.parsers.length;r++){const t=this.parsers[r];if(t.test(e)){s=t.getCacheableAssets(i,e);break}}s||(s={}
3,i.forEach((t=>{s[t]=e})));const n=Object.keys(s),o={cacheKeys:n,keys:i};if(i.forEach((t=>{this._cacheMap.set(t,o)})),n.forEach((t=>{this._cache.has(t)&&this._cache.get(t)!==e&&console.warn("[Cache] already has key:",t),this._cache.set(t,s[t])})),e instanceof r.xE){const t=e;i.forEach((e=>{t.baseTexture!==r.xE.EMPTY.baseTexture&&r.VL.addToCache(t.baseTexture,e),r.xE.addToCache(t,e)}))}}remove(t){if(!this._cacheMap.has(t))return void console.warn(`[Assets] Asset id ${t} was not found in the Cache`);const e=this._cacheMap.get(t);e.cacheKeys.forEach((t=>{this._cache.delete(t)})),e.keys.forEach((t=>{this._cacheMap.delete(t)}))}get parsers(){return this._parsers}},l=t=>!Array.isArray(t);class u{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,i)=>(this._parsersValidated=!1,t[e]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const i={promise:null,parser:null};return i.promise=(async()=>{let r=null,s=null;if(e.loadParser&&(s=this._parserHash[e.loadParser],s||console.warn(`[Assets] specified load parser "${e.loadParser}" not found while loading ${t}`)),!s){for(let i=0;i<this.parsers.length;i++){const r=this.parsers[i];if(r.load&&r.test?.(t,e,this)){s=r;break}}if(!s)return console.warn(`[Assets] ${t} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}r=await s.load(t,e,this),i.parser=s;for(let t=0;t<this.parsers.length;t++){const s=this.parsers[t];s.parse&&s.parse&&await(s.testParse?.(r,e,this))&&(r=await s.parse(r,e,this)||r,i.parser=s)}return r})(),i}async load(t,e){this._parsersValidated||this._validateParsers();let i=0;const s={},n=l(t),o=a(t,(t=>({alias:[t],src:t}))),h=o.length,u=o.map((async t=>{const n=r.P6.path.toAbsolute(t.src);if(!s[t.src])try{this.promiseCache[n]||(this.promiseCache[n]=this._getLoadPromiseAndParser(n,t)),s[t.src]=await this.promiseCache[n].promise,e&&e(++i/h)}catch(o){throw delete this.promiseCache[n],delete s[t.src],new Error(`[Loader.load] Failed to load ${n}.\n${o}`)}}));return await Promise.all(u),n?s[o[0].src]:s}async unload(t){const e=a(t,(t=>({alias:[t],src:t}))).map((async t=>{const e=r.P6.path.toAbsolute(t.src),i=this.promiseCache[e];if(i){const r=await i.promise;delete this.promiseCache[e],i.parser?.unload?.(r,t,this)}}));await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter((t=>t.name)).reduce(((t,e)=>(t[e.name]&&console.warn(`[Assets] loadParser name conflict "${e.name}"`),{...t,[e.name]:e})),{})}}var c=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(c||{});function d(t,e){if(Array.isArray(e)){for(const i of e)if(t.startsWith(`data:${i}`))return!0;return!1}return t.startsWith(`data:${e}`)}const f={extension:{type:r.nw.LoadParser,priority:c.Low},name:"loadJson",test:t=>d(t,"application/json")||o(t,".json"),load:async t=>await(await r.Xd.ADAPTER.fetch(t)).json()};r.Rw.add(f);const p={name:"loadTxt",extension:{type:r.nw.LoadParser,priority:c.Low},test:t=>d(t,"text/plain")||o(t,".txt"),load:async t=>await(await r.Xd.ADAPTER.fetch(t)).text()};r.Rw.add(p);const m=["normal","bold","100","200","300","400","500","600","700","800","900"],g=[".ttf",".otf",".woff",".woff2"],_=["font/ttf","font/otf","font/woff","font/woff2"],x=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;const v=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;const y={extension:{type:r.nw.LoadParser,priority:c.Low},name:"loadWebFont",test:t=>d(t,_)||o(t,g),async load(t,e){const i=r.Xd.ADAPTER.getFontFaceSet();if(i){const n=[],o=e.data?.family??function(t){const e=r.P6.path.extname(t),i=r.P6.path.basename(t,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map((t=>t.charAt(0).toUpperCase()+t.slice(1)));let s=i.length>0;for(const r of i)if(!r.match(x)){s=!1;break}let n=i.join(" ");return s||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}(t),a=e.data?.weights?.filter((t=>m.includes(t)))??["normal"],h=e.data??{};for(let e=0;e<a.length;e++){const r=a[e],l=new FontFace(o,`url(${s=t,v.test(s)?s:encodeURI(s)})`,{...h,weight:r});await l.load(),i.add(l),n.push(l)}return 1===n.length?n[0]:n}var s;return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),null}
3,unload(t){(Array.isArray(t)?t:[t]).forEach((t=>r.Xd.ADAPTER.getFontFaceSet().delete(t)))}};r.Rw.add(y);let T=null;class b{constructor(){T||(T=URL.createObjectURL(new Blob(['(function() {\n "use strict";\n const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";\n async function checkImageBitmap() {\n try {\n if (typeof createImageBitmap != "function")\n return !1;\n const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap.width === 1 && imageBitmap.height === 1;\n } catch {\n return !1;\n }\n }\n checkImageBitmap().then((result) => {\n self.postMessage(result);\n });\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(T)}}b.revokeObjectURL=function(){T&&(URL.revokeObjectURL(T),T=null)};let E=null;class A{constructor(){E||(E=URL.createObjectURL(new Blob(['(function() {\n "use strict";\n async function loadImageBitmap(url) {\n const response = await fetch(url);\n if (!response.ok)\n throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);\n const imageBlob = await response.blob();\n return await createImageBitmap(imageBlob);\n }\n self.onmessage = async (event) => {\n try {\n const imageBitmap = await loadImageBitmap(event.data.data[0]);\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id\n }, [imageBitmap]);\n } catch (e) {\n self.postMessage({\n error: e,\n uuid: event.data.uuid,\n id: event.data.id\n });\n }\n };\n})();\n'],{type:"application/javascript"}))),this.worker=new Worker(E)}}A.revokeObjectURL=function(){E&&(URL.revokeObjectURL(E),E=null)};let w,S=0;const I=new class{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return void 0!==this._isImageBitmapSupported||(this._isImageBitmapSupported=new Promise((t=>{const{worker:e}=new b;e.addEventListener("message",(i=>{e.terminate(),b.revokeObjectURL(),t(i.data)}))}))),this._isImageBitmapSupported}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){void 0===w&&(w=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers<w&&(this._createdWorkers++,t=(new A).worker,t.addEventListener("message",(t=>{this.complete(t.data),this.returnWorker(t.target),this.next()}))),t}returnWorker(t){this.workerPool.push(t)}complete(t){void 0!==t.error?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const i=new Promise(((i,r)=>{this.queue.push({id:t,arguments:e,resolve:i,reject:r})}));return this.next(),i}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),i=e.id;this.resolveHash[S]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:S++,id:i})}};function R(t,e,i){t.resource.internal=!0;const s=new r.xE(t),n=()=>{delete e.promiseCache[i],h.has(i)&&h.remove(i)};return s.baseTexture.once("destroyed",(()=>{i in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),n())})),s.once("destroyed",(()=>{t.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),n())})),s}const C=[".jpeg",".jpg",".png",".webp",".avif"],P=["image/jpeg","image/png","image/webp","image/avif"];const M={name:"loadTextures",extension:{type:r.nw.LoadParser,priority:c.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test:t=>d(t,P)||o(t,C),async load(t,e,i){const s=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;n=s?this.config.preferWorkers&&await I.isImageBitmapSupported()?await I.loadImageBitmap(t):await async function(t){const e=await r.Xd.ADAPTER.fetch(t);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${t}: ${e.status} ${e.statusText}`);const i=await e.blob();return await createImageBitmap(i)}(t):await new Promise(((e,i)=>{const r=new Image;r.crossOrigin=this.config.crossOrigin,r.src=t,r.complete?e(r):(r.onload=()=>e(r),r.onerror=t=>i(t))}));const o={...e.data};o.resolution??(o.resolution=r.P6.getResolutionOfUrl(t)),s&&void 0===o.resourceOptions?.ownsImageBitmap&&(o.resourceOptions={...o.resourceOptions},o.resourceOptions.ownsImageBitmap=!0);const a=new r.VL(n,o);return a.resource.src=t,R(a,i,t)},unload(t){t.destroy(!0)}};r.Rw.add(M);const B={extension:{type:r.nw.LoadParser,priority:c.High},name:"loadSVG",test:t=>d(t,"image/svg+xml")||o(t,".svg"),testParse:async t=>r.pX.test(t),async parse(t,e,i){const s=new r.pX(t,e?.data?.resourceOptions);await s.load();const n=new r.VL(s,{resolution:r.P6.getResolutionOfUrl(t),...e?.data});return n.resource.src=e.src,R(n,i,e.src)},load:async(t,e)=>(await r.Xd.ADAPTER.fetch(t)).text(),unload:M.unload};r.Rw.add(B);const D=[".mp4",".m4v",".webm",".ogv"],N=["video/mp4","video/webm","video/ogg"],F={name:"loadVideo",extension:{type:r.nw.LoadParser,priority:c.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test:t=>d(t,N)||o(t,D),async load(t,e,i){let s;const n=await(await r.Xd.ADAPTER.fetch(t)).blob(),o=URL.createObjectURL(n);try{const n={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...e?.data?.resourceOptions,autoLoad:!0},a=new r.eH(o,n);await a.load();const h=new r.VL(a,{alphaMode:await r.P6.detectVideoAlphaMode(),resolution:r.P6.getResolutionOfUrl(t),...e?.data});h.resource.src=t,s=R(h,i,t),s.baseTexture.once("destroyed",(()=>{URL.revokeObjectURL(o)}))}catch(a){throw URL.revokeObjectURL(o),a}return s},unload(t){t.destroy(!0)}};function L(t,e,i,r,s){const n=e[i];for(let o=0;o<n.length;o++){const a=n[o];i<e.length-1?L(t.replace(r[i],a),e,i+1,r,s):s.push(t.replace(r[i],a))}}function O(t){const e=t.match(/\{(.*?)\}/g),i=[];if(e){const r=[];e.forEach((t=>{const e=t.substring(1,t.length-1).split(",");r.push(e)})),L(t,r,0,e,i)}else i.push(t);return i}r.Rw.add(F);class U{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach((t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}
3)),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if("string"==typeof t)this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}}getAlias(t){const{alias:e,name:i,src:r,srcs:s}=t;return a(e||i||r||s,(t=>"string"==typeof t?t:Array.isArray(t)?t.map((t=>t?.src??t?.srcs??t)):t?.src||t?.srcs?t.src??t.srcs:t),!0)}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach((t=>{this.addBundle(t.name,t.assets)}))}addBundle(t,e){const i=[];Array.isArray(e)?e.forEach((e=>{const r=e.src??e.srcs,s=e.alias??e.name;let n;if("string"==typeof s){const e=this._createBundleAssetId(t,s);i.push(e),n=[s,e]}else{const e=s.map((e=>this._createBundleAssetId(t,e)));i.push(...e),n=[...s,...e]}this.add({...e,alias:n,src:r})})):Object.keys(e).forEach((r=>{const s=[r,this._createBundleAssetId(t,r)];if("string"==typeof e[r])this.add({alias:s,src:e[r]});else if(Array.isArray(e[r]))this.add({alias:s,src:e[r]});else{const t=e[r],i=t.src??t.srcs;this.add({...t,alias:s,src:Array.isArray(i)?i:[i]})}i.push(...s)})),this._bundles[t]=i}add(t,e,i,s,n){const o=[];let h;"string"==typeof t||Array.isArray(t)&&"string"==typeof t[0]?(r.P6.deprecation("7.2.0","Assets.add now uses an object instead of individual parameters.\nPlease use Assets.add({ alias, src, data, format, loadParser }) instead."),o.push({alias:t,src:e,data:i,format:s,loadParser:n})):Array.isArray(t)?o.push(...t):o.push(t),h=t=>{this.hasKey(t)&&console.warn(`[Resolver] already has key: ${t} overwriting`)},a(o).forEach((t=>{const{src:e,srcs:i}=t;let{data:r,format:s,loadParser:n}=t;const o=a(e||i).map((t=>"string"==typeof t?O(t):Array.isArray(t)?t:[t])),l=this.getAlias(t);Array.isArray(l)?l.forEach(h):h(l);const u=[];o.forEach((t=>{t.forEach((t=>{let e={};if("object"!=typeof t){e.src=t;for(let i=0;i<this._parsers.length;i++){const r=this._parsers[i];if(r.test(t)){e=r.parse(t);break}}}else r=t.data??r,s=t.format??s,n=t.loadParser??n,e={...e,...t};if(!l)throw new Error(`[Resolver] alias is undefined for this asset: ${e.src}`);e=this.buildResolvedAsset(e,{aliases:l,data:r,format:s,loadParser:n}),u.push(e)}))})),l.forEach((t=>{this._assetMap[t]=u}))}))}resolveBundle(t){const e=l(t);t=a(t);const i={};return t.forEach((t=>{const e=this._bundles[t];if(e){const r=this.resolve(e),s={};for(const e in r){const i=r[e];s[this._extractAssetIdFromBundle(t,e)]=i}i[t]=s}})),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if("string"!=typeof t){const t={};for(const i in e)t[i]=e[i].src;return t}return e.src}resolve(t){const e=l(t);t=a(t);const i={};return t.forEach((t=>{if(!this._resolverHash[t])if(this._assetMap[t]){let e=this._assetMap[t];const i=e[0],r=this._getPreferredOrder(e);r?.priority.forEach((t=>{r.params[t].forEach((i=>{const r=e.filter((e=>!!e[t]&&e[t]===i));r.length&&(e=r)}))})),this._resolverHash[t]=e[0]??i}else this._resolverHash[t]=this.buildResolvedAsset({alias:[t],src:t},{});i[t]=this._resolverHash[t]})),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const e=t[0],i=this._preferredOrder.find((t=>t.params.format.includes(e.format)));if(i)return i}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;return`${t}${/\?/.test(t)?"&":"?"}${this._defaultSearchParams}`}buildResolvedAsset(t,e){const{aliases:i,data:s,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=r.P6.path.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...s||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??t.format??r.P6.path.extname(t.src).slice(1),t.srcs=t.src,t.name=t.alias,t}}const k=new class{constructor(){this._detections=[],this._initialized=!1,this.resolver=new
3U,this.loader=new u,this.cache=h,this._backgroundLoader=new n(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){if(this._initialized)return void console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let e=t.manifest;"string"==typeof e&&(e=await this.load(e)),this.resolver.addManifest(e)}const e=t.texturePreference?.resolution??1,i="number"==typeof e?[e]:e,r=await this._detectFormats({preferredFormats:t.texturePreference?.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:r,resolution:i}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,i,r,s){this.resolver.add(t,e,i,r,s)}async load(t,e){this._initialized||await this.init();const i=l(t),r=a(t).map((t=>{if("string"!=typeof t){const e=this.resolver.getAlias(t);return e.some((t=>!this.resolver.hasKey(t)))&&this.add(t),Array.isArray(e)?e[0]:e}return this.resolver.hasKey(t)||this.add({alias:t,src:t}),t})),s=this.resolver.resolve(r),n=await this._mapLoadToResolve(s,e);return i?n[r[0]]:n}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let i=!1;"string"==typeof t&&(i=!0,t=[t]);const r=this.resolver.resolveBundle(t),s={},n=Object.keys(r);let o=0,a=0;const h=()=>{e?.(++o/a)},l=n.map((t=>{const e=r[t];return a+=Object.keys(e).length,this._mapLoadToResolve(e,h).then((e=>{s[t]=e}))}));return await Promise.all(l),i?s[t[0]]:s}async backgroundLoad(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),"string"==typeof t&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach((t=>{this._backgroundLoader.add(Object.values(t))}))}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if("string"==typeof t)return h.get(t);const e={};for(let i=0;i<t.length;i++)e[i]=h.get(t[i]);return e}async _mapLoadToResolve(t,e){const i=Object.values(t),r=Object.keys(t);this._backgroundLoader.active=!1;const s=await this.loader.load(i,e);this._backgroundLoader.active=!0;const n={};return i.forEach(((t,e)=>{const i=s[t.src],o=[t.src];t.alias&&o.push(...t.alias),n[r[e]]=i,h.set(o,i)})),n}async unload(t){this._initialized||await this.init();const e=a(t).map((t=>"string"!=typeof t?t.src:t)),i=this.resolver.resolve(e);await this._unloadFromResolved(i)}async unloadBundle(t){this._initialized||await this.init(),t=a(t);const e=this.resolver.resolveBundle(t),i=Object.keys(e).map((t=>this._unloadFromResolved(e[t])));await Promise.all(i)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach((t=>{h.remove(t.src)})),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const i of t.detections)t.skipDetections||await i.test()?e=await i.add(e):t.skipDetections||(e=await i.remove(e));return e=e.filter(((t,i)=>e.indexOf(t)===i)),e}get detections(){return this._detections}get preferWorkers(){return M.config.preferWorkers}set preferWorkers(t){r.P6.deprecation("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach((e=>{e.config&&Object.keys(e.config).filter((e=>e in t)).forEach((i=>{e.config[i]=t[i]}))}))}};r.Rw.handleByList(r.nw.LoadParser,k.loader.parsers).handleByList(r.nw.ResolveParser,k.resolver.parsers).handleByList(r.nw.CacheParser,k.cache.parsers).handleByList(r.nw.DetectionParser,k.detections);const G={extension:r.nw.CacheParser,test:t=>Array.isArray(t)&&t.every((t=>t instanceof r.xE)),getCacheableAssets:(t,e)=>{const i={};return t.forEach((t=>{e.forEach(((e,r)=>{i[t+(0===r?"":r+1)]=e}))})),i}};async function H(t){if("Image"in globalThis)return new Promise((e=>{const i=new Image;i.onload=()=>{e(!0)},i.onerror=()=>{e(!1)},i.src=t}));if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(t)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}r.Rw.add(G);const X={extension:{type:r.nw.DetectionParser,priority:1},test:async()=>H("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdj
3FDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async t=>[...t,"avif"],remove:async t=>t.filter((t=>"avif"!==t))};r.Rw.add(X);const V={extension:{type:r.nw.DetectionParser,priority:0},test:async()=>H("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async t=>[...t,"webp"],remove:async t=>t.filter((t=>"webp"!==t))};r.Rw.add(V);const W=["png","jpg","jpeg"],z={extension:{type:r.nw.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async t=>[...t,...W],remove:async t=>t.filter((t=>!W.includes(t)))};r.Rw.add(z);const $="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function j(t){return!$&&""!==document.createElement("video").canPlayType(t)}const Y={extension:{type:r.nw.DetectionParser,priority:0},test:async()=>j("video/webm"),add:async t=>[...t,"webm"],remove:async t=>t.filter((t=>"webm"!==t))};r.Rw.add(Y);const K={extension:{type:r.nw.DetectionParser,priority:0},test:async()=>j("video/mp4"),add:async t=>[...t,"mp4","m4v"],remove:async t=>t.filter((t=>"mp4"!==t&&"m4v"!==t))};r.Rw.add(K);const q={extension:{type:r.nw.DetectionParser,priority:0},test:async()=>j("video/ogg"),add:async t=>[...t,"ogv"],remove:async t=>t.filter((t=>"ogv"!==t))};r.Rw.add(q);const Z={extension:r.nw.ResolveParser,test:M.test,parse:t=>({resolution:parseFloat(r.Xd.RETINA_PREFIX.exec(t)?.[1]??"1"),format:r.P6.path.extname(t).slice(1),src:t})};r.Rw.add(Z);const Q=(t,e)=>{const i=e.split("?")[1];return i&&(t+=`?${i}`),t}},69118:function(t,e,i){i.d(e,{I:function(){return B}});var r={grad:.9,turn:360,rad:360/(2*Math.PI)},s=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},n=function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=Math.pow(10,e)),Math.round(i*t)/i+0},o=function(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=1),t>i?i:t>e?t:e},a=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},h=function(t){return{r:o(t.r,0,255),g:o(t.g,0,255),b:o(t.b,0,255),a:o(t.a)}},l=function(t){return{r:n(t.r),g:n(t.g),b:n(t.b),a:n(t.a,3)}},u=/^#([0-9a-f]{3,8})$/i,c=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},d=function(t){var e=t.r,i=t.g,r=t.b,s=t.a,n=Math.max(e,i,r),o=n-Math.min(e,i,r),a=o?n===e?(i-r)/o:n===i?2+(r-e)/o:4+(e-i)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:s}},f=function(t){var e=t.h,i=t.s,r=t.v,s=t.a;e=e/360*6,i/=100,r/=100;var n=Math.floor(e),o=r*(1-i),a=r*(1-(e-n)*i),h=r*(1-(1-e+n)*i),l=n%6;return{r:255*[r,a,o,o,h,r][l],g:255*[h,r,r,a,o,o][l],b:255*[o,o,h,r,r,a][l],a:s}},p=function(t){return{h:a(t.h),s:o(t.s,0,100),l:o(t.l,0,100),a:o(t.a)}},m=function(t){return{h:n(t.h),s:n(t.s),l:n(t.l),a:n(t.a,3)}},g=function(t){return f((i=(e=t).s,{h:e.h,s:(i*=((r=e.l)<50?r:100-r)/100)>0?2*i/(r+i)*100:0,v:r+i,a:e.a}));var e,i,r},_=function(t){return{h:(e=d(t)).h,s:(s=(200-(i=e.s))*(r=e.v)/100)>0&&s<200?i*r/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,i,r,s},x=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,T=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b={string:[[function(t){var e=u.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?n(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?n(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=y.exec(t)||T.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:h({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=x.exec(t)||v.exec(t);if(!e)return null;var i,s,n=p({h:(i=e[1],s=e[2],void 0===s&&(s="deg"),Number(i)*(r[s]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return g(n)},"hsl"]],object:[[function(t){var e=t.r,i=t.g,r=t.b,n=t.a,o=void 0===n?1:n;return s(e)&&s(i)&&s(r)?h({r:Number(e),g:Number(i),b:Number(r),a:Number(o)}):null},"rgb"],[function(t){var e=t.h,i=t.s,r=t.l,n=t.a,o=void 0===n?1:n;
3if(!s(e)||!s(i)||!s(r))return null;var a=p({h:Number(e),s:Number(i),l:Number(r),a:Number(o)});return g(a)},"hsl"],[function(t){var e=t.h,i=t.s,r=t.v,n=t.a,h=void 0===n?1:n;if(!s(e)||!s(i)||!s(r))return null;var l=function(t){return{h:a(t.h),s:o(t.s,0,100),v:o(t.v,0,100),a:o(t.a)}}({h:Number(e),s:Number(i),v:Number(r),a:Number(h)});return f(l)},"hsv"]]},E=function(t,e){for(var i=0;i<e.length;i++){var r=e[i][0](t);if(r)return[r,e[i][1]]}return[null,void 0]},A=function(t){return"string"==typeof t?E(t.trim(),b.string):"object"==typeof t&&null!==t?E(t,b.object):[null,void 0]},w=function(t,e){var i=_(t);return{h:i.h,s:o(i.s+100*e,0,100),l:i.l,a:i.a}},S=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},I=function(t,e){var i=_(t);return{h:i.h,s:i.s,l:o(i.l+100*e,0,100),a:i.a}},R=function(){function t(t){this.parsed=A(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return null!==this.parsed},t.prototype.brightness=function(){return n(S(this.rgba),2)},t.prototype.isDark=function(){return S(this.rgba)<.5},t.prototype.isLight=function(){return S(this.rgba)>=.5},t.prototype.toHex=function(){return e=(t=l(this.rgba)).r,i=t.g,r=t.b,o=(s=t.a)<1?c(n(255*s)):"","#"+c(e)+c(i)+c(r)+o;var t,e,i,r,s,o},t.prototype.toRgb=function(){return l(this.rgba)},t.prototype.toRgbString=function(){return e=(t=l(this.rgba)).r,i=t.g,r=t.b,(s=t.a)<1?"rgba("+e+", "+i+", "+r+", "+s+")":"rgb("+e+", "+i+", "+r+")";var t,e,i,r,s},t.prototype.toHsl=function(){return m(_(this.rgba))},t.prototype.toHslString=function(){return e=(t=m(_(this.rgba))).h,i=t.s,r=t.l,(s=t.a)<1?"hsla("+e+", "+i+"%, "+r+"%, "+s+")":"hsl("+e+", "+i+"%, "+r+"%)";var t,e,i,r,s},t.prototype.toHsv=function(){return t=d(this.rgba),{h:n(t.h),s:n(t.s),v:n(t.v),a:n(t.a,3)};var t},t.prototype.invert=function(){return C({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),C(w(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),C(w(this.rgba,-t))},t.prototype.grayscale=function(){return C(w(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),C(I(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),C(I(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?C({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):n(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=_(this.rgba);return"number"==typeof t?C({h:t,s:e.s,l:e.l,a:e.a}):n(e.h)},t.prototype.isEqual=function(t){return this.toHex()===C(t).toHex()},t}(),C=function(t){return t instanceof R?t:new R(t)},P=[];!function(t){t.forEach((function(t){P.indexOf(t)<0&&(t(R,b),P.push(t))}))}([function(t,e){var i={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",s
3andybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var s in i)r[i[s]]=s;var n={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,o,a=r[this.toHex()];if(a)return a;if(null==e?void 0:e.closest){var h=this.toRgb(),l=1/0,u="black";if(!n.length)for(var c in i)n[c]=new t(i[c]).toRgb();for(var d in i){var f=(s=h,o=n[d],Math.pow(s.r-o.r,2)+Math.pow(s.g-o.g,2)+Math.pow(s.b-o.b,2));f<l&&(l=f,u=d)}return u}},e.string.push([function(e){var r=e.toLowerCase(),s="transparent"===r?"#0000":i[r];return s?new t(s).toRgb():null},"name"])}]);const M=class t{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(e){if(e instanceof t)this._value=this.cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(null===e)throw new Error("Cannot set PIXI.Color#value to null");(null===this._value||!this.isSourceEqual(this._value,e))&&(this.normalize(e),this._value=this.cloneSource(e))}}get value(){return this._value}cloneSource(t){return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?{...t}:t}isSourceEqual(t,e){const i=typeof t;if(i!==typeof e)return!1;if("number"===i||"string"===i||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every(((t,i)=>t===e[i]));if(null!==t&&null!==e){const i=Object.keys(t),r=Object.keys(e);return i.length===r.length&&i.every((i=>t[i]===e[i]))}return t===e}toRgba(){const[t,e,i,r]=this._components;return{r:t,g:e,b:i,a:r}}toRgb(){const[t,e,i]=this._components;return{r:t,g:e,b:i}}toRgbaString(){const[t,e,i]=this.toUint8RgbArray();return`rgba(${t},${e},${i},${this.alpha})`}toUint8RgbArray(t){const[e,i,r]=this._components;return(t=t??[])[0]=Math.round(255*e),t[1]=Math.round(255*i),t[2]=Math.round(255*r),t}toRgbArray(t){t=t??[];const[e,i,r]=this._components;return t[0]=e,t[1]=i,t[2]=r,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(e){const[i,r,s,n]=t.temp.setValue(e)._components;return this._components[0]*=i,this._components[1]*=r,this._components[2]*=s,this._components[3]*=n,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let i=this._int>>16&255,r=this._int>>8&255,s=255&this._int;return e&&(i=i*t+.5|0,r=r*t+.5|0,s=s*t+.5|0),(255*t<<24)+(i<<16)+(r<<8)+s}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,i,r]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(i*t)/t,this._components[2]=Math.round(r*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,i,r,s]=this._components;return t[0]=e,t[1]=i,t[2]=r,t[3]=s,t}normalize(e){let i,r,s,n;if(("number"==typeof e||e instanceof Number)&&e>=0&&e<=16777215){i=(e>>16&255)/255,r=(e>>8&255)/255,s=(255&e)/255,n=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[i,r,s,n=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[i,r,s,n=255]=e,i/=255,r/=255,s/=255,n/=255;else if("string"==typeof e||"object"==typeof e){if("string"==typeof e){const i=t.HEX_PATTERN.exec(e);i&&(e=`#${i[2]}`)}const o=C(e);o.isValid()&&(({r:i,g:r,b:s,a:n}=o.rgba),i/=255,r/=255,s/=255)}if(void 0===i)throw new Error(`Unable to convert color ${e}`);this._components[0]=i,this._components[1]=r,this._components[2]=s,this._components[3]=n,this.refreshInt()}refreshInt(){this._clamp(this._components);const[t,e,i]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*i|0)}_clamp(t,e=0,i=1){return"number"==typeof t?Math.min(Math.max(t,e),i):(t.forEach(((r,s)=>{t[s]=Math.min(Math.max(r,e),i)})),t)}};M.shared=new M,M.temp=new M,M.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let B=M}
3,57361:function(t,e,i){i.d(e,{A7:function(){return v},G5:function(){return y},I2:function(){return h},N3:function(){return s},Nt:function(){return f},T$:function(){return o},UN:function(){return _},V0:function(){return n},Vi:function(){return r},WB:function(){return p},aH:function(){return d},cB:function(){return x},iw:function(){return m},lg:function(){return a},mr:function(){return T},oT:function(){return c},sp:function(){return l},vK:function(){return u},yl:function(){return g}});var r=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(r||{}),s=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(s||{}),n=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(n||{}),o=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t))(o||{}),a=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(a||{}),h=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(h||{}),l=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(l||{}),u=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(u||{}),c=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(c||{}),d=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(d||{}),f=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(f||{}),p=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(p||{}),m=(t=>(t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(m||{}),g=(t=>(t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t))(g||{}),_=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(_||{}),x=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(x||{}),v=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(v||{}),y=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(y||{}),T=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(T||{})}
3,67767:function(t,e,i){i.d(e,{iw:function(){return r.iw},T$:function(){return r.T$},jd:function(){return lt},VL:function(){return v},a$:function(){return y},JZ:function(){return C},Ie:function(){return Q},lW:function(){return b},qm:function(){return g},yl:function(){return r.yl},Y8:function(){return Pe},Cd:function(){return P.Cd},Il:function(){return o.I},ZX:function(){return P.ZX},lg:function(){return r.lg},Pj:function(){return P.Pj},nw:function(){return a.n},I2:function(){return r.I2},wn:function(){return rt},wG:function(){return R},A7:function(){return r.A7},KI:function(){return r.WB},y3:function(){return P.y3},bO:function(){return J},AB:function(){return P.AB},_b:function(){return P._b},E9:function(){return P.E9},mg:function(){return P.mg},$r:function(){return j},ud:function(){return vt},jl:function(){return P.jl},N3:function(){return r.N3},Ae:function(){return P.Ae},TI:function(){return gt},Th:function(){return Re},c9:function(){return P.c9},aH:function(){return r.aH},HS:function(){return P.HS},pX:function(){return Fe},ex:function(){return q},ZM:function(){return c},Od:function(){return ce},vK:function(){return r.vK},xE:function(){return mt},UX:function(){return Pt},vB:function(){return xe.vB},wx:function(){return P.wx},uF:function(){return xe.uF},oo:function(){return K},eH:function(){return Oe},Rv:function(){return h},Nt:function(){return r.Nt},e6:function(){return ye},Y9:function(){return be},kP:function(){return Te},Rw:function(){return a.R},Lv:function(){return P.Lv},Xd:function(){return s.Xd},P6:function(){return n}});var r=i(57361),s=i(78706),n=i(89009),o=i(69118),a=i(90463);class h{constructor(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const l=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function u(t){let e="";for(let i=0;i<t;++i)i>0&&(e+="\nelse "),i<t-1&&(e+=`if(test == ${i}.0){}`);return e}class c{constructor(){this.data=0,this.blendMode=r.T$.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(t){!!(1&this.data)!==t&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(t){!!(2&this.data)!==t&&(this.data^=2)}get culling(){return!!(4&this.data)}set culling(t){!!(4&this.data)!==t&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(t){!!(8&this.data)!==t&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(t){!!(32&this.data)!==t&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(t){!!(16&this.data)!==t&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==r.T$.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}static for2d(){const t=new c;return t.depthTest=!1,t.blend=!0,t}}c.prototype.toString=function(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`};const d=[];function f(t,e){if(!t)return null;let i="";if("string"==typeof t){const e=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);e&&(i=e[1].toLowerCase())}
3for(let r=d.length-1;r>=0;--r){const s=d[r];if(s.test&&s.test(t,i))return new s(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class p{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,i,r,s,n,o,a){if(arguments.length>8)throw new Error("max arguments reached");const{name:h,items:l}=this;this._aliasCount++;for(let u=0,c=l.length;u<c;u++)l[u][h](t,e,i,r,s,n,o,a);return l===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return 0===this.items.length}get name(){return this._name}}Object.defineProperties(p.prototype,{dispatch:{value:p.prototype.emit},run:{value:p.prototype.emit}});class m{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new p("setRealSize"),this.onUpdate=new p("update"),this.onError=new p("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,i){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,e){return!1}}class g extends m{constructor(t,e){const{width:i,height:r}=e||{};if(!i||!r)throw new Error("BufferResource width or height invalid");super(i,r),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,i){const s=t.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,this.unpackAlignment),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===r.iw.UNPACK);const n=e.realWidth,o=e.realHeight;return i.width===n&&i.height===o?s.texSubImage2D(e.target,0,0,0,n,o,e.format,i.type,this.data):(i.width=n,i.height=o,s.texImage2D(e.target,0,i.internalFormat,n,o,0,e.format,i.type,this.data)),!0}dispose(){this.data=null}static test(t){return null===t||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}const _={scaleMode:r.aH.NEAREST,alphaMode:r.iw.NPM},x=class t extends n.EventEmitter{constructor(e=null,i=null){super(),i=Object.assign({},t.defaultOptions,i);const{alphaMode:r,mipmap:o,anisotropicLevel:a,scaleMode:h,width:l,height:u,wrapMode:c,format:d,type:p,target:g,resolution:_,resourceOptions:x}=i;e&&!(e instanceof m)&&((e=f(e,x)).internal=!0),this.resolution=_||s.Xd.RESOLUTION,this.width=Math.round((l||0)*this.resolution)/this.resolution,this.height=Math.round((u||0)*this.resolution)/this.resolution,this._mipmap=o,this.anisotropicLevel=a,this._wrapMode=c,this._scaleMode=h,this.format=d,this.type=p,this.target=g,this.alphaMode=r,this.uid=(0,n.uid)(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=l>0&&u>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&
3(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this}setSize(t,e,i){return i=i||this.resolution,this.setRealSize(t*i,e*i,i)}setRealSize(t,e,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=(0,n.isPow2)(this.realWidth)&&(0,n.isPow2)(this.realHeight)}setResolution(t){const e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT()),this}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete n.BaseTextureCache[this.cacheId],delete n.TextureCache[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),t.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,i,r=s.Xd.STRICT_TEXTURE_CACHE){const o="string"==typeof e;let a=null;if(o)a=e;else{if(!e._pixiId){const t=i?.pixiIdPrefix||"pixiid";e._pixiId=`${t}_${(0,n.uid)()}`}a=e._pixiId}let h=n.BaseTextureCache[a];if(o&&r&&!h)throw new Error(`The cacheId "${a}" does not exist in BaseTextureCache.`);return h||(h=new t(e,i),h.cacheId=a,t.addToCache(h,a)),h}static fromBuffer(e,i,s,n){e=e||new Float32Array(i*s*4);const o=new g(e,{width:i,height:s,...n?.resourceOptions});let a,h;return e instanceof Float32Array?(a=r.I2.RGBA,h=r.vK.FLOAT):e instanceof Int32Array?(a=r.I2.RGBA_INTEGER,h=r.vK.INT):e instanceof Uint32Array?(a=r.I2.RGBA_INTEGER,h=r.vK.UNSIGNED_INT):e instanceof Int16Array?(a=r.I2.RGBA_INTEGER,h=r.vK.SHORT):e instanceof Uint16Array?(a=r.I2.RGBA_INTEGER,h=r.vK.UNSIGNED_SHORT):e instanceof Int8Array?(a=r.I2.RGBA,h=r.vK.BYTE):(a=r.I2.RGBA,h=r.vK.UNSIGNED_BYTE),o.internal=!0,new t(o,Object.assign({},_,{type:h,format:a},n))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),n.BaseTextureCache[e]&&n.BaseTextureCache[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),n.BaseTextureCache[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=n.BaseTextureCache[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete n.BaseTextureCache[t],e}}else if(t?.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)delete n.BaseTextureCache[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}};x.defaultOptions={mipmap:r.WB.POW2,anisotropicLevel:0,scaleMode:r.aH.LINEAR,wrapMode:r.Nt.CLAMP,alphaMode:r.iw.UNPACK,target:r.sp.TEXTURE_2D,format:r.I2.RGBA,type:r.vK.UNSIGNED_BYTE},x._globalBatch=0;let v=x;class y{constructor(){this.texArray=null,this.blend=0,this.type=r.lg.TRIANGLES,this.start=0,this.size=0,this.data=null}}let T=0;class b{constructor(t,e=!0,i=!1){this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=T++,this.disposeRunner=new p("disposeBuffer")}update(t){t instanceof Array&&(t=new Float32Array(t)),this.data=t||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(t){this.type=t?r.mr.ELEMENT_ARRAY_BUFFER:r.mr.ARRAY_BUFFER}get index(){return this.type===r.mr.ELEMENT_ARRAY_BUFFER}static from(t){return t instanceof Array&&(t=new Float32Array(t)),new b(t)}}class E{constructor(t,e=0,i=!1,s=r.vK.FLOAT,n,o,a,h=1){this.buffer=t,this.size=e,this.normalized=i,this.type=s,this.stride=n,this.start=o,this.instance=a,this.divisor=h}destroy(){this.buffer=null}static from(t,e,i,r,s){return new E(t,e,i,r,s)}}const A={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};const w={5126:4,5123:2,5121:1};let S=0;const I={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array};class R{constructor(t=[],e={}){this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=S++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new p("disposeGeometry"),this.refCount=0}addAttribute(t,e,i=0,r=!1,s,n,o,a=!1){if(!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof b||(e instanceof Array&&(e=new Float32Array(e)),e=new b(e));const h=t.split("|");if(h.length>1){for(let t=0;t<h.length;t++)this.addAttribute(h[t],e,i,r,s);return this}let l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new E(l,i,r,s,n,o,a),this.instanced=this.instanced||a,this}getAttribute(t){return this.attributes[t]}getBuffer(t){return this.buffers[this.getAttribute(t).buffer]}addIndex(t){return t instanceof b||(t instanceof Array&&(t=new Uint16Array(t)),t=new b(t)),t.type=r.mr.ELEMENT_ARRAY_BUFFER,this.indexBuffer=t,this.buffers.includes(t)||this.buffers.push(t),this}getIndex(){return this.indexBuffer}interleave(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;const t=[],e=[],i=new b;let r;for(r in this.attributes){const i=this.attributes[r],s=this.buffers[i.buffer];t.push(s.data),e.push(i.size*w[i.type]/4),i.buffer=0}for(i.data=function(t,e){let i=0,r=0;const s={};for(let n=0;n<t.length;n++)r+=e[n],i+=t[n].length;const o=new ArrayBuffer(4*i);let a=null,h=0;for(let l=0;l<t.length;l++){const i=e[l],u=t[l],c=(0,n.getBufferType)(u);s[c]||(s[c]=new A[c](o)),a=s[c];for(let t=0;t<u.length;t++)a[(t/i|0)*r+h+t%i]=u[t];h+=i}return new Float32Array(o)}(t,e),r=0;r<this.buffers.length;r++)this.buffers[r]!==this.indexBuffer&&this.buffers[r].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const t in this.attributes){const e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const t=new R;for(let e=0;e<this.buffers.length;e++)t.buffers[e]=new b(this.buffers[e].data.slice(0));for(const e in this.attributes){const i=this.attributes[e];t.attributes[e]=new E(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(t.indexBuffer=t.buffers[this.buffers.indexOf(this.indexBuffer)],t.indexBuffer.type=r.mr.ELEMENT_ARRAY_BUFFER),t}static merge(t){const e=new R,i=[],s=[],o=[];let a;for(let r=0;r<t.length;r++){a=t[r];for(let t=0;t<a.buffers.length;t++)s[t]=s[t]||0,s[t]+=a.buffers[t].data.length,o[t]=0}for(let r=0;r<a.buffers.length;r++)i[r]=new(I[(0,n.getBufferType)(a.buffers[r].data)])(s[r]),e.buffers[r]=new b(i[r]);for(let r=0;r<t.length;r++){a=t[r];for(let t=0;t<a.buffers.length;t++)i[t].set(a.buffers[t].data,o[t]),o[t]+=a.buffers[t].data.length}if(e.attributes=a.attributes,a.indexBuffer){e.indexBuffer=e.buffers[a.buffers.indexOf(a.indexBuffer)],e.indexBuffer.type=r.mr.ELEMENT_ARRAY_BUFFER;let i=0,s=0,n=0,o=0;for(let t=0;t<a.buffers.length;t++)if(a.buffers[t]!==a.indexBuffer){o=t;break}for(const t in a.attributes){const e=a.attributes[t];(0|e.buffer)===o&&(s+=e.size*w[e.type]/4)}for(let r=0;r<t.length;r++){const a=t[r].indexBuffer.data;for(let t=0;t<a.length;t++)e.indexBuffer.data[t+n]+=i;i+=t[r].buffers[o].data.length/s,n+=a.length}}return e}}class C extends R{constructor(t=!1){super(),this._buffer=new b(null,t,!1),this._indexBuffer=new b(null,t,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,r.vK.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,r.vK.FLOAT).addAttribute("aColor",this._buffer,4,!0,r.vK.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,r.vK.FLOAT).addIndex(this._indexBuffer)}}var P=i(64260);const M=[{test:t=>"float"===t.type&&1===t.size&&!t.isArray,code:t=>`\n if(uv["${t}"] !== ud["${t}"].value)\n {\n ud["${t}"].value = uv["${t}"]\n gl.uniform1f(ud["${t}"].location, uv["${t}"])\n }\n `},{test:(t,e)=>("sampler2D"===t.type||"samplerCube"===t.type||"sampler2DArray"===t.type)&&1===t.size&&!t.isArray&&(null==e||void 0!==e.castToBaseTexture),code:t=>`t = syncData.textureCount++;\n\n renderer.texture.bind(uv["${t}"], t);\n\n if(ud["${t}"].value !== t)\n {\n ud["${t}"].value = t;\n gl.uniform1i(ud["${t}"].location, t);\n; // eslint-disable-line max-len\n }`},{test:(t,e)=>"mat3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.a,code:t=>`\n gl.uniformMatrix3fv(ud["${t}"].location, false, uv["${t}"].toArray(true));\n `,codeUbo:t=>`\n var ${t}_matrix = uv.${t}.toArray(true);\n\n data[offset] = ${t}_matrix[0];\n data[offset+1] = ${t}_matrix[1];\n data[offset+2] = ${t}_matrix[2];\n \n data[offset + 4] = ${t}_matrix[3];\n data[offset + 5] = ${t}_matrix[4];\n data[offset + 6] = ${t}_matrix[5];\n \n data[offset + 8] = ${t}_matrix[6];\n data[offset + 9] = ${t}_matrix[7];\n data[offset + 10] = ${t}_matrix[8];\n `},{test:(t,e)=>"vec2"===t.type&&1===t.size&&!t.isArray&&void 0!==e.x,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud["${t}"].location, v.x, v.y);\n }`,codeUbo:t=>`\n v = uv.${t};\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n `},{test:t=>"vec2"===t.type&&1===t.size&&!t.isArray,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud["${t}"].location, v[0], v[1]);\n }\n `},{test:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.width,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud["${t}"].location, v.x, v.y, v.width, v.height)\n }`,codeUbo:t=>`\n v = uv.${t};\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n data[offset+2] = v.width;\n data[offset+3] = v.height;\n `},{test:(t,e)=>"vec4"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)\n {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n cv[3] = v.alpha;\n gl.uniform4f(ud["${t}"].location, v.red, v.green, v.blue, v.alpha)\n }`,codeUbo:t=>`\n v = uv.${t};\n\n data[offset] = v.red;\n data[offset+1] = v.green;\n data[offset+2] = v.blue;\n data[offset+3] = v.alpha;\n `},{test:(t,e)=>"vec3"===t.type&&1===t.size&&!t.isArray&&void 0!==e.red,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)\n {\n cv[0] = v.red;\n cv[1] = v.green;\n cv[2] = v.blue;\n \n gl.uniform3f(ud["${t}"].location, v.red, v.green, v.blue)\n }`,codeUbo:t=>`\n v = uv.${t};\n\n data[offset] = v.red;\n data[offset+1] = v.green;\n data[offset+2] = v.blue;\n `},{test:t=>"vec4"===t.type&&1===t.size&&!t.isArray,code:t=>`\n cv = ud["${t}"].value;\n v = uv["${t}"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud["${t}"].location, v[0], v[1], v[2], v[3])\n }`}],B={float:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1f(location, v);\n }",vec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\n }",vec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }",vec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",int:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",ivec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",ivec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",ivec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",uint:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1ui(location, v);\n }",uvec2:"\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0], v[1]);\n }",uvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }",uvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",bool:"\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1i(location, v);\n }",bvec2:"\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }",bvec3:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",bvec4:"\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n
3 }",samplerCube:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }",sampler2DArray:"\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }"},D={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};const N={};let F,L=N;function O(){if(!F){F=r.cB.MEDIUM;const t=function(){if(L===N||L?.isContextLost()){const t=s.Xd.ADAPTER.createCanvas();let e;s.Xd.PREFER_ENV>=r.Vi.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),L=e}return L}();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);e&&(F=e.precision?r.cB.HIGH:r.cB.MEDIUM)}}return F}const U={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function k(t){return U[t]}let G=null;const H={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function X(t,e){if(!G){const e=Object.keys(H);G={};for(let i=0;i<e.length;++i){const r=e[i];G[t[r]]=H[r]}}return G[e]}function V(t,e,i){if("precision"!==t.substring(0,9)){let s=e;return e===r.cB.HIGH&&i!==r.cB.HIGH&&(s=r.cB.MEDIUM),`precision ${s} float;\n${t}`}return i!==r.cB.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}let W=0;const z={},$=class t{constructor(e,i,s="pixi-shader",n={}){this.extra={},this.id=W++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=i||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=n,"#version"!==this.vertexSrc.substring(0,8)&&(s=s.replace(/\s+/g,"-"),z[s]?(z[s]++,s+=`-${z[s]}`):z[s]=1,this.vertexSrc=`#define SHADER_NAME ${s}\n${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${s}\n${this.fragmentSrc}`,this.vertexSrc=V(this.vertexSrc,t.defaultVertexPrecision,r.cB.HIGH),this.fragmentSrc=V(this.fragmentSrc,t.defaultFragmentPrecision,O())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0
3)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n"}static get defaultFragmentSrc(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"}static from(e,i,r){const s=e+i;let o=n.ProgramCache[s];return o||(n.ProgramCache[s]=o=new t(e,i,r)),o}};$.defaultVertexPrecision=r.cB.HIGH,$.defaultFragmentPrecision=n.isMobile.apple.device?r.cB.HIGH:r.cB.MEDIUM;let j=$,Y=0;class K{constructor(t,e,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Y++,this.static=!!e,this.ubo=!!i,t instanceof b?(this.buffer=t,this.buffer.type=r.mr.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=t,this.ubo&&(this.buffer=new b(new Float32Array(1)),this.buffer.type=r.mr.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(t,e,i){if(this.ubo)throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them");this.uniforms[t]=new K(e,i)}static from(t,e,i){return new K(t,e,i)}static uboFrom(t,e){return new K(t,e??!0,!0)}}class q{constructor(t,e){this.uniformBindCount=0,this.program=t,this.uniformGroup=e?e instanceof K?e:new K(e):new K({}),this.disposeRunner=new p("disposeShader")}checkUniformExists(t,e){if(e.uniforms[t])return!0;for(const i in e.uniforms){const r=e.uniforms[i];if(!0===r.group&&this.checkUniformExists(t,r))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(t,e,i){const r=j.from(t,e);return new q(r,i)}}class Z{constructor(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},!e.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!e.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(t){if(!this.programCache[t]){const e=new Int32Array(t);for(let r=0;r<t;r++)e[r]=r;this.defaultGroupCache[t]=K.from({uSamplers:e},!0);let i=this.fragTemplate;i=i.replace(/%count%/gi,`${t}`),i=i.replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new j(this.vertexSrc,i)}const e={tint:new Float32Array([1,1,1,1]),translationMatrix:new P.y3,default:this.defaultGroupCache[t]};return new q(this.programCache[t],e)}generateSampleSrc(t){let e="";e+="\n",e+="\n";for(let i=0;i<t;i++)i>0&&(e+="\nelse "),i<t-1&&(e+=`if(vTextureId < ${i}.5)`),e+="\n{",e+=`\n\tcolor = texture2D(uSamplers[${i}], vTextureCoord);`,e+="\n}";return e+="\n",e+="\n",e}}class Q{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let t=0;t<this.count;t++)this.elements[t]=null;this.count=0}}class J{constructor(t){this.renderer=t}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(t){}}const tt=class t extends J{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=C,this.vertexSize=6,this.state=c.for2d(),this.size=4*t.defaultBatchSize,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??function(t){let e=!0;const i=s.Xd.ADAPTER.getNavigator();if(s.tq.tablet||s.tq.phone){if(s.tq.apple.device){const t=i.userAgent.match(/OS (\d+)_(\d+)?/);t&&parseInt(t[1],10)<11&&(e=!1)}if(s.tq.android.device){const t=i.userAgent.match(/Android\s([0-9.]*)/);t&&parseInt(t[1],10)<7&&(e=!1)}}return e?t:4}(32),this._defaultMaxTextures}static set defaultMaxTextures(t){this._defaultMaxTextures=t}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??!s.tq.apple.device,this._canUploadSameBuffer}static set canUploadSameBuffer(t){this._canUploadSameBuffer=t}get MAX_TEXTURES(){return(0,n.deprecation)("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return"precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0
3)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n"}static get defaultFragmentTemplate(){return"varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\n"}setShaderGenerator({vertex:e=t.defaultVertexSrc,fragment:i=t.defaultFragmentTemplate}={}){this.shaderGenerator=new Z(e,i)}contextChange(){const e=this.renderer.gl;s.Xd.PREFER_ENV===r.Vi.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),t.defaultMaxTextures),this.maxTextures=function(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const i=e.createShader(e.FRAGMENT_SHADER);for(;;){const r=l.replace(/%forloop%/gi,u(t));if(e.shaderSource(i,r),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS))break;t=t/2|0}return t}(this.maxTextures,e)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:e,_textureArrayPool:i}=t,r=this.size/4,s=Math.floor(r/this.maxTextures)+1;for(;e.length<r;)e.push(new y);for(;i.length<s;)i.push(new Q);for(let t=0;t<this.maxTextures;t++)this._tempBoundTextures[t]=null}onPrerender(){this._flushId=0}render(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:i}=this,r=t._textureArrayPool,s=this.renderer.batch,n=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++v._globalBatch,h=0,l=r[0],u=0;s.copyBoundTextures(n,i);for(let t=0;t<this._bufferSize;++t){const c=e[t];e[t]=null,c._batchEnabled!==a&&(l.count>=i&&(s.boundArray(l,n,a,i),this.buildDrawCalls(l,u,t),u=t,l=r[++h],++a),c._batchEnabled=a,c.touched=o,l.elements[l.count++]=c)}l.count>0&&(s.boundArray(l,n,a,i),this.buildDrawCalls(l,u,this._bufferSize),++h,++a);for(let t=0;t<n.length;t++)n[t]=null;v._globalBatch=a}buildDrawCalls(e,i,r){const{_bufferedElements:s,_attributeBuffer:o,_indexBuffer:a,vertexSize:h}=this,l=t._drawCallPool;let u=this._dcIndex,c=this._aIndex,d=this._iIndex,f=l[u];f.start=this._iIndex,f.texArray=e;for(let t=i;t<r;++t){const r=s[t],p=r._texture.baseTexture,m=n.premultiplyBlendMode[p.alphaMode?1:0][r.blendMode];s[t]=null,i<t&&f.blend!==m&&(f.size=d-f.start,i=t,f=l[++u],f.texArray=e,f.start=d),this.packInterleavedGeometry(r,o,a,c,d),c+=r.vertexData.length/2*h,d+=r.indices.length,f.blend=m}i<r&&(f.size=d-f.start,++u),this._dcIndex=u,this._aIndex=c,this._iIndex=d}bindAndClearTexArray(t){const e=this.renderer.texture;for(let i=0;i<t.count;i++)e.bind(t.elements[i],t.ids[i]),t.elements[i]=null;t.count=0}updateGeometry(){const{_packedGeometries:e,_attributeBuffer:i,_indexBuffer:r}=this;t.canUploadSameBuffer?(e[this._flushId]._buffer.update(i.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(i.rawBinaryData),e[this._flushId]._indexBuffer.update(r),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const e=this._dcIndex,{gl:i,state:r}=this.renderer,s=t._drawCallPool;let n=null;for(let t=0;t<e;t++){const{texArray:e,type:o,size:a,start:h,blend:l}=s[t];n!==e&&(n=e,this.bindAndClearTexArray(e)),this.state.blendMode=l,r.set(this.state),i.drawElements(o,a,i.UNSIGNED_SHORT,2*h)}}flush(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),t.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(t){const e=(0,n.nextPow2)(Math.ceil(t/8)),i=(0,n.log2)(e),r=8*e;this._aBuffers.length<=i&&(this._iBuffers.length=i+1);let s=this._aBuffers[r];return s||(this._aBuffers[r]=s=new h(r*this.vertexSize*4)),s}getIndexBuffer(t){const e=(0,n.nextPow2)(Math.ceil(t/12)),i=(0,n.log2)(e),r=12*e;this._iBuffers.length<=i&&(this._iBuffers.length=i+1);let s=this._iBuffers[i];return s||(this._iBuffers[i]=s=new Uint16Array(r)),s}packInterleavedGeometry(t,e,i,r,s){const{uint32View:n,float32View:a}=e,h=r/this.vertexSize,l=t.uvs,u=t.indices,c=t.vertexData,d=t._texture.baseTexture._batchLocation,f=Math.min(t.worldAlpha,1),p=o.I.shared.setValue(t._tintRGB).toPremultiplied(f,t._texture.baseTexture.alphaMode>0);for(let o=0;o<c.length;o+=2)a[r++]=c[o],a[r++]=c[o+1],a[r++]=l[o],a[r++]=l[o+1],n[r++]=p,a[r++]=d;for(let o=0;o<u.length;o++)i[s++]=h+u[o]}};tt.defaultBatchSize=4096,tt.extension={name:"batch",type:a.n.RendererPlugin},tt._drawCallPool=[],tt._textureArrayPool=[];let et=tt;a.R.add(et);const it=class t extends q{constructor(e,i,r){super(j.from(e||t.defaultVertexSrc,i||t.defaultFragmentSrc),r),this.padding=0,this.resolution=t.defaultResolution,this.multisample=t.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new c}apply(t,e,i,r,s){t.applyFilter(this,e,i,r)}get blendMode(){return this.state.blendMode}set blendMode(t){this.state.blendMode=t}get resolution(){return this._resolution}set resolution(t){this._resolution=t}static get defaultVertexSrc(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
3\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"}static get defaultFragmentSrc(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"}};it.defaultResolution=1,it.defaultMultisample=r.G5.NONE;let rt=it;class st{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new o.I(0),this.alpha=1}init(t){this.clearBeforeRender=t.clearBeforeRender;const{backgroundColor:e,background:i,backgroundAlpha:r}=t,s=i??e;void 0!==s&&(this.color=s),this.alpha=r}get color(){return this._backgroundColor.value}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get backgroundColor(){return this._backgroundColor}destroy(){}}st.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},st.extension={type:[a.n.RendererSystem,a.n.CanvasRendererSystem],name:"background"},a.R.add(st);class nt{constructor(t){this.renderer=t,this.emptyRenderer=new J(t),this.currentRenderer=this.emptyRenderer}setObjectRenderer(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(t,e){const{boundTextures:i}=this.renderer.texture;for(let r=e-1;r>=0;--r)t[r]=i[r]||null,t[r]&&(t[r]._batchLocation=r)}boundArray(t,e,i,r){const{elements:s,ids:n,count:o}=t;let a=0;for(let h=0;h<o;h++){const t=s[h],o=t._batchLocation;if(o>=0&&o<r&&e[o]===t)n[h]=o;else for(;a<r;){const r=e[a];if(!r||r._batchEnabled!==i||r._batchLocation!==a){n[h]=a,t._batchLocation=a,e[a]=t;break}a++}}}destroy(){this.renderer=null}}nt.extension={type:a.n.RendererSystem,name:"batch"},a.R.add(nt);let ot=0;class at{constructor(t){this.renderer=t,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=ot++}init(t){if(t.context)this.initFromContext(t.context);else{const e=this.renderer.background.alpha<1,i=t.premultipliedAlpha;this.preserveDrawingBuffer=t.preserveDrawingBuffer,this.useContextAlpha=t.useContextAlpha,this.powerPreference=t.powerPreference,this.initFromOptions({alpha:e,premultipliedAlpha:i,antialias:t.antialias,stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:t.powerPreference})}}initFromContext(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=ot++,this.renderer.runners.contextChange.emit(t);const e=this.renderer.view;void 0!==e.addEventListener&&(e.addEventListener("webglcontextlost",this.handleContextLost,!1),e.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(t){const e=this.createContext(this.renderer.view,t);this.initFromContext(e)}createContext(t,e){let i;if(s.Xd.PREFER_ENV>=r.Vi.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc"),bptc:t.getExtension("EXT_texture_compression_bptc")};1===this.webGLVersion?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout((()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()}),0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,void 0!==t.removeEventListener&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const r=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=r,r||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}at.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},at.extension={type:a.n.RendererSystem,name:"context"},a.R.add(at);class ht{constructor(t,e){if(this.width=Math.round(t),this.height=Math.round(e),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new p("disposeFramebuffer"),this.multisample=r.G5.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new v(null,{scaleMode:r.aH.NEAREST,resolution:1,mipmap:r.WB.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new v(null,{scaleMode:r.aH.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:r.WB.OFF,format:r.I2.DEPTH_COMPONENT,type:r.vK.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,e){if(t=Math.round(t),e=Math.round(e),!t||!e)throw new Error("Framebuffer width and height must not be zero");if(t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(let i=0;i<this.colorTextures.length;i++){const r=this.colorTextures[i],s=r.resolution;r.setSize(t/s,e/s)}if(this.depthTexture){const i=this.depthTexture.resolution;this.depthTexture.setSize(t/i,e/i)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class lt extends v{constructor(t={}){if("number"==typeof t){t={width:arguments[0],height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}}t.width=t.width??100,t.height=t.height??100,t.multisample??(t.multisample=r.G5.NONE),super(null,t),this.mipmap=r.WB.OFF,this.valid=!0,this._clear=new o.I([0,0,0,0]),this.framebuffer=new ht(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=t.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(t){this._clear.setValue(t)}get clearColor(){return this._clear.value}get clear(){return this._clear}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e){this.framebuffer.resize(t*this.resolution,e*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.he
3ight)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class ut extends m{constructor(t){const e=t;super(e.naturalWidth||e.videoWidth||e.displayWidth||e.width,e.naturalHeight||e.videoHeight||e.displayHeight||e.height),this.source=t,this.noSubImage=!1}static crossOrigin(t,e,i){void 0!==i||e.startsWith("data:")?!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous"):t.crossOrigin=(0,n.determineCrossOrigin)(e)}upload(t,e,i,s){const n=t.gl,o=e.realWidth,a=e.realHeight;if(s=s||this.source,typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement){if(!s.complete||0===s.naturalWidth)return!1}else if(typeof HTMLVideoElement<"u"&&s instanceof HTMLVideoElement&&s.readyState<=1)return!1;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===r.iw.UNPACK),this.noSubImage||e.target!==n.TEXTURE_2D||i.width!==o||i.height!==a?(i.width=o,i.height=a,n.texImage2D(e.target,0,i.internalFormat,e.format,i.type,s)):n.texSubImage2D(n.TEXTURE_2D,0,0,0,e.format,i.type,s),!0}update(){if(this.destroyed)return;const t=this.source,e=t.naturalWidth||t.videoWidth||t.width,i=t.naturalHeight||t.videoHeight||t.height;this.resize(e,i),super.update()}dispose(){this.source=null}}class ct extends ut{constructor(t,e){if(e=e||{},"string"==typeof t){const i=new Image;ut.crossOrigin(i,t,e.crossorigin),i.src=t,t=i}super(t),!t.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=t.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(e.createBitmap??s.Xd.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode="number"==typeof e.alphaMode?e.alphaMode:null,this.bitmap=null,this._load=null,!1!==e.autoLoad&&this.load()}load(t){return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise(((t,e)=>{const i=this.source;this.url=i.src;const r=()=>{this.destroyed||(i.onload=null,i.onerror=null,this.update(),this._load=null,this.createBitmap?t(this.process()):t(this))};i.complete&&i.src?r():(i.onload=r,i.onerror=t=>{e(t),this.onError.emit(t)})}))),this._load}process(){const t=this.source;if(null!==this._process)return this._process;if(null!==this.bitmap||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,i=!t.crossOrigin||"anonymous"===t.crossOrigin;return this._process=fetch(t.src,{mode:i?"cors":"no-cors"}).then((t=>t.blob())).then((i=>e(i,0,0,t.width,t.height,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===r.iw.UNPACK?"premultiply":"none"}))).then((t=>this.destroyed?Promise.reject():(this.bitmap=t,this.update(),this._process=null,Promise.resolve(this)))),this._process}upload(t,e,i){if("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,i,this.bitmap),!this.preserveBitmap){let t=!0;const r=e._glTextures;for(const s in r){const n=r[s];if(n!==i&&n.dirtyId!==e.dirtyId){t=!1;break}}t&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&("string"==typeof t||t instanceof HTMLImageElement)}}class dt{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,e,i){const r=e.width,s=e.height;if(i){const e=t.width/2/r,n=t.height/2/s,o=t.x/r+e,a=t.y/s+n;i=P.Lv.add(i,P.Lv.NW),this.x0=o+e*P.Lv.uX(i),this.y0=a+n*P.Lv.uY(i),i=P.Lv.add(i,2),this.x1=o+e*P.Lv.uX(i),this.y1=a+n*P.Lv.uY(i),i=P.Lv.add(i,2),this.x2=o+e*P.Lv.uX(i),this.y2=a+n*P.Lv.uY(i),i=P.Lv.add(i,2),this.x3=o+e*P.Lv.uX(i),this.y3=a+n*P.Lv.uY(i)}else this.x0=t.x/r,this.y0=t.y/s,this.x1=(t.x+t.width)/r,this.y1=t.y/s,this.x2=(t.x+t.width)/r,this.y2=(t.y+t.height)/s,this.x3=t.x/r,this.y3=(t.y+t.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}dt.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};
3const ft=new dt;function pt(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class mt extends n.EventEmitter{constructor(t,e,i,r,s,n,o){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new P.Ae(0,0,1,1)),t instanceof mt&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=r,this.valid=!1,this.destroyed=!1,this._uvs=ft,this.uvMatrix=null,this.orig=i||e,this._rotate=Number(s||0),!0===s)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=n?new P.E9(n.x,n.y):new P.E9(0,0),this.defaultBorders=o,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:t}=this.baseTexture;t?.url&&n.TextureCache[t.url]&&mt.removeFromCache(t.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,mt.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){const t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),i=new mt(this.baseTexture,!this.noFrame&&t,e,this.trim?.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=t),i}updateUvs(){this._uvs===ft&&(this._uvs=new dt),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},i=s.Xd.STRICT_TEXTURE_CACHE){const r="string"==typeof t;let o=null;if(r)o=t;else if(t instanceof v){if(!t.cacheId){const i=e?.pixiIdPrefix||"pixiid";t.cacheId=`${i}-${(0,n.uid)()}`,v.addToCache(t,t.cacheId)}o=t.cacheId}else{if(!t._pixiId){const i=e?.pixiIdPrefix||"pixiid";t._pixiId=`${i}_${(0,n.uid)()}`}o=t._pixiId}let a=n.TextureCache[o];if(r&&i&&!a)throw new Error(`The cacheId "${o}" does not exist in TextureCache.`);return a||t instanceof v?!a&&t instanceof v&&(a=new mt(t),mt.addToCache(a,o)):(e.resolution||(e.resolution=(0,n.getResolutionOfUrl)(t)),a=new mt(new v(t,e)),a.baseTexture.cacheId=o,v.addToCache(a.baseTexture,o),mt.addToCache(a,o)),a}static fromURL(t,e){const i=Object.assign({autoLoad:!1},e?.resourceOptions),r=mt.from(t,Object.assign({resourceOptions:i},e),!1),s=r.baseTexture.resource;return r.baseTexture.valid?Promise.resolve(r):s.load().then((()=>Promise.resolve(r)))}static fromBuffer(t,e,i,r){return new mt(v.fromBuffer(t,e,i,r))}static fromLoader(t,e,i,r){const s=new v(t,Object.assign({scaleMode:v.defaultOptions.scaleMode,resolution:(0,n.getResolutionOfUrl)(e)},r)),{resource:o}=s;o instanceof ct&&(o.url=e);const a=new mt(s);return i||(i=e),v.addToCache(a.baseTexture,i),mt.addToCache(a,i),i!==e&&(v.addToCache(a.baseTexture,e),mt.addToCache(a,e)),a.baseTexture.valid?Promise.resolve(a):new Promise((t=>{a.baseTexture.once("loaded",(()=>t(a)))}))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),n.TextureCache[e]&&n.TextureCache[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),n.TextureCache[e]=t)}static removeFromCache(t){if("string"==typeof t){const e=n.TextureCache[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete n.TextureCache[t],e}}else if(t?.textureCacheIds){for(let e=0;e<t.textureCacheIds.length;++e)n.TextureCache[t.textureCacheIds[e]]===t&&delete n.TextureCache[t.textureCacheIds[e]];return t.textureCacheIds.length=0,t}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(t){this._frame=t,this.noFrame=!1;const{x:e,y:i,width:r,height:s}=t,n=e+r>this.baseTexture.width,o=i+s>this.baseTexture.height;if(n||o){const t=n&&o?"and":"or",a=`X: ${e} + ${r} = ${e+r} > ${this.baseTexture.width}`,h=`Y: ${i} + ${s} = ${i+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${a} ${t} ${h}`)}this.valid=r&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}
3static get EMPTY(){return mt._EMPTY||(mt._EMPTY=new mt(new v),pt(mt._EMPTY),pt(mt._EMPTY.baseTexture)),mt._EMPTY}static get WHITE(){if(!mt._WHITE){const t=s.Xd.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),mt._WHITE=new mt(v.from(t)),pt(mt._WHITE),pt(mt._WHITE.baseTexture)}return mt._WHITE}}class gt extends mt{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,i=!0){const r=this.baseTexture.resolution,s=Math.round(t*r)/r,n=Math.round(e*r)/r;this.valid=s>0&&n>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=n,i&&this.baseTexture.resize(s,n),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new gt(new lt(t))}}class _t{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,i=r.G5.NONE){const s=new lt(Object.assign({width:t,height:e,resolution:1,multisample:i},this.textureOptions));return new gt(s)}getOptimalTexture(t,e,i=1,s=r.G5.NONE){let o;t=Math.max(Math.ceil(t*i-1e-6),1),e=Math.max(Math.ceil(e*i-1e-6),1),this.enableFullScreen&&t===this._pixelsWidth&&e===this._pixelsHeight?o=s>1?-s:-1:(o=((65535&(t=(0,n.nextPow2)(t)))<<16|65535&(e=(0,n.nextPow2)(e)))>>>0,s>1&&(o+=4294967296*s)),this.texturePool[o]||(this.texturePool[o]=[]);let a=this.texturePool[o].pop();return a||(a=this.createTexture(t,e,s)),a.filterPoolKey=o,a.setResolution(i),a}getFilterTexture(t,e,i){const s=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||r.G5.NONE);return s.filterFrame=t.filterFrame,s}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=!1!==t)for(const e in this.texturePool){const t=this.texturePool[e];if(t)for(let e=0;e<t.length;e++)t[e].destroy(!0)}this.texturePool={}}setScreenSize(t){if(t.width!==this._pixelsWidth||t.height!==this._pixelsHeight){this.enableFullScreen=t.width>0&&t.height>0;for(const t in this.texturePool){if(!(Number(t)<0))continue;const e=this.texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0);this.texturePool[t]=[]}this._pixelsWidth=t.width,this._pixelsHeight=t.height}}}_t.SCREEN_KEY=-1;class xt extends R{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class vt extends R{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new b(this.vertices),this.uvBuffer=new b(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(t,e){let i=0,r=0;return this.uvs[0]=i,this.uvs[1]=r,this.uvs[2]=i+e.width/t.width,this.uvs[3]=r,this.uvs[4]=i+e.width/t.width,this.uvs[5]=r+e.height/t.height,this.uvs[6]=i,this.uvs[7]=r+e.height/t.height,i=e.x,r=e.y,this.vertices[0]=i,this.vertices[1]=r,this.vertices[2]=i+e.width,this.vertices[3]=r,this.vertices[4]=i+e.width,this.vertices[5]=r+e.height,this.vertices[6]=i,this.vertices[7]=r+e.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class yt{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=r.G5.NONE,this.sourceFrame=new P.Ae,this.destinationFrame=new P.Ae,this.bindingSourceFrame=new P.Ae,this.bindingDestinationFrame=new P.Ae,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const Tt=[new P.E9,new P.E9,new P.E9,new P.E9],bt=new P.y3;class Et{constructor(t){this.renderer=t,this.defaultFilterStack=[{}],this.texturePool=new _t,this.statePool=[],this.quad=new xt,this.quadUv=new vt,this.tempRect=new P.Ae,this.activeState={},this.globalUniforms=new K({outputFrame:new P.Ae,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}
3init(){this.texturePool.setScreenSize(this.renderer.view)}push(t,e){const i=this.renderer,r=this.defaultFilterStack,s=this.statePool.pop()||new yt,n=i.renderTexture;let o,a;if(n.current){const t=n.current;o=t.resolution,a=t.multisample}else o=i.resolution,a=i.multisample;let h=e[0].resolution||o,l=e[0].multisample??a,u=e[0].padding,c=e[0].autoFit,d=e[0].legacy??!0;for(let m=1;m<e.length;m++){const t=e[m];h=Math.min(h,t.resolution||o),l=Math.min(l,t.multisample??a),u=this.useMaxPadding?Math.max(u,t.padding):u+t.padding,c=c&&t.autoFit,d=d||(t.legacy??!0)}1===r.length&&(this.defaultFilterStack[0].renderTexture=n.current),r.push(s),s.resolution=h,s.multisample=l,s.legacy=d,s.target=t,s.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),s.sourceFrame.pad(u);const f=this.tempRect.copyFrom(n.sourceFrame);i.projection.transform&&this.transformAABB(bt.copyFrom(i.projection.transform).invert(),f),c?(s.sourceFrame.fit(f),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(f)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,n.current?n.current.resolution:i.resolution,n.sourceFrame,n.destinationFrame,i.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,h,l),s.filters=e,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const p=this.tempRect;p.x=0,p.y=0,p.width=s.sourceFrame.width,p.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(n.sourceFrame),s.bindingDestinationFrame.copyFrom(n.destinationFrame),s.transform=i.projection.transform,i.projection.transform=null,n.bind(s.renderTexture,s.sourceFrame,p),i.framebuffer.clear(0,0,0,0)}pop(){const t=this.defaultFilterStack,e=t.pop(),i=e.filters;this.activeState=e;const s=this.globalUniforms.uniforms;s.outputFrame=e.sourceFrame,s.resolution=e.resolution;const n=s.inputSize,o=s.inputPixel,a=s.inputClamp;if(n[0]=e.destinationFrame.width,n[1]=e.destinationFrame.height,n[2]=1/n[0],n[3]=1/n[1],o[0]=Math.round(n[0]*e.resolution),o[1]=Math.round(n[1]*e.resolution),o[2]=1/o[0],o[3]=1/o[1],a[0]=.5*o[2],a[1]=.5*o[3],a[2]=e.sourceFrame.width*n[2]-.5*o[2],a[3]=e.sourceFrame.height*n[3]-.5*o[3],e.legacy){const t=s.filterArea;t[0]=e.destinationFrame.width,t[1]=e.destinationFrame.height,t[2]=e.sourceFrame.x,t[3]=e.sourceFrame.y,s.filterClamp=s.inputClamp}this.globalUniforms.update();const h=t[t.length-1];if(this.renderer.framebuffer.blit(),1===i.length)i[0].apply(this,e.renderTexture,h.renderTexture,r.yl.BLEND,e),this.returnFilterTexture(e.renderTexture);else{let t=e.renderTexture,s=this.getOptimalFilterTexture(t.width,t.height,e.resolution);s.filterFrame=t.filterFrame;let n=0;for(n=0;n<i.length-1;++n){1===n&&e.multisample>1&&(s=this.getOptimalFilterTexture(t.width,t.height,e.resolution),s.filterFrame=t.filterFrame),i[n].apply(this,t,s,r.yl.CLEAR,e);const o=t;t=s,s=o}i[n].apply(this,t,h.renderTexture,r.yl.BLEND,e),n>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(t),this.returnFilterTexture(s)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=r.yl.CLEAR){const{renderTexture:i,state:s}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t?.filterFrame){const e=this.tempRect;e.x=0,e.y=0,e.width=t.filterFrame.width,e.height=t.filterFrame.height,i.bind(t,t.filterFrame,e)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const n=1&s.stateId||this.forceClear;(e===r.yl.CLEAR||e===r.yl.BLIT&&n)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,i,s){const n=this.renderer;n.state.set(t.state),this.bindAndClear(i,s),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,n.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),n.geometry.bind(this.quadUv),n.geometry.draw(r.lg.TRIANGLES)):(n.geometry.bind(this.quad),n.geometry.draw(r.lg.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:i,destinationFrame:r}=this.activeState,{orig:s}=e._texture,n=t.set(r.width,0,0,r.height,i.x,i.y),o=e.worldTransform.copyTo(P.y3.TEMP_MATRIX);return o.invert(),n.prepend(o),n.scale(1/s.width,1/s.height),n.translate(e.anchor.x,e.anchor.y),n}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,i=1,s=r.G5.NONE){return this.texturePool.getOptimalTexture(t,e,i,s)}getFilterTexture(t,e,i){if("number"==typeof t){const i=t;t=e,e=i}t=t||this.activeState.renderTexture;const s=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||r.G5.NONE);return s.filterFrame=t.filterFrame,s}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}
3resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const i=Tt[0],r=Tt[1],s=Tt[2],n=Tt[3];i.set(e.left,e.top),r.set(e.left,e.bottom),s.set(e.right,e.top),n.set(e.right,e.bottom),t.apply(i,i),t.apply(r,r),t.apply(s,s),t.apply(n,n);const o=Math.min(i.x,r.x,s.x,n.x),a=Math.min(i.y,r.y,s.y,n.y),h=Math.max(i.x,r.x,s.x,n.x),l=Math.max(i.y,r.y,s.y,n.y);e.x=o,e.y=a,e.width=h-o,e.height=l-a}roundFrame(t,e,i,r,s){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(s){const{a:t,b:e,c:i,d:r}=s;if((Math.abs(e)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(t)>1e-4||Math.abs(r)>1e-4))return}(s=s?bt.copyFrom(s):bt.identity()).translate(-i.x,-i.y).scale(r.width/i.width,r.height/i.height).translate(r.x,r.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}}}Et.extension={type:a.n.RendererSystem,name:"filter"},a.R.add(Et);class At{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=r.G5.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const wt=new P.Ae;class St{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new ht(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new P.Ae,this.hasMRT=!0,this.writeDepthTexture=!0,1===this.renderer.context.webGLVersion){let e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;s.Xd.PREFER_ENV===r.Vi.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=t=>e.drawBuffersWEBGL(t):(this.hasMRT=!1,t.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,i=0){const{gl:r}=this;if(t){const s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=i),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let e=0;e<t.colorTextures.length;e++){const i=t.colorTextures[e];this.renderer.texture.unbind(i.parentTextureArray||i)}if(t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e){const t=e.width>>i,r=e.height>>i,s=t/e.width;this.setViewport(e.x*s,e.y*s,t,r)}else{const e=t.width>>i,r=t.height>>i;this.setViewport(0,0,e,r)}}else this.current&&(this.current=null,r.bindFramebuffer(r.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,e,i,r){const s=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),r=Math.round(r),(s.width!==i||s.height!==r||s.x!==t||s.y!==e)&&(s.x=t,s.y=e,s.width=i,s.height=r,this.gl.viewport(t,e,i,r))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,e,i,s,n=r.V0.COLOR|r.V0.DEPTH){const{gl:o}=this;o.clearColor(t,e,i,s),o.clear(n)}initFramebuffer(t){const{gl:e}=this,i=new At(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i}resizeFramebuffer(t){const{gl:e}=this,i=t.glFramebuffers[this.CONTEXT_UID];if(i.stencil){let r;e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),r=1===this.renderer.context.webGLVersion?e.DEPTH_STENCIL:t.depth&&t.stencil?e.DEPTH24_STENCIL8:t.depth?e.DEPTH_COMPONENT24:e.STENCIL_INDEX8,i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,r,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,r,t.width,t.height)}const r=t.colorTextures;let s=r.length;e.drawBuffers||(s=Math.min(s,1));for(let n=0;n<s;n++){const s=r[n],o=s.parentTextureArray||s;this.renderer.texture.bind(o,0),0===n&&i.msaaBuffer&&(e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,o._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height))}t.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(t.depthTexture,0)}updateFramebuffer(t,e){const{gl:i}=this,r=t.glFramebuffers[this.CONTEXT_UID],s=t.colorTextures;let n=s.length;i.drawBuffers||(n=Math.min(n,1)),r.multisample>1&&this.canMultisampleFramebuffer(t)?r.msaaBuffer=r.msaaBuffer||i.createRenderbuffer():r.msaaBuffer&&(i.deleteRenderbuffer(r.msaaBuffer),r.msaaBuffer=null,r.blitFramebuffer&&(r.blitFramebuffer.dispose(),r.blitFramebuffer=null));const o=[];for(let a=0;a<n;a++){const n=s[a],h=n.parentTextureArray||n;this.renderer.texture.bind(h,0),0===a&&r.msaaBuffer?(i.bindRenderbuffer(i.RENDERBUFFER,r.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,r.multisample,h._glTextures[this.CONTEXT_UID].internalFormat,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,r.msaaBuffer)):(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+a,n.target,h._glTextures[this.CONTEXT_UID].texture,e),o.push(i.COLOR_ATTACHMENT0+a))}if(o.length>1&&i.drawBuffers(o),t.depthTexture&&this.writeDepthTexture){const r=t.depthTexture;this.renderer.texture.bind(r,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,r._glTextures[this.CONTEXT_UID].texture,e)}if(!t.stencil&&!t.depth||t.depthTexture&&this.writeDepthTexture)r.stencil&&(i.deleteRenderbuffer(r.stencil),r.stencil=null);else{let e,s;r.stencil=r.stencil||i.createRenderbuffer(),1===this.renderer.context.webGLVersion?(e=i.DEPTH_STENCIL_ATTACHMENT,s=i.DEPTH_STENCIL):t.depth&&t.stencil?(e=i.DEPTH_STENCIL_ATTACHMENT,s=i.DEPTH24_STENCIL8):t.depth?(e=i.DEPTH_ATTACHMENT,s=i.DEPTH_COMPONENT24):(e=i.STENCIL_ATTACHMENT,s=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,r.stencil),r.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,r.multisample,s,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,s,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,e,i.RENDERBUFFER,r.stencil)}}canMultisampleFramebuffer(t){return 1!==this.renderer.context.webGLVersion&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let i=r.G5.NONE;if(t<=1||null===e)return i;for(let r=0;r<e.length;r++)if(e[r]<=t){i=e[r];break}return 1===i&&(i=r.G5.NONE),i}blit(t,e,i){const{current:r,renderer:s,gl:n,CONTEXT_UID:o}=this;if(2!==s.context.webGLVersion||!r)return;const a=r.glFramebuffers[o];if(!a)return;if(!t){if(!a.msaaBuffer)return;const e=r.colorTextures[0];if(!e)return;a.blitFramebuffer||(a.blitFramebuffer=new ht(r.width,r.height),a.blitFramebuffer.addColorTexture(0,e)),(t=a.blitFramebuffer).colorTextures[0]!==e&&(t.colorTextures[0]=e,t.dirtyId++,t.dirtyFormat++),(t.width!==r.width||t.height!==r.height)&&(t.width=r.width,t.height=r.height,t.dirtyId++,t.dirtySize++)}e||((e=wt).width=r.width,e.height=r.height),i||(i=e);const h=e.width===i.width&&e.height===i.height;this.bind(t),n.bindFramebuffer(n.READ_FRAMEBUFFER,a.framebuffer),n.blitFramebuffer(e.left,e.top,e.right,e.bottom,i.left,i.top,i.right,i.bottom,n.COLOR_BUFFER_BIT,h?n.NEAREST:n.LINEAR),n.bindFramebuffer(n.READ_FRAMEBUFFER,t.glFramebuffers[this.CONTEXT_UID].framebuffer)}disposeFramebuffer(t,e){const i=t.glFramebuffers[this.CONTEXT_UID],r=this.gl;if(!i)return;delete t.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(t);s>
3=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),e||(r.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&r.deleteRenderbuffer(i.msaaBuffer),i.stencil&&r.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;i<e.length;i++)this.disposeFramebuffer(e[i],t)}forceStencil(){const t=this.current;if(!t)return;const e=t.glFramebuffers[this.CONTEXT_UID];if(!e||e.stencil&&t.stencil)return;t.stencil=!0;const i=t.width,r=t.height,s=this.gl,n=e.stencil=s.createRenderbuffer();let o,a;s.bindRenderbuffer(s.RENDERBUFFER,n),1===this.renderer.context.webGLVersion?(o=s.DEPTH_STENCIL_ATTACHMENT,a=s.DEPTH_STENCIL):t.depth?(o=s.DEPTH_STENCIL_ATTACHMENT,a=s.DEPTH24_STENCIL8):(o=s.STENCIL_ATTACHMENT,a=s.STENCIL_INDEX8),e.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,e.multisample,a,i,r):s.renderbufferStorage(s.RENDERBUFFER,a,i,r),s.framebufferRenderbuffer(s.FRAMEBUFFER,o,s.RENDERBUFFER,n)}reset(){this.current=this.unknownFramebuffer,this.viewport=new P.Ae}destroy(){this.renderer=null}}St.extension={type:a.n.RendererSystem,name:"framebuffer"},a.R.add(St);const It={5126:4,5123:2,5121:1};class Rt{constructor(t){this.renderer=t,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){let e=this.renderer.context.extensions.vertexArrayObject;s.Xd.PREFER_ENV===r.Vi.WEBGL_LEGACY&&(e=null),e?(t.createVertexArray=()=>e.createVertexArrayOES(),t.bindVertexArray=t=>e.bindVertexArrayOES(t),t.deleteVertexArray=t=>e.deleteVertexArrayOES(t)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(2!==e.webGLVersion){const e=t.getExtension("ANGLE_instanced_arrays");e?(t.vertexAttribDivisor=(t,i)=>e.vertexAttribDivisorANGLE(t,i),t.drawElementsInstanced=(t,i,r,s,n)=>e.drawElementsInstancedANGLE(t,i,r,s,n),t.drawArraysInstanced=(t,i,r,s)=>e.drawArraysInstancedANGLE(t,i,r,s)):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:i}=this;let r=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;r||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=r={},s=!0);const n=r[e.program.id]||this.initGeometryVao(t,e,s);this._activeGeometry=t,this._activeVao!==n&&(this._activeVao=n,this.hasVao?i.bindVertexArray(n):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let i=0;i<t.buffers.length;i++){const r=t.buffers[i];e.update(r)}}checkCompatibility(t,e){const i=t.attributes,r=e.attributeData;for(const s in r)if(!i[s])throw new Error(`shader and geometry incompatible, geometry missing the "${s}" attribute`)}getSignature(t,e){const i=t.attributes,r=e.attributeData,s=["g",t.id];for(const n in i)r[n]&&s.push(n,r[n].location);return s.join("-")}initGeometryVao(t,e,i=!0){const s=this.gl,n=this.CONTEXT_UID,o=this.renderer.buffer,a=e.program;a.glPrograms[n]||this.renderer.shader.generateProgram(e),this.checkCompatibility(t,a);const h=this.getSignature(t,a),l=t.glVertexArrayObjects[this.CONTEXT_UID];let u=l[h];if(u)return l[a.id]=u,u;const c=t.buffers,d=t.attributes,f={},p={};for(const r in c)f[r]=0,p[r]=0;for(const r in d)!d[r].size&&a.attributeData[r]?d[r].size=a.attributeData[r].size:d[r].size||console.warn(`PIXI Geometry attribute '${r}' size cannot be determined (likely the bound shader does not have the attribute)`),f[d[r].buffer]+=d[r].size*It[d[r].type];for(const r in d){const t=d[r],e=t.size;void 0===t.stride&&(f[t.buffer]===e*It[t.type]?t.stride=0:t.stride=f[t.buffer]),void 0===t.start&&(t.start=p[t.buffer],p[t.buffer]+=e*It[t.type])}u=s.createVertexArray(),s.bindVertexArray(u);for(let r=0;r<c.length;r++){const t=c[r];o.bind(t),i&&t._glBuffers[n].refCount++}return this.activateVao(t,a),l[a.id]=u,l[h]=u,s.bindVertexArray(null),o.unbind(r.mr.ARRAY_BUFFER),u}disposeGeometry(t,e){if(!this.managedGeometries[t.id])return;delete this.managedGeometries[t.id];const i=t.glVertexArrayObjects[this.CONTEXT_UID],r=this.gl,s=t.buffers,n=this.renderer?.buffer;if(t.disposeRunner.remove(this),i){if(n)for(let t=0;t<s.length;t++){const i=s[t]._glBuffers[this.CONTEXT_UID];i&&(i.refCount--,0===i.refCount&&!e&&n.dispose(s[t],e))}if(!e)for(const t in i)if("g"===t[0]){const e=i[t];this._activeVao===e&&this.unbind(),r.deleteVertexArray(e)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(t){const e=Object.keys(this.managedGeometries);for(let i=0;i<e.length;i++)this.disposeGeometry(this.managedGeometries[e[i]],t)}activateVao(t,e){const i=this.gl,r=this.CONTEXT_UID,s=this.renderer.buffer,n=t.buffers,o=t.attributes;t.indexBuffer&&s.bind(t.indexBuffer);let a=null;for(const h in o){const t=o[h],l=n[t.buffer],u=l._glBuffers[r];if(e.attributeData[h]){a!==u&&(s.bind(l),a=u);const r=e.attributeData[h].location;if(i.enableVertexAttribArray(r),i.vertexAttribPointer(r,t.size,t.type||i.FLOAT,t.normalized,t.stride,t.start),t.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");i.vertexAttribDivisor(r,t.divisor)}}}}draw(t,e,i,r){const{gl:s}=this,n=this._activeGeometry;if(n.indexBuffer){const o=n.indexBuffer.data.BYTES_PER_ELEMENT,a=2===o?s.UNSIGNED_SHORT:s.UNSIGNED_INT;2===o||4===o&&this.canUseUInt32ElementIndex?n.instanced?s.drawElementsInstanced(t,e||n.indexBuffer.data.length,a,(i||0)*o,r||1):s.drawElements(t,e||n.indexBuffer.data.length,a,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else n.instanced?s.drawArraysInstanced(t,i,e||n.getSize(),r||1):s.drawArrays(t,i,e||n.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}Rt.extension={type:a.n.RendererSystem,name:"geometry"},a.R.add(Rt);const Ct=new P.y3;class Pt{constructor(t,e){this._texture=t,this.mapCoord=new P.y3,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof e>"u"?.5:e,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,e){void 0===e&&(e=t);const i=this.mapCoord;for(let r=0;r<t.length;r+=2){const s=t[r],n=t[r+1];e[r]=s*i.a+n*i.c+i.tx,e[r+1]=s*i.b+n*i.d+i.ty}return e}update(t){const e=this._texture;if(!e||!e.valid||!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;const i=e._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);const r=e.orig,s=e.trim;s&&(Ct.set(r.width/s.width,0,0,r.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Ct));const n=e.baseTexture,o=this.uClampFrame,a=this.clampMargin/n.resolution,h=this.clampOffset;return o[0]=(e._frame.x+a+h)/n.width,o[1]=(e._frame.y+a+h)/n.height,o[2]=(e._frame.x+e._frame.width-a+h)/n.width,o[3]=(e._frame.y+e._frame.height-a+h)/n.height,this.uClampOffset[0]=h/n.realWidth,this.uClampOffset[1]=h/n.realHeight,this.isSimple=e._frame.width===n.width&&e._frame.height===n.height&&0===e.rotate,!0}}class Mt extends rt{constructor(t,e,i){let r=null;"string"!=typeof t&&void 0===e&&void 0===i&&(r=t,t=void 0,e=void 0,i=void 0),super(t||"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0
3)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n",e||"varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n",i),this.maskSprite=r,this.maskMatrix=new P.y3}get maskSprite(){return this._maskSprite}set maskSprite(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(t,e,i,r){const s=this._maskSprite,n=s._texture;n.valid&&(n.uvMatrix||(n.uvMatrix=new Pt(n,0)),n.uvMatrix.update(),this.uniforms.npmAlpha=n.baseTexture.alphaMode?0:1,this.uniforms.mask=n,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,s).prepend(n.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=n.uvMatrix.uClampFrame,t.applyFilter(this,e,i,r))}}class Bt{constructor(t=null){this.type=r.A7.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=rt.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(t){t?this._filters?this._filters[0]=t:this._filters=[t]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=r.A7.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class Dt{constructor(t){this.renderer=t,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)}push(t,e){let i=e;if(!i.isMaskData){const t=this.maskDataPool.pop()||new Bt;t.pooled=!0,t.maskObject=e,i=t}const s=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(s),i._colorMask=s?s._colorMask:15,i.autoDetect&&this.detect(i),i._target=t,i.type!==r.A7.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case r.A7.SCISSOR:this.renderer.scissor.push(i);break;case r.A7.STENCIL:this.renderer.stencil.push(i);break;case r.A7.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case r.A7.COLOR:this.pushColorMask(i)}i.type===r.A7.SPRITE&&this.maskStack.push(i)}pop(t){const e=this.maskStack.pop();if(e&&e._target===t){if(e.enabled)switch(e.type){case r.A7.SCISSOR:this.renderer.scissor.pop(e);break;case r.A7.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case r.A7.SPRITE:this.popSpriteMask(e);break;case r.A7.COLOR:this.popColorMask(e)}if(e.reset(),e.pooled&&this.maskDataPool.push(e),0!==this.maskStack.length){const t=this.maskStack[this.maskStack.length-1];t.type===r.A7.SPRITE&&t._filters&&(t._filters[0].maskSprite=t.maskObject)}}}detect(t){const e=t.maskObject;e?e.isSprite?t.type=r.A7.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(t)?t.type=r.A7.SCISSOR:t.type=r.A7.STENCIL:t.type=r.A7.COLOR}pushSpriteMask(t){const{maskObject:e}=t,i=t._target;let r=t._filters;r||(r=this.alphaMaskPool[this.alphaMaskIndex],r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new Mt])),r[0].resolution=t.resolution,r[0].multisample=t.multisample,r[0].maskSprite=e;const s=i.filterArea;i.filterArea=e.getBounds(!0),this.renderer.filter.push(i,r),i.filterArea=s,t._filters||this.alphaMaskIndex++}
3popSpriteMask(t){this.renderer.filter.pop(),t._filters?t._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(t){const e=t._colorMask,i=t._colorMask=e&t.colorMask;i!==e&&this.renderer.gl.colorMask(0!==(1&i),0!==(2&i),0!==(4&i),0!==(8&i))}popColorMask(t){const e=t._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask(0!==(1&i),0!==(2&i),0!==(4&i),0!==(8&i))}destroy(){this.renderer=null}}Dt.extension={type:a.n.RendererSystem,name:"mask"},a.R.add(Dt);class Nt{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,i=this.getStackLength();this.maskStack=t;const r=this.getStackLength();r!==i&&(0===r?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const Ft=new P.y3,Lt=[],Ot=class t extends Nt{constructor(t){super(t),this.glConst=s.Xd.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:i}=t,{renderer:r}=this,s=r.renderTexture,n=i.getBounds(!0,Lt.pop()??new P.Ae);this.roundFrameToPixels(n,s.current?s.current.resolution:r.resolution,s.sourceFrame,s.destinationFrame,r.projection.transform),e&&n.fit(e),t._scissorRectLocal=n}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:i,c:r,d:s}=t;return(Math.abs(i)>1e-4||Math.abs(r)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(s)>1e-4)}testScissor(e){const{maskObject:i}=e;if(!i.isFastRect||!i.isFastRect()||t.isMatrixRotated(i.worldTransform)||t.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const r=e._scissorRectLocal;return r.width>0&&r.height>0}roundFrameToPixels(e,i,r,s,n){t.isMatrixRotated(n)||((n=n?Ft.copyFrom(n):Ft.identity()).translate(-r.x,-r.y).scale(s.width/r.width,s.height/r.height).translate(s.x,s.y),this.renderer.filter.transformAABB(n,e),e.fit(s),e.x=Math.round(e.x*i),e.y=Math.round(e.y*i),e.width=Math.round(e.width*i),e.height=Math.round(e.height*i))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&Lt.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;e=this.renderer.renderTexture.current?t.y:this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};Ot.extension={type:a.n.RendererSystem,name:"scissor"};let Ut=Ot;a.R.add(Ut);class kt extends Nt{constructor(t){super(t),this.glConst=s.Xd.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:i}=this.renderer,r=t._stencilCounter;0===r&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;const s=t._colorMask;0!==s&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,r,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,0!==s&&(t._colorMask=s,i.colorMask(0!==(1&s),0!==(2&s),0!==(4&s),0!==(8&s))),this._useCurrent()}pop(t){const e=this.renderer.gl;if(0===this.getStackLength())e.disable(e.STENCIL_TEST);else{const i=0!==this.maskStack.length?this.maskStack[this.maskStack.length-1]:null,r=i?i._colorMask:15;0!==r&&(i._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,0!==r&&(i._colorMask=r,e.colorMask(0!==(1&r),0!==(2&r),0!==(4&r),0!==(8&r))),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;
3t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}kt.extension={type:a.n.RendererSystem,name:"stencil"},a.R.add(kt);class Gt{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get:()=>((0,n.deprecation)("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract)},prepare:{enumerable:!1,get:()=>((0,n.deprecation)("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare)},interaction:{enumerable:!1,get:()=>((0,n.deprecation)("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events)}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}Gt.extension={type:[a.n.RendererSystem,a.n.CanvasRendererSystem],name:"_plugin"},a.R.add(Gt);class Ht{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new P.y3,this.transform=null}update(t,e,i,r){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,r),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(t,e,i,r){const s=this.projectionMatrix,n=r?-1:1;s.identity(),s.a=1/e.width*2,s.d=n*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-n-e.y*s.d}setTransform(t){}destroy(){this.renderer=null}}Ht.extension={type:a.n.RendererSystem,name:"projection"},a.R.add(Ht);const Xt=new P.wx,Vt=new P.Ae;class Wt{constructor(t){this.renderer=t,this._tempMatrix=new P.y3}generateTexture(t,e){const{region:i,...r}=e||{},s=i?.copyTo(Vt)||t.getLocalBounds(Vt,!0),n=r.resolution||this.renderer.resolution;s.width=Math.max(s.width,1/n),s.height=Math.max(s.height,1/n),r.width=s.width,r.height=s.height,r.resolution=n,r.multisample??(r.multisample=this.renderer.multisample);const o=gt.create(r);this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const a=t.transform;return t.transform=Xt,this.renderer.render(t,{renderTexture:o,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=a,o}destroy(){}}Wt.extension={type:[a.n.RendererSystem,a.n.CanvasRendererSystem],name:"textureGenerator"},a.R.add(Wt);const zt=new P.Ae,$t=new P.Ae;class jt{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new P.Ae,this.destinationFrame=new P.Ae,this.viewportFrame=new P.Ae}contextChange(){const t=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,e,i){const r=this.renderer;let s,n,o;this.current=t,t?(s=t.baseTexture,o=s.resolution,e||(zt.width=t.frame.width,zt.height=t.frame.height,e=zt),i||($t.x=t.frame.x,$t.y=t.frame.y,$t.width=e.width,$t.height=e.height,i=$t),n=s.framebuffer):(o=r.resolution,e||(zt.width=r._view.screen.width,zt.height=r._view.screen.height,e=zt),i||((i=zt).width=e.width,i.height=e.height));const a=this.viewportFrame;a.x=i.x*o,a.y=i.y*o,a.width=i.width*o,a.height=i.height*o,t||(a.y=r.view.height-(a.y+a.height)),a.ceil(),this.renderer.framebuffer.bind(n,a),this.renderer.projection.update(i,e,o,!n),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)}clear(t,e){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,r=o.I.shared.setValue(t||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&r.premultiply(r.alpha);const s=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer._view.screen,a=s.width!==n.width||s.height!==n.height;if(a){let{x:t,y:e,width:i,height:r}=this.viewportFrame;t=Math.round(t),e=Math.round(e),i=Math.round(i),r=Math.round(r),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(t,e,i,r)}this.renderer.framebuffer.clear(r.red,r.green,r.blue,r.alpha,e),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}jt.extension={type:a.n.RendererSystem,name:"renderTexture"},a.R.add(jt);
3class Yt{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function Kt(t,e,i){const r=t.createShader(e);return t.shaderSource(r,i),t.compileShader(r),r}function qt(t){const e=new Array(t);for(let i=0;i<e.length;i++)e[i]=!1;return e}function Zt(t,e){switch(t){case"float":case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return qt(2*e);case"bvec3":return qt(3*e);case"bvec4":return qt(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}function Qt(t,e){const i=t.getShaderSource(e).split("\n").map(((t,e)=>`${e}: ${t}`)),r=t.getShaderInfoLog(e),s=r.split("\n"),n={},o=s.map((t=>parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1")))).filter((t=>!(!t||n[t])&&(n[t]=!0,!0))),a=[""];o.forEach((t=>{i[t-1]=`%c${i[t-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")}));const h=i.join("\n");a[0]=h,console.error(r),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function Jt(t,e){const i=Kt(t,t.VERTEX_SHADER,e.vertexSrc),r=Kt(t,t.FRAGMENT_SHADER,e.fragmentSrc),s=t.createProgram();t.attachShader(s,i),t.attachShader(s,r);const n=e.extra?.transformFeedbackVaryings;if(n&&("function"!=typeof t.transformFeedbackVaryings?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(s,n.names,"separate"===n.bufferMode?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||function(t,e,i,r){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(i,t.COMPILE_STATUS)||Qt(t,i),t.getShaderParameter(r,t.COMPILE_STATUS)||Qt(t,r),console.error("PixiJS Error: Could not initialize shader."),""!==t.getProgramInfoLog(e)&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}(t,s,i,r),e.attributeData=function(t,e){const i={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let s=0;s<r;s++){const r=e.getActiveAttrib(t,s);if(r.name.startsWith("gl_"))continue;const n=X(e,r.type),o={type:n,name:r.name,size:k(n),location:e.getAttribLocation(t,r.name)};i[r.name]=o}return i}(s,t),e.uniformData=function(t,e){const i={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;s++){const r=e.getActiveUniform(t,s),n=r.name.replace(/\[.*?\]$/,""),o=!!r.name.match(/\[.*?\]$/),a=X(e,r.type);i[n]={name:n,index:s,type:a,size:r.size,isArray:o,value:Zt(a,r.size)}}return i}(s,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const i=Object.keys(e.attributeData);i.sort(((t,e)=>t>e?1:-1));for(let r=0;r<i.length;r++)e.attributeData[i[r]].location=r,t.bindAttribLocation(s,r,i[r]);t.linkProgram(s)}t.deleteShader(i),t.deleteShader(r);const o={};for(const a in e.uniformData){const i=e.uniformData[a];o[a]={location:t.getUniformLocation(s,a),value:Zt(i.type,i.size)}}return new Yt(s,o)}function te(t,e,i,r,s){i.buffer.update(s)}const ee={float:"\n data[offset] = v;\n ",vec2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n ",vec3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ",vec4:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ",mat2:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ",mat3:"\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ",mat4:"\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n "},ie={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:32,mat3:48,mat4:64};function re(t,e){if(!t.autoManage)return{size:0,syncFunc:te};const i=function(t,e){const i=[];for(const r in t)e[r]&&i.push(e[r]);return i.sort(((t,e)=>t.index-e.index)),i}(t.uniforms,e),{uboElements:r,size:s}=function(t){const e=t.map((t=>({data:t,offset:0,dataLen:0,dirty:0})));let i=0,r=0,s=0;for(let n=0;n<e.length;
3n++){const t=e[n];if(i=ie[t.data.type],t.data.size>1&&(i=Math.max(i,16)*t.data.size),t.dataLen=i,r%i!==0&&r<16){const t=r%i%16;r+=t,s+=t}r+i>16?(s=16*Math.ceil(s/16),t.offset=s,s+=i,r=i):(t.offset=s,r+=i,s+=i)}return s=16*Math.ceil(s/16),{uboElements:e,size:s}}(i),n=["\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n "];for(let o=0;o<r.length;o++){const e=r[o],i=t.uniforms[e.data.name],s=e.data.name;let a=!1;for(let t=0;t<M.length;t++){const r=M[t];if(r.codeUbo&&r.test(e.data,i)){n.push(`offset = ${e.offset/4};`,M[t].codeUbo(e.data.name,i)),a=!0;break}}if(!a)if(e.data.size>1){const t=k(e.data.type),i=Math.max(ie[e.data.type]/16,1),r=t/i,o=(4-r%4)%4;n.push(`\n cv = ud.${s}.value;\n v = uv.${s};\n offset = ${e.offset/4};\n\n t = 0;\n\n for(var i=0; i < ${e.data.size*i}; i++)\n {\n for(var j = 0; j < ${r}; j++)\n {\n data[offset++] = v[t++];\n }\n offset += ${o};\n }\n\n `)}else{const t=ee[e.data.type];n.push(`\n cv = ud.${s}.value;\n v = uv.${s};\n offset = ${e.offset/4};\n ${t};\n `)}}return n.push("\n renderer.buffer.update(buffer);\n "),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",n.join("\n"))}}let se;let ne=0;const oe={textureCount:0,uboCount:0};class ae{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=ne++}systemCheck(){if(!function(){if("boolean"==typeof se)return se;try{se=!0===new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")}catch{se=!1}return se}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const i=t.program,r=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(r.program)),e||(oe.textureCount=0,oe.uboCount=0,this.syncUniformGroup(t.uniformGroup,oe)),r}setUniforms(t){const e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)}syncUniformGroup(t,e){const i=this.getGlProgram();(!t.static||t.dirtyId!==i.uniformDirtyGroups[t.id])&&(i.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))}syncUniforms(t,e,i){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,i)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=function(t,e){const i=["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n "];for(const r in t.uniforms){const s=e[r];if(!s){!0===t.uniforms[r]?.group&&(t.uniforms[r].ubo?i.push(`\n renderer.shader.syncUniformBufferGroup(uv.${r}, '${r}');\n `):i.push(`\n renderer.shader.syncUniformGroup(uv.${r}, syncData);\n `));continue}const n=t.uniforms[r];let o=!1;for(let t=0;t<M.length;t++)if(M[t].test(s,n)){i.push(M[t].code(r,n)),o=!0;break}if(!o){const t=(1!==s.size||s.isArray?D:B)[s.type].replace("location",`ud["${r}"].location`);i.push(`\n cu = ud["${r}"];\n cv = cu.value;\n v = uv["${r}"];\n ${t};`)}}return new Function("ud","uv","renderer","syncData",i.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const i=this.getGlProgram();if(!t.static||0!==t.dirtyId||!i.uniformGroups[t.id]){t.dirtyId=0;const r=i.uniformGroups[t.id]||this.createSyncBufferGroup(t,i,e);
3t.buffer.update(),r(i.uniformData,t.uniforms,this.renderer,oe,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,i.uniformBufferBindings[e])}createSyncBufferGroup(t,e,i){const{gl:r}=this.renderer;this.renderer.buffer.bind(t.buffer);const s=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=this.shader.uniformBindCount,r.uniformBlockBinding(e.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const n=this.getSignature(t,this.shader.program.uniformData,"ubo");let o=this._uboCache[n];if(o||(o=this._uboCache[n]=re(t,this.shader.program.uniformData)),t.autoManage){const e=new Float32Array(o.size/4);t.buffer.update(e)}return e.uniformGroups[t.id]=o.syncFunc,e.uniformGroups[t.id]}getSignature(t,e,i){const r=t.uniforms,s=[`${i}-`];for(const n in r)s.push(n),e[n]&&s.push(e[n].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const e=this.gl,i=t.program,r=Jt(e,i);return i.glPrograms[this.renderer.CONTEXT_UID]=r,r}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}ae.extension={type:a.n.RendererSystem,name:"shader"},a.R.add(ae);class he{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.4.2 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}he.defaultOptions={hello:!1},he.extension={type:[a.n.RendererSystem,a.n.CanvasRendererSystem],name:"startup"},a.R.add(he);const le=class t{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=r.T$.NONE,this._blendEq=!1,this.map=[],this.map[0]=this.setBlend,this.map[1]=this.setOffset,this.map[2]=this.setCullFace,this.map[3]=this.setDepthTest,this.map[4]=this.setFrontFace,this.map[5]=this.setDepthMask,this.checks=[],this.defaultState=new c,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=function(t,e=[]){return e[r.T$.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.ADD]=[t.ONE,t.ONE],e[r.T$.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.NONE]=[0,0],e[r.T$.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[r.T$.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.T$.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[r.T$.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[r.T$.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[r.T$.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[r.T$.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[r.T$.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[r.T$.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[r.T$.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[r.T$.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,i=0;for(;e;)1&e&&this.map[i].call(this,!!(t.data&1<<i)),e>>=1,i++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(e){this.updateCheck(t.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(t.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(t===this.blendMode)return;this.blendMode=t;const e=this.blendModes[t],i=this.gl;
32===e.length?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(t,e){const i=this.checks.indexOf(t);e&&-1===i?this.checks.push(t):!e&&-1!==i&&this.checks.splice(i,1)}static checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null}};le.extension={type:a.n.RendererSystem,name:"state"};let ue=le;a.R.add(ue);class ce extends n.EventEmitter{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(t){this.addRunners(...t.runners);const e=(t.priority??[]).filter((e=>t.systems[e])),i=[...e,...Object.keys(t.systems).filter((t=>!e.includes(t)))];for(const r of i)this.addSystem(t.systems[r],r)}addRunners(...t){t.forEach((t=>{this.runners[t]=new p(t)}))}addSystem(t,e){const i=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=i,this._systemsHash[e]=i;for(const r in this.runners)this.runners[r].add(i);return this}emitWithCustomOptions(t,e){const i=Object.keys(this._systemsHash);t.items.forEach((r=>{const s=i.find((t=>this._systemsHash[t]===r));r[t.name](e[s])}))}destroy(){Object.values(this.runners).forEach((t=>{t.destroy()})),this._systemsHash={}}}const de=class t{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=t.defaultMaxIdle,this.checkCountMax=t.defaultCheckCountMax,this.mode=t.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==r.UN.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let i=!1;for(let r=0;r<e.length;r++){const s=e[r];s.resource&&this.count-s.touched>
3this.maxIdle&&(t.destroyTexture(s,!0),e[r]=null,i=!0)}if(i){let t=0;for(let i=0;i<e.length;i++)null!==e[i]&&(e[t++]=e[i]);e.length=t}}unload(t){const e=this.renderer.texture,i=t._texture;i&&!i.framebuffer&&e.destroyTexture(i);for(let r=t.children.length-1;r>=0;r--)this.unload(t.children[r])}destroy(){this.renderer=null}};de.defaultMode=r.UN.AUTO,de.defaultMaxIdle=3600,de.defaultCheckCountMax=600,de.extension={type:a.n.RendererSystem,name:"textureGC"};let fe=de;a.R.add(fe);class pe{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=r.vK.UNSIGNED_BYTE,this.internalFormat=r.I2.RGBA,this.samplerType=0}}class me{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new v,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=function(t){let e;return e="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?{[r.vK.UNSIGNED_BYTE]:{[r.I2.RGBA]:t.RGBA8,[r.I2.RGB]:t.RGB8,[r.I2.RG]:t.RG8,[r.I2.RED]:t.R8,[r.I2.RGBA_INTEGER]:t.RGBA8UI,[r.I2.RGB_INTEGER]:t.RGB8UI,[r.I2.RG_INTEGER]:t.RG8UI,[r.I2.RED_INTEGER]:t.R8UI,[r.I2.ALPHA]:t.ALPHA,[r.I2.LUMINANCE]:t.LUMINANCE,[r.I2.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[r.vK.BYTE]:{[r.I2.RGBA]:t.RGBA8_SNORM,[r.I2.RGB]:t.RGB8_SNORM,[r.I2.RG]:t.RG8_SNORM,[r.I2.RED]:t.R8_SNORM,[r.I2.RGBA_INTEGER]:t.RGBA8I,[r.I2.RGB_INTEGER]:t.RGB8I,[r.I2.RG_INTEGER]:t.RG8I,[r.I2.RED_INTEGER]:t.R8I},[r.vK.UNSIGNED_SHORT]:{[r.I2.RGBA_INTEGER]:t.RGBA16UI,[r.I2.RGB_INTEGER]:t.RGB16UI,[r.I2.RG_INTEGER]:t.RG16UI,[r.I2.RED_INTEGER]:t.R16UI,[r.I2.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[r.vK.SHORT]:{[r.I2.RGBA_INTEGER]:t.RGBA16I,[r.I2.RGB_INTEGER]:t.RGB16I,[r.I2.RG_INTEGER]:t.RG16I,[r.I2.RED_INTEGER]:t.R16I},[r.vK.UNSIGNED_INT]:{[r.I2.RGBA_INTEGER]:t.RGBA32UI,[r.I2.RGB_INTEGER]:t.RGB32UI,[r.I2.RG_INTEGER]:t.RG32UI,[r.I2.RED_INTEGER]:t.R32UI,[r.I2.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[r.vK.INT]:{[r.I2.RGBA_INTEGER]:t.RGBA32I,[r.I2.RGB_INTEGER]:t.RGB32I,[r.I2.RG_INTEGER]:t.RG32I,[r.I2.RED_INTEGER]:t.R32I},[r.vK.FLOAT]:{[r.I2.RGBA]:t.RGBA32F,[r.I2.RGB]:t.RGB32F,[r.I2.RG]:t.RG32F,[r.I2.RED]:t.R32F,[r.I2.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[r.vK.HALF_FLOAT]:{[r.I2.RGBA]:t.RGBA16F,[r.I2.RGB]:t.RGB16F,[r.I2.RG]:t.RG16F,[r.I2.RED]:t.R16F},[r.vK.UNSIGNED_SHORT_5_6_5]:{[r.I2.RGB]:t.RGB565},[r.vK.UNSIGNED_SHORT_4_4_4_4]:{[r.I2.RGBA]:t.RGBA4},[r.vK.UNSIGNED_SHORT_5_5_5_1]:{[r.I2.RGBA]:t.RGB5_A1},[r.vK.UNSIGNED_INT_2_10_10_10_REV]:{[r.I2.RGBA]:t.RGB10_A2,[r.I2.RGBA_INTEGER]:t.RGB10_A2UI},[r.vK.UNSIGNED_INT_10F_11F_11F_REV]:{[r.I2.RGB]:t.R11F_G11F_B10F},[r.vK.UNSIGNED_INT_5_9_9_9_REV]:{[r.I2.RGB]:t.RGB9_E5},[r.vK.UNSIGNED_INT_24_8]:{[r.I2.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[r.vK.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[r.I2.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:{[r.vK.UNSIGNED_BYTE]:{[r.I2.RGBA]:t.RGBA,[r.I2.RGB]:t.RGB,[r.I2.ALPHA]:t.ALPHA,[r.I2.LUMINANCE]:t.LUMINANCE,[r.I2.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[r.vK.UNSIGNED_SHORT_5_6_5]:{[r.I2.RGB]:t.RGB},[r.vK.UNSIGNED_SHORT_4_4_4_4]:{[r.I2.RGBA]:t.RGBA},[r.vK.UNSIGNED_SHORT_5_5_5_1]:{[r.I2.RGBA]:t.RGBA}},e}(t),this.samplerTypes=function(t){let e;return e="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?{[t.RGB]:r.oT.FLOAT,[t.RGBA]:r.oT.FLOAT,[t.ALPHA]:r.oT.FLOAT,[t.LUMINANCE]:r.oT.FLOAT,[t.LUMINANCE_ALPHA]:r.oT.FLOAT,[t.R8]:r.oT.FLOAT,[t.R8_SNORM]:r.oT.FLOAT,[t.RG8]:r.oT.FLOAT,[t.RG8_SNORM]:r.oT.FLOAT,[t.RGB8]:r.oT.FLOAT,[t.RGB8_SNORM]:r.oT.FLOAT,[t.RGB565]:r.oT.FLOAT,[t.RGBA4]:r.oT.FLOAT,[t.RGB5_A1]:r.oT.FLOAT,[t.RGBA8]:r.oT.FLOAT,[t.RGBA8_SNORM]:r.oT.FLOAT,[t.RGB10_A2]:r.oT.FLOAT,[t.RGB10_A2UI]:r.oT.FLOAT,[t.SRGB8]:r.oT.FLOAT,[t.SRGB8_ALPHA8]:r.oT.FLOAT,[t.R16F]:r.oT.FLOAT,[t.RG16F]:r.oT.FLOAT,[t.RGB16F]:r.oT.FLOAT,[t.RGBA16F]:r.oT.FLOAT,[t.R32F]:r.oT.FLOAT,[t.RG32F]:r.oT.FLOAT,[t.RGB32F]:r.oT.FLOAT,[t.RGBA32F]:r.oT.FLOAT,[t.R11F_G11F_B10F]:r.oT.FLOAT,[t.RGB9_E5]:r.oT.FLOAT,[t.R8I]:r.oT.INT,[t.R8UI]:r.oT.UINT,[t.R16I]:r.oT.INT,[t.R16UI]:r.oT.UINT,[t.R32I]:r.oT.INT,[t.R32UI]:r.oT.UINT,[t.RG8I]:r.oT.INT,[t.RG8UI]:r.oT.UINT,[t.RG16I]:r.oT.INT,[t.RG16UI]:r.oT.UINT,[t.RG32I]:r.oT.INT,[t.RG32UI]:r.oT.UINT,[t.RGB8I]:r.oT.INT,[t.RGB8UI]:r.oT.UINT,[t.RGB16I]:r.oT.INT,[t.RGB16UI]:r.oT.UINT,[t.RGB32I]:r.oT.INT,[t.RGB32UI]:r.oT.UINT,[t.RGBA8I]:r.oT.INT,[t.RGBA8UI]:r.oT.UINT,[t.RGBA16I]:r.oT.INT,[t.RGBA16UI]:r.oT.UINT,[t.RGBA32I]:r.oT.INT,[t.RGBA32UI]:r.oT.UINT,[t.DEPTH_COMPONENT16]:r.oT.FLOAT,[t.DEPTH_COMPONENT24]:r.oT.FLOAT,[t.DEPTH_COMPONENT32F]:r.oT.FLOAT,[t.DEPTH_STENCIL]:r.oT.FLOAT,[t.DEPTH24_STENCIL8]:r.oT.FLOAT,[t.DEPTH32F_STENCIL8]:r.oT.FLOAT}:{[t.RGB]:r.oT.FLOAT,[t.RGBA]:r.oT.FLOAT,[t.ALPHA]:r.oT.FLOAT,[t.LUMINANCE]:r.oT.FLOAT,[t.LUMINANCE_ALPHA]:r.oT.FLOAT,[t.DEPTH_STENCIL]:r.oT.FLOAT},e}(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let r=0;r<e;r++)this.boundTextures[r]=null;this.emptyTextures={};const i=new pe(t.createTexture());t.bindTexture(t.TEXTURE_2D,i.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=i,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new pe(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(let r=0;r<6;r++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(let r=0;r<this.boundTextures.length;r++)this.bind(null,r)}bind(t,e=0){const{gl:i}=this;if(t=t?.castToBaseTexture(),t?.valid&&!t.parentTextureArray){t.touched=this.renderer.textureGC.count;const r=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(t.target,r.texture)),r.dirtyId!==t.dirtyId?(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),this.updateTexture(t)):r.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(t),this.boundTextures[e]=t}else this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[e]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture}unbind(t){const{gl:e,boundTextures:i}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let t=0;t<i.length;t++)i[t]===this.unknownTexture&&this.bind(null,t)}for(let r=0;r<i.length;r++)i[r]===t&&(this.currentLocation!==r&&(e.activeTexture(e.TEXTURE0+r),this.currentLocation=r),e.bindTexture(t.target,this.emptyTextures[t.target].texture),i[r]=null)}ensureSamplerType(t){const{boundTextures:e,hasIntegerTextures:i,CONTEXT_UID:s}=this;if(i)for(let n=t-1;n>=0;
3--n){const t=e[n];t&&t._glTextures[s].samplerType!==r.oT.FLOAT&&this.renderer.texture.unbind(t)}}initTexture(t){const e=new pe(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){e.internalFormat=this.internalFormats[t.type]?.[t.format]??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??r.oT.FLOAT,2===this.webGLVersion&&t.type===r.vK.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){const e=t._glTextures[this.CONTEXT_UID];if(!e)return;const i=this.renderer;if(this.initTextureType(t,e),t.resource?.upload(i,t,e))e.samplerType!==r.oT.FLOAT&&(this.hasIntegerTextures=!0);else{const r=t.realWidth,s=t.realHeight,n=i.gl;(e.width!==r||e.height!==s||e.dirtyId<0)&&(e.width=r,e.height=s,n.texImage2D(t.target,0,e.internalFormat,r,s,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:i}=this;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){const e=this.managedTextures.indexOf(t);-1!==e&&(0,n.removeItems)(this.managedTextures,e,1)}}updateTextureStyle(t){const e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==r.WB.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=r.Nt.CLAMP,t.resource?.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const i=this.gl;if(e.mipmap&&t.mipmap!==r.WB.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===r.aH.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const e=this.renderer.context.extensions.anisotropicFiltering;if(e&&t.anisotropicLevel>0&&t.scaleMode===r.aH.LINEAR){const r=Math.min(t.anisotropicLevel,i.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY_EXT,r)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===r.aH.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===r.aH.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}me.extension={type:a.n.RendererSystem,name:"texture"},a.R.add(me);class ge{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:i}=this,r=t._glTransformFeedbacks[i]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,r)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:i,renderer:r}=this;e&&r.shader.bind(e),i.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:i,CONTEXT_UID:r}=this,s=e.createTransformFeedback();t._glTransformFeedbacks[r]=s,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,s);for(let n=0;n<t.buffers.length;n++){const s=t.buffers[n];s&&(i.buffer.update(s),s._glBuffers[r].refCount++,e.bindBufferBase(e.TRANSFORM_FEEDBACK_BUFFER,n,s._glBuffers[r].buffer||null))}return e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null),t.disposeRunner.add(this),s}disposeTransformFeedback(t,e){const i=t._glTransformFeedbacks[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let n=0;n<t.buffers.length;n++){const i=t.buffers[n];if(!i)continue;const r=i._glBuffers[this.CONTEXT_UID];r&&(r.refCount--,0===r.refCount&&!e&&s.dispose(i,e))}i&&(e||r.deleteTransformFeedback(i),delete t._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}ge.extension={type:a.n.RendererSystem,name:"transformFeedback"},a.R.add(ge);class _e{constructor(t){this.renderer=t}init(t){this.screen=new P.Ae(0,0,t.width,t.height),this.element=t.view||s.Xd.ADAPTER.createCanvas(),this.resolution=t.resolution||s.Xd.RESOLUTION,this.autoDensity=!!t.autoDensity}resizeView(t,e){this.element.width=Math.round(t*this.resolution),this.element.height=Math.round(e*this.resolution);const i=this.element.width/this.resolution,r=this.element.height/this.resolution;this.screen.width=i,this.screen.height=r,this.autoDensity&&(this.element.style.width=`${i}px`,this.element.style.height=`${r}px`),this.renderer.emit("resize",i,r),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(t){t&&this.element.parentNode?.removeChild(this.element),this.renderer=null,this.element=null,this.screen=null}}_e.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},_e.extension={type:[a.n.RendererSystem,a.n.CanvasRendererSystem],name:"_view"},a.R.add(_e),s.Xd.PREFER_ENV=r.Vi.WEBGL2,s.Xd.STRICT_TEXTURE_CACHE=!1,s.Xd.RENDER_OPTIONS={...at.defaultOptions,...st.defaultOptions,..._e.defaultOptions,...he.defaultOptions},Object.defineProperties(s.Xd,{WRAP_MODE:{get:()=>v.defaultOptions.wrapMode,set(t){(0,n.deprecation)("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),v.defaultOptions.wrapMode=t}},SCALE_MODE:{get:()=>v.defaultOptions.scaleMode,set(t){(0,n.deprecation)("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),v.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get:()=>v.defaultOptions.mipmap,set(t){(0,n.deprecation)("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),v.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get:()=>v.defaultOptions.anisotropicLevel,set(t){(0,n.deprecation)("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),v.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get:()=>((0,n.deprecation)("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),rt.defaultResolution),set(t){rt.defaultResolution=t}},FILTER_MULTISAMPLE:{get:()=>((0,n.deprecation)("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),rt.defaultMultisample),set(t){rt.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get:()=>et.defaultMaxTextures,set(t){(0,n.deprecation)("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),et.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get:()=>et.defaultBatchSize,set(t){(0,n.deprecation)("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),et.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get:()=>et.canUploadSameBuffer,set(t){(0,n.deprecation)("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),et.canUploadSameBuffer=t}},GC_MODE:{get:()=>fe.defaultMode,set(t){(0,n.deprecation)("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),fe.defaultMode=t}},GC_MAX_IDLE:{get:()=>fe.defaultMaxIdle,set(t){(0,n.deprecation)("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),fe.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get:()=>fe.defaultCheckCountMax,set(t){(0,n.deprecation)("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),fe.defaultCheckCountMax=t}},PRECISION_VERTEX:{get:()=>j.defaultVertexPrecision,set(t){(0,n.deprecation)("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),j.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get:()=>j.defaultFragmentPrecision,set(t){(0,n.deprecation)("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),j.defaultFragmentPrecision=t}}});var xe=i(97091);const ve=[];function ye(t){for(const e of ve)if(e.test(t))return new e(t);throw new Error("Unable to auto-detect a suitable renderer.")}a.R.handleByList(a.n.Renderer,ve);const Te="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0
3)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",be="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n";class Ee{constructor(t){this.renderer=t}contextChange(t){let e;if(1===this.renderer.context.webGLVersion){const i=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,i)}else{const i=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,i)}e>=r.G5.HIGH?this.multisample=r.G5.HIGH:e>=r.G5.MEDIUM?this.multisample=r.G5.MEDIUM:e>=r.G5.LOW?this.multisample=r.G5.LOW:this.multisample=r.G5.NONE}destroy(){}}Ee.extension={type:a.n.RendererSystem,name:"_multisample"},a.R.add(Ee);class Ae{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class we{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:i}=this,r=t._glBuffers[i]||this.createGLBuffer(t);e.bindBuffer(t.type,r.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:i,CONTEXT_UID:r}=this;if(this.boundBufferBases[e]!==t){const s=t._glBuffers[r]||this.createGLBuffer(t);this.boundBufferBases[e]=t,i.bindBufferBase(i.UNIFORM_BUFFER,e,s.buffer)}}bindBufferRange(t,e,i){const{gl:r,CONTEXT_UID:s}=this;i=i||0;const n=t._glBuffers[s]||this.createGLBuffer(t);r.bindBufferRange(r.UNIFORM_BUFFER,e||0,n.buffer,256*i,256)}update(t){const{gl:e,CONTEXT_UID:i}=this,r=t._glBuffers[i]||this.createGLBuffer(t);if(t._updateID!==r.updateID)if(r.updateID=t._updateID,e.bindBuffer(t.type,r.buffer),r.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{const i=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;r.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,i)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const i=t._glBuffers[this.CONTEXT_UID],r=this.gl;t.disposeRunner.remove(this),i&&(e||r.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let i=0;i<e.length;i++)this.dispose(this.managedBuffers[e[i]],t)}createGLBuffer(t){const{CONTEXT_UID:e,gl:i}=this;return t._glBuffers[e]=new Ae(i.createBuffer()),this.managedBuffers[t.id]=t,t.disposeRunner.add(this),t._glBuffers[e]}}we.extension={type:a.n.RendererSystem,name:"buffer"},a.R.add(we);class Se{constructor(t){this.renderer=t}render(t,e){const i=this.renderer;let r,s,n,o;if(e&&(r=e.renderTexture,s=e.clear,n=e.transform,o=e.skipUpdateTransform),this.renderingToScreen=!r,i.runners.prerender.emit(),i.emit("prerender"),i.projection.transform=n,!i.context.isLost){if(r||(this.lastObjectRendered=t),!o){const e=t.enableTempParent();t.updateTransform(),t.disableTempParent(e)}i.renderTexture.bind(r),i.batch.currentRenderer.start(),(s??i.background.clearBeforeRender)&&i.renderTexture.clear(),t.render(i),i.batch.currentRenderer.flush(),r&&(e.blit&&i.framebuffer.blit(),r.baseTexture.update()),i.runners.postrender.emit(),i.projection.transform=null,i.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}Se.extension={type:a.n.RendererSystem,name:"objectRenderer"},a.R.add(Se);const Ie=class t extends ce{constructor(e){super(),this.type=r.N3.WEBGL,e=Object.assign({},s.Xd.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new K({projectionMatrix:new P.y3},!0);const i={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:t.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};
3this.setup(i),"useContextAlpha"in e&&((0,n.deprecation)("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&"notMultiplied"!==e.useContextAlpha,e.backgroundAlpha=!1===e.useContextAlpha?1:e.backgroundAlpha),this._plugin.rendererPlugins=t.__plugins,this.options=e,this.startup.run(this.options)}static test(t){return!t?.forceCanvas&&(0,n.isWebGLSupported)()}render(t,e){this.objectRenderer.render(t,e)}resize(t,e){this._view.resizeView(t,e)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(t=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:t}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(t){this._view.resolution=t,this.runners.resolutionChange.emit(t)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return(0,n.deprecation)("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return(0,n.deprecation)("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return(0,n.deprecation)("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return(0,n.deprecation)("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(t){(0,n.deprecation)("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=t}get backgroundAlpha(){return(0,n.deprecation)("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(t){(0,n.deprecation)("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=t}get powerPreference(){return(0,n.deprecation)("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(t,e){return this.textureGenerator.generateTexture(t,e)}};Ie.extension={type:a.n.Renderer,priority:1},Ie.__plugins={},Ie.__systems={};let Re=Ie;a.R.handleByMap(a.n.RendererPlugin,Re.__plugins),a.R.handleByMap(a.n.RendererSystem,Re.__systems),a.R.add(Re);class Ce extends m{constructor(t,e){const{width:i,height:r}=e||{};super(i,r),this.items=[],this.itemDirtyIds=[];for(let s=0;s<t;s++){const t=new v;this.items.push(t),this.itemDirtyIds.push(-2)}this.length=t,this._load=null,this.baseTexture=null}initFromArray(t,e){for(let i=0;i<this.length;i++)t[i]&&(t[i].castToBaseTexture?this.addBaseTextureAt(t[i].castToBaseTexture(),i):t[i]instanceof m?this.addResourceAt(t[i],i):this.addResourceAt(f(t[i],e),i))}dispose(){for(let t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(t,e){if(!this.items[e])throw new Error(`Index ${e} is out of bounds`);return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this}bind(t){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");super.bind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=t,this.items[e].on("update",t.update,t)}unbind(t){super.unbind(t);for(let e=0;e<this.length;e++)this.items[e].parentTextureArray=null,this.items[e].off("update",t.update,t)}load(){if(this._load)return this._load;const t=this.items.map((t=>t.resource)).filter((t=>t)).map((t=>t.load()));return this._load=Promise.all(t).then((()=>{const{realWidth:t,realHeight:e}=this.items[0];return this.resize(t,e),this.update(),Promise.resolve(this)})),this._load}}class Pe extends ut{constructor(t){super(t)}static test(t){const{OffscreenCanvas:e}=globalThis;return!!(e&&t instanceof e)||globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement}}const Me=class t extends Ce{constructor(e,i){const{width:s,height:n,autoLoad:o,linkBaseTexture:a}=i||{};if(e&&e.length!==t.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:s,height:n});for(let h=0;h<t.SIDES;h++)this.items[h].target=r.sp.TEXTURE_CUBE_MAP_POSITIVE_X+h;this.linkBaseTexture=!1!==a,e&&this.initFromArray(e,i),!1!==o&&this.load()}bind(t){super.bind(t),t.target=r.sp.TEXTURE_CUBE_MAP}addBaseTextureAt(t,e,i){if(void 0===i&&(i=this.linkBaseTexture),!this.items[e])throw new Error(`Index ${e} is out of bounds`);if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=r.sp.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}upload(e,i,r){const s=this.itemDirtyIds;for(let n=0;n<t.SIDES;n++){const t=this.items[n];(s[n]<t.dirtyId||r.dirtyId<i.dirtyId)&&(t.valid&&t.resource?(t.resource.upload(e,t,r),s[n]=t.dirtyId):s[n]<-1&&(e.gl.texImage2D(t.target,0,r.internalFormat,i.realWidth,i.realHeight,0,i.format,r.type,null),s[n]=-1))}return!0}static test(e){return Array.isArray(e)&&e.length===t.SIDES}};Me.SIDES=6;let Be=Me;class De extends ut{constructor(t,e){let i,r,s;e=e||{},"string"==typeof t?(i=De.EMPTY,r=t,s=!0):(i=t,r=null,s=!1),super(i),this.url=r,this.crossOrigin=e.crossOrigin??!0,this.alphaMode="number"==typeof e.alphaMode?e.alphaMode:null,this.ownsImageBitmap=e.ownsImageBitmap??s,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise((async(t,e)=>{if(null!==this.url)try{const e=await s.Xd.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const i=await e.blob();if(this.destroyed)return;const n=await createImageBitmap(i,{premultiplyAlpha:null===this.alphaMode||this.alphaMode===r.iw.UNPACK?"premultiply":"none"});if(this.destroyed)return void n.close();this.source=n,this.update(),t(this)}catch(i){if(this.destroyed)return;e(i),this.onError.emit(i)}else t(this)}))),this._load}upload(t,e,i){return this.source instanceof ImageBitmap?("number"==typeof this.alphaMode&&(e.alphaMode=this.alphaMode),super.upload(t,e,i)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&("string"==typeof t||t instanceof ImageBitmap)}static get EMPTY(){return De._EMPTY=De._EMPTY??s.Xd.ADAPTER.createCanvas(0,0),De._EMPTY}}const Ne=class t extends ut{constructor(t,e){e=e||{},super(s.Xd.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,!1!==e.autoLoad&&this.load()}load(){return this._load||(this._load=new Promise((e=>{if(this._resolve=()=>{this.update(),e(this)},t.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}))),this._load}_loadSvg(){const t=new Image;ut.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>
3{if(!this._resolve)return;const e=t.width,i=t.height;if(!e||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let r=e*this.scale,s=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(r=this._overrideWidth||this._overrideHeight/i*e,s=this._overrideHeight||this._overrideWidth/e*i),r=Math.round(r),s=Math.round(s);const o=this.source;o.width=r,o.height=s,o._pixiId=`canvas_${(0,n.uid)()}`,o.getContext("2d").drawImage(t,0,0,e,i,0,0,r,s),this._resolve(),this._resolve=null}}static getSize(e){const i=t.SVG_SIZE.exec(e),r={};return i&&(r[i[1]]=Math.round(parseFloat(i[3])),r[i[5]]=Math.round(parseFloat(i[7]))),r}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,i){return"svg"===i||"string"==typeof e&&e.startsWith("data:image/svg+xml")||"string"==typeof e&&t.SVG_XML.test(e)}};Ne.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Ne.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Fe=Ne;const Le=class t extends ut{constructor(e,i){if(i=i||{},!(e instanceof HTMLVideoElement)){const r=document.createElement("video");!1!==i.autoLoad&&r.setAttribute("preload","auto"),!1!==i.playsinline&&(r.setAttribute("webkit-playsinline",""),r.setAttribute("playsinline","")),!0===i.muted&&(r.setAttribute("muted",""),r.muted=!0),!0===i.loop&&r.setAttribute("loop",""),!1!==i.autoPlay&&r.setAttribute("autoplay",""),"string"==typeof e&&(e=[e]);const s=e[0].src||e[0];ut.crossOrigin(r,s,i.crossorigin);for(let i=0;i<e.length;++i){const s=document.createElement("source");let{src:n,mime:o}=e[i];if(n=n||e[i],n.startsWith("data:"))o=n.slice(5,n.indexOf(";"));else if(!n.startsWith("blob:")){const e=n.split("?").shift().toLowerCase(),i=e.slice(e.lastIndexOf(".")+1);o=o||t.MIME_TYPES[i]||`video/${i}`}s.src=n,o&&(s.type=o),r.appendChild(s)}e=r}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=i.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==i.autoPlay,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),!1!==i.autoLoad&&this.load()}update(t=0){if(!this.destroyed){if(this._updateFPS){const t=xe.vB.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;const t=this.source;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._load=new Promise(((e,i)=>{this.valid?e(this):(this._resolve=e,this._reject=i,t.load())})),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!e&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._configureAutoUpdate();const t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(xe.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(xe.vB.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(xe.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,i){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||t.TYPES.includes(i)}};Le.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Le.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Oe=Le;d.push(De,ct,Pe,Oe,class extends ut{constructor(t){super(t)}static test(t){return!!globalThis.VideoFrame&&t instanceof globalThis.VideoFrame}},Fe,g,Be,class extends Ce{constructor(t,e){const{width:i,height:r}=e||{};let s,n;Array.isArray(t)?(s=t,n=t.length):n=t,super(n,{width:i,height:r}),s&&this.initFromArray(s,e)}
3addBaseTextureAt(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this}bind(t){super.bind(t),t.target=r.sp.TEXTURE_2D_ARRAY}upload(t,e,i){const{length:r,itemDirtyIds:s,items:n}=this,{gl:o}=t;i.dirtyId<0&&o.texImage3D(o.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,r,0,e.format,i.type,null);for(let a=0;a<r;a++){const t=n[a];s[a]<t.dirtyId&&(s[a]=t.dirtyId,t.valid&&o.texSubImage3D(o.TEXTURE_2D_ARRAY,0,0,0,a,t.resource.width,t.resource.height,1,e.format,i.type,t.resource.source))}return!0}})},68276:function(t,e,i){i.d(e,{YZ:function(){return s},W2:function(){return u},s$:function(){return n}});var r=i(67767);class s{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?r.Ae.EMPTY:((t=t||new r.Ae(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,e){const{a:i,b:r,c:s,d:n,tx:o,ty:a}=t,h=i*e.x+s*e.y+o,l=r*e.x+n*e.y+a;this.minX=Math.min(this.minX,h),this.maxX=Math.max(this.maxX,h),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)}addQuad(t){let e=this.minX,i=this.minY,r=this.maxX,s=this.maxY,n=t[0],o=t[1];e=n<e?n:e,i=o<i?o:i,r=n>r?n:r,s=o>s?o:s,n=t[2],o=t[3],e=n<e?n:e,i=o<i?o:i,r=n>r?n:r,s=o>s?o:s,n=t[4],o=t[5],e=n<e?n:e,i=o<i?o:i,r=n>r?n:r,s=o>s?o:s,n=t[6],o=t[7],e=n<e?n:e,i=o<i?o:i,r=n>r?n:r,s=o>s?o:s,this.minX=e,this.minY=i,this.maxX=r,this.maxY=s}addFrame(t,e,i,r,s){this.addFrameMatrix(t.worldTransform,e,i,r,s)}addFrameMatrix(t,e,i,r,s){const n=t.a,o=t.b,a=t.c,h=t.d,l=t.tx,u=t.ty;let c=this.minX,d=this.minY,f=this.maxX,p=this.maxY,m=n*e+a*i+l,g=o*e+h*i+u;c=m<c?m:c,d=g<d?g:d,f=m>f?m:f,p=g>p?g:p,m=n*r+a*i+l,g=o*r+h*i+u,c=m<c?m:c,d=g<d?g:d,f=m>f?m:f,p=g>p?g:p,m=n*e+a*s+l,g=o*e+h*s+u,c=m<c?m:c,d=g<d?g:d,f=m>f?m:f,p=g>p?g:p,m=n*r+a*s+l,g=o*r+h*s+u,c=m<c?m:c,d=g<d?g:d,f=m>f?m:f,p=g>p?g:p,this.minX=c,this.minY=d,this.maxX=f,this.maxY=p}addVertexData(t,e,i){let r=this.minX,s=this.minY,n=this.maxX,o=this.maxY;for(let a=e;a<i;a+=2){const e=t[a],i=t[a+1];r=e<r?e:r,s=i<s?i:s,n=e>n?e:n,o=i>o?i:o}this.minX=r,this.minY=s,this.maxX=n,this.maxY=o}addVertices(t,e,i,r){this.addVerticesMatrix(t.worldTransform,e,i,r)}addVerticesMatrix(t,e,i,r,s=0,n=s){const o=t.a,a=t.b,h=t.c,l=t.d,u=t.tx,c=t.ty;let d=this.minX,f=this.minY,p=this.maxX,m=this.maxY;for(let g=i;g<r;g+=2){const t=e[g],i=e[g+1],r=o*t+h*i+u,_=l*i+a*t+c;d=Math.min(d,r-s),p=Math.max(p,r+s),f=Math.min(f,_-n),m=Math.max(m,_+n)}this.minX=d,this.minY=f,this.maxX=p,this.maxY=m}addBounds(t){const e=this.minX,i=this.minY,r=this.maxX,s=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<i?t.minY:i,this.maxX=t.maxX>r?t.maxX:r,this.maxY=t.maxY>s?t.maxY:s}addBoundsMask(t,e){const i=t.minX>e.minX?t.minX:e.minX,r=t.minY>e.minY?t.minY:e.minY,s=t.maxX<e.maxX?t.maxX:e.maxX,n=t.maxY<e.maxY?t.maxY:e.maxY;if(i<=s&&r<=n){const t=this.minX,e=this.minY,o=this.maxX,a=this.maxY;this.minX=i<t?i:t,this.minY=r<e?r:e,this.maxX=s>o?s:o,this.maxY=n>a?n:a}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const i=t.minX>e.x?t.minX:e.x,r=t.minY>e.y?t.minY:e.y,s=t.maxX<e.x+e.width?t.maxX:e.x+e.width,n=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(i<=s&&r<=n){const t=this.minX,e=this.minY,o=this.maxX,a=this.maxY;this.minX=i<t?i:t,this.minY=r<e?r:e,this.maxX=s>o?s:o,this.maxY=n>a?n:a}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,i,r,s,n){t-=s,e-=n,i+=s,r+=n,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>r?this.maxY:r}}class n extends r.P6.EventEmitter{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new r.wx,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new s,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const r=e[i];Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&
3(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new r.Ae),e=this._boundsRect),this._bounds.getRectangle(e)}getLocalBounds(t){t||(this._localBoundsRect||(this._localBoundsRect=new r.Ae),t=this._localBoundsRect),this._localBounds||(this._localBounds=new s);const e=this.transform,i=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=i?.worldAlpha??1,this.transform=this._tempDisplayObjectParent.transform;const n=this._bounds,o=this._boundsID;this._bounds=this._localBounds;const a=this.getBounds(!1,t);return this.parent=i,this.transform=e,this._bounds=n,this._bounds.updateID+=this._boundsID-o,a}toGlobal(t,e,i=!1){return i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)}toLocal(t,e,i,r){return e&&(t=e.toGlobal(t,i,r)),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,i)}setParent(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t}removeFromParent(){this.parent?.removeChild(this)}setTransform(t=0,e=0,i=1,r=1,s=0,n=0,o=0,a=0,h=0){return this.position.x=t,this.position.y=e,this.scale.x=i||1,this.scale.y=r||1,this.rotation=s,this.skew.x=n,this.skew.y=o,this.pivot.x=a,this.pivot.y=h,this}destroy(t){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new o),this.tempDisplayObjectParent}enableTempParent(){const t=this.parent;return this.parent=this._tempDisplayObjectParent,t}disableTempParent(t){this.parent=t}get x(){return this.position.x}set x(t){this.transform.position.x=t}get y(){return this.position.y}set y(t){this.transform.position.y=t}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(t){this.transform.position.copyFrom(t)}get scale(){return this.transform.scale}set scale(t){this.transform.scale.copyFrom(t)}get pivot(){return this.transform.pivot}set pivot(t){this.transform.pivot.copyFrom(t)}get skew(){return this.transform.skew}set skew(t){this.transform.skew.copyFrom(t)}get rotation(){return this.transform.rotation}set rotation(t){this.transform.rotation=t}get angle(){return this.transform.rotation*r.jl}set angle(t){this.transform.rotation=t*r.ZX}get zIndex(){return this._zIndex}set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.parent&&(this.parent.sortDirty=!0))}get worldVisible(){let t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}get mask(){return this._mask}set mask(t){if(this._mask!==t){if(this._mask){const t=this._mask.isMaskData?this._mask.maskObject:this._mask;t&&(t._maskRefCount--,0===t._maskRefCount&&(t.renderable=!0,t.isMask=!1))}if(this._mask=t,this._mask){const t=this._mask.isMaskData?this._mask.maskObject:this._mask;t&&(0===t._maskRefCount&&(t.renderable=!1,t.isMask=!0),t._maskRefCount++)}}}}class o extends n{constructor(){super(...arguments),this.sortDirty=null}}n.prototype.displayObjectUpdateTransform=n.prototype.updateTransform;const a=new r.y3;function h(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const l=class t extends n{constructor(){super(),this.children=[],this.sortableChildren=t.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(t){}addChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.addChild(t[e]);else{const e=t[0];e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.push(e),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit
3("childAdded",e,this,this.children.length-1),e.emit("added",this)}return t[0]}addChildAt(t,e){if(e<0||e>this.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const i=this.getChildIndex(t),r=this.getChildIndex(e);this.children[i]=e,this.children[r]=t,this.onChildrenChange(i<r?i:r)}getChildIndex(t){const e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e}setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(t);r.P6.removeItems(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e<t.length;e++)this.removeChild(t[e]);else{const e=t[0],i=this.children.indexOf(e);if(-1===i)return null;e.parent=null,e.transform._parentID=-1,r.P6.removeItems(this.children,i,1),this._boundsID++,this.onChildrenChange(i),e.emit("removed",this),this.emit("childRemoved",e,this,i)}return t[0]}removeChildAt(t){const e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,r.P6.removeItems(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e}removeChildren(t=0,e=this.children.length){const i=t,r=e-i;let s;if(r>0&&r<=e){s=this.children.splice(i,r);for(let t=0;t<s.length;++t)s[t].parent=null,s[t].transform&&(s[t].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(let t=0;t<s.length;++t)s[t].emit("removed",this),this.emit("childRemoved",s[t],this,t);return s}if(0===r&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let t=!1;for(let e=0,i=this.children.length;e<i;++e){const i=this.children[e];i._lastSortedIndex=e,!t&&0!==i.zIndex&&(t=!0)}t&&this.children.length>1&&this.children.sort(h),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t){const e=this.children[t];e.visible&&e.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let t=0;t<this.children.length;t++){const e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){const t=e._mask.isMaskData?e._mask.maskObject:e._mask;t?(t.calculateBounds(),this._bounds.addBoundsMask(e._bounds,t._bounds)):this._bounds.addBounds(e._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(t,e=!1){const i=super.getLocalBounds(t);if(!e)for(let r=0,s=this.children.length;r<s;++r){const t=this.children[r];t.visible&&t.updateTransform()}return i}_calculateBounds(){}_renderWithCulling(e){const i=e.renderTexture.sourceFrame;if(!(i.width>0&&i.height>0))return;let r,s;this.cullArea?(r=this.cullArea,s=this.worldTransform):this._render!==t.prototype._render&&(r=this.getBounds(!0));const n=e.projection.transform;if(n&&(s?(s=a.copyFrom(s),s.prepend(n)):s=n),r&&i.intersects(r,s))this._render(e);else if(this.cullArea)return;for(let t=0,o=this.children.length;t<o;++t){const i=this.children[t],r=i.cullable;i.cullable=r||!this.cullArea,i.render(e),i.cullable=r}}render(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters?.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(let e=0,i=this.children.length;e<i;++e)this.children[e].render(t)}}renderAdvanced(t){const e=this.filters,i=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let t=0;t<e.length;t++)e[t].enabled&&this._enabledFilters.push(e[t])}const s=e&&this._enabledFilters?.length||i&&(!i.isMaskData||i.enabled&&(i.autoDetect||i.type!==r.A7.NONE));if(s&&t.batch.flush(),e&&this._enabledFilters?.length&&t.filter.push(this,this._enabledFilters),i&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(let e=0,i=this.children.length;e<i;++e)this.children[e].render(t)}s&&t.batch.flush(),i&&t.mask.pop(this),e&&this._enabledFilters?.length&&t.filter.pop()}_render(t){}destroy(t){super.destroy(),this.sortDirty=!1;const e="boolean"==typeof t?t:t?.children,i=this.removeChildren(0,this.children.length);if(e)for(let r=0;r<i.length;++r)i[r].destroy(t)}get width(){return this.scale.x*this.getLocalBounds().width}set width(t){const e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}get height(){return this.scale.y*this.getLocalBounds().height}set height(t){const e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}};l.defaultSortableChildren=!1;let u=l;u.prototype.containerUpdateTransform=u.prototype.updateTransform,Object.defineProperties(r.Xd,{SORTABLE_CHILDREN:{get:()=>u.defaultSortableChildren,set(t){r.P6.deprecation("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),u.defaultSortableChildren=t}}})}
3,90463:function(t,e,i){i.d(e,{R:function(){return o},n:function(){return r}});var r=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(r||{});const s=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={..."object"!=typeof t.extension?{type:t.extension}:t.extension,ref:t}}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t={...t}).type&&(t.type=[t.type]),t},n=(t,e)=>s(t).priority??e,o={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(s).forEach((t=>{t.type.forEach((e=>this._removeHandlers[e]?.(t)))})),this},add(...t){return t.map(s).forEach((t=>{t.type.forEach((e=>{const i=this._addHandlers,r=this._queue;i[e]?i[e]?.(t):(r[e]=r[e]||[],r[e]?.push(t))}))})),this},handle(t,e,i){const r=this._addHandlers,s=this._removeHandlers;if(r[t]||s[t])throw new Error(`Extension type ${t} already has a handler`);r[t]=e,s[t]=i;const n=this._queue;return n[t]&&(n[t]?.forEach((t=>e(t))),delete n[t]),this},handleByMap(t,e){return this.handle(t,(t=>{t.name&&(e[t.name]=t.ref)}),(t=>{t.name&&delete e[t.name]}))},handleByList(t,e,i=-1){return this.handle(t,(t=>{e.includes(t.ref)||(e.push(t.ref),e.sort(((t,e)=>n(e,i)-n(t,i))))}),(t=>{const i=e.indexOf(t.ref);-1!==i&&e.splice(i,1)}))}}},19743:function(t,e,i){i.d(e,{TC:function(){return M}});var r=i(67767);const s={build(t){const e=t.points;let i,s,n,o,a,h;if(t.type===r.HS.CIRC){const e=t.shape;i=e.x,s=e.y,a=h=e.radius,n=o=0}else if(t.type===r.HS.ELIP){const e=t.shape;i=e.x,s=e.y,a=e.width,h=e.height,n=o=0}else{const e=t.shape,r=e.width/2,l=e.height/2;i=e.x+r,s=e.y+l,a=h=Math.max(0,Math.min(e.radius,Math.min(r,l))),n=r-a,o=l-h}if(!(a>=0&&h>=0&&n>=0&&o>=0))return void(e.length=0);const l=Math.ceil(2.3*Math.sqrt(a+h)),u=8*l+(n?4:0)+(o?4:0);if(e.length=u,0===u)return;if(0===l)return e.length=8,e[0]=e[6]=i+n,e[1]=e[3]=s+o,e[2]=e[4]=i-n,void(e[5]=e[7]=s-o);let c=0,d=4*l+(n?2:0)+2,f=d,p=u;{const t=n+a,r=o,h=i+t,l=i-t,u=s+r;if(e[c++]=h,e[c++]=u,e[--d]=u,e[--d]=l,o){const t=s-r;e[f++]=l,e[f++]=t,e[--p]=t,e[--p]=h}}for(let r=1;r<l;r++){const t=Math.PI/2*(r/l),u=n+Math.cos(t)*a,m=o+Math.sin(t)*h,g=i+u,_=i-u,x=s+m,v=s-m;e[c++]=g,e[c++]=x,e[--d]=x,e[--d]=_,e[f++]=_,e[f++]=v,e[--p]=v,e[--p]=g}{const t=o+h,r=i+n,a=i-n,l=s+t,u=s-t;e[c++]=r,e[c++]=l,e[--p]=u,e[--p]=r,n&&(e[c++]=a,e[c++]=l,e[--p]=u,e[--p]=a)}},triangulate(t,e){const i=t.points,s=e.points,n=e.indices;if(0===i.length)return;let o=s.length/2;const a=o;let h,l;if(t.type!==r.HS.RREC){const e=t.shape;h=e.x,l=e.y}else{const e=t.shape;h=e.x+e.width/2,l=e.y+e.height/2}const u=t.matrix;s.push(t.matrix?u.a*h+u.c*l+u.tx:h,t.matrix?u.b*h+u.d*l+u.ty:l),o++,s.push(i[0],i[1]);for(let r=2;r<i.length;r+=2)s.push(i[r],i[r+1]),n.push(o++,a,o);n.push(a+1,a,o)}};function n(t,e=!1){const i=t.length;if(i<6)return;let r=0;for(let s=0,n=t[i-2],o=t[i-1];s<i;s+=2){const e=t[s],i=t[s+1];r+=(e-n)*(i+o),n=e,o=i}if(!e&&r>0||e&&r<=0){const e=i/2;for(let r=e+e%2;r<i;r+=2){const e=i-r-2,s=i-r-1,n=r,o=r+1;[t[e],t[n]]=[t[n],t[e]],[t[s],t[o]]=[t[o],t[s]]}}}const o={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let i=t.points;const s=t.holes,o=e.points,a=e.indices;if(i.length>=6){n(i,!1);const t=[];for(let r=0;r<s.length;r++){const e=s[r];n(e.points,!0),t.push(i.length/2),i=i.concat(e.points)}const e=r.P6.earcut(i,t,2);if(!e)return;const h=o.length/2;for(let i=0;i<e.length;i+=3)a.push(e[i]+h),a.push(e[i+1]+h),a.push(e[i+2]+h);for(let r=0;r<i.length;r++)o.push(i[r])}}},a={build(t){const e=t.shape,i=e.x,r=e.y,s=e.width,n=e.height,o=t.points;o.length=0,s>=0&&n>=0&&o.push(i,r,i+s,r,i+s,r+n,i,r+n)},triangulate(t,e){const i=t.points,r=e.points;if(0===i.length)return;const s=r.length/2;r.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),e.indices.push(s,s+1,s+2,s+1,s+2,s+3)}},h={build(t){s.build(t)},triangulate(t,e){s.triangulate(t,e)}};var l=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(l||{}),u=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(u||{});const c={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let i=Math.ceil(t/this.maxLength);return i<this.minSegments?i=this.minSegments:i>this.maxSegments&&(i=this.maxSegments),i}};class d{static curveTo(t,e,i,r,s,n){const o=n[n.length-2],a=n[n.length-1]-e,h=o-t,l=r-e,u=i-t,c=Math.abs(a*u-h*l);
3if(c<1e-8||0===s)return(n[n.length-2]!==t||n[n.length-1]!==e)&&n.push(t,e),null;const d=a*a+h*h,f=l*l+u*u,p=a*l+h*u,m=s*Math.sqrt(d)/c,g=s*Math.sqrt(f)/c,_=m*p/d,x=g*p/f,v=m*u+g*h,y=m*l+g*a,T=h*(g+_),b=a*(g+_),E=u*(m+x),A=l*(m+x);return{cx:v+t,cy:y+e,radius:s,startAngle:Math.atan2(b-y,T-v),endAngle:Math.atan2(A-y,E-v),anticlockwise:h*l>u*a}}static arc(t,e,i,s,n,o,a,h,l){const u=a-o,d=c._segmentsCount(Math.abs(u)*n,40*Math.ceil(Math.abs(u)/r._b)),f=u/(2*d),p=2*f,m=Math.cos(f),g=Math.sin(f),_=d-1,x=_%1/_;for(let r=0;r<=_;++r){const t=f+o+p*(r+x*r),e=Math.cos(t),a=-Math.sin(t);l.push((m*e+g*a)*n+i,(m*-a+g*e)*n+s)}}}class f{static curveLength(t,e,i,r,s,n,o,a){let h=0,l=0,u=0,c=0,d=0,f=0,p=0,m=0,g=0,_=0,x=0,v=t,y=e;for(let T=1;T<=10;++T)l=T/10,u=l*l,c=u*l,d=1-l,f=d*d,p=f*d,m=p*t+3*f*l*i+3*d*u*s+c*o,g=p*e+3*f*l*r+3*d*u*n+c*a,_=v-m,x=y-g,v=m,y=g,h+=Math.sqrt(_*_+x*x);return h}static curveTo(t,e,i,r,s,n,o){const a=o[o.length-2],h=o[o.length-1];o.length-=2;const l=c._segmentsCount(f.curveLength(a,h,t,e,i,r,s,n));let u=0,d=0,p=0,m=0,g=0;o.push(a,h);for(let c=1,f=0;c<=l;++c)f=c/l,u=1-f,d=u*u,p=d*u,m=f*f,g=m*f,o.push(p*a+3*d*f*t+3*u*m*i+g*s,p*h+3*d*f*e+3*u*m*r+g*n)}}function p(t,e,i,r,s,n,o,a){let h,l;o?(h=r,l=-i):(h=-r,l=i);const u=t-i*s+h,c=e-r*s+l,d=t+i*n+h,f=e+r*n+l;return a.push(u,c,d,f),2}function m(t,e,i,r,s,n,o,a){const h=i-t,l=r-e;let u=Math.atan2(h,l),c=Math.atan2(s-t,n-e);a&&u<c?u+=2*Math.PI:!a&&u>c&&(c+=2*Math.PI);let d=u;const f=c-u,p=Math.abs(f),m=Math.sqrt(h*h+l*l),g=1+(15*p*Math.sqrt(m)/Math.PI>>0),_=f/g;if(d+=_,a){o.push(t,e,i,r);for(let i=1,r=d;i<g;i++,r+=_)o.push(t,e,t+Math.sin(r)*m,e+Math.cos(r)*m);o.push(t,e,s,n)}else{o.push(i,r,t,e);for(let i=1,r=d;i<g;i++,r+=_)o.push(t+Math.sin(r)*m,e+Math.cos(r)*m,t,e);o.push(s,n,t,e)}return 2*g}function g(t,e){t.lineStyle.native?function(t,e){let i=0;const s=t.shape,n=t.points||s.points,o=s.type!==r.HS.POLY||s.closeStroke;if(0===n.length)return;const a=e.points,h=e.indices,l=n.length/2,u=a.length/2;let c=u;for(a.push(n[0],n[1]),i=1;i<l;i++)a.push(n[2*i],n[2*i+1]),h.push(c,c+1),c++;o&&h.push(c,u)}(t,e):function(t,e){const i=t.shape;let s=t.points||i.points.slice();const n=e.closePointEps;if(0===s.length)return;const o=t.lineStyle,a=new r.E9(s[0],s[1]),h=new r.E9(s[s.length-2],s[s.length-1]),d=i.type!==r.HS.POLY||i.closeStroke,f=Math.abs(a.x-h.x)<n&&Math.abs(a.y-h.y)<n;if(d){s=s.slice(),f&&(s.pop(),s.pop(),h.set(s[s.length-2],s[s.length-1]));const t=.5*(a.x+h.x),e=.5*(h.y+a.y);s.unshift(t,e),s.push(t,e)}const g=e.points,_=s.length/2;let x=s.length;const v=g.length/2,y=o.width/2,T=y*y,b=o.miterLimit*o.miterLimit;let E=s[0],A=s[1],w=s[2],S=s[3],I=0,R=0,C=-(A-S),P=E-w,M=0,B=0,D=Math.sqrt(C*C+P*P);C/=D,P/=D,C*=y,P*=y;const N=o.alignment,F=2*(1-N),L=2*N;d||(o.cap===u.ROUND?x+=m(E-C*(F-L)*.5,A-P*(F-L)*.5,E-C*F,A-P*F,E+C*L,A+P*L,g,!0)+2:o.cap===u.SQUARE&&(x+=p(E,A,C,P,F,L,!0,g))),g.push(E-C*F,A-P*F,E+C*L,A+P*L);for(let r=1;r<_-1;++r){E=s[2*(r-1)],A=s[2*(r-1)+1],w=s[2*r],S=s[2*r+1],I=s[2*(r+1)],R=s[2*(r+1)+1],C=-(A-S),P=E-w,D=Math.sqrt(C*C+P*P),C/=D,P/=D,C*=y,P*=y,M=-(S-R),B=w-I,D=Math.sqrt(M*M+B*B),M/=D,B/=D,M*=y,B*=y;const t=w-E,e=A-S,i=w-I,n=R-S,a=t*i+e*n,h=e*i-n*t,u=h<0;if(Math.abs(h)<.001*Math.abs(a)){g.push(w-C*F,S-P*F,w+C*L,S+P*L),a>=0&&(o.join===l.ROUND?x+=m(w,S,w-C*F,S-P*F,w-M*F,S-B*F,g,!1)+4:x+=2,g.push(w-M*L,S-B*L,w+M*F,S+B*F));continue}const c=(-C+E)*(-P+S)-(-C+w)*(-P+A),d=(-M+I)*(-B+S)-(-M+w)*(-B+R),f=(t*d-i*c)/h,p=(n*c-e*d)/h,_=(f-w)*(f-w)+(p-S)*(p-S),v=w+(f-w)*F,N=S+(p-S)*F,O=w-(f-w)*L,U=S-(p-S)*L,k=u?F:L,G=_<=Math.min(t*t+e*e,i*i+n*n)+k*k*T;let H=o.join;if(H===l.MITER&&_/T>b&&(H=l.BEVEL),G)switch(H){case l.MITER:g.push(v,N,O,U);break;case l.BEVEL:u?g.push(v,N,w+C*L,S+P*L,v,N,w+M*L,S+B*L):g.push(w-C*F,S-P*F,O,U,w-M*F,S-B*F,O,U),x+=2;break;case l.ROUND:u?(g.push(v,N,w+C*L,S+P*L),x+=m(w,S,w+C*L,S+P*L,w+M*L,S+B*L,g,!0)+4,g.push(v,N,w+M*L,S+B*L)):(g.push(w-C*F,S-P*F,O,U),x+=m(w,S,w-C*F,S-P*F,w-M*F,S-B*F,g,!1)+4,g.push(w-M*F,S-B*F,O,U))}else{switch(g.push(w-C*F,S-P*F,w+C*L,S+P*L),H){case l.MITER:u?g.push(O,U,O,U):g.push(v,N,v,N),x+=2;break;case l.ROUND:x+=u?m(w,S,w+C*L,S+P*L,w+M*L,S+B*L,g,!0)+2:m(w,S,w-C*F,S-P*F,w-M*F,S-B*F,g,!1)+2}g.push(w-M*F,S-B*F,w+M*L,S+B*L),x+=2}}E=s[2*(_-2)],A=s[2*(_-2)+1],w=s[2*(_-1)],S=s[2*(_-1)+1],C=-(A-S),P=E-w,D=Math.sqrt(C*C+P*P),C/=D,P/=D,C*=y,P*=y,g.push(w-C*F,S-P*F,w+C*L,S+P*L),d||(o.cap===u.ROUND?x+=m(w-C*(F-L)*.5,S-P*(
3F-L)*.5,w-C*F,S-P*F,w+C*L,S+P*L,g,!1)+2:o.cap===u.SQUARE&&(x+=p(w,S,C,P,F,L,!1,g)));const O=e.indices,U=c.epsilon*c.epsilon;for(let r=v;r<x+v-2;++r)E=g[2*r],A=g[2*r+1],w=g[2*(r+1)],S=g[2*(r+1)+1],I=g[2*(r+2)],R=g[2*(r+2)+1],!(Math.abs(E*(S-R)+w*(R-A)+I*(A-S))<U)&&O.push(r,r+1,r+2)}(t,e)}class _{static curveLength(t,e,i,r,s,n){const o=t-2*i+s,a=e-2*r+n,h=2*i-2*t,l=2*r-2*e,u=4*(o*o+a*a),c=4*(o*h+a*l),d=h*h+l*l,f=2*Math.sqrt(u+c+d),p=Math.sqrt(u),m=2*u*p,g=2*Math.sqrt(d),_=c/p;return(m*f+p*c*(f-g)+(4*d*u-c*c)*Math.log((2*p+_+f)/(_+g)))/(4*m)}static curveTo(t,e,i,r,s){const n=s[s.length-2],o=s[s.length-1],a=c._segmentsCount(_.curveLength(n,o,t,e,i,r));let h=0,l=0;for(let u=1;u<=a;++u){const c=u/a;h=n+(t-n)*c,l=o+(e-o)*c,s.push(h+(t+(i-t)*c-h)*c,l+(e+(r-e)*c-l)*c)}}}const x={[r.HS.POLY]:o,[r.HS.CIRC]:s,[r.HS.ELIP]:s,[r.HS.RECT]:a,[r.HS.RREC]:h},v=[],y=[];var T=i(68276);class b{constructor(t,e=null,i=null,r=null){this.points=[],this.holes=[],this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type}clone(){return new b(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}class E{constructor(){this.reset()}begin(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}const A=new r.E9,w=class t extends r.JZ{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new T.YZ,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),y.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),v.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,i=null,r=null){const s=new b(t,e,i,r);return this.graphicsData.push(s),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const i=new b(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let i=0;i<e.length;++i){const r=e[i];if(r.fillStyle.visible&&r.shape&&(r.matrix?r.matrix.applyInverse(t,A):A.copyFrom(t),r.shape.contains(A.x,A.y))){let t=!1;if(r.holes)for(let e=0;e<r.holes.length;e++)if(r.holes[e].shape.contains(A.x,A.y)){t=!0;break}if(!t)return!0}}return!1}updateBatches(){if(!this.graphicsData.length)return void(this.batchable=!0);if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let i=null,s=null;this.batches.length>0&&(i=this.batches[this.batches.length-1],s=i.style);for(let h=this.shapeIndex;h<e.length;h++){this.shapeIndex++;const n=e[h],o=n.fillStyle,a=n.lineStyle;x[n.type].build(n),n.matrix&&this.transformPoints(n.points,n.matrix),(o.visible||a.visible)&&this.processHoles(n.holes);for(let e=0;e<2;e++){const h=0===e?o:a;if(!h.visible)continue;const l=h.texture.baseTexture,u=this.indices.length,c=this.points.length/2;l.wrapMode=r.Nt.REPEAT,0===e?this.processFill(n):this.processLine(n);const d=this.points.length/2-c;0!==d&&(i&&!this._compareStyles(s,h)&&(i.end(u,c),i=null),i||(i=v.pop()||new E,i.begin(h,u,c),this.batches.push(i),s=h),this.addUvs(this.points,t,h.texture,c,d,h.matrix
3))}}const n=this.indices.length,o=this.points.length/2;if(i&&i.end(n,o),0===this.batches.length)return void(this.batchable=!0);const a=o>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const e=this.graphicsData[t],i=e.fillStyle,r=e.lineStyle;if(i&&!i.texture.baseTexture.valid||r&&!r.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,i=t.length;e<i;e++){const i=t[e];for(let t=0;t<i.size;t++){const e=i.start+t;this.indicesUint16[e]=this.indicesUint16[e]-i.attribStart}}}isBatchable(){if(this.points.length>131070)return!1;const e=this.batches;for(let t=0;t<e.length;t++)if(e[t].style.native)return!1;return this.points.length<2*t.BATCHABLE_SIZE}buildDrawCalls(){let t=++r.VL._globalBatch;for(let r=0;r<this.drawCalls.length;r++)this.drawCalls[r].texArray.clear(),y.push(this.drawCalls[r]);this.drawCalls.length=0;const e=this.colors,i=this.textureIds;let s=y.pop();s||(s=new r.a$,s.texArray=new r.Ie),s.texArray.count=0,s.start=0,s.size=0,s.type=r.lg.TRIANGLES;let n=0,o=null,a=0,h=!1,l=r.lg.TRIANGLES,u=0;this.drawCalls.push(s);for(let c=0;c<this.batches.length;c++){const d=this.batches[c],f=8,p=d.style,m=p.texture.baseTexture;h!==!!p.native&&(h=!!p.native,l=h?r.lg.LINES:r.lg.TRIANGLES,o=null,n=f,t++),o!==m&&(o=m,m._batchEnabled!==t&&(n===f&&(t++,n=0,s.size>0&&(s=y.pop(),s||(s=new r.a$,s.texArray=new r.Ie),this.drawCalls.push(s)),s.start=u,s.size=0,s.texArray.count=0,s.type=l),m.touched=1,m._batchEnabled=t,m._batchLocation=n,m.wrapMode=r.Nt.REPEAT,s.texArray.elements[s.texArray.count++]=m,n++)),s.size+=d.size,u+=d.size,a=m._batchLocation,this.addColors(e,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,a,d.attribSize,d.attribStart)}r.VL._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,i=this.colors,r=this.textureIds,s=new ArrayBuffer(3*t.length*4),n=new Float32Array(s),o=new Uint32Array(s);let a=0;for(let h=0;h<t.length/2;h++)n[a++]=t[2*h],n[a++]=t[2*h+1],n[a++]=e[2*h],n[a++]=e[2*h+1],o[a++]=i[h],n[a++]=r[h];this._buffer.update(s),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?o.triangulate(t,this):x[t.type].triangulate(t,this)}processLine(t){g(t,this);for(let e=0;e<t.holes.length;e++)g(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const i=t[e];x[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let i=0;i<t.length/2;i++){const r=t[2*i],s=t[2*i+1];t[2*i]=e.a*r+e.c*s+e.tx,t[2*i+1]=e.b*r+e.d*s+e.ty}}addColors(t,e,i,s,n=0){const o=r.Il.shared.setValue(e).toLittleEndianNumber(),a=r.Il.shared.setValue(o).toPremultiplied(i);t.length=Math.max(t.length,n+s);for(let r=0;r<s;r++)t[n+r]=a}addTextureIds(t,e,i,r=0){t.length=Math.max(t.length,r+i);for(let s=0;s<i;s++)t[r+s]=e}addUvs(t,e,i,r,s,n=null){let o=0;const a=e.length,h=i.frame;for(;o<s;){let i=t[2*(r+o)],s=t[2*(r+o)+1];if(n){const t=n.a*i+n.c*s+n.tx;s=n.b*i+n.d*s+n.ty,i=t}o++,e.push(i/h.width,s/h.height)}const l=i.baseTexture;(h.width<l.width||h.height<l.height)&&this.adjustUvs(e,i,a,s)}adjustUvs(t,e,i,r){const s=e.baseTexture,n=1e-6,o=i+2*r,a=e.frame,h=a.width/s.width,l=a.height/s.height;let u=a.x/a.width,c=a.y/a.height,d=Math.floor(t[i]+n),f=Math.floor(t[i+1]+n);for(let p=i+2;p<o;p+=2)d=Math.min(d,Math.floor(t[p]+n)),f=Math.min(f,Math.floor(t[p+1]+n));u-=d,c-=f;for(let p=i;p<o;p+=2)t[p]=(t[p]+u)*h,t[p+1]=(t[p+1]+c)*l}};w.BATCHABLE_SIZE=100;let S=w;class I{constructor(){this.color=16777215,this.alpha=1,this.texture=r.xE.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const t=new I;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t}reset(){this.color=16777215,this.alpha=1,this.texture=r.xE.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class R extends I{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=u.BUTT,this.join=l.MITER,this.miterLimit=10}clone(){const t=new R;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1,this.cap=u.BUTT,this.join=l.MITER,this.miterLimit=10}}const C={},P=class t extends T.W2{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new I,this._lineStyle=new R,this._matrix=null,this._holeMode=!1,this.state=r.ZM.for2d(),this._geometry=t||new S,this._geometry.refCount++,this._transformID=-1,this._tintColor=new r.Il(16777215),this.blendMode=r.T$.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new t(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,i,r=.5,s=!1){return"number"==typeof t&&(t={width:t,color:e,alpha:i,alignment:r,native:s}),this.lineTextureStyle(t)}lineTextureStyle(t){const e={width:0,texture:r.xE.WHITE,color:t?.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:u.BUTT,join:l.MITER,miterLimit:10};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();
3const i=t.width>0&&t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:i},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new r.mg,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new r.mg,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,r=i[i.length-2],s=i[i.length-1];return(r!==t||s!==e)&&i.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,i,r){this._initCurve();const s=this.currentPath.points;return 0===s.length&&this.moveTo(0,0),_.curveTo(t,e,i,r,s),this}bezierCurveTo(t,e,i,r,s,n){return this._initCurve(),f.curveTo(t,e,i,r,s,n,this.currentPath.points),this}arcTo(t,e,i,r,s){this._initCurve(t,e);const n=this.currentPath.points,o=d.curveTo(t,e,i,r,s,n);if(o){const{cx:t,cy:e,radius:i,startAngle:r,endAngle:s,anticlockwise:n}=o;this.arc(t,e,i,r,s,n)}return this}arc(t,e,i,s,n,o=!1){if(s===n)return this;if(!o&&n<=s?n+=r._b:o&&s<=n&&(s+=r._b),n-s===0)return this;const a=t+Math.cos(s)*i,h=e+Math.sin(s)*i,l=this._geometry.closePointEps;let u=this.currentPath?this.currentPath.points:null;if(u){const t=Math.abs(u[u.length-2]-a),e=Math.abs(u[u.length-1]-h);t<l&&e<l||u.push(a,h)}else this.moveTo(a,h),u=this.currentPath.points;return d.arc(a,h,t,e,i,s,n,o,u),this}beginFill(t=0,e){return this.beginTextureFill({texture:r.xE.WHITE,color:t,alpha:e})}normalizeColor(t){const e=r.Il.shared.setValue(t.color??0);t.color=e.toNumber(),t.alpha??(t.alpha=e.alpha)}beginTextureFill(t){const e={texture:r.xE.WHITE,color:16777215,matrix:null};t=Object.assign(e,t),this.normalizeColor(t),this.currentPath&&this.startPoly();const i=t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,i,s){return this.drawShape(new r.Ae(t,e,i,s))}drawRoundedRect(t,e,i,s,n){return this.drawShape(new r.c9(t,e,i,s,n))}drawCircle(t,e,i){return this.drawShape(new r.Cd(t,e,i))}drawEllipse(t,e,i,s){return this.drawShape(new r.Pj(t,e,i,s))}drawPolygon(...t){let e,i=!0;const s=t[0];s.points?(i=s.closeStroke,e=s.points):e=Array.isArray(t[0])?t[0]:t;const n=new r.mg(e);return n.closeStroke=i,this.drawShape(n),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return 1===t.length&&t[0].shape.type===r.HS.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(let s=0;s<i;s++){const i=t.batches[s],n=i.style.color,o=new Float32Array(this.vertexData.buffer,4*i.attribStart*2,2*i.attribSize),a=new Float32Array(t.uvsFloat32.buffer,4*i.attribStart*2,2*i.attribSize),h={vertexData:o,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*i.start,i.size),uvs:a,_batchRGB:r.Il.shared.setValue(n).toRgbArray(),_tintRGB:n,_texture:i.style.texture,alpha:i.style.alpha,worldAlpha:1};this.batches[s]=h}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,i=this.batches.length;e<i;e++){const i=this.batches[e];i.worldAlpha=this.worldAlpha*i.alpha,t.plugins[this.pluginName].render(i)}}}_renderDirect(t){const e=this._resolveDirectShader(t),i=this._geometry,s=this.worldAlpha,n=e.uniforms,o=i.drawCalls;n.translationMatrix=this.transform.worldTransform,r.Il.shared.setValue(this._tintColor).premultiply(s).toArray(n.tint),t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(let r=0,a=o.length;r<a;r++)this._renderDrawCallDirect(t,i.drawCalls[r])}_renderDrawCallDirect(t,e){const{texArray:i,type:r,size:s,start:n}=e,o=i.count;for(let a=0;a<o;a++)t.texture.bind(i.elements[a],a);t.geometry.draw(r,s,n)}_resolveDirectShader(t){let e=this.shader;const i=this.pluginName;if(!e){if(!C[i]){const{maxTextures:e}=t.plugins[i],s=new Int32Array(e);for(let t=0;t<e;t++)s[t]=t;const n={tint:new Float32Array([1,1,1,1]),translationMatrix:new r.y3,default:r.oo.from({uSamplers:s},!0)},o=t.plugins[i]._shader.program;C[i]=new r.ex(o,n)}e=C[i]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:i,maxX:r,maxY:s}=t.bounds;this._bounds.addFrame(this.transform,e,i,r,s)}containsPoint(e){return this.worldTransform.applyInverse(e,t._TEMP_POINT),this._geometry.containsPoint(t._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e._tintRGB=r.Il.shared.setValue(this._tintColor).multiply(e._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,i=e.a,r=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,h=this._geometry.points,l=this.vertexData;let u=0;for(let c=0;c<h.length;c+=2){const t=h[c],e=h[c+1];l[u++]=i*t+s*e+o,l[u++]=n*e+r*t+a}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,
3super.destroy(t)}};P.curves=c,P._TEMP_POINT=new r.E9;let M=P},64260:function(t,e,i){i.d(e,{Cd:function(){return u},ZX:function(){return n},Pj:function(){return c},y3:function(){return p},AB:function(){return E},_b:function(){return r},E9:function(){return a},mg:function(){return d},jl:function(){return s},Ae:function(){return l},c9:function(){return f},HS:function(){return o},wx:function(){return w},Lv:function(){return b}});const r=2*Math.PI,s=180/Math.PI,n=Math.PI/180;var o=(t=>(t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t))(o||{});class a{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new a(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}}a.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const h=[new a,new a,new a,new a];class l{constructor(t=0,e=0,i=0,r=0){this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=o.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new l(0,0,0,0)}clone(){return new l(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)}intersects(t,e){if(!e){const e=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=e)return!1;const i=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>i}const i=this.left,r=this.right,s=this.top,n=this.bottom;if(r<=i||n<=s)return!1;const o=h[0].set(t.left,t.top),a=h[1].set(t.left,t.bottom),l=h[2].set(t.right,t.top),u=h[3].set(t.right,t.bottom);if(l.x<=o.x||a.y<=o.y)return!1;const c=Math.sign(e.a*e.d-e.b*e.c);if(0===c||(e.apply(o,o),e.apply(a,a),e.apply(l,l),e.apply(u,u),Math.max(o.x,a.x,l.x,u.x)<=i||Math.min(o.x,a.x,l.x,u.x)>=r||Math.max(o.y,a.y,l.y,u.y)<=s||Math.min(o.y,a.y,l.y,u.y)>=n))return!1;const d=c*(a.y-o.y),f=c*(o.x-a.x),p=d*i+f*s,m=d*r+f*s,g=d*i+f*n,_=d*r+f*n;if(Math.max(p,m,g,_)<=d*o.x+f*o.y||Math.min(p,m,g,_)>=d*u.x+f*u.y)return!1;const x=c*(o.y-l.y),v=c*(l.x-o.x),y=x*i+v*s,T=x*r+v*s,b=x*i+v*n,E=x*r+v*n;return!(Math.max(y,T,b,E)<=x*o.x+v*o.y||Math.min(y,T,b,E)>=x*u.x+v*u.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(s-r,0),this}ceil(t=1,e=.001){const i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=s-r,this}}l.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class u{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.radius=i,this.type=o.CIRC}clone(){return new u(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-t,s=this.y-e;return r*=r,s*=s,r+s<=i}getBounds(){return new l(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}}u.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class c{constructor(t=0,e=0,i=0,r=0){this.x=t,this.y=e,this.width=i,this.height=r,this.type=o.ELIP}clone(){return new c(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let i=(t-this.x)/this.width,r=(e-this.y)/this.height;return i*=i,r*=r,i+r<=1}getBounds(){return new l(this.x-this.width,this.y-this.height,this.width,this.height)}}c.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class d{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let i=0,r=e.length;i<r;i++)t.push(e[i].x,e[i].y);e=t}this.points=e,this.type=o.POLY,this.closeStroke=!0}clone(){const t=this.points.slice(),e=new d(t);return e.closeStroke=this.closeStroke,e}contains(t,e){let i=!1;const r=this.points.length/2;for(let s=0,n=r-1;s<r;n=s++){const r=this.points[2*s],o=this.points[2*s+1],a=this.points[2*n],h=this.points[2*n+1];o>e!=h>e&&t<(e-o)/(h-o)*(a-r)+r&&(i=!i)}return i}}d.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce(((t,e)=>`${t}, ${e}`),"")}]`};class f{constructor(t=0,e=0,i=0,r=0,s=20){this.x=t,this.y=e,this.width=i,this.height=r,this.radius=s,this.type=o.RREC}clone(){return new f(this.x,this.y,this.width,this.height,this.radius)}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let r=t-(this.x+i),s=e-(this.y+i);const n=i*i;if(r*r+s*s<=n||(r=t-(this.x+this.width-i),r*r+s*s<=n)||(s=e-(this.y+this.height-i),r*r+s*s<=n)||(r=t-(this.x+i),r*r+s*s<=n))return!0}return!1}}f.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class p{constructor(t=1,e=0,i=0,r=1,s=0,n=0){this.array=null,this.a=t,this.b=e,this.c=i,this.d=r,this.tx=s,this.ty=n}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,i,r,s,n){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=s,this.ty=n,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(t,e){e=e||new a;const i=t.x,r=t.y;return e.x=this.a*i+this.c*r+this.tx,e.y=this.b*i+this.d*r+this.t
3y,e}applyInverse(t,e){e=e||new a;const i=1/(this.a*this.d+this.c*-this.b),r=t.x,s=t.y;return e.x=this.d*i*r+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*s+-this.b*i*r+(-this.ty*this.a+this.tx*this.b)*i,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),r=this.a,s=this.c,n=this.tx;return this.a=r*e-this.b*i,this.b=r*i+this.b*e,this.c=s*e-this.d*i,this.d=s*i+this.d*e,this.tx=n*e-this.ty*i,this.ty=n*i+this.ty*e,this}append(t){const e=this.a,i=this.b,r=this.c,s=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*i+t.b*s,this.c=t.c*e+t.d*r,this.d=t.c*i+t.d*s,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*s+this.ty,this}setTransform(t,e,i,r,s,n,o,a,h){return this.a=Math.cos(o+h)*s,this.b=Math.sin(o+h)*s,this.c=-Math.sin(o-a)*n,this.d=Math.cos(o-a)*n,this.tx=t-(i*this.a+r*this.c),this.ty=e-(i*this.b+r*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,i=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,i=this.b,s=this.c,n=this.d,o=t.pivot,a=-Math.atan2(-s,n),h=Math.atan2(i,e),l=Math.abs(a+h);return l<1e-5||Math.abs(r-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(s*s+n*n),t.position.x=this.tx+(o.x*e+o.y*s),t.position.y=this.ty+(o.x*i+o.y*n),t}invert(){const t=this.a,e=this.b,i=this.c,r=this.d,s=this.tx,n=t*r-e*i;return this.a=r/n,this.b=-e/n,this.c=-i/n,this.d=t/n,this.tx=(i*this.ty-r*s)/n,this.ty=-(t*this.ty-e*s)/n,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new p;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}static get IDENTITY(){return new p}static get TEMP_MATRIX(){return new p}}p.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const m=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],g=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],_=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],x=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],v=[],y=[],T=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];v.push(e);for(let i=0;i<16;i++){const r=T(m[t]*m[i]+_[t]*g[i]),s=T(g[t]*m[i]+x[t]*g[i]),n=T(m[t]*_[i]+_[t]*x[i]),o=T(g[t]*_[i]+x[t]*x[i]);for(let t=0;t<16;t++)if(m[t]===r&&g[t]===s&&_[t]===n&&x[t]===o){e.push(t);break}}}for(let t=0;t<16;t++){const e=new p;e.set(m[t],g[t],_[t],x[t],0,0),y.push(e)}}();const b={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>m[t],uY:t=>g[t],vX:t=>_[t],vY:t=>x[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>v[t][e],sub:(t,e)=>v[t][b.inv(e)],rotate180:t=>4^t,isVertical:t=>2===(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?b.S:b.N:2*Math.abs(e)<=Math.abs(t)?t>0?b.E:b.W:e>0?t>0?b.SE:b.SW:t>0?b.NE:b.NW,matrixAppendRotationInv:(t,e,i=0,r=0)=>{const s=y[b.inv(e)];s.tx=i,s.ty=r,t.append(s)}};class E{constructor(t,e,i=0,r=0){this._x=i,this._y=r,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new E(t,e,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}E.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const A=class{constructor(){this.worldTransform=new p,this.localTransform=new p,this.position=new E(this.onChange,this,0,0),this.scale=new E(this.onChange,this,1,1),this.pivot=new E(this.onChange,this,0,0),this.skew=new E(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(t){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){const i=t.
3worldTransform,r=this.worldTransform;r.a=e.a*i.a+e.b*i.c,r.b=e.a*i.b+e.b*i.d,r.c=e.c*i.a+e.d*i.c,r.d=e.c*i.b+e.d*i.d,r.tx=e.tx*i.a+e.ty*i.c+i.tx,r.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};A.IDENTITY=new A;let w=A;w.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}},88831:function(t,e,i){i.d(e,{ZT:function(){return h},AL:function(){return l},IE:function(){return u}});var r=i(29902);class s extends r.xc{constructor(t=100,e=100,i=10,r=10){super(),this.segWidth=i,this.segHeight=r,this.width=t,this.height=e,this.build()}build(){const t=this.segWidth*this.segHeight,e=[],i=[],r=[],s=this.segWidth-1,n=this.segHeight-1,o=this.width/s,a=this.height/n;for(let l=0;l<t;l++){const t=l%this.segWidth,r=l/this.segWidth|0;e.push(t*o,r*a),i.push(t/s,r/n)}const h=s*n;for(let l=0;l<h;l++){const t=l%s,e=l/s|0,i=e*this.segWidth+t,n=e*this.segWidth+t+1,o=(e+1)*this.segWidth+t,a=(e+1)*this.segWidth+t+1;r.push(i,n,o,n,a,o)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint16Array(r),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}}class n extends r.xc{constructor(t=200,e,i=0){super(new Float32Array(4*e.length),new Float32Array(4*e.length),new Uint16Array(6*(e.length-1))),this.points=e,this._width=t,this.textureScale=i,this.build()}get width(){return this._width}build(){const t=this.points;if(!t)return;const e=this.getBuffer("aVertexPosition"),i=this.getBuffer("aTextureCoord"),r=this.getIndex();if(t.length<1)return;e.data.length/4!==t.length&&(e.data=new Float32Array(4*t.length),i.data=new Float32Array(4*t.length),r.data=new Uint16Array(6*(t.length-1)));const s=i.data,n=r.data;s[0]=0,s[1]=0,s[2]=0,s[3]=1;let o=0,a=t[0];const h=this._width*this.textureScale,l=t.length;for(let c=0;c<l;c++){const e=4*c;if(this.textureScale>0){const e=a.x-t[c].x,i=a.y-t[c].y,r=Math.sqrt(e*e+i*i);a=t[c],o+=r/h}else o=c/(l-1);s[e]=o,s[e+1]=0,s[e+2]=o,s[e+3]=1}let u=0;for(let c=0;c<l-1;c++){const t=2*c;n[u++]=t,n[u++]=t+1,n[u++]=t+2,n[u++]=t+2,n[u++]=t+1,n[u++]=t+3}i.update(),r.update(),this.updateVertices()}updateVertices(){const t=this.points;if(t.length<1)return;let e,i=t[0],r=0,s=0;const n=this.buffers[0].data,o=t.length,a=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let h=0;h<o;h++){const l=t[h],u=4*h;e=h<t.length-1?t[h+1]:l,s=-(e.x-i.x),r=e.y-i.y;let c=10*(1-h/(o-1));c>1&&(c=1);const d=Math.sqrt(r*r+s*s);d<1e-6?(r=0,s=0):(r/=d,s/=d,r*=a,s*=a),n[u]=l.x+r,n[u+1]=l.y+s,n[u+2]=l.x-r,n[u+3]=l.y-s,i=l}this.buffers[0].update()}update(){this.textureScale>0?this.build():this.updateVertices()}}var o=i(67767);class a extends r.Kj{constructor(t,e,i){super(new s(t.width,t.height,e,i),new r.rY(o.xE.WHITE)),this.texture=t,this.autoResize=!0}textureUpdated(){this._textureID=this.shader.texture._updateID;const t=this.geometry,{width:e,height:i}=this.shader.texture;this.autoResize&&(t.width!==e||t.height!==i)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())}set texture(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))}get texture(){return this.shader.texture}_render(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),super._render(t)}destroy(t){this.shader.texture.off("update",this.textureUpdated,this),super.destroy(t)}}class h extends a{constructor(t,e,i,r,s){super(o.xE.WHITE,4,4),this._origWidth=t.orig.width,this._origHeight=t.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=e??t.defaultBorders?.left??10,this._rightWidth=r??t.defaultBorders?.right??10,this._topHeight=i??t.defaultBorders?.top??10,this._bottomHeight=s??t.defaultBorders?.bottom??10,this.texture=t}textureUpdated(){this._textureID=this.shader.texture._updateID,this._refresh()}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}updateHorizontalVertices(){const t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height}updateVerticalVertices(){const t=this.vertices,e=this._getMinScale();
3t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width}_getMinScale(){const t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,i=this._topHeight+this._bottomHeight,r=this._height>i?1:this._height/i;return Math.min(e,r)}get width(){return this._width}set width(t){this._width=t,this._refresh()}get height(){return this._height}set height(t){this._height=t,this._refresh()}get leftWidth(){return this._leftWidth}set leftWidth(t){this._leftWidth=t,this._refresh()}get rightWidth(){return this._rightWidth}set rightWidth(t){this._rightWidth=t,this._refresh()}get topHeight(){return this._topHeight}set topHeight(t){this._topHeight=t,this._refresh()}get bottomHeight(){return this._bottomHeight}set bottomHeight(t){this._bottomHeight=t,this._refresh()}_refresh(){const t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;const i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()}}class l extends r.Kj{constructor(t=o.xE.EMPTY,e,i,s,n){const a=new r.xc(e,i,s);a.getBuffer("aVertexPosition").static=!1;super(a,new r.rY(t),null,n),this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(t){this.geometry.getBuffer("aVertexPosition").data=t}_render(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(t)}}class u extends r.Kj{constructor(t,e,i=0){const s=new n(t.height,e,i),a=new r.rY(t);i>0&&(t.baseTexture.wrapMode=o.Nt.REPEAT),super(s,a),this.autoUpdate=!0}_render(t){const e=this.geometry;(this.autoUpdate||e._width!==this.shader.texture.height)&&(e._width=this.shader.texture.height,e.update()),super._render(t)}}},29902:function(t,e,i){i.d(e,{Kj:function(){return l},xc:function(){return u},rY:function(){return c}});var r=i(67767),s=i(68276);class n{constructor(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(t){if(!t&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const e=this.uvBuffer.data;(!this.data||this.data.length!==e.length)&&(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}}const o=new r.E9,a=new r.mg,h=class t extends s.W2{constructor(t,e,i,s=r.lg.TRIANGLES){super(),this.geometry=t,this.shader=e,this.state=i||r.ZM.for2d(),this.drawMode=s,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=r.Xd.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(t){this.shader=t}get material(){return this.shader}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(t){this.shader.tint=t}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(t){this.shader.texture=t}_render(e){const i=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===r.lg.TRIANGLES&&i.length<2*t.BATCHABLE_SIZE?this._renderToBatch(e):this._renderDefault(e)}_renderDefault(t){const e=this.shader;
3e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(t){const e=this.geometry,i=this.shader;i.uvMatrix&&(i.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=i._tintRGB,this._texture=i.texture;const r=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[r]),t.plugins[r].render(this)}calculateVertices(){const t=this.geometry.buffers[0],e=t.data,i=t._updateID;if(i===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));const s=this.transform.worldTransform,n=s.a,o=s.b,a=s.c,h=s.d,l=s.tx,u=s.ty,c=this.vertexData;for(let r=0;r<c.length/2;r++){const t=e[2*r],i=e[2*r+1];c[2*r]=n*t+a*i+l,c[2*r+1]=o*t+h*i+u}if(this._roundPixels){const t=r.Xd.RESOLUTION;for(let e=0;e<c.length;++e)c[e]=Math.round(c[e]*t)/t}this.vertexDirty=i}calculateUvs(){const t=this.geometry.buffers[1],e=this.shader;e.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new n(t,e.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,o);const e=this.geometry.getBuffer("aVertexPosition").data,i=a.points,r=this.geometry.getIndex().data,s=r.length,n=4===this.drawMode?3:1;for(let h=0;h+2<s;h+=n){const t=2*r[h],s=2*r[h+1],n=2*r[h+2];if(i[0]=e[t],i[1]=e[t+1],i[2]=e[s],i[3]=e[s+1],i[4]=e[n],i[5]=e[n+1],a.contains(o.x,o.y))return!0}return!1}destroy(t){super.destroy(t),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};h.BATCHABLE_SIZE=100;let l=h;class u extends r.wG{constructor(t,e,i){super();const s=new r.lW(t),n=new r.lW(e,!0),o=new r.lW(i,!0,!0);this.addAttribute("aVertexPosition",s,2,!1,r.vK.FLOAT).addAttribute("aTextureCoord",n,2,!1,r.vK.FLOAT).addIndex(o),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}class c extends r.ex{constructor(t,e){const i={uSampler:t,alpha:1,uTextureMatrix:r.y3.IDENTITY,uColor:new Float32Array([1,1,1,1])};(e=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},e)).uniforms&&Object.assign(i,e.uniforms),super(e.program||r.$r.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0
3)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),i),this._colorDirty=!1,this.uvMatrix=new r.UX(t),this.batchable=void 0===e.program,this.pluginName=e.pluginName,this._tintColor=new r.Il(e.tint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0,this.alpha=e.alpha}get texture(){return this.uniforms.uSampler}set texture(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)}set alpha(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(t){t!==this.tint&&(this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}get tintValue(){return this._tintColor.toNumber()}update(){if(this._colorDirty){this._colorDirty=!1;const t=this.texture.baseTexture.alphaMode;r.Il.shared.setValue(this._tintColor).premultiply(this._alpha,t).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}},93233:function(t,e,i){i.d(e,{T:function(){return n}});var r=i(67767),s=i(68276);class n extends s.W2{constructor(t=1500,e,i=16384,s=!1){super();i>16384&&(i=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=i,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=r.T$.NORMAL,this.autoResize=s,this.roundPixels=!0,this.baseTexture=null,this.setProperties(e),this._tintColor=new r.Il(0),this.tintRgb=new Float32Array(3),this.tint=16777215}setProperties(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])}updateTransform(){this.displayObjectUpdateTransform()}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintColor.toRgbArray(this.tintRgb)}render(t){!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(()=>this.onChildrenChange(0)))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))}onChildrenChange(t){const e=Math.floor(t/this._batchSize);for(;this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID}dispose(){if(this._buffers){for(let t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}}destroy(t){super.destroy(t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null}}class o{constructor(t,e,i){this.geometry=new r.wG,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(let s=0;s<t.length;++s){let i=t[s];i={attributeName:i.attributeName,size:i.size,uploadFunction:i.uploadFunction,type:i.type||r.vK.FLOAT,offset:i.offset},e[s]?this.dynamicProperties.push(i):this.staticProperties.push(i)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}initBuffers(){const t=this.geometry;let e=0;this.indexBuffer=new r.lW(r.P6.createIndicesForQuads(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(let r=0;r<this.dynamicProperties.length;++r){const t=this.dynamicProperties[r];t.offset=e,e+=t.size,this.dynamicStride+=t.size}const i=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(i),this.dynamicDataUint32=new Uint32Array(i),this.dynamicBuffer=new r.lW(this.dynamicData,!1,!1);let s=0;
3this.staticStride=0;for(let r=0;r<this.staticProperties.length;++r){const t=this.staticProperties[r];t.offset=s,s+=t.size,this.staticStride+=t.size}const n=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(n),this.staticDataUint32=new Uint32Array(n),this.staticBuffer=new r.lW(this.staticData,!0,!1);for(let o=0;o<this.dynamicProperties.length;++o){const e=this.dynamicProperties[o];t.addAttribute(e.attributeName,this.dynamicBuffer,0,e.type===r.vK.UNSIGNED_BYTE,e.type,4*this.dynamicStride,4*e.offset)}for(let o=0;o<this.staticProperties.length;++o){const e=this.staticProperties[o];t.addAttribute(e.attributeName,this.staticBuffer,0,e.type===r.vK.UNSIGNED_BYTE,e.type,4*this.staticStride,4*e.offset)}}uploadDynamic(t,e,i){for(let s=0;s<this.dynamicProperties.length;s++){const n=this.dynamicProperties[s];n.uploadFunction(t,e,i,n.type===r.vK.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer._updateID++}uploadStatic(t,e,i){for(let s=0;s<this.staticProperties.length;s++){const n=this.staticProperties[s];n.uploadFunction(t,e,i,n.type===r.vK.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer._updateID++}destroy(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()}}class a extends r.bO{constructor(t){super(t),this.shader=null,this.properties=null,this.tempMatrix=new r.y3,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:r.vK.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=r.ex.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",{}),this.state=r.ZM.for2d()}render(t){const e=t.children,i=t._maxSize,s=t._batchSize,n=this.renderer;let o=e.length;if(0===o)return;o>i&&!t.autoResize&&(o=i);let a=t._buffers;a||(a=t._buffers=this.generateBuffers(t));const h=e[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=r.P6.correctBlendMode(t.blendMode,l),n.state.set(this.state);const u=n.gl,c=t.worldTransform.copyTo(this.tempMatrix);c.prepend(n.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=r.Il.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let r=0,f=0;r<o;r+=s,f+=1){let i=o-r;i>s&&(i=s),f>=a.length&&a.push(this._generateOneMoreBuffer(t));const h=a[f];h.uploadDynamic(e,r,i);const l=t._bufferUpdateIDs[f]||0;d=d||h._updateID<l,d&&(h._updateID=t._updateID,h.uploadStatic(e,r,i)),n.geometry.bind(h.geometry),u.drawElements(u.TRIANGLES,6*i,u.UNSIGNED_SHORT,0)}}generateBuffers(t){const e=[],i=t._maxSize,r=t._batchSize,s=t._properties;for(let n=0;n<i;n+=r)e.push(new o(this.properties,s,r));return e}_generateOneMoreBuffer(t){const e=t._batchSize,i=t._properties;return new o(this.properties,i,e)}uploadVertices(t,e,i,r,s,n){let o=0,a=0,h=0,l=0;for(let u=0;u<i;++u){const i=t[e+u],c=i._texture,d=i.scale.x,f=i.scale.y,p=c.trim,m=c.orig;p?(a=p.x-i.anchor.x*m.width,o=a+p.width,l=p.y-i.anchor.y*m.height,h=l+p.height):(o=m.width*(1-i.anchor.x),a=m.width*-i.anchor.x,h=m.height*(1-i.anchor.y),l=m.height*-i.anchor.y),r[n]=a*d,r[n+1]=l*f,r[n+s]=o*d,r[n+s+1]=l*f,r[n+2*s]=o*d,r[n+2*s+1]=h*f,r[n+3*s]=a*d,r[n+3*s+1]=h*f,n+=4*s}}
3uploadPosition(t,e,i,r,s,n){for(let o=0;o<i;o++){const i=t[e+o].position;r[n]=i.x,r[n+1]=i.y,r[n+s]=i.x,r[n+s+1]=i.y,r[n+2*s]=i.x,r[n+2*s+1]=i.y,r[n+3*s]=i.x,r[n+3*s+1]=i.y,n+=4*s}}uploadRotation(t,e,i,r,s,n){for(let o=0;o<i;o++){const i=t[e+o].rotation;r[n]=i,r[n+s]=i,r[n+2*s]=i,r[n+3*s]=i,n+=4*s}}uploadUvs(t,e,i,r,s,n){for(let o=0;o<i;++o){const i=t[e+o]._texture._uvs;i?(r[n]=i.x0,r[n+1]=i.y0,r[n+s]=i.x1,r[n+s+1]=i.y1,r[n+2*s]=i.x2,r[n+2*s+1]=i.y2,r[n+3*s]=i.x3,r[n+3*s+1]=i.y3,n+=4*s):(r[n]=0,r[n+1]=0,r[n+s]=0,r[n+s+1]=0,r[n+2*s]=0,r[n+2*s+1]=0,r[n+3*s]=0,r[n+3*s+1]=0,n+=4*s)}}uploadTint(t,e,i,s,n,o){for(let a=0;a<i;++a){const i=t[e+a],h=r.Il.shared.setValue(i._tintRGB).toPremultiplied(i.alpha,i.texture.baseTexture.alphaMode>0);s[o]=h,s[o+n]=h,s[o+2*n]=h,s[o+3*n]=h,o+=4*n}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}a.extension={name:"particle",type:r.nw.RendererPlugin},r.Rw.add(a)},48044:function(t,e,i){i.d(e,{Zq:function(){return m}});var r=i(67767),s=i(68276),n=i(53984);class o{constructor(t){this.maxItemsPerFrame=t,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function a(t,e){let i=!1;if(t?._textures?.length)for(let s=0;s<t._textures.length;s++)if(t._textures[s]instanceof r.xE){const r=t._textures[s].baseTexture;e.includes(r)||(e.push(r),i=!0)}return i}function h(t,e){if(t.baseTexture instanceof r.VL){const i=t.baseTexture;return e.includes(i)||e.push(i),!0}return!1}function l(t,e){if(t._texture&&t._texture instanceof r.xE){const i=t._texture.baseTexture;return e.includes(i)||e.push(i),!0}return!1}function u(t,e){return e instanceof n.xv&&(e.updateText(!0),!0)}function c(t,e){if(e instanceof n.pn){const t=e.toFontString();return n._A.measureFont(t),!0}return!1}function d(t,e){if(t instanceof n.xv){e.includes(t.style)||e.push(t.style),e.includes(t)||e.push(t);const i=t._texture.baseTexture;return e.includes(i)||e.push(i),!0}return!1}function f(t,e){return t instanceof n.pn&&(e.includes(t)||e.push(t),!0)}const p=class t{constructor(e){this.limiter=new o(t.uploadsPerFrame),this.renderer=e,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{this.queue&&this.prepareItems()},this.registerFindHook(d),this.registerFindHook(f),this.registerFindHook(a),this.registerFindHook(h),this.registerFindHook(l),this.registerUploadHook(u),this.registerUploadHook(c)}upload(t){return new Promise((e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,r.vB.system.addOnce(this.tick,this,r.uF.UTILITY))):e()}))}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const t=this.queue[0];let e=!1;if(t&&!t._destroyed)for(let i=0,r=this.uploadHooks.length;i<r;i++)if(this.uploadHooks[i](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)r.vB.system.addOnce(this.tick,this,r.uF.UTILITY);else{this.ticking=!1;const t=this.completes.slice(0);this.completes.length=0;for(let e=0,i=t.length;e<i;e++)t[e]()}}registerFindHook(t){return t&&this.addHooks.push(t),this}registerUploadHook(t){return t&&this.uploadHooks.push(t),this}add(t){for(let e=0,i=this.addHooks.length;e<i&&!this.addHooks[e](t,this.queue);e++);if(t instanceof s.W2)for(let e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&r.vB.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};p.uploadsPerFrame=4;let m=p;Object.defineProperties(r.Xd,{UPLOADS_PER_FRAME:{get:()=>m.uploadsPerFrame,set(t){r.P6.deprecation("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),m.uploadsPerFrame=t}}});var g=i(19743);function _(t,e){return e instanceof r.VL&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function x(t,e){if(!(e instanceof g.TC))return!1;const{geometry:i}=e;e.finishPoly(),i.updateBatches();const{batches:r}=i;for(let s=0;s<r.length;s++){const{texture:e}=r[s].style;e&&_(t,e.baseTexture)}return i.batchable||t.geometry.bind(i,e._resolveDirectShader(t)),!0}function v(t,e){return t instanceof g.TC&&(e.push(t),!0)}class y extends m{constructor(t){super(t),this.uploadHookHelper=this.renderer,this.registerFindHook(v),this.registerUploadHook(_),this.registerUploadHook(x)}}y.extension={name:"prepare",type:r.nw.RendererSystem},r.Rw.add(y)}
3,78706:function(t,e,i){i.d(e,{tq:function(){return T},Xd:function(){return r}});const r={ADAPTER:{createCanvas:(t,e)=>{const i=document.createElement("canvas");return i.width=t,i.height=e,i},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")},RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var s=/iPhone/i,n=/iPod/i,o=/iPad/i,a=/\biOS-universal(?:.+)Mac\b/i,h=/\bAndroid(?:.+)Mobile\b/i,l=/Android/i,u=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,c=/Silk/i,d=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,p=/BlackBerry/i,m=/BB10/i,g=/Opera Mini/i,_=/\b(CriOS|Chrome)(?:.+)Mobile/i,x=/Mobile(?:.+)Firefox\b/i,v=function(t){return"undefined"!==typeof t&&"MacIntel"===t.platform&&"number"===typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"===typeof MSStream};function y(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"===typeof navigator?"string"===typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var i=e.userAgent,r=i.split("[FBAN");"undefined"!==typeof r[1]&&(i=r[0]),"undefined"!==typeof(r=i.split("Twitter"))[1]&&(i=r[0]);var y=function(t){return function(e){return e.test(t)}}(i),T={apple:{phone:y(s)&&!y(d),ipod:y(n),tablet:!y(s)&&(y(o)||v(e))&&!y(d),universal:y(a),device:(y(s)||y(n)||y(o)||y(a)||v(e))&&!y(d)},amazon:{phone:y(u),tablet:!y(u)&&y(c),device:y(u)||y(c)},android:{phone:!y(d)&&y(u)||!y(d)&&y(h),tablet:!y(d)&&!y(u)&&!y(h)&&(y(c)||y(l)),device:!y(d)&&(y(u)||y(c)||y(h)||y(l))||y(/\bokhttp\b/i)},windows:{phone:y(d),tablet:y(f),device:y(d)||y(f)},other:{blackberry:y(p),blackberry10:y(m),opera:y(g),firefox:y(x),chrome:y(_),device:y(p)||y(m)||y(g)||y(x)||y(_)},any:!1,phone:!1,tablet:!1};return T.any=T.apple.device||T.android.device||T.windows.device||T.other.device,T.phone=T.apple.phone||T.android.phone||T.windows.phone,T.tablet=T.apple.tablet||T.android.tablet||T.windows.tablet,T}const T=(y.default??y)(globalThis.navigator)},17108:function(t,e,i){i.d(e,{K:function(){return n}});var r=i(67767),s=i(67220);class n extends s.j{constructor(t,e=!0){super(t[0]instanceof r.xE?t[0]:t[0].texture),this._textures=null,this._durations=null,this._autoUpdate=e,this._isConnectedToTicker=!1,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=t}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(r.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(r.vB.shared.add(this.update,this,r.uF.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(t){this.stop(),this.currentFrame=t}gotoAndPlay(t){this.currentFrame=t,this.play()}update(t){if(!this._playing)return;const e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){let i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];const r=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*r,this._currentTime+=r;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<i||this.animationSpeed<0&&this.currentFrame>i)&&this.onLoop(),this.updateTexture())}updateTexture(){const t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(t){this.stop(),super.destroy(t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(t){const e=[];for(let i=0;i<t.length;++i)e.push(r.xE.from(t[i]));return new n(e)}static fromImages(t){const e=[];for(let i=0;i<t.length;++i)e.push(r.xE.from(t[i]));return new n(e)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(t){if(t[0]instanceof r.xE)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(let e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()}get currentFrame(){let t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}set currentFrame(t){if(t<0||t>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${t}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(r.vB.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(r.vB.shared.add(this.update,this),this._isConnectedToTicker=!0))}}}
3,27331:function(t,e,i){i.d(e,{o:function(){return o}});var r=i(67767),s=i(67220);const n=new r.E9;class o extends s.j{constructor(t,e=100,i=100){super(t),this.tileTransform=new r.wx,this._width=e,this._height=i,this.uvMatrix=this.texture.uvMatrix||new r.UX(t),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}get clampMargin(){return this.uvMatrix.clampMargin}set clampMargin(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)}get tileScale(){return this.tileTransform.scale}set tileScale(t){this.tileTransform.scale.copyFrom(t)}get tilePosition(){return this.tileTransform.position}set tilePosition(t){this.tileTransform.position.copyFrom(t)}_onTextureUpdate(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215}_render(t){const e=this._texture;!e||!e.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))}_calculateBounds(){const t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,i=this._width*(1-this._anchor._x),r=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,i,r)}getLocalBounds(t){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new r.Ae),t=this._localBoundsRect),this._bounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,n);const e=this._width,i=this._height,r=-e*this.anchor._x;if(n.x>=r&&n.x<r+e){const t=-i*this.anchor._y;if(n.y>=t&&n.y<t+i)return!0}return!1}destroy(t){super.destroy(t),this.tileTransform=null,this.uvMatrix=null}static from(t,e){const i=t instanceof r.xE?t:r.xE.from(t,e);return new o(i,e.width,e.height)}get width(){return this._width}set width(t){this._width=t}get height(){return this._height}set height(t){this._height=t}}var a="#version 100\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0
3)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n";const h=new r.y3;class l extends r.bO{constructor(t){super(t),t.runners.contextChange.add(this),this.quad=new r.ud,this.state=r.ZM.for2d()}contextChange(){const t=this.renderer,e={globals:t.globalUniforms};this.simpleShader=r.ex.from(a,"#version 100\n#define SHADER_NAME Tiling-Sprite-Simple-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 texSample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = texSample * uColor;\n}\n",e),this.shader=t.context.webGLVersion>1?r.ex.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",e):r.ex.from(a,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",e)}render(t){const e=this.renderer,i=this.quad;let s=i.vertices;s[0]=s[6]=t._width*-t.anchor.x,s[1]=s[3]=t._height*-t.anchor.y,s[2]=s[4]=t._width*(1-t.anchor.x),s[5]=s[7]=t._height*(1-t.anchor.y);const n=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;s=i.uvs,s[0]=s[6]=-n,s[1]=s[3]=-o,s[2]=s[4]=1-n,s[5]=s[7]=1-o,i.invalidate();const a=t._texture,l=a.baseTexture,u=l.alphaMode>0,c=t.tileTransform.localTransform,d=t.uvMatrix;let f=l.isPowerOfTwo&&a.frame.width===l.width&&a.frame.height===l.height;f&&(l._glTextures[e.CONTEXT_UID]?f=l.wrapMode!==r.Nt.CLAMP:l.wrapMode===r.Nt.CLAMP&&(l.wrapMode=r.Nt.REPEAT));const p=f?this.simpleShader:this.shader,m=a.width,g=a.height,_=t._width,x=t._height;h.set(c.a*m/_,c.b*m/x,c.c*g/_,c.d*g/x,c.tx/_,c.ty/x),h.invert(),f?h.prepend(d.mapCoord):(p.uniforms.uMapCoord=d.mapCoord.toArray(!0),p.uniforms.uClampFrame=d.uClampFrame,p.uniforms.uClampOffset=d.uClampOffset),p.uniforms.uTransform=h.toArray(!0),p.uniforms.uColor=r.Il.shared.setValue(t.tint).premultiply(t.worldAlpha,u).toArray(p.uniforms.uColor),p.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),p.uniforms.uSampler=a,e.shader.bind(p),e.geometry.bind(i),this.state.blendMode=r.P6.correctBlendMode(t.blendMode,u),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}l.extension={name:"tilingSprite",type:r.nw.RendererPlugin},r.Rw.add(l)},67220:function(t,e,i){i.d(e,{j:function(){return a}});var r=i(67767),s=i(68276);const n=new r.E9,o=new Uint16Array([0,1,2,0,2,3]);class a extends s.W2{constructor(t){super(),this._anchor=new r.AB(this._onAnchorUpdate,this,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new r.Il(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=r.T$.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=t||r.xE.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=o,this.pluginName="batch",this.isSprite=!0,this._roundPixels=r.Xd.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=r.P6.sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=r.P6.sign(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const t=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===t._updateID)return;this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;const e=this.transform.worldTransform,i=e.a,s=e.b,n=e.c,o=e.d,a=e.tx,h=e.ty,l=this.vertexData,u=t.trim,c=t.orig,d=this._anchor;let f=0,p=0,m=0,g=0;if(u?(p=u.x-d._x*c.width,f=p+u.width,g=u.y-d._y*c.height,m=g+u.height):(p=-d._x*c.width,f=p+c.width,g=-d._y*c.height,m=g+c.height),l[0]=i*p+n*g+a,l[1]=o*g+s*p+h,l[2]=i*f+n*g+a,l[3]=o*g+s*f+h,l[4]=i*f+n*m+a,l[5]=o*m+s*f+h,l[6]=i*p+n*m+a,l[7]=o*m+s*p+h,this._roundPixels){const t=r.Xd.RESOLUTION;for(let e=0;e<l.length;++e)l[e]=Math.round(l[e]*t)/t}}
3calculateTrimmedVertices(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;const t=this._texture,e=this.vertexTrimmedData,i=t.orig,s=this._anchor,n=this.transform.worldTransform,o=n.a,a=n.b,h=n.c,l=n.d,u=n.tx,c=n.ty,d=-s._x*i.width,f=d+i.width,p=-s._y*i.height,m=p+i.height;if(e[0]=o*d+h*p+u,e[1]=l*p+a*d+c,e[2]=o*f+h*p+u,e[3]=l*p+a*f+c,e[4]=o*f+h*m+u,e[5]=l*m+a*f+c,e[6]=o*d+h*m+u,e[7]=l*m+a*d+c,this._roundPixels){const t=r.Xd.RESOLUTION;for(let i=0;i<e.length;++i)e[i]=Math.round(e[i]*t)/t}}_render(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)}_calculateBounds(){const t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(t){return 0===this.children.length?(this._localBounds||(this._localBounds=new s.YZ),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new r.Ae),t=this._localBoundsRect),this._localBounds.getRectangle(t)):super.getLocalBounds.call(this,t)}containsPoint(t){this.worldTransform.applyInverse(t,n);const e=this._texture.orig.width,i=this._texture.orig.height,r=-e*this.anchor.x;let s=0;return n.x>=r&&n.x<r+e&&(s=-i*this.anchor.y,n.y>=s&&n.y<s+i)}destroy(t){if(super.destroy(t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.baseTexture;this._texture.destroy(!!e)}this._texture=null}static from(t,e){const i=t instanceof r.xE?t:r.xE.from(t,e);return new a(i)}set roundPixels(t){this._roundPixels!==t&&(this._transformID=-1,this._transformTrimmedID=-1),this._roundPixels=t}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){const e=r.P6.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){const e=r.P6.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get anchor(){return this._anchor}set anchor(t){this._anchor.copyFrom(t)}get tint(){return this._tintColor.value}set tint(t){this._tintColor.setValue(t),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||r.xE.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}},12270:function(t,e,i){i.d(e,{Xz:function(){return T}});var r=i(67767),s=i(53984);class n{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class o{static test(t){return"string"==typeof t&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const s in e){const t=e[s].match(/^[a-z]+/gm)[0],r=e[s].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),n={};for(const e in r){const t=r[e].split("="),i=t[0],s=t[1].replace(/"/gm,""),o=parseFloat(s),a=isNaN(o)?s:o;n[i]=a}i[t].push(n)}const r=new n;return i.info.forEach((t=>r.info.push({face:t.face,size:parseInt(t.size,10)}))),i.common.forEach((t=>r.common.push({lineHeight:parseInt(t.lineHeight,10)}))),i.page.forEach((t=>r.page.push({id:parseInt(t.id,10),file:t.file}))),i.char.forEach((t=>r.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)}))),i.kerning.forEach((t=>r.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)}))),i.distanceField.forEach((t=>r.distanceField.push({distanceRange:parseInt(t.distanceRange,10),fieldType:t.fieldType}))),r}}class a{static test(t){const e=t;return"string"!=typeof t&&"getElementsByTagName"in t&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")}static parse(t){const e=new n,i=t.getElementsByTagName("info"),r=t.getElementsByTagName("common"),s=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),a=t.getElementsByTagName("kerning"),h=t.getElementsByTagName("distanceField");for(let n=0;n<i.length;n++)e.info.push({face:i[n].getAttribute("face"),size:parseInt(i[n].getAttribute("size"),10)});for(let n=0;n<r.length;n++)e.common.push({lineHeight:parseInt(r[n].getAttribute("lineHeight"),10)});for(let n=0;n<s.length;n++)e.page.push({id:parseInt(s[n].getAttribute("id"),10)||0,file:s[n].getAttribute("file")});for(let n=0;n<o.length;n++){const t=o[n];e.char.push({id:parseInt(t.getAttribute("id"),10),page:parseInt(t.getAttribute("page"),10)||0,x:parseInt(t.getAttribute("x"),10),y:parseInt(t.getAttribute("y"),10),width:parseInt(t.getAttribute("width"),10),height:parseInt(t.getAttribute("height"),10),xoffset:parseInt(t.getAttribute("xoffset"),10),yoffset:parseInt(t.getAttribute("yoffset"),10),xadvance:parseInt(t.getAttribute("xadvance"),10)})}for(let n=0;n<a.length;n++)e.kerning.push({first:parseInt(a[n].getAttribute("first"),10),second:parseInt(a[n].getAttribute("second"),10),amount:parseInt(a[n].getAttribute("amount"),10)});for(let n=0;n<h.length;
3n++)e.distanceField.push({fieldType:h[n].getAttribute("fieldType"),distanceRange:parseInt(h[n].getAttribute("distanceRange"),10)});return e}}class h{static test(t){return!("string"!=typeof t||!t.includes("<font>"))&&a.test(r.Xd.ADAPTER.parseXML(t))}static parse(t){return a.parse(r.Xd.ADAPTER.parseXML(t))}}const l=[o,a,h];function u(t,e,i,n,o,a,h){const l=i.text,u=i.fontProperties;e.translate(n,o),e.scale(a,a);const c=h.strokeThickness/2,d=-h.strokeThickness/2;if(e.font=h.toFontString(),e.lineWidth=h.strokeThickness,e.textBaseline=h.textBaseline,e.lineJoin=h.lineJoin,e.miterLimit=h.miterLimit,e.fillStyle=function(t,e,i,r,n,o){const a=i.fill;if(!Array.isArray(a))return a;if(1===a.length)return a[0];let h;const l=i.dropShadow?i.dropShadowDistance:0,u=i.padding||0,c=t.width/r-l-2*u,d=t.height/r-l-2*u,f=a.slice(),p=i.fillGradientStops.slice();if(!p.length){const t=f.length+1;for(let e=1;e<t;++e)p.push(e/t)}if(f.unshift(a[0]),p.unshift(0),f.push(a[a.length-1]),p.push(1),i.fillGradientType===s.M_.LINEAR_VERTICAL){h=e.createLinearGradient(c/2,u,c/2,d+u);let t=0;const r=(o.fontProperties.fontSize+i.strokeThickness)/d;for(let e=0;e<n.length;e++){const i=o.lineHeight*e;for(let e=0;e<f.length;e++){let s=0;s="number"==typeof p[e]?p[e]:e/f.length;const n=i/d+s*r;let o=Math.max(t,n);o=Math.min(o,1),h.addColorStop(o,f[e]),t=o}}}else{h=e.createLinearGradient(u,d/2,c+u,d/2);const t=f.length+1;let i=1;for(let e=0;e<f.length;e++){let r;r="number"==typeof p[e]?p[e]:i/t,h.addColorStop(r,f[e]),i++}}return h}(t,e,h,a,[l],i),e.strokeStyle=h.stroke,h.dropShadow){const t=h.dropShadowColor,i=h.dropShadowBlur*a,s=h.dropShadowDistance*a;e.shadowColor=r.Il.shared.setValue(t).setAlpha(h.dropShadowAlpha).toRgbaString(),e.shadowBlur=i,e.shadowOffsetX=Math.cos(h.dropShadowAngle)*s,e.shadowOffsetY=Math.sin(h.dropShadowAngle)*s}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;h.stroke&&h.strokeThickness&&e.strokeText(l,c,d+i.lineHeight-u.descent),h.fill&&e.fillText(l,c,d+i.lineHeight-u.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function c(t){return Array.from?Array.from(t):t.split("")}function d(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}const f=class t{constructor(t,e,i){const[s]=t.info,[n]=t.common,[o]=t.page,[a]=t.distanceField,h=r.P6.getResolutionOfUrl(o.file),l={};this._ownsTextures=i,this.font=s.face,this.size=s.size,this.lineHeight=n.lineHeight/h,this.chars={},this.pageTextures=l;for(let u=0;u<t.page.length;u++){const{id:i,file:s}=t.page[u];l[i]=e instanceof Array?e[u]:e[s],a?.fieldType&&"none"!==a.fieldType&&(l[i].baseTexture.alphaMode=r.iw.NO_PREMULTIPLIED_ALPHA,l[i].baseTexture.mipmap=r.KI.OFF)}for(let u=0;u<t.char.length;u++){const{id:e,page:i}=t.char[u];let{x:s,y:n,width:o,height:a,xoffset:c,yoffset:d,xadvance:f}=t.char[u];s/=h,n/=h,o/=h,a/=h,c/=h,d/=h,f/=h;const p=new r.Ae(s+l[i].frame.x/h,n+l[i].frame.y/h,o,a);this.chars[e]={xOffset:c,yOffset:d,xAdvance:f,kerning:{},texture:new r.xE(l[i].baseTexture,p),page:i}}for(let r=0;r<t.kerning.length;r++){let{first:e,second:i,amount:s}=t.kerning[r];e/=h,i/=h,s/=h,this.chars[i]&&(this.chars[i].kerning[e]=s)}this.distanceFieldRange=a?.distanceRange,this.distanceFieldType=a?.fieldType?.toLowerCase()??"none"}destroy(){for(const t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(const t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null}static install(e,i,s){let o;if(e instanceof n)o=e;else{const t=function(t){for(let e=0;e<l.length;e++)if(l[e].test(t))return l[e];return null}(e);if(!t)throw new Error("Unrecognized data format for font.");o=t.parse(e)}i instanceof r.xE&&(i=[i]);const a=new t(o,i,s);return t.available[a.font]=a,a}static uninstall(e){const i=t.available[e];if(!i)throw new Error(`No font found named '${e}'`);i.destroy(),delete t.available[e]}static from(e,i,o){if(!e)throw new Error("[BitmapFont] Property `name` is required.");const{chars:a,padding:h,resolution:l,textureWidth:f,textureHeight:p,...m}=Object.assign({},t.defaultOptions,o),g=function(t){"string"==typeof t&&(t=[t]);const e=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];if(Array.isArray(r)){if(2!==r.length)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${r.length}.`);
3const t=r[0].charCodeAt(0),i=r[1].charCodeAt(0);if(i<t)throw new Error("[BitmapFont]: Invalid character range.");for(let r=t,s=i;r<=s;r++)e.push(String.fromCharCode(r))}else e.push(...c(r))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(a),_=i instanceof s.pn?i:new s.pn(i),x=f,v=new n;v.info[0]={face:_.fontFamily,size:_.fontSize},v.common[0]={lineHeight:_.fontSize};let y,T,b,E=0,A=0,w=0;const S=[],I=[];for(let t=0;t<g.length;t++){y||(y=r.Xd.ADAPTER.createCanvas(),y.width=f,y.height=p,T=y.getContext("2d"),b=new r.VL(y,{resolution:l,...m}),S.push(b),I.push(new r.xE(b)),v.page.push({id:I.length-1,file:""}));const e=g[t],i=s._A.measureText(e,_,!1,y),n=i.width,o=Math.ceil(i.height),a=Math.ceil(("italic"===_.fontStyle?2:1)*n);if(A>=p-o*l){if(0===A)throw new Error(`[BitmapFont] textureHeight ${p}px is too small (fontFamily: '${_.fontFamily}', fontSize: ${_.fontSize}px, char: '${e}')`);--t,y=null,T=null,b=null,A=0,E=0,w=0;continue}if(w=Math.max(o+i.fontProperties.descent,w),a*l+E>=x){if(0===E)throw new Error(`[BitmapFont] textureWidth ${f}px is too small (fontFamily: '${_.fontFamily}', fontSize: ${_.fontSize}px, char: '${e}')`);--t,A+=w*l,A=Math.ceil(A),E=0,w=0;continue}u(y,T,i,E,A,l,_);const c=d(i.text);v.char.push({id:c,page:I.length-1,x:E/l,y:A/l,width:a,height:o,xoffset:0,yoffset:0,xadvance:n-(_.dropShadow?_.dropShadowDistance:0)-(_.stroke?_.strokeThickness:0)}),E+=(a+2*h)*l,E=Math.ceil(E)}if(!o?.skipKerning)for(let t=0,r=g.length;t<r;t++){const e=g[t];for(let t=0;t<r;t++){const i=g[t],r=T.measureText(e).width,s=T.measureText(i).width,n=T.measureText(e+i).width-(r+s);n&&v.kerning.push({first:d(e),second:d(i),amount:n})}}const R=new t(v,I,!0);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=R,R}};f.ALPHA=[["a","z"],["A","Z"]," "],f.NUMERIC=[["0","9"]],f.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],f.ASCII=[[" ","~"]],f.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:f.ALPHANUMERIC},f.available={};let p=f;var m=i(68276),g=i(29902);const _=[],x=[],v=[],y=class t extends m.W2{constructor(e,i={}){super();const{align:s,tint:n,maxWidth:o,letterSpacing:a,fontName:h,fontSize:l}=Object.assign({},t.styleDefaults,i);if(!p.available[h])throw new Error(`Missing BitmapFont "${h}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=s,this._tintColor=new r.Il(n),this._font=void 0,this._fontName=h,this._fontSize=l,this.text=e,this._maxWidth=o,this._maxLineHeight=0,this._letterSpacing=a,this._anchor=new r.AB((()=>{this.dirty=!0}),this,0,0),this._roundPixels=r.Xd.ROUND_PIXELS,this.dirty=!0,this._resolution=r.Xd.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){const t=p.available[this._fontName],e=this.fontSize,i=e/t.size,s=new r.E9,n=[],o=[],a=[],h=c(this._text.replace(/(?:\r\n|\r)/g,"\n")||" "),l=this._maxWidth*t.size/e,u="none"===t.distanceFieldType?_:x;let f=null,m=0,y=0,T=0,b=-1,E=0,A=0,w=0,S=0;for(let c=0;c<h.length;c++){const e=h[c],i=d(e);if(/(?:\s)/.test(e)&&(b=c,E=m,S++),"\r"===e||"\n"===e){o.push(m),a.push(-1),y=Math.max(y,m),++T,++A,s.x=0,s.y+=t.lineHeight,f=null,S=0;continue}const u=t.chars[i];if(!u)continue;f&&u.kerning[f]&&(s.x+=u.kerning[f]);const p=v.pop()||{texture:r.xE.EMPTY,line:0,charCode:0,prevSpaces:0,position:new r.E9};p.texture=u.texture,p.line=T,p.charCode=i,p.position.x=Math.round(s.x+u.xOffset+this._letterSpacing/2),p.position.y=Math.round(s.y+u.yOffset),p.prevSpaces=S,n.push(p),m=p.position.x+Math.max(u.xAdvance-u.xOffset,u.texture.orig.width),s.x+=u.xAdvance+this._letterSpacing,w=Math.max(w,u.yOffset+u.texture.height),f=i,-1!==b&&l>0&&s.x>l&&(++A,r.P6.removeItems(n,1+b-A,1+c-b),c=b,b=-1,o.push(E),a.push(n.length>0?n[n.length-1].prevSpaces:0),y=Math.max(y,E),T++,s.x=0,s.y+=t.lineHeight,f=null,S=0)}const I=h[h.length-1];
3"\r"!==I&&"\n"!==I&&(/(?:\s)/.test(I)&&(m=E),o.push(m),y=Math.max(y,m),a.push(-1));const R=[];for(let r=0;r<=T;r++){let t=0;"right"===this._align?t=y-o[r]:"center"===this._align?t=(y-o[r])/2:"justify"===this._align&&(t=a[r]<0?0:(y-o[r])/a[r]),R.push(t)}const C=n.length,P={},M=[],B=this._activePagesMeshData;u.push(...B);for(let c=0;c<C;c++){const e=n[c].texture,i=e.baseTexture.uid;if(!P[i]){let s=u.pop();if(!s){const e=new g.xc;let i,n;"none"===t.distanceFieldType?(i=new g.rY(r.xE.EMPTY),n=r.T$.NORMAL):(i=new g.rY(r.xE.EMPTY,{program:r.$r.from("// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n","// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n // MSDF\r\n float median = texColor.r + texColor.g + texColor.b -\r\n min(texColor.r, min(texColor.g, texColor.b)) -\r\n max(texColor.r, max(texColor.g, texColor.b));\r\n // SDF\r\n median = min(median, texColor.a);\r\n\r\n float screenPxDistance = uFWidth * (median - 0.5);\r\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n if (median < 0.01) {\r\n alpha = 0.0;\r\n } else if (median > 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // Gamma correction for coverage-like alpha\r\n float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r\n float gamma = mix(1.0, 1.0 / 2.2, luma);\r\n float coverage = pow(uColor.a * alpha, gamma); \r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, coverage);\r\n}\r\n"),uniforms:{uFWidth:0}}),n=r.T$.NORMAL_NPM);const o=new g.Kj(e,i);o.blendMode=n,s={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:o,vertices:null,uvs:null,indices:null}}s.index=0,s.indexCount=0,s.vertexCount=0,s.uvsCount=0,s.total=0;const{_textureCache:n}=this;n[i]=n[i]||new r.xE(e.baseTexture),s.mesh.texture=n[i],s.mesh.tint=this._tintColor.value,M.push(s),P[i]=s}P[i].total++}for(let r=0;r<B.length;r++)M.includes(B[r])||this.removeChild(B[r].mesh);for(let r=0;r<M.length;r++)M[r].mesh.parent!==this&&this.addChild(M[r].mesh);this._activePagesMeshData=M;for(const r in P){const t=P[r],e=t.total;if(!(t.indices?.length>6*e)||t.vertices.length<2*g.Kj.BATCHABLE_SIZE)t.vertices=new Float32Array(8*e),t.uvs=new Float32Array(8*e),t.indices=new Uint16Array(6*e);else{const e=t.total,i=t.vertices;for(let t=4*e*2;t<i.length;t++)i[t]=0}t.mesh.size=6*e}for(let r=0;r<C;r++){const t=n[r];let e=t.position.x+R[t.line]*("justify"===this._align?t.prevSpaces:1);this._roundPixels&&(e=Math.round(e));const s=e*i,o=t.position.y*i,a=t.texture,h=P[a.baseTexture.uid],l=a.frame,u=a._uvs,c=h.index++;h.indices[6*c+0]=0+4*c,h.indices[6*c+1]=1+4*c,h.indices[6*c+2]=2+4*c,h.indices[6*c+3]=0+4*c,h.indices[6*c+4]=2+4*c,h.indices[6*c+5]=3+4*c,h.vertices[8*c+0]=s,h.vertices[8*c+1]=o,h.vertices[8*c+2]=s+l.width*i,h.vertices[8*c+3]=o,h.vertices[8*c+4]=s+l.width*i,h.vertices[8*c+5]=o+l.height*i,h.vertices[8*c+6]=s,h.vertices[8*c+7]=o+l.height*i,h.uvs[8*c+0]=u.x0,h.uvs[8*c+1]=u.y0,h.uvs[8*c+2]=u.x1,h.uvs[8*c+3]=u.y1,h.uvs[8*c+4]=u.x2,h.uvs[8*c+5]=u.y2,h.uvs[8*c+6]=u.x3,h.uvs[8*c+7]=u.y3}this._textWidth=y*i,this._textHeight=(s.y+t.lineHeight)*i;for(const r in P){const t=P[r];if(0!==this.anchor.x||0!==this.anchor.y){let e=0;const i=this._textWidth*this.anchor.x,r=this._textHeight*this.anchor.y;for(let s=0;s<t.total;s++)t.vertices[e++]-=i,t.vertices[e++]-=r,t.vertices[e++]-=i,t.vertices[e++]-=r,t.vertices[e++]-=i,t.vertices[e++]-=r,t.vertices[e++]-=i,t.vertices[e++]-=r}this._maxLineHeight=w*i;const e=t.mesh.geometry.getBuffer("aVertexPosition"),s=t.mesh.geometry.getBuffer("aTextureCoord"),n=t.mesh.geometry.getIndex();
3e.data=t.vertices,s.data=t.uvs,n.data=t.indices,e.update(),s.update(),n.update()}for(let r=0;r<n.length;r++)v.push(n[r]);this._font=t,this.dirty=!1}updateTransform(){this.validate(),this.containerUpdateTransform()}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0);const{distanceFieldRange:e,distanceFieldType:i,size:r}=p.available[this._fontName];if("none"!==i){const{a:i,b:s,c:n,d:o}=this.worldTransform,a=Math.sqrt(i*i+s*s),h=Math.sqrt(n*n+o*o),l=(Math.abs(a)+Math.abs(h))/2,u=this.fontSize/r,c=t._view.resolution;for(const t of this._activePagesMeshData)t.mesh.shader.uniforms.uFWidth=l*e*u*c}super._render(t)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){const t=p.available[this._fontName];if(!t)throw new Error(`Missing BitmapFont "${this._fontName}"`);this._font!==t&&(this.dirty=!0),this.dirty&&this.updateText()}get tint(){return this._tintColor.value}set tint(t){if(this.tint!==t){this._tintColor.setValue(t);for(let e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.dirty=!0)}get fontName(){return this._fontName}set fontName(t){if(!p.available[t])throw new Error(`Missing BitmapFont "${t}"`);this._fontName!==t&&(this._fontName=t,this.dirty=!0)}get fontSize(){return this._fontSize??p.available[this._fontName].size}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}get text(){return this._text}set text(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)}get maxLineHeight(){return this.validate(),this._maxLineHeight}get textWidth(){return this.validate(),this._textWidth}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)}get roundPixels(){return this._roundPixels}set roundPixels(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)}get textHeight(){return this.validate(),this._textHeight}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}destroy(t){const{_textureCache:e}=this,i="none"===p.available[this._fontName].distanceFieldType?_:x;i.push(...this._activePagesMeshData);for(const r of this._activePagesMeshData)this.removeChild(r.mesh);this._activePagesMeshData=[],i.filter((t=>e[t.mesh.texture.baseTexture.uid])).forEach((t=>{t.mesh.texture=r.xE.EMPTY}));for(const r in e)e[r].destroy(),delete e[r];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}};y.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};let T=y;var b=i(10787);const E=[".xml",".fnt"],A={extension:{type:r.nw.LoadParser,priority:b.Q2.Normal},name:"loadBitmapFont",test:t=>E.includes(r.P6.path.extname(t).toLowerCase()),testParse:async t=>o.test(t)||h.test(t),async parse(t,e,i){const s=o.test(t)?o.parse(t):h.parse(t),{src:n}=e,{page:a}=s,l=[];for(let o=0;o<a.length;++o){const t=a[o].file;let e=r.P6.path.join(r.P6.path.dirname(n),t);e=(0,b.uz)(e,n),l.push(e)}const u=await i.load(l),c=l.map((t=>u[t]));return p.install(s,c,!0)},load:async(t,e)=>(await r.Xd.ADAPTER.fetch(t)).text(),unload(t){t.destroy()}};r.Rw.add(A)},53984:function(t,e,i){i.d(e,{M_:function(){return r},xv:function(){return g},_A:function(){return h},pn:function(){return c}});var r=(t=>(t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",t))(r||{}),s=i(67767),n=i(67220);const o={willReadFrequently:!0},a=class t{static get experimentalLetterSpacingSupported(){let e=t._experimentalLetterSpacingSupported;if(void 0!==e){const i=s.Xd.ADAPTER.getCanvasRenderingContext2D().prototype;e=t._experimentalLetterSpacingSupported="letterSpacing"in i||"textLetterSpacing"in i}return e}constructor(t,e,i,r,s,n,o,a,h){this.text=t,this.style=e,this.width=i,this.height=r,this.lines=s,this.lineWidths=n,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=h}static measureText(e,i,r,s=t._canvas){r=r??i.wordWrap;const n=i.toFontString(),a=t.measureFont(n);0===a.fontSize&&(a.fontSize=i.fontSize,a.ascent=i.fontSize);const h=s.getContext("2d",o);h.font=n;const l=(r?t.wordWrap(e,i,s):e).split(/(?:\r\n|\r|\n)/),u=new Array(l.length);let c=0;for(let o=0;o<l.length;o++){const e=t._measureText(l[o],i.letterSpacing,h);u[o]=e,c=Math.max(c,e)}let d=c+i.strokeThickness;i.dropShadow&&(d+=i.dropShadowDistance);const f=i.lineHeight||a.fontSize+i.strokeThickness;let p=Math.max(f,a.fontSize+2*i.strokeThickness)+i.leading+(l.length-1)*(f+i.leading);return i.dropShadow&&(p+=i.dropShadowDistance),new t(e,i,d,p,l,u,f+i.leading,c,a)}static _measureText(e,i,r){let s=!1;t.experimentalLetterSpacingSupported&&(t.experimentalLetterSpacing?(r.letterSpacing=`${i}px`,r.textLetterSpacing=`${i}px`,s=!0):(r.letterSpacing="0px",r.textLetterSpacing="0px"));let n=r.measureText(e).width;return n>0&&(s?n-=i:n+=(t.graphemeSegmenter(e).length-1)*i),n}static wordWrap(e,i,r=t._canvas){const s=r.getContext("2d",o);let n=0,a="",h="";const l=Object.create(null),{letterSpacing:u,whiteSpace:c}=i,d=t.collapseSpaces(c),f=t.collapseNewlines(c);let p=!d;const m=i.wordWrapWidth+u,g=t.tokenize(e);for(let o=0;o<g.length;o++){let e=g[o];if(t.isNewline(e)){if(!f){h+=t.addLine(a),p=!d,a="",n=0;continue}e=" "}if(d){const i=t.isBreakingSpace(e),r=t.isBreakingSpace(a[a.length-1]);if(i&&r)continue}const r=t.getFromCache(e,u,l,s);if(r>m)if(""!==a&&(h+=t.addLine(a),a="",n=0),t.canBreakWords(e,i.breakWords)){const r=t.wordWrapSplit(e);for(let o=0;o<r.length;o++){let c=r[o],d=c,f=1;for(;r[o+f];){const s=r[o+f];if(t.canBreakChars(d,s,e,o,i.breakWords))break;c+=s,d=s,f++}o+=f-1;const g=t.getFromCache(c,u,l,s);g+n>m&&(h+=t.addLine(a),p=!1,a="",n=0),a+=c,n+=g}}else{a.length>0&&(h+=t.addLine(a),a="",n=0);const i=o===g.length-1;h+=t.addLine(e,!i),p=!1,a="",n=0}else r+n>m&&(p=!1,h+=t.addLine(a),a="",n=0),(a.length>0||!t.isBreakingSpace(e)||p)&&(a+=e,n+=r)}return h+=t.addLine(a,!1),h}static addLine(e,i=!0){return e=t.trimRight(e),e=i?`${e}\n`:e}
3static getFromCache(e,i,r,s){let n=r[e];return"number"!=typeof n&&(n=t._measureText(e,i,s)+i,r[e]=n),n}static collapseSpaces(t){return"normal"===t||"pre-line"===t}static collapseNewlines(t){return"normal"===t}static trimRight(e){if("string"!=typeof e)return"";for(let i=e.length-1;i>=0;i--){const r=e[i];if(!t.isBreakingSpace(r))break;e=e.slice(0,-1)}return e}static isNewline(e){return"string"==typeof e&&t._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,i){return"string"==typeof e&&t._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const i=[];let r="";if("string"!=typeof e)return i;for(let s=0;s<e.length;s++){const n=e[s],o=e[s+1];t.isBreakingSpace(n,o)||t.isNewline(n)?(""!==r&&(i.push(r),r=""),i.push(n)):r+=n}return""!==r&&i.push(r),i}static canBreakWords(t,e){return e}static canBreakChars(t,e,i,r,s){return!0}static wordWrapSplit(e){return t.graphemeSegmenter(e)}static measureFont(e){if(t._fonts[e])return t._fonts[e];const i={ascent:0,descent:0,fontSize:0},r=t._canvas,s=t._context;s.font=e;const n=t.METRICS_STRING+t.BASELINE_SYMBOL,o=Math.ceil(s.measureText(n).width);let a=Math.ceil(s.measureText(t.BASELINE_SYMBOL).width);const h=Math.ceil(t.HEIGHT_MULTIPLIER*a);if(a=a*t.BASELINE_MULTIPLIER|0,0===o||0===h)return t._fonts[e]=i,i;r.width=o,r.height=h,s.fillStyle="#f00",s.fillRect(0,0,o,h),s.font=e,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(n,0,a);const l=s.getImageData(0,0,o,h).data,u=l.length,c=4*o;let d=0,f=0,p=!1;for(d=0;d<a;++d){for(let t=0;t<c;t+=4)if(255!==l[f+t]){p=!0;break}if(p)break;f+=c}for(i.ascent=a-d,f=u-c,p=!1,d=h;d>a;--d){for(let t=0;t<c;t+=4)if(255!==l[f+t]){p=!0;break}if(p)break;f-=c}return i.descent=d-a,i.fontSize=i.ascent+i.descent,t._fonts[e]=i,i}static clearMetrics(e=""){e?delete t._fonts[e]:t._fonts={}}static get _canvas(){if(!t.__canvas){let e;try{const i=new OffscreenCanvas(0,0);if(i.getContext("2d",o)?.measureText)return t.__canvas=i,i;e=s.Xd.ADAPTER.createCanvas()}catch{e=s.Xd.ADAPTER.createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas}static get _context(){return t.__context||(t.__context=t._canvas.getContext("2d",o)),t.__context}};a.METRICS_STRING="|\xc9q\xc5",a.BASELINE_SYMBOL="M",a.BASELINE_MULTIPLIER=1.4,a.HEIGHT_MULTIPLIER=2,a.graphemeSegmenter=(()=>{if("function"==typeof Intl?.Segmenter){const t=new Intl.Segmenter;return e=>[...t.segment(e)].map((t=>t.segment))}return t=>[...t]})(),a.experimentalLetterSpacing=!1,a._fonts={},a._newlines=[10,13],a._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let h=a;const l=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],u=class t{constructor(t){this.styleID=0,this.reset(),f(this,t,t)}clone(){const e={};return f(e,this,t.defaultStyle),new t(e)}reset(){f(this,t.defaultStyle,t.defaultStyle)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){const e=d(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){const e=d(t);this._fill!==e&&(this._fill=e,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.styleID++)}get stroke(){return this._stroke}set stroke(t){const e=d(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}toFontString(){const t="number"==typeof this.fontSize?`${this.fontSize}px`:this.fontSize;let e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(let i=e.length-1;i>=0;i--){let t=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(t)&&!l.includes(t)&&(t=`"${t}"`),e[i]=t}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};u.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:r.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let c=u;function d(t){const e=s.Il.shared,i=t=>{const i=e.setValue(t);return 1===i.alpha?i.toHex():i.toRgbaString()};return Array.isArray(t)?t.map(i):i(t)}function f(t,e,i){for(const r in i)Array.isArray(e[r])?t[r]=e[r].slice():t[r]=e[r]}const p={texture:!0,children:!1,baseTexture:!0},m=class t extends n.j{constructor(e,i,r){let n=!1;r||(r=s.Xd.ADAPTER.createCanvas(),n=!0),r.width=3,r.height=3;const o=s.xE.from(r);o.orig=new s.Ae,o.trim=new s.Ae,super(o),this._ownCanvas=n,this.canvas=r,this.context=r.getContext("2d",{willReadFrequently:!0}),this._resolution=t.defaultResolution??s.Xd.RESOLUTION,this._autoResolution=t.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=i,this.localStyleID=-1}static get experimentalLetterSpacing(){return h.experimentalLetterSpacing}static set experimentalLetterSpacing(t){s.P6.deprecation("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),h.experimentalLetterSpacing=t}updateText(t){const e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;this._font=this._style.toFontString();const i=this.context,r=h.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),n=r.width,o=r.height,a=r.lines,l=r.lineHeight,u=r.lineWidths,c=r.maxLineWidth,d=r.fontProperties;let f,p;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,n)+2*e.padding)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,o)+2*e.padding)*this._resolution),i.scale(this._resolution,this._resolution),i.clearRect(0,0,this.canvas.width,this.canvas.height),i.font=this._font,i.lineWidth=e.strokeThickness,i.textBaseline=e.textBaseline,i.lineJoin=e.lineJoin,i.miterLimit=e.miterLimit;const m=e.dropShadow?2:1;for(let h=0;h<m;++h){const t=e.dropShadow&&0===h,n=t?Math.ceil(Math.max(1,o)+2*e.padding):0,m=n*this._resolution;if(t){i.fillStyle="black",i.strokeStyle="black";const t=e.dropShadowColor,r=e.dropShadowBlur*this._resolution,n=e.dropShadowDistance*this._resolution;i.shadowColor=s.Il.shared.setValue(t).setAlpha(e.dropShadowAlpha).toRgbaString(),i.shadowBlur=r,i.shadowOffsetX=Math.cos(e.dropShadowAngle)*n,i.shadowOffsetY=Math.sin(e.dropShadowAngle)*n+m}else i.fillStyle=this._generateFillStyle(e,a,r),i.strokeStyle=e.stroke,i.shadowColor="black",i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0;let g=(l-d.fontSize)/2;l-d.fontSize<0&&(g=0);for(let i=0;i<a.length;i++)f=e.strokeThickness/2,p=e.strokeThickness/2+i*l+d.ascent+g,"right"===e.align?f+=c-u[i]:"center"===e.align&&(f+=(c-u[i])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(a[i],f+e.padding,p+e.padding-n,!0),e.fill&&this.drawLetterSpacing(a[i],f+e.padding,p+e.padding-n)}this.updateTexture()}drawLetterSpacing(t,e,i,r=!1){const s=this._style.letterSpacing;let n=!1;if(h.experimentalLetterSpacingSupported&&(h.experimentalLetterSpacing?(this.context.letterSpacing=`${s}px`,this.context.textLetterSpacing=`${s}px`,n=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),0===s||n)return void(r?this.context.strokeText(t,e,i):this.context.fillText(t,e,i));let o=e;const a=h.graphemeSegmenter(t);let l=this.context.measureText(t).width,u=0;for(let h=0;h<a.length;++h){const t=a[h];r?this.context.strokeText(t,o,i):this.context.fillText(t,o,i);let e="";for(let i=h+1;i<a.length;++i)e+=a[i];u=this.context.measureText(e).width,o+=l-u+s,l=u}}updateTexture(){const t=this.canvas;if(this._style.trim){const e=s.P6.trimCanvas(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}const e=this._texture,i=this._style,r=i.trim?0:i.padding,n=e.baseTexture;e.trim.width=e._frame.width=t.width/this._resolution,e.trim.height=e._frame.height=t.height/this._resolution,e.trim.x=-r,e.trim.y=-r,e.orig.width=e._frame.width-2*r,e.orig.height=e._frame.height-2*r,this._onTextureUpdate(),n.setRealSize(t.width,t.height,this._resolution),e.updateUvs(),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(t,e){return this.updateText(!0),-1===this._textureID&&(t=!1),super.getBounds(t,e)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds.call(this,t)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(t,e,i){const s=t.fill;if(!Array.isArray(s))return s;if(1===s.length)return s[0];let n;const o=t.dropShadow?t.dropShadowDistance:0,a=t.padding||0,h=this.canvas.width/this._resolution-o-2*a,l=this.canvas.height/this._resolution-o-2*a,u=s.slice(),c=t.fillGradientStops.slice();if(!c.length){const t=u.length+1;for(let e=1;e<t;++e)c.push(e/t)}if(u.unshift(s[0]),c.unshift(0),u.push(s[s.length-1]),c.push(1),t.fillGradientType===r.LINEAR_VERTICAL){n=this.context.createLinearGradient(h/2,a,h/2,l+a);const r=i.fontProperties.fontSize+t.strokeThickness;for(let t=0;t<e.length;t++){const s=i.lineHeight*(t-1)+r,o=i.lineHeight*t;let a=o;t>0&&s>o&&(a=(o+s)/2);const h=o+r,d=i.lineHeight*(t+1);let f=h;t+1<e.length&&d<h&&(f=(h+d)/2);const p=(f-a)/l;for(let t=0;t<u.length;t++){let e=0;e="number"==typeof c[t]?c[t]:t/u.length;let i=Math.min(1,Math.max(0,a/l+e*p));i=Number(i.toFixed(5)),n.addColorStop(i,u[t])}}}else{n=this.context.createLinearGradient(a,l/2,h+a,l/2);const t=u.length+1;let e=1;for(let i=0;i<u.length;i++){let r;r="number"==typeof c[i]?c[i]:e/t,n.addColorStop(r,u[i]),e++}}return n}destroy(t){"boolean"==typeof t&&(t={children:t}),t=Object.assign({},p,t),super.destroy(t),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this.updateText(!0);const e=s.P6.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this.updateText(!0);const e=s.P6.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}get style(){return this._style}set style(t){t=t||{},this._style=t instanceof c?t:new c(t),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}};m.defaultAutoResolution=!0;let g=m}
3,97091:function(t,e,i){i.d(e,{vB:function(){return h},uF:function(){return n}});var r=i(78706),s=i(89009),n=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(n||{});class o{constructor(t,e=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=r}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const a=class t{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new o(null,null,1/0),this.deltaMS=1/t.targetFPMS,this.elapsedMS=1/t.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,i=n.NORMAL){return this._addListener(new o(t,e,i))}addOnce(t,e,i=n.NORMAL){return this._addListener(new o(t,e,i,!0))}_addListener(t){let e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this}remove(t,e){let i=this._head.next;for(;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let i;if(e>this.lastTime){if(i=this.elapsedMS=e-this.lastTime,i>this._maxElapsedMS&&(i=this._maxElapsedMS),i*=this.speed,this._minElapsedMS){const t=e-this._lastFrame|0;if(t<this._minElapsedMS)return;this._lastFrame=e-t%this._minElapsedMS}this.deltaMS=i,this.deltaTime=this.deltaMS*t.targetFPMS;const r=this._head;let s=r.next;for(;s;)s=s.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const i=Math.min(this.maxFPS,e),r=Math.min(Math.max(0,i)/1e3,t.targetFPMS);this._maxElapsedMS=1/r}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(0===t)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!t._shared){const e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared}static get system(){if(!t._system){const e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system}};a.targetFPMS=.06;let h=a;Object.defineProperties(r.Xd,{TARGET_FPMS:{get:()=>h.targetFPMS,set(t){(0,s.deprecation)("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),h.targetFPMS=t}}});var l=i(90463);class u{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,n.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?h.shared:new h,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}u.extension=l.n.Application,l.R.add(u)}
3,89009:function(t,e,i){i.r(e),i.d(e,{BaseTextureCache:function(){return $},BoundingBox:function(){return V},CanvasRenderTarget:function(){return K},DATA_URI:function(){return P},EventEmitter:function(){return s},ProgramCache:function(){return W},TextureCache:function(){return z},clearTextureCache:function(){return Y},correctBlendMode:function(){return S},createIndicesForQuads:function(){return M},decomposeDataUri:function(){return tt},deprecation:function(){return h},destroyTextureCache:function(){return j},detectVideoAlphaMode:function(){return g},determineCrossOrigin:function(){return et},earcut:function(){return n},getBufferType:function(){return B},getCanvasBoundingBox:function(){return Q},getResolutionOfUrl:function(){return it},hex2rgb:function(){return T},hex2string:function(){return b},interleaveTypedArrays:function(){return N},isMobile:function(){return r.tq},isPow2:function(){return L},isWebGLSupported:function(){return v},log2:function(){return O},nextPow2:function(){return F},path:function(){return d},premultiplyBlendMode:function(){return w},premultiplyRgba:function(){return I},premultiplyTint:function(){return R},premultiplyTintToRgba:function(){return C},removeItems:function(){return U},rgb2hex:function(){return A},sayHello:function(){return x},sign:function(){return k},skipHello:function(){return _},string2hex:function(){return E},trimCanvas:function(){return J},uid:function(){return H},url:function(){return l}});var r=i(78706);r.Xd.RETINA_PREFIX=/@([0-9\.]+)x/,r.Xd.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var s=i(26729),n=i(9187),o=i(11987);const a={};function h(t,e,i=3){if(a[e])return;let r=(new Error).stack;typeof r>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}\nDeprecated since v${t}`):(r=r.split("\n").splice(i).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}\nDeprecated since v${t}`),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}\nDeprecated since v${t}`),console.warn(r))),a[e]=!0}const l={get parse(){return h("7.3.0","utils.url.parse is deprecated, use native URL API instead."),o.parse},get format(){return h("7.3.0","utils.url.format is deprecated, use native URL API instead."),o.format},get resolve(){return h("7.3.0","utils.url.resolve is deprecated, use native URL API instead."),o.resolve}};function u(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function c(t){return t.split("?")[0].split("#")[0]}const d={toPosix(t){return e="\\",i="/",t.replace(new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),i);var e,i},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),isBlobUrl:t=>t.startsWith("blob:"),hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){u(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const i=/^[^/:]+:\/{0,2}/.exec(t);return i?i[0]:""},toAbsolute(t,e,i){if(u(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const s=c(this.toPosix(e??r.Xd.ADAPTER.getBaseUrl())),n=c(this.toPosix(i??this.rootname(s)));return(t=this.toPosix(t)).startsWith("/")?d.join(n,t.slice(1)):this.isAbsolute(t)?t:this.join(s,t)},normalize(t){if(u(t),0===t.length)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;let e="";const i=(t=this.toPosix(t)).startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const r=t.endsWith("/");return(t=function(t,e){let i="",r=0,s=-1,n=0,o=-1;for(let a=0;a<=t.length;++a){if(a<t.length)o=t.charCodeAt(a);else{if(47===o)break;o=47}if(47===o){if(s!==a-1&&1!==n)if(s!==a-1&&2===n){if(i.length<2||2!==r||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){const t=i.lastIndexOf("/");if(t!==i.length-1){-1===t?(i="",r=0):(i=i.slice(0,t),r=i.length-1-i.lastIndexOf("/")),s=a,n=0;continue}}else if(2===i.length||1===i.length){i="",r=0,s=a,n=0;continue}e&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+=`/${t.slice(s+1,a)}`:i=t.slice(s+1,a),r=a-s-1;s=a,n=0}else 46===o&&-1!==n?++n:n=-1}return i}(t,!1)).length>0&&r&&(t+="/"),i?`/${t}`:e+t},isAbsolute(t){return u(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){if(0===t.length)return".";let e;for(let i=0;i<t.length;++i){const r=t[i];if(u(r),r.length>0)if(void 0===e)e=r;else{const s=t[i-1]??"";this.joinExtensions.includes(this.extname(s).toLowerCase())?e+=`/../${r}`:e+=`/${r}`}}return void 0===e?".":this.normalize(e)},dirname(t){if(u(t),0===t.length)return".";
3let e=(t=this.toPosix(t)).charCodeAt(0);const i=47===e;let r=-1,s=!0;const n=this.getProtocol(t),o=t;for(let a=(t=t.slice(n.length)).length-1;a>=1;--a)if(e=t.charCodeAt(a),47===e){if(!s){r=a;break}}else s=!1;return-1===r?i?"/":this.isUrl(o)?n+t:n:i&&1===r?"//":n+t.slice(0,r)},rootname(t){u(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const i=t.indexOf("/",e.length);e=-1!==i?t.slice(0,i):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){u(t),e&&u(e),t=c(this.toPosix(t));let i,r=0,s=-1,n=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let o=e.length-1,a=-1;for(i=t.length-1;i>=0;--i){const h=t.charCodeAt(i);if(47===h){if(!n){r=i+1;break}}else-1===a&&(n=!1,a=i+1),o>=0&&(h===e.charCodeAt(o)?-1===--o&&(s=i):(o=-1,s=a))}return r===s?s=a:-1===s&&(s=t.length),t.slice(r,s)}for(i=t.length-1;i>=0;--i)if(47===t.charCodeAt(i)){if(!n){r=i+1;break}}else-1===s&&(n=!1,s=i+1);return-1===s?"":t.slice(r,s)},extname(t){u(t);let e=-1,i=0,r=-1,s=!0,n=0;for(let o=(t=c(this.toPosix(t))).length-1;o>=0;--o){const a=t.charCodeAt(o);if(47!==a)-1===r&&(s=!1,r=o+1),46===a?-1===e?e=o:1!==n&&(n=1):-1!==e&&(n=-1);else if(!s){i=o+1;break}}return-1===e||-1===r||0===n||1===n&&e===r-1&&e===i+1?"":t.slice(e,r)},parse(t){u(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let i=(t=c(this.toPosix(t))).charCodeAt(0);const r=this.isAbsolute(t);let s;e.root=this.rootname(t),s=r||this.hasProtocol(t)?1:0;let n=-1,o=0,a=-1,h=!0,l=t.length-1,d=0;for(;l>=s;--l)if(i=t.charCodeAt(l),47!==i)-1===a&&(h=!1,a=l+1),46===i?-1===n?n=l:1!==d&&(d=1):-1!==n&&(d=-1);else if(!h){o=l+1;break}return-1===n||-1===a||0===d||1===d&&n===a-1&&n===o+1?-1!==a&&(e.base=e.name=0===o&&r?t.slice(1,a):t.slice(o,a)):(0===o&&r?(e.name=t.slice(1,n),e.base=t.slice(1,a)):(e.name=t.slice(o,n),e.base=t.slice(o,a)),e.ext=t.slice(n,a)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};var f=i(57361);let p,m;async function g(){return p??(p=(async()=>{const t=document.createElement("canvas").getContext("webgl");if(!t)return f.iw.UNPACK;const e=await new Promise((t=>{const e=document.createElement("video");e.onloadeddata=()=>t(e),e.onerror=()=>t(null),e.autoplay=!1,e.crossOrigin="anonymous",e.preload="auto",e.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",e.load()}));if(!e)return f.iw.UNPACK;const i=t.createTexture();t.bindTexture(t.TEXTURE_2D,i);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const s=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,s),t.deleteFramebuffer(r),t.deleteTexture(i),t.getExtension("WEBGL_lose_context")?.loseContext(),s[0]<=s[3]?f.iw.PMA:f.iw.UNPACK})()),p}function _(){h("7.0.0","skipHello is deprecated, please use settings.RENDER_OPTIONS.hello")}function x(){h("7.0.0",'sayHello is deprecated, please use Renderer\'s "hello" option')}function v(){return typeof m>"u"&&(m=function(){const t={stencil:!0,failIfMajorPerformanceCaveat:r.Xd.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!r.Xd.ADAPTER.getWebGLRenderingContext())return!1;const e=r.Xd.ADAPTER.createCanvas();let i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);const s=!!i?.getContextAttributes()?.stencil;if(i){const t=i.getExtension("WEBGL_lose_context");t&&t.loseContext()}
3return i=null,s}catch{return!1}}()),m}var y=i(69118);function T(t,e=[]){return h("7.2.0","utils.hex2rgb is deprecated, use Color#toRgbArray instead"),y.I.shared.setValue(t).toRgbArray(e)}function b(t){return h("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),y.I.shared.setValue(t).toHex()}function E(t){return h("7.2.0","utils.string2hex is deprecated, use Color#toNumber instead"),y.I.shared.setValue(t).toNumber()}function A(t){return h("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),y.I.shared.setValue(t).toNumber()}const w=function(){const t=[],e=[];for(let r=0;r<32;r++)t[r]=r,e[r]=r;t[f.T$.NORMAL_NPM]=f.T$.NORMAL,t[f.T$.ADD_NPM]=f.T$.ADD,t[f.T$.SCREEN_NPM]=f.T$.SCREEN,e[f.T$.NORMAL]=f.T$.NORMAL_NPM,e[f.T$.ADD]=f.T$.ADD_NPM,e[f.T$.SCREEN]=f.T$.SCREEN_NPM;const i=[];return i.push(e),i.push(t),i}();function S(t,e){return w[e?1:0][t]}function I(t,e,i,r=!0){return h("7.2.0","utils.premultiplyRgba has moved to Color.premultiply"),y.I.shared.setValue(t).premultiply(e,r).toArray(i??new Float32Array(4))}function R(t,e){return h("7.2.0","utils.premultiplyTint has moved to Color.toPremultiplied"),y.I.shared.setValue(t).toPremultiplied(e)}function C(t,e,i,r=!0){return h("7.2.0","utils.premultiplyTintToRgba has moved to Color.premultiply"),y.I.shared.setValue(t).premultiply(e,r).toArray(i??new Float32Array(4))}const P=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function M(t,e=null){const i=6*t;if((e=e||new Uint16Array(i)).length!==i)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${i}`);for(let r=0,s=0;r<i;r+=6,s+=4)e[r+0]=s+0,e[r+1]=s+1,e[r+2]=s+2,e[r+3]=s+0,e[r+4]=s+2,e[r+5]=s+3;return e}function B(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}const D={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};function N(t,e){let i=0,r=0;const s={};for(let h=0;h<t.length;h++)r+=e[h],i+=t[h].length;const n=new ArrayBuffer(4*i);let o=null,a=0;for(let h=0;h<t.length;h++){const i=e[h],l=t[h],u=B(l);s[u]||(s[u]=new D[u](n)),o=s[u];for(let t=0;t<l.length;t++){o[(t/i|0)*r+a+t%i]=l[t]}a+=i}return new Float32Array(n)}function F(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function L(t){return!(t&t-1)&&!!t}function O(t){let e=(t>65535?1:0)<<4,i=((t>>>=e)>255?1:0)<<3;return e|=i,i=((t>>>=i)>15?1:0)<<2,e|=i,i=((t>>>=i)>3?1:0)<<1,e|=i,e|(t>>>=i)>>1}function U(t,e,i){const r=t.length;let s;if(e>=r||0===i)return;const n=r-(i=e+i>r?r-e:i);for(s=e;s<n;++s)t[s]=t[s+i];t.length=n}function k(t){return 0===t?0:t<0?-1:1}let G=0;function H(){return++G}const X=class{constructor(t,e,i,r){this.left=t,this.top=e,this.right=i,this.bottom=r}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};X.EMPTY=new X(0,0,0,0);let V=X;const W={},z=Object.create(null),$=Object.create(null);function j(){let t;for(t in z)z[t].destroy();for(t in $)$[t].destroy()}function Y(){let t;for(t in z)delete z[t];for(t in $)delete $[t]}class K{constructor(t,e,i){this._canvas=r.Xd.ADAPTER.createCanvas(),this._context=this._canvas.getContext("2d"),this.resolution=i||r.Xd.RESOLUTION,this.resize(t,e)}clear(){this._checkDestroyed(),this._context.setTransform(1,0,0,1,0,0),this._context.clearRect(0,0,this._canvas.width,this._canvas.height)}resize(t,e){this._checkDestroyed(),this._canvas.width=Math.round(t*this.resolution),this._canvas.height=Math.round(e*this.resolution)}destroy(){this._context=null,this._canvas=null}get width(){return this._checkDestroyed(),this._canvas.width}set width(t){this._checkDestroyed(),this._canvas.width=Math.round(t)}get height(){return this._checkDestroyed(),this._canvas.height}set height(t){this._checkDestroyed(),this._canvas.height=Math.round(t)}get canvas(){return this._checkDestroyed(),this._canvas}get context(){return this._checkDestroyed(),this._context}_checkDestroyed(){if(null===this._canvas)throw new TypeError("The CanvasRenderTarget has already been destroyed")}}function q(t,e,i){for(let r=0,s=4*i*e;r<e;++r,s+=4)if(0!==t[s+3])return!1;return!0}
3function Z(t,e,i,r,s){const n=4*e;for(let o=r,a=r*n+4*i;o<=s;++o,a+=n)if(0!==t[a+3])return!1;return!0}function Q(t){const{width:e,height:i}=t,r=t.getContext("2d",{willReadFrequently:!0});if(null===r)throw new TypeError("Failed to get canvas 2D context");const s=r.getImageData(0,0,e,i).data;let n=0,o=0,a=e-1,h=i-1;for(;o<i&&q(s,e,o);)++o;if(o===i)return V.EMPTY;for(;q(s,e,h);)--h;for(;Z(s,e,n,o,h);)++n;for(;Z(s,e,a,o,h);)--a;return++a,++h,new V(n,o,a,h)}function J(t){const e=Q(t),{width:i,height:r}=e;let s=null;if(!e.isEmpty()){const n=t.getContext("2d");if(null===n)throw new TypeError("Failed to get canvas 2D context");s=n.getImageData(e.left,e.top,i,r)}return{width:i,height:r,data:s}}function tt(t){const e=P.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}}function et(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location;const i=new URL(t,document.baseURI);return i.hostname!==e.hostname||i.port!==e.port||i.protocol!==e.protocol?"anonymous":""}function it(t,e=1){const i=r.Xd.RETINA_PREFIX?.exec(t);return i?parseFloat(i[1]):e}},84732:function(t,e,i){i.d(e,{W20:function(){return s.W2},TCu:function(){return Et.TC},Thl:function(){return r.Th},xvT:function(){return Ct.xv},pn8:function(){return Ct.pn}});var r=i(67767),s=i(68276),n=i(67220);const o=new r.y3;s.s$.prototype._cacheAsBitmap=!1,s.s$.prototype._cacheData=null,s.s$.prototype._cacheAsBitmapResolution=null,s.s$.prototype._cacheAsBitmapMultisample=null;class a{constructor(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}}Object.defineProperties(s.s$.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(t){if(this._cacheAsBitmap===t)return;let e;this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new a),e=this._cacheData,e.originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(e=this._cacheData,e.sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea)}}}),s.s$.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},s.s$.prototype._initCachedDisplayObject=function(t){if(this._cacheData?.sprite)return;const e=this.alpha;this.alpha=1,t.batch.flush();const i=this.getLocalBounds(new r.Ae,!0);if(this.filters?.length){const t=this.filters[0].padding;i.pad(t)}const s=this.cacheAsBitmapResolution||t.resolution;i.ceil(s),i.width=Math.max(i.width,1/s),i.height=Math.max(i.height,1/s);const a=t.renderTexture.current,h=t.renderTexture.sourceFrame.clone(),l=t.renderTexture.destinationFrame.clone(),u=t.projection.transform,c=r.TI.create({width:i.width,height:i.height,resolution:s,multisample:this.cacheAsBitmapMultisample??t.multisample}),d=`cacheAsBitmap_${r.P6.uid()}`;this._cacheData.textureCacheId=d,r.VL.addToCache(c.baseTexture,d),r.xE.addToCache(c,d);const f=this.transform.localTransform.copyTo(o).invert().translate(-i.x,-i.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:c,clear:!0,transform:f,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=u,t.renderTexture.bind(a,h,l),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=e;const p=new n.j(c);p.transform.worldTransform=this.transform.worldTransform,p.anchor.x=-i.x/i.width,p.anchor.y=-i.y/i.height,p.alpha=e,p._bounds=this._bounds,this._cacheData.sprite=p,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=p.containsPoint.bind(p)},s.s$.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},s.s$.prototype._initCachedDisplayObjectCanvas=function(t){if(this._cacheData?.sprite)return;const e=this.getLocalBounds(new r.Ae,!0),i=this.alpha;this.alpha=1;const s=t.canvasContext.activeContext,a=t._projTransform,h=this.cacheAsBitmapResolution||t.resolution;e.ceil(h),e.width=Math.max(e.width,1/h),e.height=Math.max(e.height,1/h);const l=r.TI.create({width:e.width,height:e.height,resolution:h}),u=`cacheAsBitmap_${r.P6.uid()}`;this._cacheData.textureCacheId=u,r.VL.addToCache(l.baseTexture,u),r.xE.addToCache(l,u);const c=o;this.transform.localTransform.copyTo(c),c.invert(),c.tx-=e.x,c.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:l,clear:!0,transform:c,skipUpdateTransform:!1}),t.canvasContext.activeContext=s,t._projTransform=a,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;const d=new n.j(l);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-e.x/e.width,d.anchor.y=-e.y
3/e.height,d.alpha=i,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=d.containsPoint.bind(d)},s.s$.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},s.s$.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},s.s$.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,r.VL.removeFromCache(this._cacheData.textureCacheId),r.xE.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},s.s$.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},s.s$.prototype.name=null,s.W2.prototype.getChildByName=function(t,e){for(let i=0,r=this.children.length;i<r;i++)if(this.children[i].name===t)return this.children[i];if(e)for(let i=0,r=this.children.length;i<r;i++){const e=this.children[i];if(!e.getChildByName)continue;const r=e.getChildByName(t,!0);if(r)return r}return null},s.s$.prototype.getGlobalPosition=function(t=new r.E9,e=!1){return this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};class h extends r.wn{constructor(t=1){super(r.kP,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",{uAlpha:1}),this.alpha=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}const l={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},u=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join("\n");class c extends r.wn{constructor(t,e=8,i=4,s=r.wn.defaultResolution,n=5){const o=function(t,e){const i=Math.ceil(t/2);let r,s="\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }",n="";r=e?"vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o<t;o++){let t=r.replace("%index%",o.toString());t=t.replace("%sampleIndex%",o-(i-1)+".0"),n+=t,n+="\n"}return s=s.replace("%blur%",n),s=s.replace("%size%",t.toString()),s}(n,t),a=function(t){const e=l[t],i=e.length;let r,s=u,n="";for(let o=0;o<t;o++){let s="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",o.toString());r=o,o>=i&&(r=t-o-1),s=s.replace("%value%",e[r].toString()),n+=s,n+="\n"}return s=s.replace("%blur%",n),s=s.replace("%size%",t.toString()),s}(n);super(o,a),this.horizontal=t,this.resolution=s,this._quality=0,this.quality=i,this.blur=e}apply(t,e,i,s){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.he
3ight),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,s);else{const n=t.getFilterTexture(),o=t.renderer;let a=e,h=n;this.state.blend=!1,t.applyFilter(this,a,h,r.yl.CLEAR);for(let e=1;e<this.passes-1;e++){t.bindAndClear(a,r.yl.BLIT),this.uniforms.uSampler=h;const e=h;h=a,a=e,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,h,i,s),t.returnFilterTexture(n)}}get blur(){return this.strength}set blur(t){this.padding=1+2*Math.abs(t),this.strength=t}get quality(){return this._quality}set quality(t){this._quality=t,this.passes=t}}class d extends r.wn{constructor(t=8,e=4,i=r.wn.defaultResolution,s=5){super(),this._repeatEdgePixels=!1,this.blurXFilter=new c(!0,t,e,i,s),this.blurYFilter=new c(!1,t,e,i,s),this.resolution=i,this.quality=e,this.blur=t,this.repeatEdgePixels=!1}apply(t,e,i,s){const n=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(n&&o){const n=t.getFilterTexture();this.blurXFilter.apply(t,e,n,r.yl.CLEAR),this.blurYFilter.apply(t,n,i,s),t.returnFilterTexture(n)}else o?this.blurYFilter.apply(t,e,i,s):this.blurXFilter.apply(t,e,i,s)}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))}get blur(){return this.blurXFilter.blur}set blur(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(t){this.blurXFilter.quality=this.blurYFilter.quality=t}get blurX(){return this.blurXFilter.blur}set blurX(t){this.blurXFilter.blur=t,this.updatePadding()}get blurY(){return this.blurYFilter.blur}set blurY(t){this.blurYFilter.blur=t,this.updatePadding()}get blendMode(){return this.blurYFilter.blendMode}set blendMode(t){this.blurYFilter.blendMode=t}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(t){this._repeatEdgePixels=t,this.updatePadding()}}class f extends r.wn{constructor(){const t={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(r.Y9,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",t),this.alpha=1}_loadMatrix(t,e=!1){let i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i}_multiply(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t}_colorMatrix(t){const e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e}brightness(t,e){const i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)}tint(t,e){const[i,s,n]=r.Il.shared.setValue(t).toArray(),o=[i,0,0,0,0,0,s,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(o,e)}greyscale(t,e){const i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)}blackAndWhite(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)}hue(t,e){t=(t||0)/180*Math.PI;const i=Math.cos(t),r=Math.sin(t),s=1/3,n=(0,Math.sqrt)(s),o=[i+(1-i)*s,s*(1-i)-n*r,s*(1-i)+n*r,0,0,s*(1-i)+n*r,i+s*(1-i),s*(1-i)-n*r,0,0,s*(1-i)-n*r,s*(1-i)+n*r,i+s*(1-i),0,0,0,0,0,1,0];this._loadMatrix(o,e)}contrast(t,e){const i=(t||0)+1,r=-.5*(i-1),s=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(s,e)}saturate(t=0,e){const i=2*t/3+1,r=-.5*(i-1),s=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(s,e)}desaturate(){this.saturate(-1)}negative(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)}sepia(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)}technicolor(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.091555084827
355585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)}polaroid(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)}toBGR(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)}kodachrome(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)}browni(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)}vintage(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)}colorTone(t,e,i,s,n){t=t||.2,e=e||.15,i=i||16770432,s=s||3375104;const o=r.Il.shared,[a,h,l]=o.setValue(i).toArray(),[u,c,d]=o.setValue(s).toArray(),f=[.3,.59,.11,0,0,a,h,l,t,0,u,c,d,e,0,a-u,h-c,l-d,0,0];this._loadMatrix(f,n)}night(t,e){const i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)}predator(t,e){const i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,e)}lsd(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)}reset(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)}get matrix(){return this.uniforms.m}set matrix(t){this.uniforms.m=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}f.prototype.grayscale=f.prototype.greyscale;class p extends r.wn{constructor(t,e){const i=new r.y3;t.renderable=!1,super("attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:t._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=t,this.maskMatrix=i,null==e&&(e=20),this.scale=new r.E9(e,e)}apply(t,e,i,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const s=this.maskSprite.worldTransform,n=Math.sqrt(s.a*s.a+s.b*s.b),o=Math.sqrt(s.c*s.c+s.d*s.d);0!==n&&0!==o&&(this.uniforms.rotation[0]=s.a/n,this.uniforms.rotation[1]=s.b/n,this.uniforms.rotation[2]=s.c/o,this.uniforms.rotation[3]=s.d/o),t.applyFilter(this,e,i,r)}get map(){return this.uniforms.mapSampler}set map(t){this.uniforms.mapSampler=t}}class m extends r.wn{constructor(){super("\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
3\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);
3\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')}}class g extends r.wn{constructor(t=.5,e=Math.random()){super(r.Y9,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0}),this.noise=t,this.seed=e}get noise(){return this.uniforms.uNoise}set noise(t){this.uniforms.uNoise=t}get seed(){return this.uniforms.uSeed}set seed(t){this.uniforms.uSeed=t}}const _={AlphaFilter:h,BlurFilter:d,BlurFilterPass:c,ColorMatrixFilter:f,DisplacementFilter:p,FXAAFilter:m,NoiseFilter:g};Object.entries(_).forEach((([t,e])=>{Object.defineProperty(_,t,{get:()=>(r.P6.deprecation("7.1.0",`filters.${t} has moved to ${t}`),e)})}));const x=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(r.vB.system.add(this.tickerUpdate,this,r.uF.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(r.vB.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}};class v{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=v.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new r.E9,this.page=new r.E9,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,i,r,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class y extends v{constructor(){super(...arguments),this.client=new r.E9,this.movement=new r.E9,this.offset=new r.E9,this.global=new r.E9,this.screen=new r.E9}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}
3getLocalPosition(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,r,s,n,o,a,h,l,u,c,d,f,p){throw new Error("Method not implemented.")}}class T extends y{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class b extends y{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}b.DOM_DELTA_PIXEL=0,b.DOM_DELTA_LINE=1,b.DOM_DELTA_PAGE=2;const E=new r.E9,A=new r.E9;class w{constructor(t){this.dispatch=new r.P6.EventEmitter,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let i=0,r=e.length;i<r;i++)e[i].fn(t);else console.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}
3hitTest(t,e){x.pauseUpdate=!0;const i=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,E.set(t,e),this.hitTestFn,this.hitPruneFn);return i&&i[0]}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let r=0,s=i.length-1;r<s;r++)if(t.currentTarget=i[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let r=i.length-2;r>=0;r--)if(t.currentTarget=i[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,i=this._allInteractiveElements){if(0===i.length)return;t.eventPhase=t.BUBBLING_PHASE;const r=Array.isArray(e)?e:[e];for(let s=i.length-1;s>=0;s--)r.forEach((e=>{t.currentTarget=i[s],this.notifyTarget(t,e)}))}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,i,r,s,n=!1){let o=!1;if(this._interactivePrune(t))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(x.pauseUpdate=!1),t.interactiveChildren&&t.children){const a=t.children;for(let h=a.length-1;h>=0;h--){const l=a[h],u=this.hitTestMoveRecursive(l,this._isInteractive(e)?e:l.eventMode,i,r,s,n||s(t,i));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const e=t.isInteractive();(u.length>0||e)&&(e&&this._allInteractiveElements.push(t),u.push(t)),0===this._hitElements.length&&(this._hitElements=u),o=!0}}}const a=this._isInteractive(e),h=t.isInteractive();return a&&h&&this._allInteractiveElements.push(t),n||this._hitElements.length>0?null:o?this._hitElements:a&&!s(t,i)&&r(t,i)?h?[t]:[]:null}hitTestRecursive(t,e,i,r,s){if(this._interactivePrune(t)||s(t,i))return null;if(("dynamic"===t.eventMode||"dynamic"===e)&&(x.pauseUpdate=!1),t.interactiveChildren&&t.children){const n=t.children;for(let o=n.length-1;o>=0;o--){const a=n[o],h=this.hitTestRecursive(a,this._isInteractive(e)?e:a.eventMode,i,r,s
3);if(h){if(h.length>0&&!h[h.length-1].parent)continue;const e=t.isInteractive();return(h.length>0||e)&&h.push(t),h}}}const n=this._isInteractive(e),o=t.isInteractive();return n&&r(t,i)?o?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&!t.isMask&&t.visible&&t.renderable&&"none"!==t.eventMode&&("passive"!==t.eventMode||t.interactiveChildren)&&!t.isMask)}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,A),!t.hitArea.contains(A.x,A.y)))return!0;if(t._mask){const i=t._mask.isMaskData?t._mask.maskObject:t._mask;if(i&&!i.containsPoint?.(e))return!0}return!1}hitTestFn(t,e){return"passive"!==t.eventMode&&(!!t.hitArea||!!t.containsPoint&&t.containsPoint(e))}notifyTarget(t,e){const i=`on${e=e??t.type}`;t.currentTarget[i]?.(t);const r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof T))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)this.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){const t=2===e.button;this.dispatchEvent(e,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){if(!(t instanceof T))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const i="mouse"===e.pointerType||"pen"===e.pointerType,r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.overTargets);if(r.overTargets?.length>0&&s!==e.target){const r="mousemove"===t.type?"mouseout":"pointerout",n=this.createPointerEvent(t,r,s);if(this.dispatchEvent(n,"pointerout"),i&&this.dispatchEvent(n,"mouseout"),!e.composedPath().includes(s)){const r=this.createPointerEvent(t,"pointerleave",s);for(r.eventPhase=r.AT_TARGET;r.target&&!e.composedPath().includes(r.target);)r.currentTarget=r.target,this.notifyTarget(r),i&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;this.freeEvent(r)}this.freeEvent(n)}if(s!==e.target){const r="mousemove"===t.type?"mouseover":"pointerover",n=this.clonePointerEvent(e,r);this.dispatchEvent(n,"pointerover"),i&&this.dispatchEvent(n,"mouseover");let o=s?.parent;for(;o&&o!==this.rootTarget.parent&&o!==e.target;)o=o.parent;if(!o||o===this.rootTarget.parent){const t=this.clonePointerEvent(e,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==s&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),i&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}const n=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?n.push("pointermove"):this.dispatchEvent(e,"pointermove"),o&&n.push("globalpointermove"),"touch"===e.pointerType&&(this.moveOnAll?n.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),o&&n.push("globaltouchmove")),i&&(this.moveOnAll?n.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),o&&n.push("globalmousemove"),this.cursor=e.target?.cursor),n.length>0&&this.all(e,n),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){if(!(t instanceof T))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),i=this.createPointerEvent(t),r="mouse"===i.pointerType||"pen"===i.pointerType;this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(this.cursor=i.target?.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),r&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;e.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(t){if(!(t instanceof T))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId);if(e.overTargets){const i="mouse"===t.pointerType||"pen"===t.pointerType,r=this.findMountedTarget(e.overTargets),s=this.createPointerEvent(t,"pointerout",r);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const n=this.createPointerEvent(t,"pointerleave",r);for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),i&&this.notifyTarget(n,"mouseleave"),n.target=n.target.parent;e.overTargets=null,this.freeEvent(s),this.freeEvent(n)}this.cursor=null}mapPointerUp(t){if(!(t instanceof T))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=performance.now(),i=this.createPointerEvent(t);if(this.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)this.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){const t=2===i.button;this.dispatchEvent(i,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.pressTargetsByButton[t.button]);let n=s;if(s&&!i.composedPath().includes(s)){let e=s;for(;e&&!i.composedPath().includes(e);){if(i.currentTarget=e,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)this.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){const t=2===i.button;this.notifyTarget(i,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],n=e}if(n){const s=this.clonePointerEvent(i,"click");s.target=n,s.path=null,r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:s.target,timeStamp:e});const o=r.clicksByButton[t.button];if(o.target===s.target&&e-o.timeStamp<200?++o.clickCount:o.clickCount=1,o.target=s.target,o.timeStamp=e,s.detail=o.clickCount,"mouse"===s.pointerType){const t=2===s.button;this.dispatchEvent(s,t?"rightclick":"click")}else"touch"===s.pointerType&&this.dispatchEvent(s,"tap");this.dispatchEvent(s,"pointertap"),this.freeEvent(s)}this.freeEvent(i)}mapPointerUpOutside(t){if(!(t instanceof T))return void console.warn("EventBoundary cannot map a non-pointer event as a pointer event");const e=this.trackingData(t.pointerId),i=this.findMountedTarget(e.pressTargetsByButton[t.button]),r=this.createPointerEvent(t);if(i){let s=i;for(;s;)r.currentTarget=s,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):("mouse"===r.pointerType||"pen"===r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),s=s.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(r)}mapWheel(t){if(!(t instanceof b))return void console.warn("EventBoundary cannot map a non-wheel event as a wheel event");const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){const r=this.allocateEvent(T);return this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=i??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],"string"==typeof e&&(r.type=e),r}createWheelEvent(t){const e=this.allocateEvent(b);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const i=this.allocateEvent(T);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=e??i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof T&&e instanceof T&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.t
vendor: 8,033 bytes, line 3
3iltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof y&&e instanceof y&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i&&t.currentTarget.isInteractive())if("fn"in i)i.once&&t.currentTarget.removeListener(e,i.fn,void 0,!0),i.fn.call(i.context,t);else for(let r=0,s=i.length;r<s&&!t.propagationImmediatelyStopped;r++)i[r].once&&t.currentTarget.removeListener(e,i[r].fn,void 0,!0),i[r].fn.call(i[r].context,t)}}const S={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},I=class t{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new w(null),x.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new T(null),this.rootWheelEvent=new b(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...t.defaultEventFeatures},{set:(t,e,i)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=i),t[e]=i,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{view:i,resolution:r}=this.renderer;this.setTargetElement(i),this.resolution=r,t._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(t){t=t||"default";let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this.currentCursor===t)return;this.currentCursor=t;const i=this.cursorStyles[t];if(i)switch(typeof i){case"string":e&&(this.domElement.style.cursor=i);break;case"function":i(t);break;case"object":e&&Object.assign(this.domElement.style,i)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this.rootPointerEvent}onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let i=0,r=e.length;i<r;i++){const t=e[i],r=this.bootstrapEvent(this.rootPointerEvent,t);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,x.pointerMoved();const e=this.normalizeToPointerData(t);for(let i=0,r=e.length;i<r;i++){const t=this.bootstrapEvent(this.rootPointerEvent,e[i]);this.rootBoundary.mapEvent(t)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);const i=e!==this.domElement?"outside":"",r=this.normalizeToPointerData(t);for(let s=0,n=r.length;s<n;s++){const t=this.bootstrapEvent(this.rootPointerEvent,r[s]);t.type+=i,this.rootBoundary.mapEvent(t)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);for(let i=0,r=e.length;i<r;i++){const t=this.bootstrapEvent(this.rootPointerEvent,e[i]);this.rootBoundary.mapEvent(t)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this.removeEvents(),this.domElement=t,x.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;x.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,!0),this.domElement.addEventListener("pointerdown",this.onPointerDown,!0),this.domElement.addEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this.onPointerOverOut,!0),globalThis.addEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,!0),this.domElement.addEventListener("mousedown",this.onPointerDown,!0),this.domElement.addEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this.onPointerOverOut,!0),globalThis.addEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this.onPointerDown,!0),this.domElement.addEventListener("touchend",this.onPointerUp,!0),this.domElement.addEventListener("touchmove",this.onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;x.removeTickerListener();const t=this.domElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this.onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,!0),this.domElement.removeEventListener("mousedown",this.onPointerDown,!0),this.domElement.removeEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this.onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this.onPointerDown,!0),this.domElement.removeEventListener("touchend",this.onPointerUp,!0),this.domElement.removeEventListener("touchmove",this.onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(t,e,i){const r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=1/this.resolution;t.x=(e-r.left)*(this.domElement.width/r.width)*s,t.y=(i-r.top)*(this.domElement.height/r.height)*s}normalizeToPointerData(t){const e=[];
3if(this.supportsTouchEvents&&t instanceof TouchEvent)for(let i=0,r=t.changedTouches.length;i<r;i++){const r=t.changedTouches[i];typeof r.button>"u"&&(r.button=0),typeof r.buttons>"u"&&(r.buttons=1),typeof r.isPrimary>"u"&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),typeof r.width>"u"&&(r.width=r.radiusX||1),typeof r.height>"u"&&(r.height=r.radiusY||1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="touch"),typeof r.pointerId>"u"&&(r.pointerId=r.identifier||0),typeof r.pressure>"u"&&(r.pressure=r.force||.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),typeof r.layerX>"u"&&(r.layerX=r.offsetX=r.clientX),typeof r.layerY>"u"&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(globalThis.MouseEvent&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof globalThis.PointerEvent))e.push(t);else{const i=t;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=1),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;return this.transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=S[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};I.extension={name:"events",type:[r.nw.RendererSystem,r.nw.CanvasRendererSystem]},I.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let R=I;function C(t){return"dynamic"===t||"static"===t}r.Rw.add(R);const P={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??C(R.defaultEventMode)},set interactive(t){r.P6.deprecation("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=t,this.eventMode=t?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??R.defaultEventMode},set eventMode(t){this._internalInteractive=C(t),this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,i){const r="boolean"==typeof i&&i||"object"==typeof i&&i.capture,s="object"==typeof i?i.signal:void 0,n="object"==typeof i&&!0===i.once,o="function"==typeof e?void 0:e;t=r?`${t}capture`:t;const a="function"==typeof e?e:e.handleEvent,h=this;s&&s.addEventListener("abort",(()=>{h.off(t,a,o)})),n?h.once(t,a,o):h.on(t,a,o)},removeEventListener(t,e,i){const r="function"==typeof e?void 0:e;t="boolean"==typeof i&&i||"object"==typeof i&&i.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,r)},dispatchEvent(t){if(!(t instanceof v))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};s.s$.mixin(P);s.s$.mixin({accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1});class M{constructor(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(r.P6.isMobile.tablet||r.P6.isMobile.phone)&&this.createTouchHook();const e=document.createElement("div");
3e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2..toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2..toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",(()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()})),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),this.renderer.view.parentNode?.appendChild(this.div))}deactivate(){!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),this.div.parentNode?.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const e=t.children;if(e)for(let i=0;i<e.length;i++)this.updateAccessibleObjects(e[i])}update(){const t=performance.now();if(r.P6.isMobile.android.device&&t<this.androidUpdateCount||(this.androidUpdateCount=t+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);const{x:e,y:i,width:s,height:n}=this.renderer.view.getBoundingClientRect(),{width:o,height:a,resolution:h}=this.renderer,l=s/o*h,u=n/a*h;let c=this.div;c.style.left=`${e}px`,c.style.top=`${i}px`,c.style.width=`${o}px`,c.style.height=`${a}px`;for(let d=0;d<this.children.length;d++){const t=this.children[d];if(t.renderId!==this.renderId)t._accessibleActive=!1,r.P6.removeItems(this.children,d,1),this.div.removeChild(t._accessibleDiv),this.pool.push(t._accessibleDiv),t._accessibleDiv=null,d--;else{c=t._accessibleDiv;let e=t.hitArea;const i=t.worldTransform;t.hitArea?(c.style.left=(i.tx+e.x*i.a)*l+"px",c.style.top=(i.ty+e.y*i.d)*u+"px",c.style.width=e.width*i.a*l+"px",c.style.height=e.height*i.d*u+"px"):(e=t.getBounds(),this.capHitArea(e),c.style.left=e.x*l+"px",c.style.top=e.y*u+"px",c.style.width=e.width*l+"px",c.style.height=e.height*u+"px",c.title!==t.accessibleTitle&&null!==t.accessibleTitle&&(c.title=t.accessibleTitle),c.getAttribute("aria-label")!==t.accessibleHint&&null!==t.accessibleHint&&c.setAttribute("aria-label",t.accessibleHint)),(t.accessibleTitle!==c.title||t.tabIndex!==c.tabIndex)&&(c.title=t.accessibleTitle,c.tabIndex=t.tabIndex,this.debug&&this.updateDebugHTML(c))}}this.renderId++}updateDebugHTML(t){t.innerHTML=`type: ${t.type}</br> title : ${t.title}</br> tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:i}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>i&&(t.height=i-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:(!t.accessibleHint||null===t.accessibleHint)&&(e.title=`displayObject ${t.tabIndex}`),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex}_dispatchEvent(t,e){const{displayObject:i}=t.target,r=this.renderer.events.rootBoundary,s=Object.assign(new v(r),{target:i});r.rootTarget=this.renderer.lastObjectRendered,e.forEach((t=>r.dispatchEvent(s,t)))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){9===t.keyCode&&this.activate()}_onMouseMove(t){0===t.movementX&&0===t.movementY||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}
3M.extension={name:"accessibility",type:[r.nw.RendererPlugin,r.nw.CanvasRendererPlugin]},r.Rw.add(M);i(89804);var B=i(10787),D=(t=>(t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t))(D||{});const N={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let F,L;function O(){L={bptc:F.getExtension("EXT_texture_compression_bptc"),astc:F.getExtension("WEBGL_compressed_texture_astc"),etc:F.getExtension("WEBGL_compressed_texture_etc"),s3tc:F.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:F.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:F.getExtension("WEBGL_compressed_texture_pvrtc")||F.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:F.getExtension("WEBGL_compressed_texture_etc1"),atc:F.getExtension("WEBGL_compressed_texture_atc")}}const U={extension:{type:r.nw.DetectionParser,priority:2},test:async()=>{const t=r.Xd.ADAPTER.createCanvas().getContext("webgl");return t?(F=t,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async t=>{L||O();const e=[];for(const i in L)L[i]&&e.push(i);return[...e,...t]},remove:async t=>(L||O(),t.filter((t=>!(t in L))))};r.Rw.add(U);class k extends r.qm{constructor(t,e={width:1,height:1,autoLoad:!0}){let i,s;"string"==typeof t?(i=t,s=new Uint8Array):(i=null,s=t),super(s,e),this.origin=i,this.buffer=s?new r.Rv(s):null,this._load=null,this.loaded=!1,null!==this.origin&&!1!==e.autoLoad&&this.load(),null===this.origin&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load||(this._load=fetch(this.origin).then((t=>t.blob())).then((t=>t.arrayBuffer())).then((t=>(this.data=new Uint32Array(t),this.buffer=new r.Rv(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)))),this._load}}class G extends k{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=G._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||G._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,i){const r=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;r.pixelStorei(r.UNPACK_ALIGNMENT,4);for(let s=0,n=this.levels;s<n;s++){const{levelID:t,levelWidth:e,levelHeight:i,levelBuffer:n}=this._levelBuffers[s];r.compressedTexImage2D(r.TEXTURE_2D,t,this.format,e,i,0,n)}return!0}onBlobLoaded(){this._levelBuffers=G._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=35916&&t<=35919)return"s3tc_sRGB";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(36196===t)return"etc1";
3if(35986===t||35987===t||34798===t)return"atc";if(t>=36492&&t<=36495)return"bptc";if(37808===t)return"astc";throw new Error(`Invalid (compressed) texture format given: ${t}`)}static _createLevelBuffers(t,e,i,r,s,n,o){const a=new Array(i);let h=t.byteOffset,l=n,u=o,c=l+r-1&~(r-1),d=u+s-1&~(s-1),f=c*d*N[e];for(let p=0;p<i;p++)a[p]={levelID:p,levelWidth:i>1?l:c,levelHeight:i>1?u:d,levelBuffer:new Uint8Array(t.buffer,h,f)},h+=f,l=l>>1||1,u=u>>1||1,c=l+r-1&~(r-1),d=u+s-1&~(s-1),f=c*d*N[e];return a}}const H=124,X=3,V=4,W=7,z=19,$=2,j=0,Y=1,K=2,q=3,Z={827611204:D.COMPRESSED_RGBA_S3TC_DXT1_EXT,861165636:D.COMPRESSED_RGBA_S3TC_DXT3_EXT,894720068:D.COMPRESSED_RGBA_S3TC_DXT5_EXT},Q={70:D.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:D.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:D.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:D.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:D.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:D.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:D.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:D.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:D.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:D.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:D.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:D.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:D.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};const J=[171,75,84,88,32,49,49,187,13,10,26,10],tt=12,et=16,it=24,rt=28,st=36,nt=40,ot=44,at=48,ht=52,lt=56,ut=60,ct={[r.vK.UNSIGNED_BYTE]:1,[r.vK.UNSIGNED_SHORT]:2,[r.vK.INT]:4,[r.vK.UNSIGNED_INT]:4,[r.vK.FLOAT]:4,[r.vK.HALF_FLOAT]:8},dt={[r.I2.RGBA]:4,[r.I2.RGB]:3,[r.I2.RG]:2,[r.I2.RED]:1,[r.I2.LUMINANCE]:1,[r.I2.LUMINANCE_ALPHA]:2,[r.I2.ALPHA]:1},ft={[r.vK.UNSIGNED_SHORT_4_4_4_4]:2,[r.vK.UNSIGNED_SHORT_5_5_5_1]:2,[r.vK.UNSIGNED_SHORT_5_6_5]:2};function pt(t,e,i=!1){const s=new DataView(e);if(!function(t,e){for(let i=0;i<J.length;i++)if(e.getUint8(i)!==J[i])return console.error(`${t} is not a valid *.ktx file!`),!1;return!0}(t,s))return null;const n=67305985===s.getUint32(tt,!0),o=s.getUint32(et,n),a=s.getUint32(it,n),h=s.getUint32(rt,n),l=s.getUint32(st,n),u=s.getUint32(nt,n)||1,c=s.getUint32(ot,n)||1,d=s.getUint32(at,n)||1,f=s.getUint32(ht,n),p=s.getUint32(lt,n),m=s.getUint32(ut,n);if(0===u||1!==c)throw new Error("Only 2D textures are supported");if(1!==f)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(1!==d)throw new Error("WebGL does not support array textures");const g=l+3&-4,_=u+3&-4,x=new Array(d);let v,y=l*u;if(0===o&&(y=g*_),v=0!==o?ct[o]?ct[o]*dt[a]:ft[o]:N[h],void 0===v)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const T=i?function(t,e,i){const r=new Map;let s=0;for(;s<e;){const n=t.getUint32(64+s,i),o=64+s+4,a=3-(n+3)%4;if(0===n||n>e-s){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h<n&&0!==t.getUint8(o+h);h++);if(-1===h){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const l=(new TextDecoder).decode(new Uint8Array(t.buffer,o,h)),u=new DataView(t.buffer,o+h+1,n-h-1);r.set(l,u),s+=4+n+a}return r}(s,m,n):null;let b=y*v,E=l,A=u,w=g,S=_,I=64+m;for(let r=0;r<p;r++){const t=s.getUint32(I,n);let i=I+4;for(let s=0;s<d;s++){let t=x[s];t||(t=x[s]=new Array(p)),t[r]={levelID:r,levelWidth:p>1||0!==o?E:w,levelHeight:p>1||0!==o?A:S,levelBuffer:new Uint8Array(e,i,b)},i+=b}I+=t+4,I=I%4!==0?I+4-I%4:I,E=E>>1||1,A=A>>1||1,w=E+4-1&-4,S=A+4-1&-4,b=w*S*v}return 0!==o?{uncompressed:x.map((t=>{let e=t[0].levelBuffer,i=!1;return o===r.vK.FLOAT?e=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):o===r.vK.UNSIGNED_INT?(i=!0,e=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):o===r.vK.INT&&(i=!0,e=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new r.qm(e,{width:t[0].levelWidth,height:t[0].levelHeight}),type:o,format:i?mt(a):a}})),kvData:T}:{compressed:x.map((t=>new G(null,{format:h,width:l,height:u,levels:p,levelBuffers:t}))),kvData:T}}function mt(t){switch(t){case r.I2.RGBA:return r.I2.RGBA_INTEGER;case r.I2.RGB:return r.I2.RGB_INTEGER;case r.I2.RG:return r.I2.RG_INTEGER;case r.I2.RED:return r.I2.RED_INTEGER;default:return t}}const gt={extension:{type:r.nw.LoadParser,priority:B.Q2.High},name:"loadDDS",test:t=>(0,B.gN)(t,".dds"),async load(t,e,i){const s=function(t){const e=new Uint32Array(t);if(542327876!==e[0])throw new Error("Invalid DDS file magic word");const i=new Uint32Array(t,0,H/Uint32Array.BYTES_PER_ELEMENT),r=i[X],s=i[V],n=i[W],o=new Uint32Array(t,z*Uint32Array.BYTES_PER_ELEMENT,32/Uint32Array.BYTES_PER_ELEMENT),a=o[1];if(4&a){const i=o[$];if(808540228!==i){const e=Z[i],o=new Uint8Array(t,128);return[new G(o,{format:e,width:s,height:r,levels:n})]}const a=128,h=new Uint32Array(e.buffer,a,20/Uint32Array.BYTES_PER_ELEMENT),l=h[j],u=h[Y],c=h[K],d=h[q],f=Q[l];if(void 0===f)throw new Error(`DDSParser cannot parse texture data with DXGI format ${l}`);if(4===c)throw new Error("DDSParser does not support cubemap textures");if(6===u)throw new Error("DDSParser does not supported 3D texture data");const p=new Array,m=148;if(1===d)p.push(new Uint8Array(t,m));else{const e=N[f];let i=0,o=s,a=r;for(let t=0;t<n;t++)i+=Math.max(1,o+3&-4)*Math.max(1,a+3&-4)*e,o>>>=1,a>>>=1;let h=m;for(let r=0;r<d;r++)p.push(new Uint8Array(t,h,i)),h+=i}return p.map((t=>new G(t,{format:f,width:s,height:r,levels:n})))}throw 64&a?new Error("DDSParser does not support uncompressed texture data."):512&a?new Error("DDSParser does not supported YUV uncompressed texture data."):131072&a?new Error("DDSParser does not support single-channel (lumninance) texture data!"):2&a?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}(await(await r.Xd.ADAPTER.fetch(t)).arrayBuffer()).map((s=>{const n=new r.VL(s,{mipmap:r.KI.OFF,alphaMode:r.iw.NO_PREMULTIPLIED_ALPHA,resolution:r.P6.getResolutionOfUrl(t),...e.data});return(0,B.cU)(n,i,t)}));return 1===s.length?s[0]:s},unload(t){Array.isArray(t)?t.forEach((t=>t.destroy(!0))):t.destroy(!0)}};r.Rw.add(gt);const _t={extension:{type:r.nw.LoadParser,priority:B.Q2.High},name:"loadKTX",test:t=>(0,B.gN)(t,".ktx"),async load(t,e,i){const s=await(await r.Xd.ADAPTER.fetch(t)).arrayBuffer(),{compressed:n,uncompressed:o,kvData:a}=pt(t,s),h=n??o,l={mipmap:r.KI.OFF,alphaMode:r.iw.NO_PREMULTIPLIED_ALPHA,resolution:r.P6.getResolutionOfUrl(t),...e.data},u=h.map((e=>{h===o&&Object.assign(l,{type:e.type,format:e.format});const s=e.resource??e,n=new r.VL(s,l);return n.ktxKeyValueData=a,(0,B.cU)(n,i,t)}));return 1===u.length?u[0]:u},unload(t){Array.isArray(t)?t.forEach((t=>t.destroy(!0))):t.destroy(!0)}};r.Rw.add(_t);const xt=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],vt={extension:r.nw.ResolveParser,test:t=>{const e=r.P6.path.extname(t).slice(1);return["basis","ktx","dds"].includes(e)},parse:t=>{const e=t.split("."),i=e.pop();if(["ktx","dds"].includes(i)){const i=e.pop();if(xt.includes(i))return{resolution:parseFloat(r.Xd.RETINA_PREFIX.exec(t)?.[1]??"1"),format:i,src:t}}return{resolution:parseFloat(r.Xd.RETINA_PREFIX.exec(t)?.[1]??"1"),format:i,src:t}}};r.Rw.add(vt);const yt=new r.Ae,Tt=class t{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){const t=this.renderer?.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}async image(t,e,i,r){const s=new Image;return s.src=await this.base64(t,e,i,r),s}async base64(t,e,i,r){const s=this.canvas(t,r);if(void 0!==s.toBlob)return new Promise(((t,r)=>{s.toBlob((e=>{if(!e)return void r(new Error("ICanvas.toBlob failed!"));const i=new FileReader;i.onload=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)}),e,i)}
3));if(void 0!==s.toDataURL)return s.toDataURL(e,i);if(void 0!==s.convertToBlob){const t=await s.convertToBlob({type:e,quality:i});return new Promise(((e,i)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=i,r.readAsDataURL(t)}))}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,i){const{pixels:s,width:n,height:o,flipY:a,premultipliedAlpha:h}=this._rawPixels(e,i);a&&t._flipY(s,n,o),h&&t._unpremultiplyAlpha(s);const l=new r.P6.CanvasRenderTarget(n,o,1),u=new ImageData(new Uint8ClampedArray(s.buffer),n,o);return l.context.putImageData(u,0,0),l.canvas}pixels(e,i){const{pixels:r,width:s,height:n,flipY:o,premultipliedAlpha:a}=this._rawPixels(e,i);return o&&t._flipY(r,s,n),a&&t._unpremultiplyAlpha(r),r}_rawPixels(t,e){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let s,n,o=!1,a=!1,h=!1;t&&(t instanceof r.TI?n=t:(n=i.generateTexture(t,{region:e,resolution:i.resolution,multisample:i.multisample}),h=!0,e&&(yt.width=e.width,yt.height=e.height,e=yt)));const l=i.gl;if(n){if(s=n.baseTexture.resolution,e=e??n.frame,o=!1,a=n.baseTexture.alphaMode>0&&n.baseTexture.format===r.I2.RGBA,!h){i.renderTexture.bind(n);const t=n.framebuffer.glFramebuffers[i.CONTEXT_UID];t.blitFramebuffer&&i.framebuffer.bind(t.blitFramebuffer)}}else s=i.resolution,e||((e=yt).width=i.width/s,e.height=i.height/s),o=!0,a=this._rendererPremultipliedAlpha,i.renderTexture.bind();const u=Math.max(Math.round(e.width*s),1),c=Math.max(Math.round(e.height*s),1),d=new Uint8Array(4*u*c);return l.readPixels(Math.round(e.x*s),Math.round(e.y*s),u,c,l.RGBA,l.UNSIGNED_BYTE,d),h&&n?.destroy(!0),{pixels:d,width:u,height:c,flipY:o,premultipliedAlpha:a}}destroy(){this.renderer=null}static _flipY(t,e,i){const r=e<<2,s=i>>1,n=new Uint8Array(r);for(let o=0;o<s;o++){const e=o*r,s=(i-o-1)*r;n.set(t.subarray(e,e+r)),t.copyWithin(e,s,s+r),t.set(n,s)}}static _unpremultiplyAlpha(t){t instanceof Uint8ClampedArray&&(t=new Uint8Array(t.buffer));const e=t.length;for(let i=0;i<e;i+=4){const e=t[i+3];if(0!==e){const r=255.001/e;t[i]=t[i]*r+.5,t[i+1]=t[i+1]*r+.5,t[i+2]=t[i+2]*r+.5}}}};Tt.extension={name:"extract",type:r.nw.RendererSystem};let bt=Tt;r.Rw.add(bt);var Et=i(19743);i(29902),i(88831),i(93233),i(48044),i(17108),i(27331);const At=class t{constructor(t,e,i){this.linkedSheets=[],(t instanceof r.VL||t instanceof r.xE)&&(t={texture:t,data:e,resolutionFilename:i});const{texture:s,data:n,resolutionFilename:o=null,cachePrefix:a=""}=t;this.cachePrefix=a,this._texture=s instanceof r.xE?s:null,this.baseTexture=s instanceof r.VL?s:this._texture.baseTexture,this.textures={},this.animations={},this.data=n;const h=this.baseTexture.resource;this.resolution=this._updateResolution(o||(h?h.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(t=null){const{scale:e}=this.data.meta;let i=r.P6.getResolutionOfUrl(t,null);return null===i&&(i="number"==typeof e?e:parseFloat(e??"1")),1!==i&&this.baseTexture.setResolution(i),i}parse(){return new Promise((e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()}))}_processFrames(e){let i=e;const s=t.BATCH_SIZE;for(;i-e<s&&i<this._frameKeys.length;){const t=this._frameKeys[i],e=this._frames[t],s=e.frame;if(s){let i=null,n=null;const o=!1!==e.trimmed&&e.sourceSize?e.sourceSize:e.frame,a=new r.Ae(0,0,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution);i=e.rotated?new r.Ae(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.h)/this.resolution,Math.floor(s.w)/this.resolution):new r.Ae(Math.floor(s.x)/this.resolution,Math.floor(s.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution),!1!==e.trimmed&&e.spriteSourceSize&&(n=new r.Ae(Math.floor(e.spriteSourceSize.x)/this.resolution,Math.floor(e.spriteSourceSize.y)/this.resolution,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution)),this.textures[t]=new r.xE(this.baseTexture,i,a,n,e.rotated?2:0,e.anchor,e.borders),r.xE.addToCache(this.textures[t],this.cachePrefix+t.toString())}i++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let i=0;i<t[e].length;i++){const r=t[e][i];this.animations[e].push(this.textures[r])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((()=>{this._batchIndex*t.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())}),0)}destroy(t=!1){for(const e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};At.BATCH_SIZE=1e3;let wt=At;const St=["jpg","png","jpeg","avif","webp","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"];function It(t,e,i){const s={};if(t.forEach((t=>{s[t]=e}
3)),Object.keys(e.textures).forEach((t=>{s[`${e.cachePrefix}${t}`]=e.textures[t]})),!i){const i=r.P6.path.dirname(t[0]);e.linkedSheets.forEach(((t,r)=>{Object.assign(s,It([`${i}/${e.data.meta.related_multi_packs[r]}`],t,!0))}))}return s}const Rt={extension:r.nw.Asset,cache:{test:t=>t instanceof wt,getCacheableAssets:(t,e)=>It(t,e,!1)},resolver:{test:t=>{const e=t.split("?")[0].split("."),i=e.pop(),r=e.pop();return"json"===i&&St.includes(r)},parse:t=>{const e=t.split(".");return{resolution:parseFloat(r.Xd.RETINA_PREFIX.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",extension:{type:r.nw.LoadParser,priority:B.Q2.Normal},testParse:async(t,e)=>".json"===r.P6.path.extname(e.src).toLowerCase()&&!!t.frames,async parse(t,e,i){const{texture:s,imageFilename:n,cachePrefix:o}=e?.data??{};let a,h=r.P6.path.dirname(e.src);if(h&&h.lastIndexOf("/")!==h.length-1&&(h+="/"),s&&s.baseTexture)a=s;else{const r=(0,B.uz)(h+(n??t.meta.image),e.src);a=(await i.load([r]))[r]}const l=new wt({texture:a.baseTexture,data:t,resolutionFilename:e.src,cachePrefix:o});await l.parse();const u=t?.meta?.related_multi_packs;if(Array.isArray(u)){const t=[];for(const s of u){if("string"!=typeof s)continue;let r=h+s;e.data?.ignoreMultiPack||(r=(0,B.uz)(r,e.src),t.push(i.load({src:r,data:{ignoreMultiPack:!0}})))}const r=await Promise.all(t);l.linkedSheets=r,r.forEach((t=>{t.linkedSheets=[l].concat(l.linkedSheets.filter((e=>e!==t)))}))}return l},unload(t){t.destroy(!0)}}};r.Rw.add(Rt);var Ct=i(53984);i(12270);const Pt=class t extends Ct.pn{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new t(Object.keys(t.defaultOptions).reduce(((t,i)=>({...t,[i]:e[i]})),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach((e=>{URL.revokeObjectURL(e.src),e.refs--,0===e.refs&&(e.fontFace&&document.fonts.delete(e.fontFace),delete t.availableFonts[e.originalUrl])})),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,i={}){const{availableFonts:s}=t;if(s[e]){const t=s[e];return this._fonts.push(t),t.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return r.Xd.ADAPTER.fetch(e).then((t=>t.blob())).then((async t=>new Promise(((e,i)=>{const r=URL.createObjectURL(t),s=new FileReader;s.onload=()=>e([r,s.result]),s.onerror=i,s.readAsDataURL(t)})))).then((async([t,n])=>{const o=Object.assign({family:r.P6.path.basename(e,r.P6.path.extname(e)),weight:"normal",style:"normal",display:"auto",src:t,dataSrc:n,refs:1,originalUrl:e,fontFace:null},i);s[e]=o,this._fonts.push(o),this.styleID++;const a=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0}))}addOverride(...t){const e=t.filter((t=>!this._overrides.includes(t)));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter((t=>this._overrides.includes(t)));e.length>0&&(this._overrides=this._overrides.filter((t=>!e.includes(t))),this.styleID++)}toCSS(t){return[`transform: scale(${t})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?["word-wrap: "+(this.breakWords?"break-all":"break-word"),`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce(((t,e)=>`${t}\n @font-face {\n font-family: "${e.family}";\n src: url('${e.dataSrc}');
3\n font-weight: ${e.weight};\n font-style: ${e.style};\n font-display: ${e.display};\n }`),this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=r.P6.rgb2hex(t)),"number"==typeof t?r.P6.hex2string(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),r=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(255*e|0).toString(16).padStart(2,"0"));const s=`${i}px ${r}px`;return this.dropShadowBlur>0?`text-shadow: ${s} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${s} ${t}`}reset(){Object.assign(this,t.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise((t=>setTimeout(t,100))):Promise.resolve()}get isSafari(){const{userAgent:t}=r.Xd.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};Pt.availableFonts={},Pt.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Mt=Pt;const Bt=class t extends n.j{constructor(e="",i={}){super(r.xE.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const s=new Image,n=r.xE.from(s,{scaleMode:r.Xd.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new r.Ae,n.trim=new r.Ae,this.texture=n;const o="http://www.w3.org/2000/svg",a="http://www.w3.org/1999/xhtml",h=document.createElementNS(o,"svg"),l=document.createElementNS(o,"foreignObject"),u=document.createElementNS(a,"div"),c=document.createElementNS(a,"style");l.setAttribute("width","10000"),l.setAttribute("height","10000"),l.style.overflow="hidden",h.appendChild(l),this.maxWidth=t.defaultMaxWidth,this.maxHeight=t.defaultMaxHeight,this._domElement=u,this._styleElement=c,this._svgRoot=h,this._foreignObject=l,this._foreignObject.appendChild(c),this._foreignObject.appendChild(u),this._image=s,this._loadImage=new Image,this._autoResolution=t.defaultAutoResolution,this._resolution=t.defaultResolution??r.Xd.RESOLUTION,this.text=e,this.style=i}measureText(t){const{text:e,style:i,resolution:r}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:i.toCSS(r)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const s=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:n,height:o}=s;(n>this.maxWidth||o>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const a=Math.min(this.maxWidth,Math.ceil(n)),h=Math.min(this.maxHeight,Math.ceil(o));return this._svgRoot.setAttribute("width",a.toString()),this._svgRoot.setAttribute("height",h.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:this._style?.toCSS(r)}),this._styleElement.textContent=this._style?.toGlobalCSS()),{width:a+2*i.padding,height:h+2*i.padding}}async updateText(t=!0){const{style:e,_image:i,_loadImage:r}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:s,height:n}=this.measureText();i.width=r.width=Math.ceil(Math.max(1,s)),i.height=r.height=Math.ceil(Math.max(1,n)),this._updateID++;const o=this._updateID;await new Promise((t=>{r.onload=async()=>{o<this._updateID||(await e.onBeforeDraw(),i.src=r.src,r.onload=null,r.src="",this.updateTexture()),t()};const s=(new XMLSerializer).serializeToString(this._svgRoot);r.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(s)}`}))}get source(){return this._image}updateTexture(){const{style:t,texture:e,_image:i,resolution:r}=this,{padding:s}=t,{baseTexture:n}=e;e.trim.width=e._frame.width=i.width/r,e.trim.height=e._frame.height=i.height/r,e.trim.x=-s,e.trim.y=-s,e.orig.width=e._frame.width-2*s,e.orig.height=e._frame.height-2*s,this._onTextureUpdate(),n.setRealSize(i.width,i.height,r),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}_renderCanvas(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(t)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds(t)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},t.defaultDestroyOptions,e),super.destroy(e);const i=null;this.ownsStyle&&this._style?.cleanFonts(),this._style=i,this._svgRoot?.remove(),this._svgRoot=i,this._domElement?.remove(),this._domElement=i,this._foreignObject?.remove(),this._foreignObject=i,this._styleElement?.remove(),this._styleElement=i,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=i,this._image.src="",this._image=i}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(t){this.updateText(!0);const e=r.P6.sign(this.scale.x)||1;this.scale.x=e*t/this._image.width/this.resolution,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(t){this.updateText(!0);const e=r.P6.sign(this.scale.y)||1;this.scale.y=e*t/this._image.height/this.resolution,this._height=t}get style(){return this._style}set style(t){this._style!==t&&((t=t||{})instanceof Mt?(this.ownsStyle=!1,this._style=t):t instanceof Ct.pn?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=Mt.from(t)):(this.ownsStyle=!0,this._style=new Mt(t)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(t){t=String(""===t||null===t||void 0===t?" ":t),t=this.sanitiseText(t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}sanitiseText(t){return t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};Bt.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Bt.defaultMaxWidth=2024,Bt.defaultMaxHeight=2024,Bt.defaultAutoResolution=!0}}]); 4//# sourceMappingURL=84732-5abb2d301ba5246c.js.map 5//# debugId=8b866658-35c4-503b-a291-ceca4c24c50c
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.