@drincs/pixi-vn 1.2.16 → 1.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/index.cjs +52 -52
- package/dist/canvas/index.d.cts +1 -1
- package/dist/canvas/index.d.ts +1 -1
- package/dist/canvas/index.mjs +52 -52
- package/dist/canvas/tickers/index.cjs +2 -2
- package/dist/canvas/tickers/index.mjs +2 -2
- package/dist/character/index.cjs +1 -1
- package/dist/character/index.mjs +1 -1
- package/dist/{index-1w4bBKAx.d.cts → index-DbaokgZ8.d.cts} +24 -8
- package/dist/{index-xaLEzplg.d.ts → index-DiRMyOsp.d.ts} +24 -8
- package/dist/index.cjs +101 -101
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +101 -101
- package/dist/narration/index.cjs +29 -29
- package/dist/narration/index.mjs +29 -29
- package/dist/sound/index.cjs +20 -20
- package/dist/sound/index.mjs +20 -20
- package/package.json +1 -1
package/dist/canvas/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
'use strict';var eM=Object.create;var Vd=Object.defineProperty;var tM=Object.getOwnPropertyDescriptor;var rM=Object.getOwnPropertyNames;var iM=Object.getPrototypeOf,sM=Object.prototype.hasOwnProperty;var GE=r=>{throw TypeError(r)};var nM=(r,e,t)=>e in r?Vd(r,e,{enumerable:true,configurable:true,writable:true,value:t}):r[e]=t;var db=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var f=(r,e)=>()=>(r&&(e=r(r=0)),e);var ti=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),zd=(r,e)=>{for(var t in e)Vd(r,t,{get:e[t],enumerable:true});},oM=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of rM(e))!sM.call(r,s)&&s!==t&&Vd(r,s,{get:()=>e[s],enumerable:!(i=tM(e,s))||i.enumerable});return r};var Wd=(r,e,t)=>(t=r!=null?eM(iM(r)):{},oM(Vd(t,"default",{value:r,enumerable:true}),r));var L=(r,e,t)=>nM(r,typeof e!="symbol"?e+"":e,t),fb=(r,e,t)=>e.has(r)||GE("Cannot "+t);var y=(r,e,t)=>(fb(r,e,"read from private field"),t?t.call(r):e.get(r)),pe=(r,e,t)=>e.has(r)?GE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),q=(r,e,t,i)=>(fb(r,e,"write to private field"),e.set(r,t),t),X=(r,e,t)=>(fb(r,e,"access private method"),t);var Xd=(r,e,t,i)=>({set _(s){q(r,e,s);},get _(){return y(r,e,i)}});var m,pb,va,O,E=f(()=>{m=(r=>(r.Application="application",r.WebGLPipes="webgl-pipes",r.WebGLPipesAdaptor="webgl-pipes-adaptor",r.WebGLSystem="webgl-system",r.WebGPUPipes="webgpu-pipes",r.WebGPUPipesAdaptor="webgpu-pipes-adaptor",r.WebGPUSystem="webgpu-system",r.CanvasSystem="canvas-system",r.CanvasPipesAdaptor="canvas-pipes-adaptor",r.CanvasPipes="canvas-pipes",r.Asset="asset",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser",r.MaskEffect="mask-effect",r.BlendMode="blend-mode",r.TextureSource="texture-source",r.Environment="environment",r.ShapeBuilder="shape-builder",r.Batcher="batcher",r))(m||{}),pb=r=>{if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");r={...typeof r.extension!="object"?{type:r.extension}:r.extension,ref:r};}if(typeof r=="object")r={...r};else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},va=(r,e)=>pb(r).priority??e,O={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(pb).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e));}),this},add(...r){return r.map(pb).forEach(e=>{e.type.forEach(t=>{let i=this._addHandlers,s=this._queue;i[t]?i[t]?.(e):(s[t]=s[t]||[],s[t]?.push(e));});}),this},handle(r,e,t){let i=this._addHandlers,s=this._removeHandlers;if(i[r]||s[r])throw new Error(`Extension type ${r} already has a handler`);i[r]=e,s[r]=t;let n=this._queue;return n[r]&&(n[r]?.forEach(o=>e(o)),delete n[r]),this},handleByMap(r,e){return this.handle(r,t=>{t.name&&(e[t.name]=t.ref);},t=>{t.name&&delete e[t.name];})},handleByNamedList(r,e,t=-1){return this.handle(r,i=>{e.findIndex(n=>n.name===i.name)>=0||(e.push({name:i.name,value:i.ref}),e.sort((n,o)=>va(o.value,t)-va(n.value,t)));},i=>{let s=e.findIndex(n=>n.name===i.name);s!==-1&&e.splice(s,1);})},handleByList(r,e,t=-1){return this.handle(r,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((s,n)=>va(n,t)-va(s,t)));},i=>{let s=e.indexOf(i.ref);s!==-1&&e.splice(s,1);})},mixin(r,...e){for(let t of e)Object.defineProperties(r.prototype,Object.getOwnPropertyDescriptors(t));}};});var LE=ti((hO,mb)=>{var aM=Object.prototype.hasOwnProperty,Lt="~";function Yl(){}Object.create&&(Yl.prototype=Object.create(null),new Yl().__proto__||(Lt=false));function uM(r,e,t){this.fn=r,this.context=e,this.once=t||false;}function UE(r,e,t,i,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new uM(t,i||r,s),o=Lt?Lt+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],n]:r._events[o].push(n):(r._events[o]=n,r._eventsCount++),r}function Yd(r,e){--r._eventsCount===0?r._events=new Yl:delete r._events[e];}function Bt(){this._events=new Yl,this._eventsCount=0;}Bt.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)aM.call(t,i)&&e.push(Lt?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Bt.prototype.listeners=function(e){var t=Lt?Lt+e:e,i=this._events[t];if(!i)return [];if(i.fn)return [i.fn];for(var s=0,n=i.length,o=new Array(n);s<n;s++)o[s]=i[s].fn;return o};Bt.prototype.listenerCount=function(e){var t=Lt?Lt+e:e,i=this._events[t];return i?i.fn?1:i.length:0};Bt.prototype.emit=function(e,t,i,s,n,o){var a=Lt?Lt+e:e;if(!this._events[a])return false;var u=this._events[a],l=arguments.length,c,h;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,true),l){case 1:return u.fn.call(u.context),true;case 2:return u.fn.call(u.context,t),true;case 3:return u.fn.call(u.context,t,i),true;case 4:return u.fn.call(u.context,t,i,s),true;case 5:return u.fn.call(u.context,t,i,s,n),true;case 6:return u.fn.call(u.context,t,i,s,n,o),true}for(h=1,c=new Array(l-1);h<l;h++)c[h-1]=arguments[h];u.fn.apply(u.context,c);}else {var d=u.length,p;for(h=0;h<d;h++)switch(u[h].once&&this.removeListener(e,u[h].fn,void 0,true),l){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,t);break;case 3:u[h].fn.call(u[h].context,t,i);break;case 4:u[h].fn.call(u[h].context,t,i,s);break;default:if(!c)for(p=1,c=new Array(l-1);p<l;p++)c[p-1]=arguments[p];u[h].fn.apply(u[h].context,c);}}return true};Bt.prototype.on=function(e,t,i){return UE(this,e,t,i,false)};Bt.prototype.once=function(e,t,i){return UE(this,e,t,i,true)};Bt.prototype.removeListener=function(e,t,i,s){var n=Lt?Lt+e:e;if(!this._events[n])return this;if(!t)return Yd(this,n),this;var o=this._events[n];if(o.fn)o.fn===t&&(!s||o.once)&&(!i||o.context===i)&&Yd(this,n);else {for(var a=0,u=[],l=o.length;a<l;a++)(o[a].fn!==t||s&&!o[a].once||i&&o[a].context!==i)&&u.push(o[a]);u.length?this._events[n]=u.length===1?u[0]:u:Yd(this,n);}return this};Bt.prototype.removeAllListeners=function(e){var t;return e?(t=Lt?Lt+e:e,this._events[t]&&Yd(this,t)):(this._events=new Yl,this._eventsCount=0),this};Bt.prototype.off=Bt.prototype.removeListener;Bt.prototype.addListener=Bt.prototype.on;Bt.prefixed=Lt;Bt.EventEmitter=Bt;typeof mb<"u"&&(mb.exports=Bt);});var NE,ue,St=f(()=>{NE=Wd(LE()),ue=NE.default;});var lM,wi,pt,xr,jE,HE,gb,cM,$d,qE,KE,VE,zE,WE,$l,hM,dM,fM,pM,bb,XE,mM,xb,_b,YE,yb,Dr,$E,ZE,QE=f(()=>{lM={grad:.9,turn:360,rad:360/(2*Math.PI)},wi=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},pt=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*r)/t+0},xr=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),r>t?t:r>e?r:e},jE=function(r){return (r=isFinite(r)?r%360:0)>0?r:r+360},HE=function(r){return {r:xr(r.r,0,255),g:xr(r.g,0,255),b:xr(r.b,0,255),a:xr(r.a)}},gb=function(r){return {r:pt(r.r),g:pt(r.g),b:pt(r.b),a:pt(r.a,3)}},cM=/^#([0-9a-f]{3,8})$/i,$d=function(r){var e=r.toString(16);return e.length<2?"0"+e:e},qE=function(r){var e=r.r,t=r.g,i=r.b,s=r.a,n=Math.max(e,t,i),o=n-Math.min(e,t,i),a=o?n===e?(t-i)/o:n===t?2+(i-e)/o:4+(e-t)/o:0;return {h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:s}},KE=function(r){var e=r.h,t=r.s,i=r.v,s=r.a;e=e/360*6,t/=100,i/=100;var n=Math.floor(e),o=i*(1-t),a=i*(1-(e-n)*t),u=i*(1-(1-e+n)*t),l=n%6;return {r:255*[i,a,o,o,u,i][l],g:255*[u,i,i,a,o,o][l],b:255*[o,o,u,i,i,a][l],a:s}},VE=function(r){return {h:jE(r.h),s:xr(r.s,0,100),l:xr(r.l,0,100),a:xr(r.a)}},zE=function(r){return {h:pt(r.h),s:pt(r.s),l:pt(r.l),a:pt(r.a,3)}},WE=function(r){return KE((t=(e=r).s,{h:e.h,s:(t*=((i=e.l)<50?i:100-i)/100)>0?2*t/(i+t)*100:0,v:i+t,a:e.a}));var e,t,i;},$l=function(r){return {h:(e=qE(r)).h,s:(s=(200-(t=e.s))*(i=e.v)/100)>0&&s<200?t*i/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,t,i,s;},hM=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dM=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fM=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pM=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bb={string:[[function(r){var e=cM.exec(r);return e?(r=e[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?pt(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?pt(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var e=fM.exec(r)||pM.exec(r);return e?e[2]!==e[4]||e[4]!==e[6]?null:HE({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:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(r){var e=hM.exec(r)||dM.exec(r);if(!e)return null;var t,i,s=VE({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(lM[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return WE(s)},"hsl"]],object:[[function(r){var e=r.r,t=r.g,i=r.b,s=r.a,n=s===void 0?1:s;return wi(e)&&wi(t)&&wi(i)?HE({r:Number(e),g:Number(t),b:Number(i),a:Number(n)}):null},"rgb"],[function(r){var e=r.h,t=r.s,i=r.l,s=r.a,n=s===void 0?1:s;if(!wi(e)||!wi(t)||!wi(i))return null;var o=VE({h:Number(e),s:Number(t),l:Number(i),a:Number(n)});return WE(o)},"hsl"],[function(r){var e=r.h,t=r.s,i=r.v,s=r.a,n=s===void 0?1:s;if(!wi(e)||!wi(t)||!wi(i))return null;var o=function(a){return {h:jE(a.h),s:xr(a.s,0,100),v:xr(a.v,0,100),a:xr(a.a)}}({h:Number(e),s:Number(t),v:Number(i),a:Number(n)});return KE(o)},"hsv"]]},XE=function(r,e){for(var t=0;t<e.length;t++){var i=e[t][0](r);if(i)return [i,e[t][1]]}return [null,void 0]},mM=function(r){return typeof r=="string"?XE(r.trim(),bb.string):typeof r=="object"&&r!==null?XE(r,bb.object):[null,void 0]},xb=function(r,e){var t=$l(r);return {h:t.h,s:xr(t.s+100*e,0,100),l:t.l,a:t.a}},_b=function(r){return (299*r.r+587*r.g+114*r.b)/1e3/255},YE=function(r,e){var t=$l(r);return {h:t.h,s:t.s,l:xr(t.l+100*e,0,100),a:t.a}},yb=function(){function r(e){this.parsed=mM(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1};}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return pt(_b(this.rgba),2)},r.prototype.isDark=function(){return _b(this.rgba)<.5},r.prototype.isLight=function(){return _b(this.rgba)>=.5},r.prototype.toHex=function(){return e=gb(this.rgba),t=e.r,i=e.g,s=e.b,o=(n=e.a)<1?$d(pt(255*n)):"","#"+$d(t)+$d(i)+$d(s)+o;var e,t,i,s,n,o;},r.prototype.toRgb=function(){return gb(this.rgba)},r.prototype.toRgbString=function(){return e=gb(this.rgba),t=e.r,i=e.g,s=e.b,(n=e.a)<1?"rgba("+t+", "+i+", "+s+", "+n+")":"rgb("+t+", "+i+", "+s+")";var e,t,i,s,n;},r.prototype.toHsl=function(){return zE($l(this.rgba))},r.prototype.toHslString=function(){return e=zE($l(this.rgba)),t=e.h,i=e.s,s=e.l,(n=e.a)<1?"hsla("+t+", "+i+"%, "+s+"%, "+n+")":"hsl("+t+", "+i+"%, "+s+"%)";var e,t,i,s,n;},r.prototype.toHsv=function(){return e=qE(this.rgba),{h:pt(e.h),s:pt(e.s),v:pt(e.v),a:pt(e.a,3)};var e;},r.prototype.invert=function(){return Dr({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e;},r.prototype.saturate=function(e){return e===void 0&&(e=.1),Dr(xb(this.rgba,e))},r.prototype.desaturate=function(e){return e===void 0&&(e=.1),Dr(xb(this.rgba,-e))},r.prototype.grayscale=function(){return Dr(xb(this.rgba,-1))},r.prototype.lighten=function(e){return e===void 0&&(e=.1),Dr(YE(this.rgba,e))},r.prototype.darken=function(e){return e===void 0&&(e=.1),Dr(YE(this.rgba,-e))},r.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},r.prototype.alpha=function(e){return typeof e=="number"?Dr({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):pt(this.rgba.a,3);var t;},r.prototype.hue=function(e){var t=$l(this.rgba);return typeof e=="number"?Dr({h:e,s:t.s,l:t.l,a:t.a}):pt(t.h)},r.prototype.isEqual=function(e){return this.toHex()===Dr(e).toHex()},r}(),Dr=function(r){return r instanceof yb?r:new yb(r)},$E=[],ZE=function(r){r.forEach(function(e){$E.indexOf(e)<0&&(e(yb,bb),$E.push(e));});};});function JE(r,e){var t={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",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var s in t)i[t[s]]=s;var n={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return "transparent";var a,u,l=i[this.toHex()];if(l)return l;if(o?.closest){var c=this.toRgb(),h=1/0,d="black";if(!n.length)for(var p in t)n[p]=new r(t[p]).toRgb();for(var _ in t){var b=(a=c,u=n[_],Math.pow(a.r-u.r,2)+Math.pow(a.g-u.g,2)+Math.pow(a.b-u.b,2));b<h&&(h=b,d=_);}return d}},e.string.push([function(o){var a=o.toLowerCase(),u=a==="transparent"?"#0000":t[a];return u?new r(u).toRgb():null},"name"]);}var eA=f(()=>{});var Ta,K,it=f(()=>{QE();eA();ZE([JE]);Ta=class jl{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e;}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(e){return this.value=e,this}set value(e){if(e instanceof jl)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else {if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value));}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,t){let i=typeof e;if(i!==typeof t)return false;if(i==="number"||i==="string"||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length!==t.length?false:e.every((n,o)=>n===t[o]);if(e!==null&&t!==null){let n=Object.keys(e),o=Object.keys(t);return n.length!==o.length?false:n.every(a=>e[a]===t[a])}return e===t}toRgba(){let[e,t,i,s]=this._components;return {r:e,g:t,b:i,a:s}}toRgb(){let[e,t,i]=this._components;return {r:e,g:t,b:i}}toRgbaString(){let[e,t,i]=this.toUint8RgbArray();return `rgba(${e},${t},${i},${this.alpha})`}toUint8RgbArray(e){let[t,i,s]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(t*255),e[1]=Math.round(i*255),e[2]=Math.round(s*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);let[t,i,s,n]=this._components;return e[0]=t,e[1]=i,e[2]=s,e[3]=n,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);let[t,i,s]=this._components;return e[0]=t,e[1]=i,e[2]=s,e}toNumber(){return this._int}toBgrNumber(){let[e,t,i]=this.toUint8RgbArray();return (i<<16)+(t<<8)+e}toLittleEndianNumber(){let e=this._int;return (e>>16)+(e&65280)+((e&255)<<16)}multiply(e){let[t,i,s,n]=jl._temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=i,this._components[2]*=s,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(e,t=true){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=true){if(e===1)return (255<<24)+this._int;if(e===0)return t?0:this._int;let i=this._int>>16&255,s=this._int>>8&255,n=this._int&255;return t&&(i=i*e+.5|0,s=s*e+.5|0,n=n*e+.5|0),(e*255<<24)+(i<<16)+(s<<8)+n}toHex(){let e=this._int.toString(16);return `#${"000000".substring(0,6-e.length)+e}`}toHexa(){let t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}_normalize(e){let t,i,s,n;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){let o=e;t=(o>>16&255)/255,i=(o>>8&255)/255,s=(o&255)/255,n=1;}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,i,s,n=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,i,s,n=255]=e,t/=255,i/=255,s/=255,n/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){let a=jl.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`);}let o=Dr(e);o.isValid()&&({r:t,g:i,b:s,a:n}=o.rgba,t/=255,i/=255,s/=255);}if(t!==void 0)this._components[0]=t,this._components[1]=i,this._components[2]=s,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);let[e,t,i]=this._components;this._int=(e*255<<16)+(t*255<<8)+(i*255|0);}_clamp(e,t=0,i=1){return typeof e=="number"?Math.min(Math.max(e,t),i):(e.forEach((s,n)=>{e[n]=Math.min(Math.max(s,t),i);}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof jl||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};Ta.shared=new Ta;Ta._temp=new Ta;Ta.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;K=Ta;});var jd,vb=f(()=>{jd={cullArea:null,cullable:false,cullableChildren:true};});var qd,Kd,Zd,Qd=f(()=>{qd=Math.PI*2,Kd=180/Math.PI,Zd=Math.PI/180;});var ne,Tb,jt=f(()=>{ne=class r{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t;}clone(){return new r(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return `[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Tb.x=0,Tb.y=0,Tb}},Tb=new ne;});var D,gM,xM,he=f(()=>{Qd();jt();D=class r{constructor(e=1,t=0,i=0,s=1,n=0,o=0){this.array=null,this.a=e,this.b=t,this.c=i,this.d=s,this.tx=n,this.ty=o;}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5];}set(e,t,i,s,n,o){return this.a=e,this.b=t,this.c=i,this.d=s,this.tx=n,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));let i=t||this.array;return e?(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(e,t){t=t||new ne;let i=e.x,s=e.y;return t.x=this.a*i+this.c*s+this.tx,t.y=this.b*i+this.d*s+this.ty,t}applyInverse(e,t){t=t||new ne;let i=this.a,s=this.b,n=this.c,o=this.d,a=this.tx,u=this.ty,l=1/(i*o+n*-s),c=e.x,h=e.y;return t.x=o*l*c+-n*l*h+(u*n-a*o)*l,t.y=i*l*h+-s*l*c+(-u*i+a*s)*l,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){let t=Math.cos(e),i=Math.sin(e),s=this.a,n=this.c,o=this.tx;return this.a=s*t-this.b*i,this.b=s*i+this.b*t,this.c=n*t-this.d*i,this.d=n*i+this.d*t,this.tx=o*t-this.ty*i,this.ty=o*i+this.ty*t,this}append(e){let t=this.a,i=this.b,s=this.c,n=this.d;return this.a=e.a*t+e.b*s,this.b=e.a*i+e.b*n,this.c=e.c*t+e.d*s,this.d=e.c*i+e.d*n,this.tx=e.tx*t+e.ty*s+this.tx,this.ty=e.tx*i+e.ty*n+this.ty,this}appendFrom(e,t){let i=e.a,s=e.b,n=e.c,o=e.d,a=e.tx,u=e.ty,l=t.a,c=t.b,h=t.c,d=t.d;return this.a=i*l+s*h,this.b=i*c+s*d,this.c=n*l+o*h,this.d=n*c+o*d,this.tx=a*l+u*h+t.tx,this.ty=a*c+u*d+t.ty,this}setTransform(e,t,i,s,n,o,a,u,l){return this.a=Math.cos(a+l)*n,this.b=Math.sin(a+l)*n,this.c=-Math.sin(a-u)*o,this.d=Math.cos(a-u)*o,this.tx=e-(i*this.a+s*this.c),this.ty=t-(i*this.b+s*this.d),this}prepend(e){let t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){let i=this.a,s=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=s*e.a+this.d*e.c,this.d=s*e.b+this.d*e.d;}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){let t=this.a,i=this.b,s=this.c,n=this.d,o=e.pivot,a=-Math.atan2(-s,n),u=Math.atan2(i,t),l=Math.abs(a+u);return l<1e-5||Math.abs(qd-l)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=u),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(s*s+n*n),e.position.x=this.tx+(o.x*t+o.y*s),e.position.y=this.ty+(o.x*i+o.y*n),e}invert(){let e=this.a,t=this.b,i=this.c,s=this.d,n=this.tx,o=e*s-t*i;return this.a=s/o,this.b=-t/o,this.c=-i/o,this.d=e/o,this.tx=(i*this.ty-s*n)/o,this.ty=-(e*this.ty-t*n)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){let e=new r;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return `[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return xM.identity()}static get shared(){return gM.identity()}},gM=new D,xM=new D;});var we,is=f(()=>{we=class r{constructor(e,t,i){this._x=t||0,this._y=i||0,this._observer=e;}clone(e){return new r(e??this._observer,this._x,this._y)}set(e=0,t=e){return (this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return (this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return `[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this));}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this));}};});function re(r="default"){return ql[r]===void 0&&(ql[r]=-1),++ql[r]}function tA(){for(let r in ql)delete ql[r];}var ql,lt=f(()=>{ql={default:-1};});function I(r,e,t=3){if(rA[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
|
|
1
|
+
'use strict';var eM=Object.create;var Vd=Object.defineProperty;var tM=Object.getOwnPropertyDescriptor;var rM=Object.getOwnPropertyNames;var iM=Object.getPrototypeOf,sM=Object.prototype.hasOwnProperty;var GE=r=>{throw TypeError(r)};var nM=(r,e,t)=>e in r?Vd(r,e,{enumerable:true,configurable:true,writable:true,value:t}):r[e]=t;var db=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var f=(r,e)=>()=>(r&&(e=r(r=0)),e);var ti=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),zd=(r,e)=>{for(var t in e)Vd(r,t,{get:e[t],enumerable:true});},oM=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of rM(e))!sM.call(r,s)&&s!==t&&Vd(r,s,{get:()=>e[s],enumerable:!(i=tM(e,s))||i.enumerable});return r};var Wd=(r,e,t)=>(t=r!=null?eM(iM(r)):{},oM(Vd(t,"default",{value:r,enumerable:true}),r));var L=(r,e,t)=>nM(r,typeof e!="symbol"?e+"":e,t),fb=(r,e,t)=>e.has(r)||GE("Cannot "+t);var y=(r,e,t)=>(fb(r,e,"read from private field"),t?t.call(r):e.get(r)),pe=(r,e,t)=>e.has(r)?GE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),q=(r,e,t,i)=>(fb(r,e,"write to private field"),e.set(r,t),t),X=(r,e,t)=>(fb(r,e,"access private method"),t);var Xd=(r,e,t,i)=>({set _(s){q(r,e,s);},get _(){return y(r,e,i)}});var g,pb,va,O,E=f(()=>{g=(r=>(r.Application="application",r.WebGLPipes="webgl-pipes",r.WebGLPipesAdaptor="webgl-pipes-adaptor",r.WebGLSystem="webgl-system",r.WebGPUPipes="webgpu-pipes",r.WebGPUPipesAdaptor="webgpu-pipes-adaptor",r.WebGPUSystem="webgpu-system",r.CanvasSystem="canvas-system",r.CanvasPipesAdaptor="canvas-pipes-adaptor",r.CanvasPipes="canvas-pipes",r.Asset="asset",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser",r.MaskEffect="mask-effect",r.BlendMode="blend-mode",r.TextureSource="texture-source",r.Environment="environment",r.ShapeBuilder="shape-builder",r.Batcher="batcher",r))(g||{}),pb=r=>{if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");r={...typeof r.extension!="object"?{type:r.extension}:r.extension,ref:r};}if(typeof r=="object")r={...r};else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},va=(r,e)=>pb(r).priority??e,O={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(pb).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e));}),this},add(...r){return r.map(pb).forEach(e=>{e.type.forEach(t=>{let i=this._addHandlers,s=this._queue;i[t]?i[t]?.(e):(s[t]=s[t]||[],s[t]?.push(e));});}),this},handle(r,e,t){let i=this._addHandlers,s=this._removeHandlers;if(i[r]||s[r])throw new Error(`Extension type ${r} already has a handler`);i[r]=e,s[r]=t;let n=this._queue;return n[r]&&(n[r]?.forEach(o=>e(o)),delete n[r]),this},handleByMap(r,e){return this.handle(r,t=>{t.name&&(e[t.name]=t.ref);},t=>{t.name&&delete e[t.name];})},handleByNamedList(r,e,t=-1){return this.handle(r,i=>{e.findIndex(n=>n.name===i.name)>=0||(e.push({name:i.name,value:i.ref}),e.sort((n,o)=>va(o.value,t)-va(n.value,t)));},i=>{let s=e.findIndex(n=>n.name===i.name);s!==-1&&e.splice(s,1);})},handleByList(r,e,t=-1){return this.handle(r,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((s,n)=>va(n,t)-va(s,t)));},i=>{let s=e.indexOf(i.ref);s!==-1&&e.splice(s,1);})},mixin(r,...e){for(let t of e)Object.defineProperties(r.prototype,Object.getOwnPropertyDescriptors(t));}};});var LE=ti((hO,mb)=>{var aM=Object.prototype.hasOwnProperty,Lt="~";function Yl(){}Object.create&&(Yl.prototype=Object.create(null),new Yl().__proto__||(Lt=false));function uM(r,e,t){this.fn=r,this.context=e,this.once=t||false;}function UE(r,e,t,i,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new uM(t,i||r,s),o=Lt?Lt+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],n]:r._events[o].push(n):(r._events[o]=n,r._eventsCount++),r}function Yd(r,e){--r._eventsCount===0?r._events=new Yl:delete r._events[e];}function Bt(){this._events=new Yl,this._eventsCount=0;}Bt.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)aM.call(t,i)&&e.push(Lt?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Bt.prototype.listeners=function(e){var t=Lt?Lt+e:e,i=this._events[t];if(!i)return [];if(i.fn)return [i.fn];for(var s=0,n=i.length,o=new Array(n);s<n;s++)o[s]=i[s].fn;return o};Bt.prototype.listenerCount=function(e){var t=Lt?Lt+e:e,i=this._events[t];return i?i.fn?1:i.length:0};Bt.prototype.emit=function(e,t,i,s,n,o){var a=Lt?Lt+e:e;if(!this._events[a])return false;var u=this._events[a],l=arguments.length,c,h;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,true),l){case 1:return u.fn.call(u.context),true;case 2:return u.fn.call(u.context,t),true;case 3:return u.fn.call(u.context,t,i),true;case 4:return u.fn.call(u.context,t,i,s),true;case 5:return u.fn.call(u.context,t,i,s,n),true;case 6:return u.fn.call(u.context,t,i,s,n,o),true}for(h=1,c=new Array(l-1);h<l;h++)c[h-1]=arguments[h];u.fn.apply(u.context,c);}else {var d=u.length,p;for(h=0;h<d;h++)switch(u[h].once&&this.removeListener(e,u[h].fn,void 0,true),l){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,t);break;case 3:u[h].fn.call(u[h].context,t,i);break;case 4:u[h].fn.call(u[h].context,t,i,s);break;default:if(!c)for(p=1,c=new Array(l-1);p<l;p++)c[p-1]=arguments[p];u[h].fn.apply(u[h].context,c);}}return true};Bt.prototype.on=function(e,t,i){return UE(this,e,t,i,false)};Bt.prototype.once=function(e,t,i){return UE(this,e,t,i,true)};Bt.prototype.removeListener=function(e,t,i,s){var n=Lt?Lt+e:e;if(!this._events[n])return this;if(!t)return Yd(this,n),this;var o=this._events[n];if(o.fn)o.fn===t&&(!s||o.once)&&(!i||o.context===i)&&Yd(this,n);else {for(var a=0,u=[],l=o.length;a<l;a++)(o[a].fn!==t||s&&!o[a].once||i&&o[a].context!==i)&&u.push(o[a]);u.length?this._events[n]=u.length===1?u[0]:u:Yd(this,n);}return this};Bt.prototype.removeAllListeners=function(e){var t;return e?(t=Lt?Lt+e:e,this._events[t]&&Yd(this,t)):(this._events=new Yl,this._eventsCount=0),this};Bt.prototype.off=Bt.prototype.removeListener;Bt.prototype.addListener=Bt.prototype.on;Bt.prefixed=Lt;Bt.EventEmitter=Bt;typeof mb<"u"&&(mb.exports=Bt);});var NE,ue,St=f(()=>{NE=Wd(LE()),ue=NE.default;});var lM,wi,pt,xr,jE,HE,gb,cM,$d,qE,KE,VE,zE,WE,$l,hM,dM,fM,pM,bb,XE,mM,xb,_b,YE,yb,Dr,$E,ZE,QE=f(()=>{lM={grad:.9,turn:360,rad:360/(2*Math.PI)},wi=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},pt=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*r)/t+0},xr=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),r>t?t:r>e?r:e},jE=function(r){return (r=isFinite(r)?r%360:0)>0?r:r+360},HE=function(r){return {r:xr(r.r,0,255),g:xr(r.g,0,255),b:xr(r.b,0,255),a:xr(r.a)}},gb=function(r){return {r:pt(r.r),g:pt(r.g),b:pt(r.b),a:pt(r.a,3)}},cM=/^#([0-9a-f]{3,8})$/i,$d=function(r){var e=r.toString(16);return e.length<2?"0"+e:e},qE=function(r){var e=r.r,t=r.g,i=r.b,s=r.a,n=Math.max(e,t,i),o=n-Math.min(e,t,i),a=o?n===e?(t-i)/o:n===t?2+(i-e)/o:4+(e-t)/o:0;return {h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:s}},KE=function(r){var e=r.h,t=r.s,i=r.v,s=r.a;e=e/360*6,t/=100,i/=100;var n=Math.floor(e),o=i*(1-t),a=i*(1-(e-n)*t),u=i*(1-(1-e+n)*t),l=n%6;return {r:255*[i,a,o,o,u,i][l],g:255*[u,i,i,a,o,o][l],b:255*[o,o,u,i,i,a][l],a:s}},VE=function(r){return {h:jE(r.h),s:xr(r.s,0,100),l:xr(r.l,0,100),a:xr(r.a)}},zE=function(r){return {h:pt(r.h),s:pt(r.s),l:pt(r.l),a:pt(r.a,3)}},WE=function(r){return KE((t=(e=r).s,{h:e.h,s:(t*=((i=e.l)<50?i:100-i)/100)>0?2*t/(i+t)*100:0,v:i+t,a:e.a}));var e,t,i;},$l=function(r){return {h:(e=qE(r)).h,s:(s=(200-(t=e.s))*(i=e.v)/100)>0&&s<200?t*i/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,t,i,s;},hM=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dM=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fM=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pM=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bb={string:[[function(r){var e=cM.exec(r);return e?(r=e[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?pt(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?pt(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var e=fM.exec(r)||pM.exec(r);return e?e[2]!==e[4]||e[4]!==e[6]?null:HE({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:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(r){var e=hM.exec(r)||dM.exec(r);if(!e)return null;var t,i,s=VE({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(lM[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return WE(s)},"hsl"]],object:[[function(r){var e=r.r,t=r.g,i=r.b,s=r.a,n=s===void 0?1:s;return wi(e)&&wi(t)&&wi(i)?HE({r:Number(e),g:Number(t),b:Number(i),a:Number(n)}):null},"rgb"],[function(r){var e=r.h,t=r.s,i=r.l,s=r.a,n=s===void 0?1:s;if(!wi(e)||!wi(t)||!wi(i))return null;var o=VE({h:Number(e),s:Number(t),l:Number(i),a:Number(n)});return WE(o)},"hsl"],[function(r){var e=r.h,t=r.s,i=r.v,s=r.a,n=s===void 0?1:s;if(!wi(e)||!wi(t)||!wi(i))return null;var o=function(a){return {h:jE(a.h),s:xr(a.s,0,100),v:xr(a.v,0,100),a:xr(a.a)}}({h:Number(e),s:Number(t),v:Number(i),a:Number(n)});return KE(o)},"hsv"]]},XE=function(r,e){for(var t=0;t<e.length;t++){var i=e[t][0](r);if(i)return [i,e[t][1]]}return [null,void 0]},mM=function(r){return typeof r=="string"?XE(r.trim(),bb.string):typeof r=="object"&&r!==null?XE(r,bb.object):[null,void 0]},xb=function(r,e){var t=$l(r);return {h:t.h,s:xr(t.s+100*e,0,100),l:t.l,a:t.a}},_b=function(r){return (299*r.r+587*r.g+114*r.b)/1e3/255},YE=function(r,e){var t=$l(r);return {h:t.h,s:t.s,l:xr(t.l+100*e,0,100),a:t.a}},yb=function(){function r(e){this.parsed=mM(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1};}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return pt(_b(this.rgba),2)},r.prototype.isDark=function(){return _b(this.rgba)<.5},r.prototype.isLight=function(){return _b(this.rgba)>=.5},r.prototype.toHex=function(){return e=gb(this.rgba),t=e.r,i=e.g,s=e.b,o=(n=e.a)<1?$d(pt(255*n)):"","#"+$d(t)+$d(i)+$d(s)+o;var e,t,i,s,n,o;},r.prototype.toRgb=function(){return gb(this.rgba)},r.prototype.toRgbString=function(){return e=gb(this.rgba),t=e.r,i=e.g,s=e.b,(n=e.a)<1?"rgba("+t+", "+i+", "+s+", "+n+")":"rgb("+t+", "+i+", "+s+")";var e,t,i,s,n;},r.prototype.toHsl=function(){return zE($l(this.rgba))},r.prototype.toHslString=function(){return e=zE($l(this.rgba)),t=e.h,i=e.s,s=e.l,(n=e.a)<1?"hsla("+t+", "+i+"%, "+s+"%, "+n+")":"hsl("+t+", "+i+"%, "+s+"%)";var e,t,i,s,n;},r.prototype.toHsv=function(){return e=qE(this.rgba),{h:pt(e.h),s:pt(e.s),v:pt(e.v),a:pt(e.a,3)};var e;},r.prototype.invert=function(){return Dr({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e;},r.prototype.saturate=function(e){return e===void 0&&(e=.1),Dr(xb(this.rgba,e))},r.prototype.desaturate=function(e){return e===void 0&&(e=.1),Dr(xb(this.rgba,-e))},r.prototype.grayscale=function(){return Dr(xb(this.rgba,-1))},r.prototype.lighten=function(e){return e===void 0&&(e=.1),Dr(YE(this.rgba,e))},r.prototype.darken=function(e){return e===void 0&&(e=.1),Dr(YE(this.rgba,-e))},r.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},r.prototype.alpha=function(e){return typeof e=="number"?Dr({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):pt(this.rgba.a,3);var t;},r.prototype.hue=function(e){var t=$l(this.rgba);return typeof e=="number"?Dr({h:e,s:t.s,l:t.l,a:t.a}):pt(t.h)},r.prototype.isEqual=function(e){return this.toHex()===Dr(e).toHex()},r}(),Dr=function(r){return r instanceof yb?r:new yb(r)},$E=[],ZE=function(r){r.forEach(function(e){$E.indexOf(e)<0&&(e(yb,bb),$E.push(e));});};});function JE(r,e){var t={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",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var s in t)i[t[s]]=s;var n={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return "transparent";var a,u,l=i[this.toHex()];if(l)return l;if(o?.closest){var c=this.toRgb(),h=1/0,d="black";if(!n.length)for(var p in t)n[p]=new r(t[p]).toRgb();for(var _ in t){var b=(a=c,u=n[_],Math.pow(a.r-u.r,2)+Math.pow(a.g-u.g,2)+Math.pow(a.b-u.b,2));b<h&&(h=b,d=_);}return d}},e.string.push([function(o){var a=o.toLowerCase(),u=a==="transparent"?"#0000":t[a];return u?new r(u).toRgb():null},"name"]);}var eA=f(()=>{});var Ta,K,it=f(()=>{QE();eA();ZE([JE]);Ta=class jl{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e;}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(e){return this.value=e,this}set value(e){if(e instanceof jl)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else {if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value));}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,t){let i=typeof e;if(i!==typeof t)return false;if(i==="number"||i==="string"||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length!==t.length?false:e.every((n,o)=>n===t[o]);if(e!==null&&t!==null){let n=Object.keys(e),o=Object.keys(t);return n.length!==o.length?false:n.every(a=>e[a]===t[a])}return e===t}toRgba(){let[e,t,i,s]=this._components;return {r:e,g:t,b:i,a:s}}toRgb(){let[e,t,i]=this._components;return {r:e,g:t,b:i}}toRgbaString(){let[e,t,i]=this.toUint8RgbArray();return `rgba(${e},${t},${i},${this.alpha})`}toUint8RgbArray(e){let[t,i,s]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(t*255),e[1]=Math.round(i*255),e[2]=Math.round(s*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);let[t,i,s,n]=this._components;return e[0]=t,e[1]=i,e[2]=s,e[3]=n,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);let[t,i,s]=this._components;return e[0]=t,e[1]=i,e[2]=s,e}toNumber(){return this._int}toBgrNumber(){let[e,t,i]=this.toUint8RgbArray();return (i<<16)+(t<<8)+e}toLittleEndianNumber(){let e=this._int;return (e>>16)+(e&65280)+((e&255)<<16)}multiply(e){let[t,i,s,n]=jl._temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=i,this._components[2]*=s,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(e,t=true){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=true){if(e===1)return (255<<24)+this._int;if(e===0)return t?0:this._int;let i=this._int>>16&255,s=this._int>>8&255,n=this._int&255;return t&&(i=i*e+.5|0,s=s*e+.5|0,n=n*e+.5|0),(e*255<<24)+(i<<16)+(s<<8)+n}toHex(){let e=this._int.toString(16);return `#${"000000".substring(0,6-e.length)+e}`}toHexa(){let t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}_normalize(e){let t,i,s,n;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){let o=e;t=(o>>16&255)/255,i=(o>>8&255)/255,s=(o&255)/255,n=1;}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,i,s,n=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,i,s,n=255]=e,t/=255,i/=255,s/=255,n/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){let a=jl.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`);}let o=Dr(e);o.isValid()&&({r:t,g:i,b:s,a:n}=o.rgba,t/=255,i/=255,s/=255);}if(t!==void 0)this._components[0]=t,this._components[1]=i,this._components[2]=s,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);let[e,t,i]=this._components;this._int=(e*255<<16)+(t*255<<8)+(i*255|0);}_clamp(e,t=0,i=1){return typeof e=="number"?Math.min(Math.max(e,t),i):(e.forEach((s,n)=>{e[n]=Math.min(Math.max(s,t),i);}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof jl||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};Ta.shared=new Ta;Ta._temp=new Ta;Ta.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;K=Ta;});var jd,vb=f(()=>{jd={cullArea:null,cullable:false,cullableChildren:true};});var qd,Kd,Zd,Qd=f(()=>{qd=Math.PI*2,Kd=180/Math.PI,Zd=Math.PI/180;});var ne,Tb,jt=f(()=>{ne=class r{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t;}clone(){return new r(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return `[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Tb.x=0,Tb.y=0,Tb}},Tb=new ne;});var D,gM,xM,he=f(()=>{Qd();jt();D=class r{constructor(e=1,t=0,i=0,s=1,n=0,o=0){this.array=null,this.a=e,this.b=t,this.c=i,this.d=s,this.tx=n,this.ty=o;}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5];}set(e,t,i,s,n,o){return this.a=e,this.b=t,this.c=i,this.d=s,this.tx=n,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));let i=t||this.array;return e?(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(e,t){t=t||new ne;let i=e.x,s=e.y;return t.x=this.a*i+this.c*s+this.tx,t.y=this.b*i+this.d*s+this.ty,t}applyInverse(e,t){t=t||new ne;let i=this.a,s=this.b,n=this.c,o=this.d,a=this.tx,u=this.ty,l=1/(i*o+n*-s),c=e.x,h=e.y;return t.x=o*l*c+-n*l*h+(u*n-a*o)*l,t.y=i*l*h+-s*l*c+(-u*i+a*s)*l,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){let t=Math.cos(e),i=Math.sin(e),s=this.a,n=this.c,o=this.tx;return this.a=s*t-this.b*i,this.b=s*i+this.b*t,this.c=n*t-this.d*i,this.d=n*i+this.d*t,this.tx=o*t-this.ty*i,this.ty=o*i+this.ty*t,this}append(e){let t=this.a,i=this.b,s=this.c,n=this.d;return this.a=e.a*t+e.b*s,this.b=e.a*i+e.b*n,this.c=e.c*t+e.d*s,this.d=e.c*i+e.d*n,this.tx=e.tx*t+e.ty*s+this.tx,this.ty=e.tx*i+e.ty*n+this.ty,this}appendFrom(e,t){let i=e.a,s=e.b,n=e.c,o=e.d,a=e.tx,u=e.ty,l=t.a,c=t.b,h=t.c,d=t.d;return this.a=i*l+s*h,this.b=i*c+s*d,this.c=n*l+o*h,this.d=n*c+o*d,this.tx=a*l+u*h+t.tx,this.ty=a*c+u*d+t.ty,this}setTransform(e,t,i,s,n,o,a,u,l){return this.a=Math.cos(a+l)*n,this.b=Math.sin(a+l)*n,this.c=-Math.sin(a-u)*o,this.d=Math.cos(a-u)*o,this.tx=e-(i*this.a+s*this.c),this.ty=t-(i*this.b+s*this.d),this}prepend(e){let t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){let i=this.a,s=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=s*e.a+this.d*e.c,this.d=s*e.b+this.d*e.d;}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){let t=this.a,i=this.b,s=this.c,n=this.d,o=e.pivot,a=-Math.atan2(-s,n),u=Math.atan2(i,t),l=Math.abs(a+u);return l<1e-5||Math.abs(qd-l)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=u),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(s*s+n*n),e.position.x=this.tx+(o.x*t+o.y*s),e.position.y=this.ty+(o.x*i+o.y*n),e}invert(){let e=this.a,t=this.b,i=this.c,s=this.d,n=this.tx,o=e*s-t*i;return this.a=s/o,this.b=-t/o,this.c=-i/o,this.d=e/o,this.tx=(i*this.ty-s*n)/o,this.ty=-(e*this.ty-t*n)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){let e=new r;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return `[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return xM.identity()}static get shared(){return gM.identity()}},gM=new D,xM=new D;});var we,is=f(()=>{we=class r{constructor(e,t,i){this._x=t||0,this._y=i||0,this._observer=e;}clone(e){return new r(e??this._observer,this._x,this._y)}set(e=0,t=e){return (this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return (this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return `[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this));}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this));}};});function re(r="default"){return ql[r]===void 0&&(ql[r]=-1),++ql[r]}function tA(){for(let r in ql)delete ql[r];}var ql,lt=f(()=>{ql={default:-1};});function I(r,e,t=3){if(rA[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
|
|
2
2
|
Deprecated since v${r}`):(i=i.split(`
|
|
3
3
|
`).splice(t).join(`
|
|
4
4
|
`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}
|
|
5
5
|
Deprecated since v${r}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}
|
|
6
|
-
Deprecated since v${r}`),console.warn(i))),rA[e]=true;}var rA,H,Jd,xe=f(()=>{rA={},H="8.0.0",Jd="8.3.4";});var Bi,ef=f(()=>{Bi=class{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t);}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e;}get(e){let t;return this._index>0?t=this._pool[--this._index]:t=new this._classType,t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e;}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0;}};});var Kl,Re,ri=f(()=>{ef();Kl=class{constructor(){this._poolsByClass=new Map;}prepopulate(e,t){this.getPool(e).prepopulate(t);}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e);}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new Bi(e)),this._poolsByClass.get(e)}stats(){let e={};return this._poolsByClass.forEach(t=>{let i=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[i]={free:t.totalFree,used:t.totalUsed,size:t.totalSize};}),e}},Re=new Kl;});var tf,Sb=f(()=>{xe();tf={get isCachedAsTexture(){return !!this.renderGroup?.isCachedAsTexture},cacheAsTexture(r){typeof r=="boolean"&&r===false?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(r===true?{}:r));},updateCacheTexture(){this.renderGroup?.updateCacheTexture();},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(r){I("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r);}};});function Sa(r,e,t){let i=r.length,s;if(e>=i||t===0)return;t=e+t>i?i-e:t;let n=i-t;for(s=e;s<n;++s)r[s]=r[s+t];r.length=n;}var rf=f(()=>{});var sf,Eb=f(()=>{rf();xe();sf={allowChildren:true,removeChildren(r=0,e){let t=e??this.children.length,i=t-r,s=[];if(i>0&&i<=t){for(let o=t-1;o>=r;o--){let a=this.children[o];a&&(s.push(a),a.parent=null);}Sa(this.children,r,t);let n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(s);for(let o=0;o<s.length;++o){let a=s[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,o),s[o].emit("removed",this);}return s.length>0&&this._didViewChangeTick++,s}else if(i===0&&this.children.length===0)return s;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(r){let e=this.getChildAt(r);return this.removeChild(e)},getChildAt(r){if(r<0||r>=this.children.length)throw new Error(`getChildAt: Index (${r}) does not exist.`);return this.children[r]},setChildIndex(r,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(r),this.addChildAt(r,e);},getChildIndex(r){let e=this.children.indexOf(r);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(r,e){this.allowChildren||I(H,"addChildAt: Only Containers will be allowed to add children in v8.0.0");let{children:t}=this;if(e<0||e>t.length)throw new Error(`${r}addChildAt: The index ${e} supplied is out of bounds ${t.length}`);if(r.parent){let s=r.parent.children.indexOf(r);if(r.parent===this&&s===e)return r;s!==-1&&r.parent.children.splice(s,1);}e===t.length?t.push(r):t.splice(e,0,r),r.parent=this,r.didChange=true,r._updateFlags=15;let i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(r),this.sortableChildren&&(this.sortDirty=true),this.emit("childAdded",r,this,e),r.emit("added",this),r},swapChildren(r,e){if(r===e)return;let t=this.getChildIndex(r),i=this.getChildIndex(e);this.children[t]=e,this.children[i]=r;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true),this._didContainerChangeTick++;},removeFromParent(){this.parent?.removeChild(this);},reparentChild(...r){return r.length===1?this.reparentChildAt(r[0],this.children.length):(r.forEach(e=>this.reparentChildAt(e,this.children.length)),r[0])},reparentChildAt(r,e){if(r.parent===this)return this.setChildIndex(r,e),r;let t=r.worldTransform.clone();r.removeFromParent(),this.addChildAt(r,e);let i=this.worldTransform.clone();return i.invert(),t.prepend(i),r.setFromMatrix(t),r}};});var nf,Ab=f(()=>{nf={collectRenderables(r,e,t){this.parentRenderLayer&&this.parentRenderLayer!==t||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(r,e,t):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,r):this.collectRenderablesWithEffects(r,e,t));},collectRenderablesSimple(r,e,t){let i=this.children,s=i.length;for(let n=0;n<s;n++)i[n].collectRenderables(r,e,t);},collectRenderablesWithEffects(r,e,t){let{renderPipes:i}=e;for(let s=0;s<this.effects.length;s++){let n=this.effects[s];i[n.pipe].push(n,this,r);}this.collectRenderablesSimple(r,e,t);for(let s=this.effects.length-1;s>=0;s--){let n=this.effects[s];i[n.pipe].pop(n,this,r);}}};});var Ir,Zl=f(()=>{Ir=class{constructor(){this.pipe="filter",this.priority=1;}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null;}};});var Ql,Ea,Cb=f(()=>{E();ri();Ql=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=false;}init(){this._initialized||(this._initialized=true,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e});}));}add(e){this._tests.push(e);}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){let i=this._tests[t];if(i.test(e))return Re.get(i.maskClass,e)}return e}returnMaskEffect(e){Re.return(e);}},Ea=new Ql;O.handleByList(m.MaskEffect,Ea._effectClasses);});var of,Pb=f(()=>{Zl();Cb();of={_maskEffect:null,_maskOptions:{inverse:false},_filterEffect:null,effects:[],_markStructureAsChanged(){let r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=true);},addEffect(r){this.effects.indexOf(r)===-1&&(this.effects.push(r),this.effects.sort((t,i)=>t.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple());},removeEffect(r){let e=this.effects.indexOf(r);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple());},set mask(r){let e=this._maskEffect;e?.mask!==r&&(e&&(this.removeEffect(e),Ea.returnMaskEffect(e),this._maskEffect=null),r!=null&&(this._maskEffect=Ea.getMaskEffect(r),this.addEffect(this._maskEffect)));},get mask(){return this._maskEffect?.mask},setMask(r){this._maskOptions={...this._maskOptions,...r},r.mask&&(this.mask=r.mask),this._markStructureAsChanged();},set filters(r){!Array.isArray(r)&&r&&(r=[r]);let e=this._filterEffect||(this._filterEffect=new Ir);r=r;let t=r?.length>0,i=e.filters?.length>0,s=t!==i;r=Array.isArray(r)?r.slice(0):r,e.filters=Object.freeze(r),s&&(t?this.addEffect(e):(this.removeEffect(e),e.filters=r??null));},get filters(){return this._filterEffect?.filters},set filterArea(r){this._filterEffect||(this._filterEffect=new Ir),this._filterEffect.filterArea=r;},get filterArea(){return this._filterEffect?.filterArea}};});var af,wb=f(()=>{xe();af={label:null,get name(){return I(H,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){I(H,"Container.name property has been removed, use Container.label instead"),this.label=r;},getChildByName(r,e=false){return this.getChildByLabel(r,e)},getChildByLabel(r,e=false){let t=this.children;for(let i=0;i<t.length;i++){let s=t[i];if(s.label===r||r instanceof RegExp&&r.test(s.label))return s}if(e)for(let i=0;i<t.length;i++){let n=t[i].getChildByLabel(r,true);if(n)return n}return null},getChildrenByLabel(r,e=false,t=[]){let i=this.children;for(let s=0;s<i.length;s++){let n=i[s];(n.label===r||r instanceof RegExp&&r.test(n.label))&&t.push(n);}if(e)for(let s=0;s<i.length;s++)i[s].getChildrenByLabel(r,true,t);return t}};});var uf,Z,Ze=f(()=>{jt();uf=[new ne,new ne,new ne,new ne],Z=class r{constructor(e=0,t=0,i=0,s=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(s);}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new r(0,0,0,0)}clone(){return new r(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?false:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,i,s=.5){let{width:n,height:o}=this;if(n<=0||o<=0)return false;let a=this.x,u=this.y,l=i*(1-s),c=i-l,h=a-l,d=a+n+l,p=u-l,_=u+o+l,b=a+c,x=a+n-c,g=u+c,v=u+o-c;return e>=h&&e<=d&&t>=p&&t<=_&&!(e>b&&e<x&&t>g&&t<v)}intersects(e,t){if(!t){let Y=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=Y)return false;let U=this.y<e.y?e.y:this.y;return (this.bottom>e.bottom?e.bottom:this.bottom)>U}let i=this.left,s=this.right,n=this.top,o=this.bottom;if(s<=i||o<=n)return false;let a=uf[0].set(e.left,e.top),u=uf[1].set(e.left,e.bottom),l=uf[2].set(e.right,e.top),c=uf[3].set(e.right,e.bottom);if(l.x<=a.x||u.y<=a.y)return false;let h=Math.sign(t.a*t.d-t.b*t.c);if(h===0||(t.apply(a,a),t.apply(u,u),t.apply(l,l),t.apply(c,c),Math.max(a.x,u.x,l.x,c.x)<=i||Math.min(a.x,u.x,l.x,c.x)>=s||Math.max(a.y,u.y,l.y,c.y)<=n||Math.min(a.y,u.y,l.y,c.y)>=o))return false;let d=h*(u.y-a.y),p=h*(a.x-u.x),_=d*i+p*n,b=d*s+p*n,x=d*i+p*o,g=d*s+p*o;if(Math.max(_,b,x,g)<=d*a.x+p*a.y||Math.min(_,b,x,g)>=d*c.x+p*c.y)return false;let v=h*(a.y-l.y),T=h*(l.x-a.x),S=v*i+T*n,B=v*s+T*n,A=v*i+T*o,R=v*s+T*o;return !(Math.max(S,B,A,R)<=v*a.x+T*a.y||Math.min(S,B,A,R)>=v*c.x+T*c.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){let t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),s=Math.max(this.y,e.y),n=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=s,this.height=Math.max(n-s,0),this}ceil(e=1,t=.001){let i=Math.ceil((this.x+this.width-t)*e)/e,s=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=s-this.y,this}enlarge(e){let t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),s=Math.min(this.y,e.y),n=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=s,this.height=n-s,this}getBounds(e){return e||(e=new r),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return false;let t=e.x,i=e.y,s=e.x+e.width,n=e.y+e.height;return t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height&&s>=this.x&&s<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(e,t,i,s){return this.x=e,this.y=t,this.width=i,this.height=s,this}toString(){return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};});var iA,me,Et=f(()=>{he();Ze();iA=new D,me=class r{constructor(e=1/0,t=1/0,i=-1/0,s=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=iA,this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Z);let e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=iA,this}set(e,t,i,s){this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}addFrame(e,t,i,s,n){n||(n=this.matrix);let o=n.a,a=n.b,u=n.c,l=n.d,c=n.tx,h=n.ty,d=this.minX,p=this.minY,_=this.maxX,b=this.maxY,x=o*e+u*t+c,g=a*e+l*t+h;x<d&&(d=x),g<p&&(p=g),x>_&&(_=x),g>b&&(b=g),x=o*i+u*t+c,g=a*i+l*t+h,x<d&&(d=x),g<p&&(p=g),x>_&&(_=x),g>b&&(b=g),x=o*e+u*s+c,g=a*e+l*s+h,x<d&&(d=x),g<p&&(p=g),x>_&&(_=x),g>b&&(b=g),x=o*i+u*s+c,g=a*i+l*s+h,x<d&&(d=x),g<p&&(p=g),x>_&&(_=x),g>b&&(b=g),this.minX=d,this.minY=p,this.maxX=_,this.maxY=b;}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t);}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t);}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY;}applyMatrix(e){let t=this.minX,i=this.minY,s=this.maxX,n=this.maxY,{a:o,b:a,c:u,d:l,tx:c,ty:h}=e,d=o*t+u*i+c,p=a*t+l*i+h;this.minX=d,this.minY=p,this.maxX=d,this.maxY=p,d=o*s+u*i+c,p=a*s+l*i+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*t+u*n+c,p=a*t+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*s+u*n+c,p=a*s+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY;}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,i,s){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<i&&(this.minY=i),this.maxY>s&&(this.maxY=s),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new r(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){let t=this.maxX-this.minX;this.minX=e,this.maxX=e+t;}get y(){return this.minY}set y(e){let t=this.maxY-this.minY;this.minY=e,this.maxY=e+t;}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e;}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e;}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,t,i,s){let n=this.minX,o=this.minY,a=this.maxX,u=this.maxY;s||(s=this.matrix);let l=s.a,c=s.b,h=s.c,d=s.d,p=s.tx,_=s.ty;for(let b=t;b<i;b+=2){let x=e[b],g=e[b+1],v=l*x+h*g+p,T=c*x+d*g+_;n=v<n?v:n,o=T<o?T:o,a=v>a?v:a,u=T>u?T:u;}this.minX=n,this.minY=o,this.maxX=a,this.maxY=u;}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}};});var je,Nt,ss=f(()=>{he();ef();Et();je=new Bi(D),Nt=new Bi(me);});var _M,lf,Bb=f(()=>{he();Et();ss();_M=new D,lf={getFastGlobalBounds(r,e){e||(e=new me),e.clear(),this._getGlobalBoundsRecursive(!!r,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);let t=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(t.worldTransform),e},_getGlobalBoundsRecursive(r,e,t){let i=e;if(r&&this.parentRenderLayer&&this.parentRenderLayer!==t||this.localDisplayStatus!==7||!this.measurable)return;let s=!!this.effects.length;if((this.renderGroup||s)&&(i=Nt.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else {if(this.renderPipeId){let o=this.bounds;i.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform);}let n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(r,i,t);}if(s){let n=false,o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(n||(n=true,i.applyMatrix(o.worldTransform)),this.effects[a].addBounds(i,true));n&&(i.applyMatrix(o.worldTransform.copyTo(_M).invert()),e.addBounds(i,this.relativeGroupTransform)),e.addBounds(i),Nt.return(i);}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),Nt.return(i));}};});function ii(r,e,t){t.clear();let i,s;return r.parent?e?i=r.parent.worldTransform:(s=je.get().identity(),i=Aa(r,s)):i=D.IDENTITY,sA(r,t,i,e),s&&je.return(s),t.isValid||t.set(0,0,0,0),t}function sA(r,e,t,i){if(!r.visible||!r.measurable)return;let s;i?s=r.worldTransform:(r.updateLocalTransform(),s=je.get(),s.appendFrom(r.localTransform,t));let n=e,o=!!r.effects.length;if(o&&(e=Nt.get().clear()),r.boundsArea)e.addRect(r.boundsArea,s);else {r.bounds&&(e.matrix=s,e.addBounds(r.bounds));for(let a=0;a<r.children.length;a++)sA(r.children[a],e,s,i);}if(o){for(let a=0;a<r.effects.length;a++)r.effects[a].addBounds?.(e);n.addBounds(e,D.IDENTITY),Nt.return(e);}i||je.return(s);}function Aa(r,e){let t=r.parent;return t&&(Aa(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}var vn=f(()=>{he();ss();});function Ca(r,e){if(r===16777215||!e)return e;if(e===16777215||!r)return r;let t=r>>16&255,i=r>>8&255,s=r&255,n=e>>16&255,o=e>>8&255,a=e&255,u=t*n/255|0,l=i*o/255|0,c=s*a/255|0;return (u<<16)+(l<<8)+c}var cf=f(()=>{});function ns(r,e){return r===nA?e:e===nA?r:Ca(r,e)}var nA,hf=f(()=>{cf();nA=16777215;});function Ri(r){return ((r&255)<<16)+(r&65280)+(r>>16&255)}var df,ff=f(()=>{vn();ss();hf();df={getGlobalAlpha(r){if(r)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,t=this.parent;for(;t;)e*=t.alpha,t=t.parent;return e},getGlobalTransform(r,e){if(e)return r.copyFrom(this.worldTransform);this.updateLocalTransform();let t=Aa(this,je.get().identity());return r.appendFrom(this.localTransform,t),je.return(t),r},getGlobalTint(r){if(r)return this.renderGroup?Ri(this.renderGroup.worldColor):this.parentRenderGroup?Ri(ns(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=ns(e,t.localColor),t=t.parent;return Ri(e)}};});function os(r,e,t){return e.clear(),t||(t=D.IDENTITY),oA(r,e,t,r,true),e.isValid||e.set(0,0,0,0),e}function oA(r,e,t,i,s){let n;if(s)n=je.get(),n=t.copyTo(n);else {if(!r.visible||!r.measurable)return;r.updateLocalTransform();let u=r.localTransform;n=je.get(),n.appendFrom(u,t);}let o=e,a=!!r.effects.length;if(a&&(e=Nt.get().clear()),r.boundsArea)e.addRect(r.boundsArea,n);else {r.renderPipeId&&(e.matrix=n,e.addBounds(r.bounds));let u=r.children;for(let l=0;l<u.length;l++)oA(u[l],e,n,i,false);}if(a){for(let u=0;u<r.effects.length;u++)r.effects[u].addLocalBounds?.(e,i);o.addBounds(e,D.IDENTITY),Nt.return(e);}je.return(n);}var Jl=f(()=>{he();ss();});function ec(r,e){let t=r.children;for(let i=0;i<t.length;i++){let s=t[i],n=s.uid,o=(s._didViewChangeTick&65535)<<16|s._didContainerChangeTick&65535,a=e.index;(e.data[a]!==n||e.data[a+1]!==o)&&(e.data[e.index]=n,e.data[e.index+1]=o,e.didChange=true),e.index=a+2,s.children.length&&ec(s,e);}return e.didChange}var Rb=f(()=>{});var bM,pf,Mb=f(()=>{he();Et();vn();Jl();Rb();bM=new D,pf={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(r,e){let t=Math.sign(this.scale.x)||1;e!==0?this.scale.x=r/e*t:this.scale.x=t;},_setHeight(r,e){let t=Math.sign(this.scale.y)||1;e!==0?this.scale.y=r/e*t:this.scale.y=t;},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:false,localBounds:new me});let r=this._localBoundsCacheData;return r.index=1,r.didChange=false,r.data[0]!==this._didViewChangeTick&&(r.didChange=true,r.data[0]=this._didViewChangeTick),ec(this,r),r.didChange&&os(this,r.localBounds,bM),r.localBounds},getBounds(r,e){return ii(this,r,e||new me)}};});var mf,Db=f(()=>{mf={_onRender:null,set onRender(r){let e=this.renderGroup||this.parentRenderGroup;if(!r){this._onRender&&e?.removeOnRender(this),this._onRender=null;return}this._onRender||e?.addOnRender(this),this._onRender=r;},get onRender(){return this._onRender}};});function yM(r,e){return r._zIndex-e._zIndex}var gf,Ib=f(()=>{gf={_zIndex:0,sortDirty:false,sortableChildren:false,get zIndex(){return this._zIndex},set zIndex(r){this._zIndex!==r&&(this._zIndex=r,this.depthOfChildModified());},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=true,this.parent.sortDirty=true),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true);},sortChildren(){this.sortDirty&&(this.sortDirty=false,this.children.sort(yM));}};});var xf,kb=f(()=>{jt();ss();xf={getGlobalPosition(r=new ne,e=false){return this.parent?this.parent.toGlobal(this._position,r,e):(r.x=this._position.x,r.y=this._position.y),r},toGlobal(r,e,t=false){let i=this.getGlobalTransform(je.get(),t);return e=i.apply(r,e),je.return(i),e},toLocal(r,e,t,i){e&&(r=e.toGlobal(r,t,i));let s=this.getGlobalTransform(je.get(),i);return t=s.applyInverse(r,t),je.return(s),t}};});var as,_f=f(()=>{lt();as=class{constructor(){this.uid=re("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0;}reset(){this.instructionSize=0;}add(e){this.instructions[this.instructionSize++]=e;}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"]);}};});function kr(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function tc(r){return !(r&r-1)&&!!r}function aA(r){let e=(r>65535?1:0)<<4;r>>>=e;let t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}var Pa=f(()=>{});function mt(r){let e={};for(let t in r)r[t]!==void 0&&(e[t]=r[t]);return e}var us=f(()=>{});function vM(r){let e=uA[r];return e===void 0&&(uA[r]=re("resource")),e}var uA,lA,st,Mi=f(()=>{St();lt();xe();uA=Object.create(null);lA=class cA extends ue{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=false,e={...cA.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1;}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e;}get addressMode(){return this.addressModeU}set wrapMode(e){I(H,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e;}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e;}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear");}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null;}_generateResourceId(){let e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=vM(e),this._resourceId}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners();}};lA.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};st=lA;});var hA,oe,ct=f(()=>{St();Pa();us();lt();Mi();hA=class dA extends ue{constructor(e={}){super(),this.options=e,this.uid=re("textureSource"),this._resourceType="textureSource",this._resourceId=re("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=false,this.format="rgba8unorm",this.dimension="2d",this.antialias=false,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...dA.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new st(mt(e)),this.destroyed=false,this._refreshPOT();}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange());}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e;}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e;}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e;}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e;}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e;}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e;}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e;}_onStyleChange(){this.emit("styleChange",this);}update(){if(this.resource){let e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this);}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners();}unload(){this._resourceId=re("resource"),this.emit("change",this),this.emit("unload",this);}get resourceWidth(){let{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){let{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e);}resize(e,t,i){i||(i=this._resolution),e||(e=this.width),t||(t=this.height);let s=Math.round(e*i),n=Math.round(t*i);return this.width=s/i,this.height=n/i,this._resolution=i,this.pixelWidth===s&&this.pixelHeight===n?false:(this._refreshPOT(),this.pixelWidth=s,this.pixelHeight=n,this.emit("resize",this),this._resourceId=re("resource"),this.emit("change",this),true)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this);}set wrapMode(e){this._style.wrapMode=e;}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e;}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=tc(this.pixelWidth)&&tc(this.pixelHeight);}static test(e){throw new Error("Unimplemented")}};hA.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:false,sampleCount:1,antialias:false,autoGarbageCollect:false};oe=hA;});function TM(){for(let r=0;r<16;r++){let e=[];Fb.push(e);for(let t=0;t<16;t++){let i=bf(Tn[r]*Tn[t]+En[r]*Sn[t]),s=bf(Sn[r]*Tn[t]+An[r]*Sn[t]),n=bf(Tn[r]*En[t]+En[r]*An[t]),o=bf(Sn[r]*En[t]+An[r]*An[t]);for(let a=0;a<16;a++)if(Tn[a]===i&&Sn[a]===s&&En[a]===n&&An[a]===o){e.push(a);break}}}for(let r=0;r<16;r++){let e=new D;e.set(Tn[r],Sn[r],En[r],An[r],0,0),fA.push(e);}}var Tn,Sn,En,An,Fb,fA,bf,le,yf=f(()=>{he();Tn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Sn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],En=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],An=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Fb=[],fA=[],bf=Math.sign;TM();le={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:r=>Tn[r],uY:r=>Sn[r],vX:r=>En[r],vY:r=>An[r],inv:r=>r&8?r&15:-r&7,add:(r,e)=>Fb[r][e],sub:(r,e)=>Fb[r][le.inv(e)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,e)=>Math.abs(r)*2<=Math.abs(e)?e>=0?le.S:le.N:Math.abs(e)*2<=Math.abs(r)?r>0?le.E:le.W:e>0?r>0?le.SE:le.SW:r>0?le.NE:le.NW,matrixAppendRotationInv:(r,e,t=0,i=0)=>{let s=fA[le.inv(e)];s.tx=t,s.ty=i,r.append(s);}};});var rc,Ob=f(()=>{rc=()=>{};});var Di,vf=f(()=>{E();ct();Di=class extends oe{constructor(e){let t=e.resource||new Float32Array(e.width*e.height*4),i=e.format;i||(t instanceof Float32Array?i="rgba32float":t instanceof Int32Array||t instanceof Uint32Array?i="rgba32uint":t instanceof Int16Array||t instanceof Uint16Array?i="rgba16uint":(i="bgra8unorm")),super({...e,resource:t,format:i}),this.uploadMethodId="buffer";}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}};Di.extension=m.TextureSource;});var pA,ls,Tf=f(()=>{he();pA=new D,ls=class{constructor(e,t){this.mapCoord=new D,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof t>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=t,this.isSimple=false,this.texture=e;}get texture(){return this._texture}set texture(e){this.texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update());}multiplyUvs(e,t){t===void 0&&(t=e);let i=this.mapCoord;for(let s=0;s<e.length;s+=2){let n=e[s],o=e[s+1];t[s]=n*i.a+o*i.c+i.tx,t[s+1]=n*i.b+o*i.d+i.ty;}return t}update(){let e=this._texture;this._updateID++;let t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);let i=e.orig,s=e.trim;s&&(pA.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(pA));let n=e.source,o=this.uClampFrame,a=this.clampMargin/n._resolution,u=this.clampOffset/n._resolution;return o[0]=(e.frame.x+a+u)/n.width,o[1]=(e.frame.y+a+u)/n.height,o[2]=(e.frame.x+e.frame.width-a+u)/n.width,o[3]=(e.frame.y+e.frame.height-a+u)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=e.frame.width===n.width&&e.frame.height===n.height&&e.rotate===0,true}};});var C,ce=f(()=>{St();yf();Ze();lt();xe();Ob();vf();ct();Tf();C=class extends ue{constructor({source:e,label:t,frame:i,orig:s,trim:n,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=re("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Z,this.noFrame=false,this.dynamic=false,this.isTexture=true,this.label=t,this.source=e?.source??new oe,this.noFrame=!i,i)this.frame.copyFrom(i);else {let{width:c,height:h}=this._source;this.frame.width=c,this.frame.height=h;}this.orig=s||this.frame,this.trim=n,this.rotate=u??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=false,this.dynamic=l||false,this.updateUvs();}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this);}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new ls(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:e,frame:t}=this,{width:i,height:s}=this._source,n=t.x/i,o=t.y/s,a=t.width/i,u=t.height/s,l=this.rotate;if(l){let c=a/2,h=u/2,d=n+c,p=o+h;l=le.add(l,le.NW),e.x0=d+c*le.uX(l),e.y0=p+h*le.uY(l),l=le.add(l,2),e.x1=d+c*le.uX(l),e.y1=p+h*le.uY(l),l=le.add(l,2),e.x2=d+c*le.uX(l),e.y2=p+h*le.uY(l),l=le.add(l,2),e.x3=d+c*le.uX(l),e.y3=p+h*le.uY(l);}else e.x0=n,e.y0=o,e.x1=n+a,e.y1=o,e.x2=n+a,e.y2=o+u,e.x3=n,e.y3=o+u;}destroy(e=false){this._source&&e&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=true,this.emit("destroy",this),this.removeAllListeners();}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this);}get baseTexture(){return I(H,"Texture.baseTexture is now Texture.source"),this._source}};C.EMPTY=new C({label:"EMPTY",source:new oe({label:"EMPTY"})});C.EMPTY.destroy=rc;C.WHITE=new C({source:new Di({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});C.WHITE.destroy=rc;});var SM,ic,be,Fr=f(()=>{Pa();ct();ce();Mi();SM=0,ic=class{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=false,this.textureStyle=new st(this.textureOptions);}createTexture(e,t,i){let s=new oe({...this.textureOptions,width:e,height:t,resolution:1,antialias:i,autoGarbageCollect:false});return new C({source:s,label:`texturePool_${SM++}`})}getOptimalTexture(e,t,i=1,s){let n=Math.ceil(e*i-1e-6),o=Math.ceil(t*i-1e-6);n=kr(n),o=kr(o);let a=(n<<17)+(o<<1)+(s?1:0);this._texturePool[a]||(this._texturePool[a]=[]);let u=this._texturePool[a].pop();return u||(u=this.createTexture(n,o,s)),u.source._resolution=i,u.source.width=n/i,u.source.height=o/i,u.source.pixelWidth=n,u.source.pixelHeight=o,u.frame.x=0,u.frame.y=0,u.frame.width=e,u.frame.height=t,u.updateUvs(),this._poolKeyHash[u.uid]=a,u}getSameSizeTexture(e,t=false){let i=e.source;return this.getOptimalTexture(e.width,e.height,i._resolution,t)}returnTexture(e,t=false){let i=this._poolKeyHash[e.uid];t&&(e.source.style=this.textureStyle),this._texturePool[i].push(e);}clear(e){if(e=e!==false,e)for(let t in this._texturePool){let i=this._texturePool[t];if(i)for(let s=0;s<i.length;s++)i[s].destroy(true);}this._texturePool={};}},be=new ic;});var wa,Gb=f(()=>{he();_f();Fr();wa=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=false,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new D,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=true,this.instructionSet=new as,this._onRenderContainers=[],this.textureNeedsUpdate=true,this.isCachedAsTexture=false,this._matrixDirty=7;}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=true;let t=e.children;for(let i=0;i<t.length;i++){let s=t[i];s._updateFlags=15,this.addChild(s);}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=true,this.textureNeedsUpdate=true;}disableCacheAsTexture(){this.isCachedAsTexture=false,this.texture&&(be.returnTexture(this.texture),this.texture=null);}updateCacheTexture(){this.textureNeedsUpdate=true;}reset(){this.renderGroupChildren.length=0;for(let e in this.childrenToUpdate){let t=this.childrenToUpdate[e];t.list.fill(null),t.index=0;}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=true,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture();}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e);}_removeRenderGroupChild(e){let t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null;}addChild(e){if(this.structureDidChange=true,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=true,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);let t=e.children;for(let i=0;i<t.length;i++)this.addChild(t[i]);}removeChild(e){if(this.structureDidChange=true,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}let t=e.children;for(let i=0;i<t.length;i++)this.removeChild(t[i]);}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t]);}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||(t=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),t.list[t.index++]=e;}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=false);}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e;}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e);}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1);}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e);}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null;}getChildren(e=[]){let t=this.root.children;for(let i=0;i<t.length;i++)this._getChildren(t[i],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;let i=e.children;for(let s=0;s<i.length;s++)this._getChildren(i[s],t);return t}invalidateMatrices(){this._matrixDirty=7;}get inverseWorldTransform(){return (this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new D),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return (this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new D),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;let e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new D),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};});function Cn(r,e,t={}){for(let i in e)!t[i]&&e[i]!==void 0&&(r[i]=e[i]);}var Sf=f(()=>{});var Ub,Lb,Nb,Pn,Ba,cs,mA,te,qt=f(()=>{St();it();vb();E();he();Qd();is();lt();xe();ri();Sb();Eb();Ab();Pb();wb();Bb();ff();Mb();Db();Ib();kb();Gb();Sf();Ub=new we(null),Lb=new we(null),Nb=new we(null,1,1),Pn=1,Ba=2,cs=4,mA=8,te=class r extends ue{constructor(e={}){super(),this.uid=re("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=false,this.didViewUpdate=false,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=true,this.measurable=true,this.isSimple=true,this.updateTick=-1,this.localTransform=new D,this.relativeGroupTransform=new D,this.groupTransform=this.relativeGroupTransform,this.destroyed=false,this._position=new we(this,0,0),this._scale=Nb,this._pivot=Lb,this._skew=Ub,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Cn(this,e,{children:true,parent:true,effects:true}),e.children?.forEach(t=>this.addChild(t)),e.parent?.addChild(this);}static mixin(e){I("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),O.mixin(r,e);}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095;}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||I(H,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let s=0;s<e.length;s++)this.addChild(e[s]);return e[0]}let t=e[0],i=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),i&&(i.structureDidChange=true),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=true),t.parent=this,t.didChange=true,t._updateFlags=15,i&&i.addChild(t),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let s=0;s<e.length;s++)this.removeChild(e[s]);return e[0]}let t=e[0],i=this.children.indexOf(t);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit("childRemoved",t,this,i),t.emit("removed",this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=true,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this));}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup());}get isRenderGroup(){return !!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=Re.get(wa,this),this.groupTransform=D.IDENTITY,e?.addChild(this),this._updateIsSimple();}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),Re.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple();}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0;}get worldTransform(){return this._worldTransform||(this._worldTransform=new D),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e;}get y(){return this._position.y}set y(e){this._position.y=e;}get position(){return this._position}set position(e){this._position.copyFrom(e);}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew));}get angle(){return this.rotation*Kd}set angle(e){this.rotation=e*Zd;}get pivot(){return this._pivot===Lb&&(this._pivot=new we(this,0,0)),this._pivot}set pivot(e){this._pivot===Lb&&(this._pivot=new we(this,0,0)),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e);}get skew(){return this._skew===Ub&&(this._skew=new we(this,0,0)),this._skew}set skew(e){this._skew===Ub&&(this._skew=new we(this,0,0)),this._skew.copyFrom(e);}get scale(){return this._scale===Nb&&(this._scale=new we(this,1,1)),this._scale}set scale(e){this._scale===Nb&&(this._scale=new we(this,0,0)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e);}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){let t=this.getLocalBounds().width;this._setWidth(e,t);}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){let t=this.getLocalBounds().height;this._setHeight(e,t);}getSize(e){e||(e={});let t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){let i=this.getLocalBounds();typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,i.width),t!==void 0&&this._setHeight(t,i.height);}_updateSkew(){let e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x);}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this}setFromMatrix(e){e.decompose(this);}updateLocalTransform(){let e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;let t=this.localTransform,i=this._scale,s=this._pivot,n=this._position,o=i._x,a=i._y,u=s._x,l=s._y;t.a=this._cx*o,t.b=this._sx*o,t.c=this._cy*a,t.d=this._sy*a,t.tx=n._x-(u*t.a+l*t.c),t.ty=n._y-(u*t.b+l*t.d);}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=Pn,this._onUpdate());}get alpha(){return this.localAlpha}set tint(e){let i=K.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=Pn,this._onUpdate());}get tint(){return Ri(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=Ba,this.localBlendMode=e,this._onUpdate());}get blendMode(){return this.localBlendMode}get visible(){return !!(this.localDisplayStatus&2)}set visible(e){let t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=cs,this.localDisplayStatus^=2,this._onUpdate());}get culled(){return !(this.localDisplayStatus&4)}set culled(e){let t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=cs,this.localDisplayStatus^=4,this._onUpdate());}get renderable(){return !!(this.localDisplayStatus&1)}set renderable(e){let t=e?1:0;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=cs,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._onUpdate());}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=false){if(this.destroyed)return;this.destroyed=true;let t;if(this.children.length&&(t=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e?.children)&&t)for(let s=0;s<t.length;++s)t[s].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null;}};O.mixin(te,sf,lf,xf,mf,pf,of,af,gf,jd,tf,df,nf);});var si,sc=f(()=>{jt();si=class r{constructor(e){this.bubbles=true,this.cancelBubble=true,this.cancelable=false,this.composed=false,this.defaultPrevented=false,this.eventPhase=r.prototype.NONE,this.propagationStopped=false,this.propagationImmediatelyStopped=false,this.layer=new ne,this.page=new ne,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e;}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,s,n){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=true;}stopImmediatePropagation(){this.propagationImmediatelyStopped=true;}stopPropagation(){this.propagationStopped=true;}};});function EM(r){return function(e){return e.test(r)}}function nc(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var s=EM(t),n={apple:{phone:s(Hb)&&!s(Ii),ipod:s(gA),tablet:!s(Hb)&&(s(xA)||CA(e))&&!s(Ii),universal:s(_A),device:(s(Hb)||s(gA)||s(xA)||s(_A)||CA(e))&&!s(Ii)},amazon:{phone:s(Ra),tablet:!s(Ra)&&s(Ef),device:s(Ra)||s(Ef)},android:{phone:!s(Ii)&&s(Ra)||!s(Ii)&&s(Vb),tablet:!s(Ii)&&!s(Ra)&&!s(Vb)&&(s(Ef)||s(bA)),device:!s(Ii)&&(s(Ra)||s(Ef)||s(Vb)||s(bA))||s(/\bokhttp\b/i)},windows:{phone:s(Ii),tablet:s(yA),device:s(Ii)||s(yA)},other:{blackberry:s(vA),blackberry10:s(TA),opera:s(SA),firefox:s(AA),chrome:s(EA),device:s(vA)||s(TA)||s(SA)||s(AA)||s(EA)},any:false,phone:false,tablet:false};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}var Hb,gA,xA,_A,Vb,bA,Ra,Ef,Ii,yA,vA,TA,SA,EA,AA,CA,zb=f(()=>{Hb=/iPhone/i,gA=/iPod/i,xA=/iPad/i,_A=/\biOS-universal(?:.+)Mac\b/i,Vb=/\bAndroid(?:.+)Mobile\b/i,bA=/Android/i,Ra=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Ef=/Silk/i,Ii=/Windows Phone/i,yA=/\bWindows(?:.+)ARM\b/i,vA=/BlackBerry/i,TA=/BB10/i,SA=/Opera Mini/i,EA=/\b(CriOS|Chrome)(?:.+)Mobile/i,AA=/Mobile(?:.+)Firefox\b/i,CA=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};});var PA=f(()=>{zb();zb();});var AM,Af,Wb=f(()=>{PA();AM=nc.default??nc,Af=AM(globalThis.navigator);});var CM,Cf,PM,wM,wA,BA,BM,RM,MM,Xb,Pf,Yb=f(()=>{sc();E();Wb();rf();CM=9,Cf=100,PM=0,wM=0,wA=2,BA=1,BM=-1e3,RM=-1e3,MM=2,Xb=class RA{constructor(e,t=Af){this._mobileInfo=t,this.debug=false,this._activateOnTab=true,this._deactivateOnMouseMove=true,this._isActive=false,this._isMobileAccessibility=false,this._div=null,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e;}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){let e=document.createElement("button");e.style.width=`${BA}px`,e.style.height=`${BA}px`,e.style.position="absolute",e.style.top=`${BM}px`,e.style.left=`${RM}px`,e.style.zIndex=MM.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=true,this._activate(),this._destroyTouchHook();}),document.body.appendChild(e),this._hookDiv=e;}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null);}_activate(){if(this._isActive)return;this._isActive=true,this._div||(this._div=document.createElement("div"),this._div.style.width=`${Cf}px`,this._div.style.height=`${Cf}px`,this._div.style.position="absolute",this._div.style.top=`${PM}px`,this._div.style.left=`${wM}px`,this._div.style.zIndex=wA.toString(),this._div.style.pointerEvents="none"),this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._deactivateOnMouseMove&&(this._onMouseMove=this._onMouseMove.bind(this),globalThis.document.addEventListener("mousemove",this._onMouseMove,true));let e=this._renderer.view.canvas;if(e.parentNode)e.parentNode.appendChild(this._div),this._initAccessibilitySetup();else {let t=new MutationObserver(()=>{e.parentNode&&(e.parentNode.appendChild(this._div),t.disconnect(),this._initAccessibilitySetup());});t.observe(document.body,{childList:true,subtree:true});}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered);}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=false,globalThis.document.removeEventListener("mousemove",this._onMouseMove,true),this._activateOnTab&&globalThis.addEventListener("keydown",this._onKeyDown,false),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv&&e._accessibleDiv.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=false;this._pool.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e);}),this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pool=[],this._children=[];}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i]);}init(e){let i={accessibilityOptions:{...RA.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault?this._activate():this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._renderer.runners.postrender.remove(this);}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i));}for(let i=this._children.length-1;i>=0;i--){let s=this._children[i];t.has(i)||(s._accessibleDiv&&s._accessibleDiv.parentNode&&(s._accessibleDiv.parentNode.removeChild(s._accessibleDiv),this._pool.push(s._accessibleDiv),s._accessibleDiv=null),s._accessibleActive=false,Sa(this._children,i,1));}if(this._renderer.renderingToScreen){let{x:i,y:s,width:n,height:o}=this._renderer.screen,a=this._div;a.style.left=`${i}px`,a.style.top=`${s}px`,a.style.width=`${n}px`,a.style.height=`${o}px`;}for(let i=0;i<this._children.length;i++){let s=this._children[i];if(!s._accessibleActive||!s._accessibleDiv)continue;let n=s._accessibleDiv,o=s.hitArea||s.getBounds().rectangle;if(s.hitArea){let a=s.worldTransform,u=this._renderer.resolution,l=this._renderer.resolution;n.style.left=`${(a.tx+o.x*a.a)*u}px`,n.style.top=`${(a.ty+o.y*a.d)*l}px`,n.style.width=`${o.width*a.a*u}px`,n.style.height=`${o.height*a.d*l}px`;}else {this._capHitArea(o);let a=this._renderer.resolution,u=this._renderer.resolution;n.style.left=`${o.x*a}px`,n.style.top=`${o.y*u}px`,n.style.width=`${o.width*a}px`,n.style.height=`${o.height*u}px`;}}this._renderId++;}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`;}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y);}_addChild(e){let t=this._pool.pop();t||(e.accessibleType==="button"?t=document.createElement("button"):(t=document.createElement(e.accessibleType),t.style.cssText=`
|
|
6
|
+
Deprecated since v${r}`),console.warn(i))),rA[e]=true;}var rA,H,Jd,xe=f(()=>{rA={},H="8.0.0",Jd="8.3.4";});var Bi,ef=f(()=>{Bi=class{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t);}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e;}get(e){let t;return this._index>0?t=this._pool[--this._index]:t=new this._classType,t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e;}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0;}};});var Kl,Re,ri=f(()=>{ef();Kl=class{constructor(){this._poolsByClass=new Map;}prepopulate(e,t){this.getPool(e).prepopulate(t);}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e);}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new Bi(e)),this._poolsByClass.get(e)}stats(){let e={};return this._poolsByClass.forEach(t=>{let i=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[i]={free:t.totalFree,used:t.totalUsed,size:t.totalSize};}),e}},Re=new Kl;});var tf,Sb=f(()=>{xe();tf={get isCachedAsTexture(){return !!this.renderGroup?.isCachedAsTexture},cacheAsTexture(r){typeof r=="boolean"&&r===false?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(r===true?{}:r));},updateCacheTexture(){this.renderGroup?.updateCacheTexture();},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(r){I("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r);}};});function Sa(r,e,t){let i=r.length,s;if(e>=i||t===0)return;t=e+t>i?i-e:t;let n=i-t;for(s=e;s<n;++s)r[s]=r[s+t];r.length=n;}var rf=f(()=>{});var sf,Eb=f(()=>{rf();xe();sf={allowChildren:true,removeChildren(r=0,e){let t=e??this.children.length,i=t-r,s=[];if(i>0&&i<=t){for(let o=t-1;o>=r;o--){let a=this.children[o];a&&(s.push(a),a.parent=null);}Sa(this.children,r,t);let n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(s);for(let o=0;o<s.length;++o){let a=s[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,o),s[o].emit("removed",this);}return s.length>0&&this._didViewChangeTick++,s}else if(i===0&&this.children.length===0)return s;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(r){let e=this.getChildAt(r);return this.removeChild(e)},getChildAt(r){if(r<0||r>=this.children.length)throw new Error(`getChildAt: Index (${r}) does not exist.`);return this.children[r]},setChildIndex(r,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(r),this.addChildAt(r,e);},getChildIndex(r){let e=this.children.indexOf(r);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(r,e){this.allowChildren||I(H,"addChildAt: Only Containers will be allowed to add children in v8.0.0");let{children:t}=this;if(e<0||e>t.length)throw new Error(`${r}addChildAt: The index ${e} supplied is out of bounds ${t.length}`);if(r.parent){let s=r.parent.children.indexOf(r);if(r.parent===this&&s===e)return r;s!==-1&&r.parent.children.splice(s,1);}e===t.length?t.push(r):t.splice(e,0,r),r.parent=this,r.didChange=true,r._updateFlags=15;let i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(r),this.sortableChildren&&(this.sortDirty=true),this.emit("childAdded",r,this,e),r.emit("added",this),r},swapChildren(r,e){if(r===e)return;let t=this.getChildIndex(r),i=this.getChildIndex(e);this.children[t]=e,this.children[i]=r;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true),this._didContainerChangeTick++;},removeFromParent(){this.parent?.removeChild(this);},reparentChild(...r){return r.length===1?this.reparentChildAt(r[0],this.children.length):(r.forEach(e=>this.reparentChildAt(e,this.children.length)),r[0])},reparentChildAt(r,e){if(r.parent===this)return this.setChildIndex(r,e),r;let t=r.worldTransform.clone();r.removeFromParent(),this.addChildAt(r,e);let i=this.worldTransform.clone();return i.invert(),t.prepend(i),r.setFromMatrix(t),r}};});var nf,Ab=f(()=>{nf={collectRenderables(r,e,t){this.parentRenderLayer&&this.parentRenderLayer!==t||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(r,e,t):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,r):this.collectRenderablesWithEffects(r,e,t));},collectRenderablesSimple(r,e,t){let i=this.children,s=i.length;for(let n=0;n<s;n++)i[n].collectRenderables(r,e,t);},collectRenderablesWithEffects(r,e,t){let{renderPipes:i}=e;for(let s=0;s<this.effects.length;s++){let n=this.effects[s];i[n.pipe].push(n,this,r);}this.collectRenderablesSimple(r,e,t);for(let s=this.effects.length-1;s>=0;s--){let n=this.effects[s];i[n.pipe].pop(n,this,r);}}};});var Ir,Zl=f(()=>{Ir=class{constructor(){this.pipe="filter",this.priority=1;}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null;}};});var Ql,Ea,Cb=f(()=>{E();ri();Ql=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=false;}init(){this._initialized||(this._initialized=true,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e});}));}add(e){this._tests.push(e);}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){let i=this._tests[t];if(i.test(e))return Re.get(i.maskClass,e)}return e}returnMaskEffect(e){Re.return(e);}},Ea=new Ql;O.handleByList(g.MaskEffect,Ea._effectClasses);});var of,Pb=f(()=>{Zl();Cb();of={_maskEffect:null,_maskOptions:{inverse:false},_filterEffect:null,effects:[],_markStructureAsChanged(){let r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=true);},addEffect(r){this.effects.indexOf(r)===-1&&(this.effects.push(r),this.effects.sort((t,i)=>t.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple());},removeEffect(r){let e=this.effects.indexOf(r);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple());},set mask(r){let e=this._maskEffect;e?.mask!==r&&(e&&(this.removeEffect(e),Ea.returnMaskEffect(e),this._maskEffect=null),r!=null&&(this._maskEffect=Ea.getMaskEffect(r),this.addEffect(this._maskEffect)));},get mask(){return this._maskEffect?.mask},setMask(r){this._maskOptions={...this._maskOptions,...r},r.mask&&(this.mask=r.mask),this._markStructureAsChanged();},set filters(r){!Array.isArray(r)&&r&&(r=[r]);let e=this._filterEffect||(this._filterEffect=new Ir);r=r;let t=r?.length>0,i=e.filters?.length>0,s=t!==i;r=Array.isArray(r)?r.slice(0):r,e.filters=Object.freeze(r),s&&(t?this.addEffect(e):(this.removeEffect(e),e.filters=r??null));},get filters(){return this._filterEffect?.filters},set filterArea(r){this._filterEffect||(this._filterEffect=new Ir),this._filterEffect.filterArea=r;},get filterArea(){return this._filterEffect?.filterArea}};});var af,wb=f(()=>{xe();af={label:null,get name(){return I(H,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){I(H,"Container.name property has been removed, use Container.label instead"),this.label=r;},getChildByName(r,e=false){return this.getChildByLabel(r,e)},getChildByLabel(r,e=false){let t=this.children;for(let i=0;i<t.length;i++){let s=t[i];if(s.label===r||r instanceof RegExp&&r.test(s.label))return s}if(e)for(let i=0;i<t.length;i++){let n=t[i].getChildByLabel(r,true);if(n)return n}return null},getChildrenByLabel(r,e=false,t=[]){let i=this.children;for(let s=0;s<i.length;s++){let n=i[s];(n.label===r||r instanceof RegExp&&r.test(n.label))&&t.push(n);}if(e)for(let s=0;s<i.length;s++)i[s].getChildrenByLabel(r,true,t);return t}};});var uf,Z,Ze=f(()=>{jt();uf=[new ne,new ne,new ne,new ne],Z=class r{constructor(e=0,t=0,i=0,s=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(s);}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new r(0,0,0,0)}clone(){return new r(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?false:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,i,s=.5){let{width:n,height:o}=this;if(n<=0||o<=0)return false;let a=this.x,u=this.y,l=i*(1-s),c=i-l,h=a-l,d=a+n+l,p=u-l,_=u+o+l,b=a+c,x=a+n-c,m=u+c,v=u+o-c;return e>=h&&e<=d&&t>=p&&t<=_&&!(e>b&&e<x&&t>m&&t<v)}intersects(e,t){if(!t){let Y=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=Y)return false;let U=this.y<e.y?e.y:this.y;return (this.bottom>e.bottom?e.bottom:this.bottom)>U}let i=this.left,s=this.right,n=this.top,o=this.bottom;if(s<=i||o<=n)return false;let a=uf[0].set(e.left,e.top),u=uf[1].set(e.left,e.bottom),l=uf[2].set(e.right,e.top),c=uf[3].set(e.right,e.bottom);if(l.x<=a.x||u.y<=a.y)return false;let h=Math.sign(t.a*t.d-t.b*t.c);if(h===0||(t.apply(a,a),t.apply(u,u),t.apply(l,l),t.apply(c,c),Math.max(a.x,u.x,l.x,c.x)<=i||Math.min(a.x,u.x,l.x,c.x)>=s||Math.max(a.y,u.y,l.y,c.y)<=n||Math.min(a.y,u.y,l.y,c.y)>=o))return false;let d=h*(u.y-a.y),p=h*(a.x-u.x),_=d*i+p*n,b=d*s+p*n,x=d*i+p*o,m=d*s+p*o;if(Math.max(_,b,x,m)<=d*a.x+p*a.y||Math.min(_,b,x,m)>=d*c.x+p*c.y)return false;let v=h*(a.y-l.y),T=h*(l.x-a.x),S=v*i+T*n,B=v*s+T*n,A=v*i+T*o,R=v*s+T*o;return !(Math.max(S,B,A,R)<=v*a.x+T*a.y||Math.min(S,B,A,R)>=v*c.x+T*c.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){let t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),s=Math.max(this.y,e.y),n=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=s,this.height=Math.max(n-s,0),this}ceil(e=1,t=.001){let i=Math.ceil((this.x+this.width-t)*e)/e,s=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=s-this.y,this}enlarge(e){let t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),s=Math.min(this.y,e.y),n=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=s,this.height=n-s,this}getBounds(e){return e||(e=new r),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return false;let t=e.x,i=e.y,s=e.x+e.width,n=e.y+e.height;return t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height&&s>=this.x&&s<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(e,t,i,s){return this.x=e,this.y=t,this.width=i,this.height=s,this}toString(){return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};});var iA,me,Et=f(()=>{he();Ze();iA=new D,me=class r{constructor(e=1/0,t=1/0,i=-1/0,s=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=iA,this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Z);let e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=iA,this}set(e,t,i,s){this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}addFrame(e,t,i,s,n){n||(n=this.matrix);let o=n.a,a=n.b,u=n.c,l=n.d,c=n.tx,h=n.ty,d=this.minX,p=this.minY,_=this.maxX,b=this.maxY,x=o*e+u*t+c,m=a*e+l*t+h;x<d&&(d=x),m<p&&(p=m),x>_&&(_=x),m>b&&(b=m),x=o*i+u*t+c,m=a*i+l*t+h,x<d&&(d=x),m<p&&(p=m),x>_&&(_=x),m>b&&(b=m),x=o*e+u*s+c,m=a*e+l*s+h,x<d&&(d=x),m<p&&(p=m),x>_&&(_=x),m>b&&(b=m),x=o*i+u*s+c,m=a*i+l*s+h,x<d&&(d=x),m<p&&(p=m),x>_&&(_=x),m>b&&(b=m),this.minX=d,this.minY=p,this.maxX=_,this.maxY=b;}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t);}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t);}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY;}applyMatrix(e){let t=this.minX,i=this.minY,s=this.maxX,n=this.maxY,{a:o,b:a,c:u,d:l,tx:c,ty:h}=e,d=o*t+u*i+c,p=a*t+l*i+h;this.minX=d,this.minY=p,this.maxX=d,this.maxY=p,d=o*s+u*i+c,p=a*s+l*i+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*t+u*n+c,p=a*t+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*s+u*n+c,p=a*s+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY;}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,i,s){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<i&&(this.minY=i),this.maxY>s&&(this.maxY=s),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new r(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){let t=this.maxX-this.minX;this.minX=e,this.maxX=e+t;}get y(){return this.minY}set y(e){let t=this.maxY-this.minY;this.minY=e,this.maxY=e+t;}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e;}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e;}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,t,i,s){let n=this.minX,o=this.minY,a=this.maxX,u=this.maxY;s||(s=this.matrix);let l=s.a,c=s.b,h=s.c,d=s.d,p=s.tx,_=s.ty;for(let b=t;b<i;b+=2){let x=e[b],m=e[b+1],v=l*x+h*m+p,T=c*x+d*m+_;n=v<n?v:n,o=T<o?T:o,a=v>a?v:a,u=T>u?T:u;}this.minX=n,this.minY=o,this.maxX=a,this.maxY=u;}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}};});var je,Nt,ss=f(()=>{he();ef();Et();je=new Bi(D),Nt=new Bi(me);});var _M,lf,Bb=f(()=>{he();Et();ss();_M=new D,lf={getFastGlobalBounds(r,e){e||(e=new me),e.clear(),this._getGlobalBoundsRecursive(!!r,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);let t=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(t.worldTransform),e},_getGlobalBoundsRecursive(r,e,t){let i=e;if(r&&this.parentRenderLayer&&this.parentRenderLayer!==t||this.localDisplayStatus!==7||!this.measurable)return;let s=!!this.effects.length;if((this.renderGroup||s)&&(i=Nt.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else {if(this.renderPipeId){let o=this.bounds;i.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform);}let n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(r,i,t);}if(s){let n=false,o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(n||(n=true,i.applyMatrix(o.worldTransform)),this.effects[a].addBounds(i,true));n&&(i.applyMatrix(o.worldTransform.copyTo(_M).invert()),e.addBounds(i,this.relativeGroupTransform)),e.addBounds(i),Nt.return(i);}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),Nt.return(i));}};});function ii(r,e,t){t.clear();let i,s;return r.parent?e?i=r.parent.worldTransform:(s=je.get().identity(),i=Aa(r,s)):i=D.IDENTITY,sA(r,t,i,e),s&&je.return(s),t.isValid||t.set(0,0,0,0),t}function sA(r,e,t,i){if(!r.visible||!r.measurable)return;let s;i?s=r.worldTransform:(r.updateLocalTransform(),s=je.get(),s.appendFrom(r.localTransform,t));let n=e,o=!!r.effects.length;if(o&&(e=Nt.get().clear()),r.boundsArea)e.addRect(r.boundsArea,s);else {r.bounds&&(e.matrix=s,e.addBounds(r.bounds));for(let a=0;a<r.children.length;a++)sA(r.children[a],e,s,i);}if(o){for(let a=0;a<r.effects.length;a++)r.effects[a].addBounds?.(e);n.addBounds(e,D.IDENTITY),Nt.return(e);}i||je.return(s);}function Aa(r,e){let t=r.parent;return t&&(Aa(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}var vn=f(()=>{he();ss();});function Ca(r,e){if(r===16777215||!e)return e;if(e===16777215||!r)return r;let t=r>>16&255,i=r>>8&255,s=r&255,n=e>>16&255,o=e>>8&255,a=e&255,u=t*n/255|0,l=i*o/255|0,c=s*a/255|0;return (u<<16)+(l<<8)+c}var cf=f(()=>{});function ns(r,e){return r===nA?e:e===nA?r:Ca(r,e)}var nA,hf=f(()=>{cf();nA=16777215;});function Ri(r){return ((r&255)<<16)+(r&65280)+(r>>16&255)}var df,ff=f(()=>{vn();ss();hf();df={getGlobalAlpha(r){if(r)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,t=this.parent;for(;t;)e*=t.alpha,t=t.parent;return e},getGlobalTransform(r,e){if(e)return r.copyFrom(this.worldTransform);this.updateLocalTransform();let t=Aa(this,je.get().identity());return r.appendFrom(this.localTransform,t),je.return(t),r},getGlobalTint(r){if(r)return this.renderGroup?Ri(this.renderGroup.worldColor):this.parentRenderGroup?Ri(ns(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=ns(e,t.localColor),t=t.parent;return Ri(e)}};});function os(r,e,t){return e.clear(),t||(t=D.IDENTITY),oA(r,e,t,r,true),e.isValid||e.set(0,0,0,0),e}function oA(r,e,t,i,s){let n;if(s)n=je.get(),n=t.copyTo(n);else {if(!r.visible||!r.measurable)return;r.updateLocalTransform();let u=r.localTransform;n=je.get(),n.appendFrom(u,t);}let o=e,a=!!r.effects.length;if(a&&(e=Nt.get().clear()),r.boundsArea)e.addRect(r.boundsArea,n);else {r.renderPipeId&&(e.matrix=n,e.addBounds(r.bounds));let u=r.children;for(let l=0;l<u.length;l++)oA(u[l],e,n,i,false);}if(a){for(let u=0;u<r.effects.length;u++)r.effects[u].addLocalBounds?.(e,i);o.addBounds(e,D.IDENTITY),Nt.return(e);}je.return(n);}var Jl=f(()=>{he();ss();});function ec(r,e){let t=r.children;for(let i=0;i<t.length;i++){let s=t[i],n=s.uid,o=(s._didViewChangeTick&65535)<<16|s._didContainerChangeTick&65535,a=e.index;(e.data[a]!==n||e.data[a+1]!==o)&&(e.data[e.index]=n,e.data[e.index+1]=o,e.didChange=true),e.index=a+2,s.children.length&&ec(s,e);}return e.didChange}var Rb=f(()=>{});var bM,pf,Mb=f(()=>{he();Et();vn();Jl();Rb();bM=new D,pf={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(r,e){let t=Math.sign(this.scale.x)||1;e!==0?this.scale.x=r/e*t:this.scale.x=t;},_setHeight(r,e){let t=Math.sign(this.scale.y)||1;e!==0?this.scale.y=r/e*t:this.scale.y=t;},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:false,localBounds:new me});let r=this._localBoundsCacheData;return r.index=1,r.didChange=false,r.data[0]!==this._didViewChangeTick&&(r.didChange=true,r.data[0]=this._didViewChangeTick),ec(this,r),r.didChange&&os(this,r.localBounds,bM),r.localBounds},getBounds(r,e){return ii(this,r,e||new me)}};});var mf,Db=f(()=>{mf={_onRender:null,set onRender(r){let e=this.renderGroup||this.parentRenderGroup;if(!r){this._onRender&&e?.removeOnRender(this),this._onRender=null;return}this._onRender||e?.addOnRender(this),this._onRender=r;},get onRender(){return this._onRender}};});function yM(r,e){return r._zIndex-e._zIndex}var gf,Ib=f(()=>{gf={_zIndex:0,sortDirty:false,sortableChildren:false,get zIndex(){return this._zIndex},set zIndex(r){this._zIndex!==r&&(this._zIndex=r,this.depthOfChildModified());},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=true,this.parent.sortDirty=true),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true);},sortChildren(){this.sortDirty&&(this.sortDirty=false,this.children.sort(yM));}};});var xf,kb=f(()=>{jt();ss();xf={getGlobalPosition(r=new ne,e=false){return this.parent?this.parent.toGlobal(this._position,r,e):(r.x=this._position.x,r.y=this._position.y),r},toGlobal(r,e,t=false){let i=this.getGlobalTransform(je.get(),t);return e=i.apply(r,e),je.return(i),e},toLocal(r,e,t,i){e&&(r=e.toGlobal(r,t,i));let s=this.getGlobalTransform(je.get(),i);return t=s.applyInverse(r,t),je.return(s),t}};});var as,_f=f(()=>{lt();as=class{constructor(){this.uid=re("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0;}reset(){this.instructionSize=0;}add(e){this.instructions[this.instructionSize++]=e;}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"]);}};});function kr(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function tc(r){return !(r&r-1)&&!!r}function aA(r){let e=(r>65535?1:0)<<4;r>>>=e;let t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}var Pa=f(()=>{});function mt(r){let e={};for(let t in r)r[t]!==void 0&&(e[t]=r[t]);return e}var us=f(()=>{});function vM(r){let e=uA[r];return e===void 0&&(uA[r]=re("resource")),e}var uA,lA,st,Mi=f(()=>{St();lt();xe();uA=Object.create(null);lA=class cA extends ue{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=false,e={...cA.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1;}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e;}get addressMode(){return this.addressModeU}set wrapMode(e){I(H,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e;}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e;}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear");}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null;}_generateResourceId(){let e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=vM(e),this._resourceId}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners();}};lA.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};st=lA;});var hA,oe,ct=f(()=>{St();Pa();us();lt();Mi();hA=class dA extends ue{constructor(e={}){super(),this.options=e,this.uid=re("textureSource"),this._resourceType="textureSource",this._resourceId=re("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=false,this.format="rgba8unorm",this.dimension="2d",this.antialias=false,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...dA.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new st(mt(e)),this.destroyed=false,this._refreshPOT();}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange());}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e;}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e;}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e;}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e;}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e;}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e;}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e;}_onStyleChange(){this.emit("styleChange",this);}update(){if(this.resource){let e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this);}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners();}unload(){this._resourceId=re("resource"),this.emit("change",this),this.emit("unload",this);}get resourceWidth(){let{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){let{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e);}resize(e,t,i){i||(i=this._resolution),e||(e=this.width),t||(t=this.height);let s=Math.round(e*i),n=Math.round(t*i);return this.width=s/i,this.height=n/i,this._resolution=i,this.pixelWidth===s&&this.pixelHeight===n?false:(this._refreshPOT(),this.pixelWidth=s,this.pixelHeight=n,this.emit("resize",this),this._resourceId=re("resource"),this.emit("change",this),true)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this);}set wrapMode(e){this._style.wrapMode=e;}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e;}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=tc(this.pixelWidth)&&tc(this.pixelHeight);}static test(e){throw new Error("Unimplemented")}};hA.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:false,sampleCount:1,antialias:false,autoGarbageCollect:false};oe=hA;});function TM(){for(let r=0;r<16;r++){let e=[];Fb.push(e);for(let t=0;t<16;t++){let i=bf(Tn[r]*Tn[t]+En[r]*Sn[t]),s=bf(Sn[r]*Tn[t]+An[r]*Sn[t]),n=bf(Tn[r]*En[t]+En[r]*An[t]),o=bf(Sn[r]*En[t]+An[r]*An[t]);for(let a=0;a<16;a++)if(Tn[a]===i&&Sn[a]===s&&En[a]===n&&An[a]===o){e.push(a);break}}}for(let r=0;r<16;r++){let e=new D;e.set(Tn[r],Sn[r],En[r],An[r],0,0),fA.push(e);}}var Tn,Sn,En,An,Fb,fA,bf,le,yf=f(()=>{he();Tn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Sn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],En=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],An=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Fb=[],fA=[],bf=Math.sign;TM();le={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:r=>Tn[r],uY:r=>Sn[r],vX:r=>En[r],vY:r=>An[r],inv:r=>r&8?r&15:-r&7,add:(r,e)=>Fb[r][e],sub:(r,e)=>Fb[r][le.inv(e)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,e)=>Math.abs(r)*2<=Math.abs(e)?e>=0?le.S:le.N:Math.abs(e)*2<=Math.abs(r)?r>0?le.E:le.W:e>0?r>0?le.SE:le.SW:r>0?le.NE:le.NW,matrixAppendRotationInv:(r,e,t=0,i=0)=>{let s=fA[le.inv(e)];s.tx=t,s.ty=i,r.append(s);}};});var rc,Ob=f(()=>{rc=()=>{};});var Di,vf=f(()=>{E();ct();Di=class extends oe{constructor(e){let t=e.resource||new Float32Array(e.width*e.height*4),i=e.format;i||(t instanceof Float32Array?i="rgba32float":t instanceof Int32Array||t instanceof Uint32Array?i="rgba32uint":t instanceof Int16Array||t instanceof Uint16Array?i="rgba16uint":(i="bgra8unorm")),super({...e,resource:t,format:i}),this.uploadMethodId="buffer";}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}};Di.extension=g.TextureSource;});var pA,ls,Tf=f(()=>{he();pA=new D,ls=class{constructor(e,t){this.mapCoord=new D,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof t>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=t,this.isSimple=false,this.texture=e;}get texture(){return this._texture}set texture(e){this.texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update());}multiplyUvs(e,t){t===void 0&&(t=e);let i=this.mapCoord;for(let s=0;s<e.length;s+=2){let n=e[s],o=e[s+1];t[s]=n*i.a+o*i.c+i.tx,t[s+1]=n*i.b+o*i.d+i.ty;}return t}update(){let e=this._texture;this._updateID++;let t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);let i=e.orig,s=e.trim;s&&(pA.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(pA));let n=e.source,o=this.uClampFrame,a=this.clampMargin/n._resolution,u=this.clampOffset/n._resolution;return o[0]=(e.frame.x+a+u)/n.width,o[1]=(e.frame.y+a+u)/n.height,o[2]=(e.frame.x+e.frame.width-a+u)/n.width,o[3]=(e.frame.y+e.frame.height-a+u)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=e.frame.width===n.width&&e.frame.height===n.height&&e.rotate===0,true}};});var C,ce=f(()=>{St();yf();Ze();lt();xe();Ob();vf();ct();Tf();C=class extends ue{constructor({source:e,label:t,frame:i,orig:s,trim:n,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=re("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Z,this.noFrame=false,this.dynamic=false,this.isTexture=true,this.label=t,this.source=e?.source??new oe,this.noFrame=!i,i)this.frame.copyFrom(i);else {let{width:c,height:h}=this._source;this.frame.width=c,this.frame.height=h;}this.orig=s||this.frame,this.trim=n,this.rotate=u??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=false,this.dynamic=l||false,this.updateUvs();}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this);}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new ls(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:e,frame:t}=this,{width:i,height:s}=this._source,n=t.x/i,o=t.y/s,a=t.width/i,u=t.height/s,l=this.rotate;if(l){let c=a/2,h=u/2,d=n+c,p=o+h;l=le.add(l,le.NW),e.x0=d+c*le.uX(l),e.y0=p+h*le.uY(l),l=le.add(l,2),e.x1=d+c*le.uX(l),e.y1=p+h*le.uY(l),l=le.add(l,2),e.x2=d+c*le.uX(l),e.y2=p+h*le.uY(l),l=le.add(l,2),e.x3=d+c*le.uX(l),e.y3=p+h*le.uY(l);}else e.x0=n,e.y0=o,e.x1=n+a,e.y1=o,e.x2=n+a,e.y2=o+u,e.x3=n,e.y3=o+u;}destroy(e=false){this._source&&e&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=true,this.emit("destroy",this),this.removeAllListeners();}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this);}get baseTexture(){return I(H,"Texture.baseTexture is now Texture.source"),this._source}};C.EMPTY=new C({label:"EMPTY",source:new oe({label:"EMPTY"})});C.EMPTY.destroy=rc;C.WHITE=new C({source:new Di({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});C.WHITE.destroy=rc;});var SM,ic,be,Fr=f(()=>{Pa();ct();ce();Mi();SM=0,ic=class{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=false,this.textureStyle=new st(this.textureOptions);}createTexture(e,t,i){let s=new oe({...this.textureOptions,width:e,height:t,resolution:1,antialias:i,autoGarbageCollect:false});return new C({source:s,label:`texturePool_${SM++}`})}getOptimalTexture(e,t,i=1,s){let n=Math.ceil(e*i-1e-6),o=Math.ceil(t*i-1e-6);n=kr(n),o=kr(o);let a=(n<<17)+(o<<1)+(s?1:0);this._texturePool[a]||(this._texturePool[a]=[]);let u=this._texturePool[a].pop();return u||(u=this.createTexture(n,o,s)),u.source._resolution=i,u.source.width=n/i,u.source.height=o/i,u.source.pixelWidth=n,u.source.pixelHeight=o,u.frame.x=0,u.frame.y=0,u.frame.width=e,u.frame.height=t,u.updateUvs(),this._poolKeyHash[u.uid]=a,u}getSameSizeTexture(e,t=false){let i=e.source;return this.getOptimalTexture(e.width,e.height,i._resolution,t)}returnTexture(e,t=false){let i=this._poolKeyHash[e.uid];t&&(e.source.style=this.textureStyle),this._texturePool[i].push(e);}clear(e){if(e=e!==false,e)for(let t in this._texturePool){let i=this._texturePool[t];if(i)for(let s=0;s<i.length;s++)i[s].destroy(true);}this._texturePool={};}},be=new ic;});var wa,Gb=f(()=>{he();_f();Fr();wa=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=false,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new D,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=true,this.instructionSet=new as,this._onRenderContainers=[],this.textureNeedsUpdate=true,this.isCachedAsTexture=false,this._matrixDirty=7;}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=true;let t=e.children;for(let i=0;i<t.length;i++){let s=t[i];s._updateFlags=15,this.addChild(s);}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=true,this.textureNeedsUpdate=true;}disableCacheAsTexture(){this.isCachedAsTexture=false,this.texture&&(be.returnTexture(this.texture),this.texture=null);}updateCacheTexture(){this.textureNeedsUpdate=true;}reset(){this.renderGroupChildren.length=0;for(let e in this.childrenToUpdate){let t=this.childrenToUpdate[e];t.list.fill(null),t.index=0;}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=true,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture();}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e);}_removeRenderGroupChild(e){let t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null;}addChild(e){if(this.structureDidChange=true,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=true,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);let t=e.children;for(let i=0;i<t.length;i++)this.addChild(t[i]);}removeChild(e){if(this.structureDidChange=true,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}let t=e.children;for(let i=0;i<t.length;i++)this.removeChild(t[i]);}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t]);}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||(t=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),t.list[t.index++]=e;}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=false);}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e;}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e);}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1);}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e);}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null;}getChildren(e=[]){let t=this.root.children;for(let i=0;i<t.length;i++)this._getChildren(t[i],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;let i=e.children;for(let s=0;s<i.length;s++)this._getChildren(i[s],t);return t}invalidateMatrices(){this._matrixDirty=7;}get inverseWorldTransform(){return (this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new D),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return (this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new D),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;let e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new D),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};});function Cn(r,e,t={}){for(let i in e)!t[i]&&e[i]!==void 0&&(r[i]=e[i]);}var Sf=f(()=>{});var Ub,Lb,Nb,Pn,Ba,cs,mA,te,qt=f(()=>{St();it();vb();E();he();Qd();is();lt();xe();ri();Sb();Eb();Ab();Pb();wb();Bb();ff();Mb();Db();Ib();kb();Gb();Sf();Ub=new we(null),Lb=new we(null),Nb=new we(null,1,1),Pn=1,Ba=2,cs=4,mA=8,te=class r extends ue{constructor(e={}){super(),this.uid=re("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=false,this.didViewUpdate=false,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=true,this.measurable=true,this.isSimple=true,this.updateTick=-1,this.localTransform=new D,this.relativeGroupTransform=new D,this.groupTransform=this.relativeGroupTransform,this.destroyed=false,this._position=new we(this,0,0),this._scale=Nb,this._pivot=Lb,this._skew=Ub,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Cn(this,e,{children:true,parent:true,effects:true}),e.children?.forEach(t=>this.addChild(t)),e.parent?.addChild(this);}static mixin(e){I("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),O.mixin(r,e);}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095;}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||I(H,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let s=0;s<e.length;s++)this.addChild(e[s]);return e[0]}let t=e[0],i=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),i&&(i.structureDidChange=true),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=true),t.parent=this,t.didChange=true,t._updateFlags=15,i&&i.addChild(t),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let s=0;s<e.length;s++)this.removeChild(e[s]);return e[0]}let t=e[0],i=this.children.indexOf(t);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit("childRemoved",t,this,i),t.emit("removed",this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=true,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this));}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup());}get isRenderGroup(){return !!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=Re.get(wa,this),this.groupTransform=D.IDENTITY,e?.addChild(this),this._updateIsSimple();}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),Re.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple();}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0;}get worldTransform(){return this._worldTransform||(this._worldTransform=new D),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e;}get y(){return this._position.y}set y(e){this._position.y=e;}get position(){return this._position}set position(e){this._position.copyFrom(e);}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew));}get angle(){return this.rotation*Kd}set angle(e){this.rotation=e*Zd;}get pivot(){return this._pivot===Lb&&(this._pivot=new we(this,0,0)),this._pivot}set pivot(e){this._pivot===Lb&&(this._pivot=new we(this,0,0)),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e);}get skew(){return this._skew===Ub&&(this._skew=new we(this,0,0)),this._skew}set skew(e){this._skew===Ub&&(this._skew=new we(this,0,0)),this._skew.copyFrom(e);}get scale(){return this._scale===Nb&&(this._scale=new we(this,1,1)),this._scale}set scale(e){this._scale===Nb&&(this._scale=new we(this,0,0)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e);}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){let t=this.getLocalBounds().width;this._setWidth(e,t);}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){let t=this.getLocalBounds().height;this._setHeight(e,t);}getSize(e){e||(e={});let t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){let i=this.getLocalBounds();typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,i.width),t!==void 0&&this._setHeight(t,i.height);}_updateSkew(){let e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x);}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this}setFromMatrix(e){e.decompose(this);}updateLocalTransform(){let e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;let t=this.localTransform,i=this._scale,s=this._pivot,n=this._position,o=i._x,a=i._y,u=s._x,l=s._y;t.a=this._cx*o,t.b=this._sx*o,t.c=this._cy*a,t.d=this._sy*a,t.tx=n._x-(u*t.a+l*t.c),t.ty=n._y-(u*t.b+l*t.d);}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=Pn,this._onUpdate());}get alpha(){return this.localAlpha}set tint(e){let i=K.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=Pn,this._onUpdate());}get tint(){return Ri(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=Ba,this.localBlendMode=e,this._onUpdate());}get blendMode(){return this.localBlendMode}get visible(){return !!(this.localDisplayStatus&2)}set visible(e){let t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=cs,this.localDisplayStatus^=2,this._onUpdate());}get culled(){return !(this.localDisplayStatus&4)}set culled(e){let t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=cs,this.localDisplayStatus^=4,this._onUpdate());}get renderable(){return !!(this.localDisplayStatus&1)}set renderable(e){let t=e?1:0;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=cs,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._onUpdate());}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=false){if(this.destroyed)return;this.destroyed=true;let t;if(this.children.length&&(t=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e?.children)&&t)for(let s=0;s<t.length;++s)t[s].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null;}};O.mixin(te,sf,lf,xf,mf,pf,of,af,gf,jd,tf,df,nf);});var si,sc=f(()=>{jt();si=class r{constructor(e){this.bubbles=true,this.cancelBubble=true,this.cancelable=false,this.composed=false,this.defaultPrevented=false,this.eventPhase=r.prototype.NONE,this.propagationStopped=false,this.propagationImmediatelyStopped=false,this.layer=new ne,this.page=new ne,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e;}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,s,n){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=true;}stopImmediatePropagation(){this.propagationImmediatelyStopped=true;}stopPropagation(){this.propagationStopped=true;}};});function EM(r){return function(e){return e.test(r)}}function nc(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var s=EM(t),n={apple:{phone:s(Hb)&&!s(Ii),ipod:s(gA),tablet:!s(Hb)&&(s(xA)||CA(e))&&!s(Ii),universal:s(_A),device:(s(Hb)||s(gA)||s(xA)||s(_A)||CA(e))&&!s(Ii)},amazon:{phone:s(Ra),tablet:!s(Ra)&&s(Ef),device:s(Ra)||s(Ef)},android:{phone:!s(Ii)&&s(Ra)||!s(Ii)&&s(Vb),tablet:!s(Ii)&&!s(Ra)&&!s(Vb)&&(s(Ef)||s(bA)),device:!s(Ii)&&(s(Ra)||s(Ef)||s(Vb)||s(bA))||s(/\bokhttp\b/i)},windows:{phone:s(Ii),tablet:s(yA),device:s(Ii)||s(yA)},other:{blackberry:s(vA),blackberry10:s(TA),opera:s(SA),firefox:s(AA),chrome:s(EA),device:s(vA)||s(TA)||s(SA)||s(AA)||s(EA)},any:false,phone:false,tablet:false};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}var Hb,gA,xA,_A,Vb,bA,Ra,Ef,Ii,yA,vA,TA,SA,EA,AA,CA,zb=f(()=>{Hb=/iPhone/i,gA=/iPod/i,xA=/iPad/i,_A=/\biOS-universal(?:.+)Mac\b/i,Vb=/\bAndroid(?:.+)Mobile\b/i,bA=/Android/i,Ra=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Ef=/Silk/i,Ii=/Windows Phone/i,yA=/\bWindows(?:.+)ARM\b/i,vA=/BlackBerry/i,TA=/BB10/i,SA=/Opera Mini/i,EA=/\b(CriOS|Chrome)(?:.+)Mobile/i,AA=/Mobile(?:.+)Firefox\b/i,CA=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};});var PA=f(()=>{zb();zb();});var AM,Af,Wb=f(()=>{PA();AM=nc.default??nc,Af=AM(globalThis.navigator);});var CM,Cf,PM,wM,wA,BA,BM,RM,MM,Xb,Pf,Yb=f(()=>{sc();E();Wb();rf();CM=9,Cf=100,PM=0,wM=0,wA=2,BA=1,BM=-1e3,RM=-1e3,MM=2,Xb=class RA{constructor(e,t=Af){this._mobileInfo=t,this.debug=false,this._activateOnTab=true,this._deactivateOnMouseMove=true,this._isActive=false,this._isMobileAccessibility=false,this._div=null,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e;}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){let e=document.createElement("button");e.style.width=`${BA}px`,e.style.height=`${BA}px`,e.style.position="absolute",e.style.top=`${BM}px`,e.style.left=`${RM}px`,e.style.zIndex=MM.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=true,this._activate(),this._destroyTouchHook();}),document.body.appendChild(e),this._hookDiv=e;}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null);}_activate(){if(this._isActive)return;this._isActive=true,this._div||(this._div=document.createElement("div"),this._div.style.width=`${Cf}px`,this._div.style.height=`${Cf}px`,this._div.style.position="absolute",this._div.style.top=`${PM}px`,this._div.style.left=`${wM}px`,this._div.style.zIndex=wA.toString(),this._div.style.pointerEvents="none"),this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._deactivateOnMouseMove&&(this._onMouseMove=this._onMouseMove.bind(this),globalThis.document.addEventListener("mousemove",this._onMouseMove,true));let e=this._renderer.view.canvas;if(e.parentNode)e.parentNode.appendChild(this._div),this._initAccessibilitySetup();else {let t=new MutationObserver(()=>{e.parentNode&&(e.parentNode.appendChild(this._div),t.disconnect(),this._initAccessibilitySetup());});t.observe(document.body,{childList:true,subtree:true});}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered);}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=false,globalThis.document.removeEventListener("mousemove",this._onMouseMove,true),this._activateOnTab&&globalThis.addEventListener("keydown",this._onKeyDown,false),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv&&e._accessibleDiv.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=false;this._pool.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e);}),this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pool=[],this._children=[];}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i]);}init(e){let i={accessibilityOptions:{...RA.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault?this._activate():this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._renderer.runners.postrender.remove(this);}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i));}for(let i=this._children.length-1;i>=0;i--){let s=this._children[i];t.has(i)||(s._accessibleDiv&&s._accessibleDiv.parentNode&&(s._accessibleDiv.parentNode.removeChild(s._accessibleDiv),this._pool.push(s._accessibleDiv),s._accessibleDiv=null),s._accessibleActive=false,Sa(this._children,i,1));}if(this._renderer.renderingToScreen){let{x:i,y:s,width:n,height:o}=this._renderer.screen,a=this._div;a.style.left=`${i}px`,a.style.top=`${s}px`,a.style.width=`${n}px`,a.style.height=`${o}px`;}for(let i=0;i<this._children.length;i++){let s=this._children[i];if(!s._accessibleActive||!s._accessibleDiv)continue;let n=s._accessibleDiv,o=s.hitArea||s.getBounds().rectangle;if(s.hitArea){let a=s.worldTransform,u=this._renderer.resolution,l=this._renderer.resolution;n.style.left=`${(a.tx+o.x*a.a)*u}px`,n.style.top=`${(a.ty+o.y*a.d)*l}px`,n.style.width=`${o.width*a.a*u}px`,n.style.height=`${o.height*a.d*l}px`;}else {this._capHitArea(o);let a=this._renderer.resolution,u=this._renderer.resolution;n.style.left=`${o.x*a}px`,n.style.top=`${o.y*u}px`,n.style.width=`${o.width*a}px`,n.style.height=`${o.height*u}px`;}}this._renderId++;}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`;}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y);}_addChild(e){let t=this._pool.pop();t||(e.accessibleType==="button"?t=document.createElement("button"):(t=document.createElement(e.accessibleType),t.style.cssText=`
|
|
7
7
|
color: transparent;
|
|
8
8
|
pointer-events: none;
|
|
9
9
|
padding: 0;
|
|
@@ -16,7 +16,7 @@ Deprecated since v${r}`),console.warn(i))),rA[e]=true;}var rA,H,Jd,xe=f(()=>{rA=
|
|
|
16
16
|
-webkit-user-select: none;
|
|
17
17
|
-moz-user-select: none;
|
|
18
18
|
-ms-user-select: none;
|
|
19
|
-
`,e.accessibleText&&(t.innerText=e.accessibleText)),t.style.width=`${Cf}px`,t.style.height=`${Cf}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=wA.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=true,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e.interactive&&(e._accessibleDiv.tabIndex=e.tabIndex);}_dispatchEvent(e,t){let{container:i}=e.target,s=this._renderer.events.rootBoundary,n=Object.assign(new si(s),{target:i});s.rootTarget=this._renderer.lastObjectRendered,t.forEach(o=>s.dispatchEvent(n,o));}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"]);}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"]);}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"]);}_onKeyDown(e){e.keyCode!==CM||!this._activateOnTab||this._activate();}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate();}destroy(){this._deactivate(),this._destroyTouchHook(),this._div=null,this._pool=null,this._children=null,this._renderer=null,this._activateOnTab&&globalThis.removeEventListener("keydown",this._onKeyDown);}setAccessibilityEnabled(e){e?this._activate():this._deactivate();}};Xb.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"accessibility"};Xb.defaultOptions={enabledByDefault:false,debug:false,activateOnTab:true,deactivateOnMouseMove:true};Pf=Xb;});var wf,$b=f(()=>{wf={accessible:false,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:true,_accessibleActive:false,_accessibleDiv:null,_renderId:-1};});var MA=f(()=>{E();qt();Yb();$b();O.add(Pf);O.mixin(te,wf);});var wn,jb=f(()=>{E();wn=class{static init(e){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;this._cancelResize();let t,i;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight;else {let{clientWidth:s,clientHeight:n}=this._resizeTo;t=s,i=n;}this.renderer.resize(t,i),this.render();},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null;}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null;}};wn.extension=m.Application;});var Ht,Bn=f(()=>{Ht=(r=>(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(Ht||{});});var hs,qb=f(()=>{hs=class{constructor(e,t=null,i=0,s=false){this.next=null,this.previous=null,this._destroyed=false,this._fn=e,this._context=t,this.priority=i,this._once=s;}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));let t=this.next;return this._once&&this.destroy(true),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this;}destroy(e=false){this._destroyed=true,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}};});var DA,ye,ds=f(()=>{Bn();qb();DA=class or{constructor(){this.autoStart=false,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=false,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=false,this._lastFrame=-1,this._head=new hs(null,null,1/0),this.deltaMS=1/or.targetFPMS,this.elapsedMS=1/or.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)));};}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick));}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null);}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start();}add(e,t,i=Ht.NORMAL){return this._addListener(new hs(e,t,i))}addOnce(e,t,i=Ht.NORMAL){return this._addListener(new hs(e,t,i,true))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else {for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next;}e.previous||e.connect(i);}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=true,this._requestIfNeeded());}stop(){this.started&&(this.started=false,this._cancelIfNeeded());}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(true);this._head.destroy(),this._head=null;}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){let n=e-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=e-n%this._minElapsedMS;}this.deltaMS=t,this.deltaTime=this.deltaMS*or.targetFPMS;let i=this._head,s=i.next;for(;s;)s=s.emit(this);i.next||this._cancelIfNeeded();}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e;}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){let t=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,t)/1e3,or.targetFPMS);this._maxElapsedMS=1/i;}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else {let t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3);}}static get shared(){if(!or._shared){let e=or._shared=new or;e.autoStart=true,e._protected=true;}return or._shared}static get system(){if(!or._system){let e=or._system=new or;e.autoStart=true,e._protected=true;}return or._system}};DA.targetFPMS=.06;ye=DA;});var Rn,Kb=f(()=>{E();Bn();ds();Rn=class{static init(e){e=Object.assign({autoStart:true,sharedTicker:false},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ht.LOW);},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop();},this.start=()=>{this._ticker.start();},this._ticker=null,this.ticker=e.sharedTicker?ye.shared:new ye,e.autoStart&&this.start();}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy();}}};Rn.extension=m.Application;});var Zb=f(()=>{E();jb();Kb();O.add(wn);O.add(Rn);});function F(...r){Qb!==IA&&(Qb++,Qb===IA?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r));}var Qb,IA,_e=f(()=>{Qb=0,IA=500;});var Jb,_r,Bf=f(()=>{Bn();ds();Jb=class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=false,this._tickerAdded=false,this._pauseUpdate=true;}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=false,this._tickerAdded=false,this._pauseUpdate=true;}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e;}addTickerListener(){this._tickerAdded||!this.domElement||(ye.system.add(this._tickerUpdate,this,Ht.INTERACTION),this._tickerAdded=true);}removeTickerListener(){this._tickerAdded&&(ye.system.remove(this._tickerUpdate,this),this._tickerAdded=false);}pointerMoved(){this._didMove=true;}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=false;return}let e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}):new MouseEvent("mousemove",{clientX:e.clientX,clientY:e.clientY}));}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update());}},_r=new Jb;});var Or,oc=f(()=>{jt();sc();Or=class extends si{constructor(){super(...arguments),this.client=new ne,this.movement=new ne,this.offset=new ne,this.global=new ne,this.screen=new ne;}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}getLocalPosition(e,t,i){return e.worldTransform.applyInverse(i||this.global,t)}getModifierState(e){return "getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,i,s,n,o,a,u,l,c,h,d,p,_,b){throw new Error("Method not implemented.")}};});var At,Rf=f(()=>{oc();At=class extends Or{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=false;}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}};});var br,Mf=f(()=>{oc();br=class extends Or{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2;}};br.DOM_DELTA_PIXEL=0;br.DOM_DELTA_LINE=1;br.DOM_DELTA_PAGE=2;});var DM,IM,ac,Ma,ey=f(()=>{St();jt();_e();Bf();oc();Rf();Mf();DM=2048,IM=new ne,ac=new ne,Ma=class{constructor(e){this.dispatch=new ue,this.moveOnAll=false,this.enableGlobalMoveEvents=true,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=false,this.rootTarget=e,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(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((i,s)=>i.priority-s.priority);}dispatchEvent(e,t){e.propagationStopped=false,e.propagationImmediatelyStopped=false,this.propagate(e,t),this.dispatch.emit(t||e.type,e);}mapEvent(e){if(!this.rootTarget)return;let t=this.mappingTable[e.type];if(t)for(let i=0,s=t.length;i<s;i++)t[i].fn(e);else F(`[EventBoundary]: Event mapping not defined for ${e.type}`);}hitTest(e,t){_r.pauseUpdate=true;let s=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",n=this[s](this.rootTarget,this.rootTarget.eventMode,IM.set(e,t),this.hitTestFn,this.hitPruneFn);return n&&n[0]}propagate(e,t){if(!e.target)return;let i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let s=0,n=i.length-1;s<n;s++)if(e.currentTarget=i[s],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let s=i.length-2;s>=0;s--)if(e.currentTarget=i[s],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;let s=Array.isArray(t)?t:[t];for(let n=i.length-1;n>=0;n--)s.forEach(o=>{e.currentTarget=i[n],this.notifyTarget(e,o);});}propagationPath(e){let t=[e];for(let i=0;i<DM&&e!==this.rootTarget&&e.parent;i++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent;}return t.reverse(),t}hitTestMoveRecursive(e,t,i,s,n,o=false){let a=false;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(_r.pauseUpdate=false),e.interactiveChildren&&e.children){let c=e.children;for(let h=c.length-1;h>=0;h--){let d=c[h],p=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,s,n,o||n(e,i));if(p){if(p.length>0&&!p[p.length-1].parent)continue;let _=e.isInteractive();(p.length>0||_)&&(_&&this._allInteractiveElements.push(e),p.push(e)),this._hitElements.length===0&&(this._hitElements=p),a=true;}}}let u=this._isInteractive(t),l=e.isInteractive();return l&&l&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:u&&!n(e,i)&&s(e,i)?l?[e]:[]:null}hitTestRecursive(e,t,i,s,n){if(this._interactivePrune(e)||n(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(_r.pauseUpdate=false),e.interactiveChildren&&e.children){let u=e.children,l=i;for(let c=u.length-1;c>=0;c--){let h=u[c],d=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,l,s,n);if(d){if(d.length>0&&!d[d.length-1].parent)continue;let p=e.isInteractive();return (d.length>0||p)&&d.push(e),d}}}let o=this._isInteractive(t),a=e.isInteractive();return o&&s(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return !e||!e.visible||!e.renderable||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,ac),!e.hitArea.contains(ac.x,ac.y)))return true;if(e.effects&&e.effects.length)for(let i=0;i<e.effects.length;i++){let s=e.effects[i];if(s.containsPoint&&!s.containsPoint(t,this.hitTestFn))return true}return false}hitTestFn(e,t){return e.hitArea?true:e?.containsPoint?(e.worldTransform.applyInverse(t,ac),e.containsPoint(ac)):false}notifyTarget(e,t){if(!e.currentTarget.isInteractive())return;t??(t=e.type);let i=`on${t}`;e.currentTarget[i]?.(e);let s=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,s),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t);}mapPointerDown(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){let s=t.button===2;this.dispatchEvent(t,s?"rightdown":"mousedown");}let i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t);}mapPointerMove(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=true;let t=this.createPointerEvent(e);this._isPointerMoveEvent=false;let i=t.pointerType==="mouse"||t.pointerType==="pen",s=this.trackingData(e.pointerId),n=this.findMountedTarget(s.overTargets);if(s.overTargets?.length>0&&n!==t.target){let u=e.type==="mousemove"?"mouseout":"pointerout",l=this.createPointerEvent(e,u,n);if(this.dispatchEvent(l,"pointerout"),i&&this.dispatchEvent(l,"mouseout"),!t.composedPath().includes(n)){let c=this.createPointerEvent(e,"pointerleave",n);for(c.eventPhase=c.AT_TARGET;c.target&&!t.composedPath().includes(c.target);)c.currentTarget=c.target,this.notifyTarget(c),i&&this.notifyTarget(c,"mouseleave"),c.target=c.target.parent;this.freeEvent(c);}this.freeEvent(l);}if(n!==t.target){let u=e.type==="mousemove"?"mouseover":"pointerover",l=this.clonePointerEvent(t,u);this.dispatchEvent(l,"pointerover"),i&&this.dispatchEvent(l,"mouseover");let c=n?.parent;for(;c&&c!==this.rootTarget.parent&&c!==t.target;)c=c.parent;if(!c||c===this.rootTarget.parent){let d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==n&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d);}this.freeEvent(l);}let o=[],a=this.enableGlobalMoveEvents??true;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=t.target?.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,s.overTargets=t.composedPath(),this.freeEvent(t);}mapPointerOver(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),s=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=i.target?.cursor);let n=this.clonePointerEvent(i,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),s&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(n);}mapPointerOut(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId);if(t.overTargets){let i=e.pointerType==="mouse"||e.pointerType==="pen",s=this.findMountedTarget(t.overTargets),n=this.createPointerEvent(e,"pointerout",s);this.dispatchEvent(n),i&&this.dispatchEvent(n,"mouseout");let o=this.createPointerEvent(e,"pointerleave",s);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(n),this.freeEvent(o);}this.cursor=null;}mapPointerUp(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){let a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup");}let s=this.trackingData(e.pointerId),n=this.findMountedTarget(s.pressTargetsByButton[e.button]),o=n;if(n&&!i.composedPath().includes(n)){let a=n;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){let u=i.button===2;this.notifyTarget(i,u?"rightupoutside":"mouseupoutside");}a=a.parent;}delete s.pressTargetsByButton[e.button],o=a;}if(o){let a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,s.clicksByButton[e.button]||(s.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});let u=s.clicksByButton[e.button];if(u.target===a.target&&t-u.timeStamp<200?++u.clickCount:u.clickCount=1,u.target=a.target,u.timeStamp=t,a.detail=u.clickCount,a.pointerType==="mouse"){let l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click");}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a);}this.freeEvent(i);}mapPointerUpOutside(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),s=this.createPointerEvent(e);if(i){let n=i;for(;n;)s.currentTarget=n,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"?this.notifyTarget(s,"touchendoutside"):(s.pointerType==="mouse"||s.pointerType==="pen")&&this.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete t.pressTargetsByButton[e.button];}this.freeEvent(s);}mapWheel(e){if(!(e instanceof br)){F("EventBoundary cannot map a non-wheel event as a wheel event");return}let t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t);}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i<e.length&&e[i].parent===t;i++)t=e[i];return t}createPointerEvent(e,t,i){let s=this.allocateEvent(At);return this.copyPointerData(e,s),this.copyMouseData(e,s),this.copyData(e,s),s.nativeEvent=e.nativeEvent,s.originalEvent=e,s.target=i??this.hitTest(s.global.x,s.global.y)??this._hitElements[0],typeof t=="string"&&(s.type=t),s}createWheelEvent(e){let t=this.allocateEvent(br);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){let i=this.allocateEvent(At);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=t??i.type,i}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ;}copyPointerData(e,t){e instanceof At&&t instanceof At&&(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);}copyMouseData(e,t){e instanceof Or&&t instanceof Or&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global));}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page);}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);let t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=false,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");let t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e);}_notifyListeners(e,t){let i=e.currentTarget._events[t];if(i)if("fn"in i)i.once&&e.currentTarget.removeListener(t,i.fn,void 0,true),i.fn.call(i.context,e);else for(let s=0,n=i.length;s<n&&!e.propagationImmediatelyStopped;s++)i[s].once&&e.currentTarget.removeListener(t,i[s].fn,void 0,true),i[s].fn.call(i[s].context,e);}};});var kM,FM,ry,Da,Df=f(()=>{E();ey();Bf();Rf();Mf();kM=1,FM={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},ry=class ty{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new Ma(null),_r.init(this),this.autoPreventDefault=true,this._eventsAdded=false,this._rootPointerEvent=new At(null),this._rootWheelEvent=new br(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...ty.defaultEventFeatures},{set:(t,i,s)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=s),t[i]=s,true)}),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){let{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,ty._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove;}resolutionChange(e){this.resolution=e;}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null;}setCursor(e){e||(e="default");let t=true;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=false),this._currentCursor===e)return;this._currentCursor=e;let i=this.cursorStyles[e];if(i)switch(typeof i){case "string":t&&(this.domElement.style.cursor=i);break;case "function":i(e);break;case "object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e);}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,s=t.length;i<s;i++){let n=t[i],o=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(o);}this.setCursor(this.rootBoundary.cursor);}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,_r.pointerMoved();let t=this._normalizeToPointerData(e);for(let i=0,s=t.length;i<s;i++){let n=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(n);}this.setCursor(this.rootBoundary.cursor);}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);let i=t!==this.domElement?"outside":"",s=this._normalizeToPointerData(e);for(let n=0,o=s.length;n<o;n++){let a=this._bootstrapEvent(this._rootPointerEvent,s[n]);a.type+=i,this.rootBoundary.mapEvent(a);}this.setCursor(this.rootBoundary.cursor);}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);for(let i=0,s=t.length;i<s;i++){let n=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(n);}this.setCursor(this.rootBoundary.cursor);}onWheel(e){if(!this.features.wheel)return;let t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t);}setTargetElement(e){this._removeEvents(),this.domElement=e,_r.domElement=e,this._addEvents();}_addEvents(){if(this._eventsAdded||!this.domElement)return;_r.addTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,true),this.domElement.addEventListener("pointerdown",this._onPointerDown,true),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,true),this.domElement.addEventListener("pointerover",this._onPointerOverOut,true),globalThis.addEventListener("pointerup",this._onPointerUp,true)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,true),this.domElement.addEventListener("mousedown",this._onPointerDown,true),this.domElement.addEventListener("mouseout",this._onPointerOverOut,true),this.domElement.addEventListener("mouseover",this._onPointerOverOut,true),globalThis.addEventListener("mouseup",this._onPointerUp,true),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,true),this.domElement.addEventListener("touchend",this._onPointerUp,true),this.domElement.addEventListener("touchmove",this._onPointerMove,true))),this.domElement.addEventListener("wheel",this.onWheel,{passive:true,capture:true}),this._eventsAdded=true;}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;_r.removeTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,true),this.domElement.removeEventListener("pointerdown",this._onPointerDown,true),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,true),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,true),globalThis.removeEventListener("pointerup",this._onPointerUp,true)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,true),this.domElement.removeEventListener("mousedown",this._onPointerDown,true),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,true),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,true),globalThis.removeEventListener("mouseup",this._onPointerUp,true),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,true),this.domElement.removeEventListener("touchend",this._onPointerUp,true),this.domElement.removeEventListener("touchmove",this._onPointerMove,true))),this.domElement.removeEventListener("wheel",this.onWheel,true),this.domElement=null,this._eventsAdded=false;}mapPositionToPoint(e,t,i){let s=this.domElement.isConnected?this.domElement.getBoundingClientRect():{width:this.domElement.width,height:this.domElement.height,left:0,top:0},n=1/this.resolution;e.x=(t-s.left)*(this.domElement.width/s.width)*n,e.y=(i-s.top)*(this.domElement.height/s.height)*n;}_normalizeToPointerData(e){let t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let i=0,s=e.changedTouches.length;i<s;i++){let n=e.changedTouches[i];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=true,n.type=e.type,t.push(n);}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){let i=e;typeof i.isPrimary>"u"&&(i.isPrimary=true),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=kM),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=true,t.push(i);}else t.push(e);return t}normalizeWheelEvent(e){let t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=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.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=FM[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey;}};ry.extension={name:"events",type:[m.WebGLSystem,m.CanvasSystem,m.WebGPUSystem],priority:-1};ry.defaultEventFeatures={move:true,globalMove:true,click:true,wheel:true};Da=ry;});var If,iy=f(()=>{Df();sc();If={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,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(r){this.eventMode=r?"static":"passive";},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Da.defaultEventMode},set eventMode(r){this._internalEventMode=r;},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:true,hitArea:null,addEventListener(r,e,t){let i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,s=typeof t=="object"?t.signal:void 0,n=typeof t=="object"?t.once===true:false,o=typeof e=="function"?void 0:e;r=i?`${r}capture`:r;let a=typeof e=="function"?e:e.handleEvent,u=this;s&&s.addEventListener("abort",()=>{u.off(r,a,o);}),n?u.once(r,a,o):u.on(r,a,o);},removeEventListener(r,e,t){let i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,s=typeof e=="function"?void 0:e;r=i?`${r}capture`:r,e=typeof e=="function"?e:e.handleEvent,this.off(r,e,s);},dispatchEvent(r){if(!(r instanceof si))throw new Error("Container cannot propagate events outside of the Federated Events API");return r.defaultPrevented=false,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}};});var kA=f(()=>{E();qt();Df();iy();O.add(Da);O.mixin(te,If);});var Mn,sy=f(()=>{E();Mn=class{constructor(e){this._attachedDomElements=[],this._renderer=e,this._renderer.runners.postrender.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000";}addRenderable(e,t){this._attachedDomElements.includes(e)||this._attachedDomElements.push(e);}updateRenderable(e){}validateRenderable(e){return true}postrender(){let e=this._attachedDomElements;if(e.length===0){this._domElement.remove();return}let t=this._renderer.view.canvas;this._domElement.parentNode!==t.parentNode&&t.parentNode?.appendChild(this._domElement);let i=parseFloat(t.style.width)/t.width*this._renderer.resolution,s=parseFloat(t.style.height)/t.height*this._renderer.resolution;this._domElement.style.transform=`translate(${t.offsetLeft}px, ${t.offsetTop}px) scale(${i}, ${s})`;for(let n=0;n<e.length;n++){let o=e[n],a=o.element;if(!o.parent||o.globalDisplayStatus<7)a?.remove(),e.splice(n,1),n--;else {this._domElement.contains(a)||(a.style.position="absolute",a.style.pointerEvents="auto",this._domElement.appendChild(a));let u=o.worldTransform,l=o._anchor,c=o.width*l.x,h=o.height*l.y;a.style.transformOrigin=`${c}px ${h}px`,a.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, ${u.tx-c}, ${u.ty-h})`,a.style.opacity=o.groupAlpha.toString();}}}destroy(){this._renderer.runners.postrender.remove(this);for(let e=0;e<this._attachedDomElements.length;e++)this._attachedDomElements[e].element?.remove();this._attachedDomElements.length=0,this._domElement.remove(),this._renderer=null;}};Mn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"dom"};});var qe,Gr=f(()=>{Et();qt();qe=class extends te{constructor(e){super(e),this.canBundle=true,this.allowChildren=false,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this._bounds=new me(0,1,0,0),this._boundsDirty=true;}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=false,this._bounds):this._bounds}get roundPixels(){return !!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0;}containsPoint(e){let t=this.bounds,{x:i,y:s}=e;return i>=t.minX&&i<=t.maxX&&s>=t.minY&&s<=t.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=true,this.didViewUpdate)return;this.didViewUpdate=true;let e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this);}destroy(e){super.destroy(e),this._bounds=null;for(let t in this._gpuData)this._gpuData[t].destroy?.();this._gpuData=null;}collectRenderablesSimple(e,t,i){let{renderPipes:s}=t;s.blendMode.setBlendMode(this,this.groupBlendMode,e),s[this.renderPipeId].addRenderable(this,e),this.didViewUpdate=false;let o=this.children,a=o.length;for(let u=0;u<a;u++)o[u].collectRenderables(e,t,i);}};});var kf,FA=f(()=>{jt();Gr();kf=class extends qe{constructor(e={}){let{element:t,anchor:i,...s}=e;super({label:"DOMContainer",...s}),this.renderPipeId="dom",this.batched=false,this._anchor=new ne(0,0),i&&(this.anchor=i),this.element=e.element||document.createElement("div");}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}set element(e){this._element!==e&&(this._element=e,this.onViewUpdate());}get element(){return this._element}updateBounds(){let e=this._bounds,t=this._element;if(!t){e.minX=0,e.minY=0,e.maxX=0,e.maxY=0;return}let{offsetWidth:i,offsetHeight:s}=t;e.minX=0,e.maxX=i,e.minY=0,e.maxY=s;}destroy(e=false){super.destroy(e),this._element?.parentNode?.removeChild(this._element),this._element=null,this._anchor=null;}};});var OA=f(()=>{E();sy();O.add(Mn);});var Me,ar=f(()=>{Me=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(Me||{});});var Ff,ny=f(()=>{Ff={createCanvas:(r,e)=>{let t=document.createElement("canvas");return t.width=r,t.height=e,t},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,e)=>fetch(r,e),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")};});var GA,V,Se=f(()=>{ny();GA=Ff,V={get(){return GA},set(r){GA=r;}};});function Ur(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function uc(r){return r.split("?")[0].split("#")[0]}function OM(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function GM(r,e,t){return r.replace(new RegExp(OM(e),"g"),t)}function UM(r,e){let t="",i=0,s=-1,n=0,o=-1;for(let a=0;a<=r.length;++a){if(a<r.length)o=r.charCodeAt(a);else {if(o===47)break;o=47;}if(o===47){if(!(s===a-1||n===1))if(s!==a-1&&n===2){if(t.length<2||i!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){let u=t.lastIndexOf("/");if(u!==t.length-1){u===-1?(t="",i=0):(t=t.slice(0,u),i=t.length-1-t.lastIndexOf("/")),s=a,n=0;continue}}else if(t.length===2||t.length===1){t="",i=0,s=a,n=0;continue}}}else t.length>0?t+=`/${r.slice(s+1,a)}`:t=r.slice(s+1,a),i=a-s-1;s=a,n=0;}else o===46&&n!==-1?++n:n=-1;}return t}var De,fs=f(()=>{Se();De={toPosix(r){return GM(r,"\\","/")},isUrl(r){return /^https?:/.test(this.toPosix(r))},isDataUrl(r){return /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},isBlobUrl(r){return r.startsWith("blob:")},hasProtocol(r){return /^[^/:]+:/.test(this.toPosix(r))},getProtocol(r){Ur(r),r=this.toPosix(r);let e=/^file:\/\/\//.exec(r);if(e)return e[0];let t=/^[^/:]+:\/{0,2}/.exec(r);return t?t[0]:""},toAbsolute(r,e,t){if(Ur(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;let i=uc(this.toPosix(e??V.get().getBaseUrl())),s=uc(this.toPosix(t??this.rootname(i)));return r=this.toPosix(r),r.startsWith("/")?De.join(s,r.slice(1)):this.isAbsolute(r)?r:this.join(i,r)},normalize(r){if(Ur(r),r.length===0)return ".";if(this.isDataUrl(r)||this.isBlobUrl(r))return r;r=this.toPosix(r);let e="",t=r.startsWith("/");this.hasProtocol(r)&&(e=this.rootname(r),r=r.slice(e.length));let i=r.endsWith("/");return r=UM(r),r.length>0&&i&&(r+="/"),t?`/${r}`:e+r},isAbsolute(r){return Ur(r),r=this.toPosix(r),this.hasProtocol(r)?true:r.startsWith("/")},join(...r){if(r.length===0)return ".";let e;for(let t=0;t<r.length;++t){let i=r[t];if(Ur(i),i.length>0)if(e===void 0)e=i;else {let s=r[t-1]??"";this.joinExtensions.includes(this.extname(s).toLowerCase())?e+=`/../${i}`:e+=`/${i}`;}}return e===void 0?".":this.normalize(e)},dirname(r){if(Ur(r),r.length===0)return ".";r=this.toPosix(r);let e=r.charCodeAt(0),t=e===47,i=-1,s=true,n=this.getProtocol(r),o=r;r=r.slice(n.length);for(let a=r.length-1;a>=1;--a)if(e=r.charCodeAt(a),e===47){if(!s){i=a;break}}else s=false;return i===-1?t?"/":this.isUrl(o)?n+r:n:t&&i===1?"//":n+r.slice(0,i)},rootname(r){Ur(r),r=this.toPosix(r);let e="";if(r.startsWith("/")?e="/":e=this.getProtocol(r),this.isUrl(r)){let t=r.indexOf("/",e.length);t!==-1?e=r.slice(0,t):e=r,e.endsWith("/")||(e+="/");}return e},basename(r,e){Ur(r),e&&Ur(e),r=uc(this.toPosix(r));let t=0,i=-1,s=true,n;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e.length===r.length&&e===r)return "";let o=e.length-1,a=-1;for(n=r.length-1;n>=0;--n){let u=r.charCodeAt(n);if(u===47){if(!s){t=n+1;break}}else a===-1&&(s=false,a=n+1),o>=0&&(u===e.charCodeAt(o)?--o===-1&&(i=n):(o=-1,i=a));}return t===i?i=a:i===-1&&(i=r.length),r.slice(t,i)}for(n=r.length-1;n>=0;--n)if(r.charCodeAt(n)===47){if(!s){t=n+1;break}}else i===-1&&(s=false,i=n+1);return i===-1?"":r.slice(t,i)},extname(r){Ur(r),r=uc(this.toPosix(r));let e=-1,t=0,i=-1,s=true,n=0;for(let o=r.length-1;o>=0;--o){let a=r.charCodeAt(o);if(a===47){if(!s){t=o+1;break}continue}i===-1&&(s=false,i=o+1),a===46?e===-1?e=o:n!==1&&(n=1):e!==-1&&(n=-1);}return e===-1||i===-1||n===0||n===1&&e===i-1&&e===t+1?"":r.slice(e,i)},parse(r){Ur(r);let e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;r=uc(this.toPosix(r));let t=r.charCodeAt(0),i=this.isAbsolute(r),s;e.root=this.rootname(r),i||this.hasProtocol(r)?s=1:s=0;let o=-1,a=0,u=-1,l=true,c=r.length-1,h=0;for(;c>=s;--c){if(t=r.charCodeAt(c),t===47){if(!l){a=c+1;break}continue}u===-1&&(l=false,u=c+1),t===46?o===-1?o=c:h!==1&&(h=1):o!==-1&&(h=-1);}return o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1?u!==-1&&(a===0&&i?e.base=e.name=r.slice(1,u):e.base=e.name=r.slice(a,u)):(a===0&&i?(e.name=r.slice(1,o),e.base=r.slice(1,u)):(e.name=r.slice(a,o),e.base=r.slice(a,u)),e.ext=r.slice(o,u)),e.dir=this.dirname(r),e},sep:"/",delimiter:":",joinExtensions:[".html"]};});var Ct,Ia=f(()=>{Ct=(r,e,t=false)=>(Array.isArray(r)||(r=[r]),e?r.map(i=>typeof i=="string"||t?e(i):i):r);});function UA(r,e,t,i,s){let n=e[t];for(let o=0;o<n.length;o++){let a=n[o];t<e.length-1?UA(r.replace(i[t],a),e,t+1,i,s):s.push(r.replace(i[t],a));}}function Of(r){let e=/\{(.*?)\}/g,t=r.match(e),i=[];if(t){let s=[];t.forEach(n=>{let o=n.substring(1,n.length-1).split(",");s.push(o);}),UA(r,s,0,t,i);}else i.push(r);return i}var oy=f(()=>{});var ki,lc=f(()=>{ki=r=>!Array.isArray(r);});function ay(r){return r.split(".").pop().split("?").shift().split("#").shift()}var Pt,ps=f(()=>{_e();fs();Ia();oy();lc();Pt=class{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${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(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params));}),this._resolverHash={};}set basePath(e){this._basePath=e;}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e;}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(e){if(typeof e=="string")this._defaultSearchParams=e;else {let t=e;this._defaultSearchParams=Object.keys(t).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`).join("&");}}getAlias(e){let{alias:t,src:i}=e;return Ct(t||i,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>o?.src??o):n?.src?n.src:n,true)}addManifest(e){this._manifest&&F("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets);});}addBundle(e,t){let i=[],s=t;Array.isArray(t)||(s=Object.entries(t).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),s.forEach(n=>{let o=n.src,a=n.alias,u;if(typeof a=="string"){let l=this._createBundleAssetId(e,a);i.push(l),u=[a,l];}else {let l=a.map(c=>this._createBundleAssetId(e,c));i.push(...l),u=[...a,...l];}this.add({...n,alias:u,src:o});}),this._bundles[e]=i;}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let i;i=n=>{this.hasKey(n)&&F(`[Resolver] already has key: ${n} overwriting`);},Ct(t).forEach(n=>{let{src:o}=n,{data:a,format:u,loadParser:l}=n,c=Ct(o).map(p=>typeof p=="string"?Of(p):Array.isArray(p)?p:[p]),h=this.getAlias(n);Array.isArray(h)?h.forEach(i):i(h);let d=[];c.forEach(p=>{p.forEach(_=>{let b={};if(typeof _!="object"){b.src=_;for(let x=0;x<this._parsers.length;x++){let g=this._parsers[x];if(g.test(_)){b=g.parse(_);break}}}else a=_.data??a,u=_.format??u,l=_.loadParser??l,b={...b,..._};if(!h)throw new Error(`[Resolver] alias is undefined for this asset: ${b.src}`);b=this._buildResolvedAsset(b,{aliases:h,data:a,format:u,loadParser:l}),d.push(b);});}),h.forEach(p=>{this._assetMap[p]=d;});});}resolveBundle(e){let t=ki(e);e=Ct(e);let i={};return e.forEach(s=>{let n=this._bundles[s];if(n){let o=this.resolve(n),a={};for(let u in o){let l=o[u];a[this._extractAssetIdFromBundle(s,u)]=l;}i[s]=a;}}),t?i[e[0]]:i}resolveUrl(e){let t=this.resolve(e);if(typeof e!="string"){let i={};for(let s in t)i[s]=t[s].src;return i}return t.src}resolve(e){let t=ki(e);e=Ct(e);let i={};return e.forEach(s=>{if(!this._resolverHash[s])if(this._assetMap[s]){let n=this._assetMap[s],o=this._getPreferredOrder(n);o?.priority.forEach(a=>{o.params[a].forEach(u=>{let l=n.filter(c=>c[a]?c[a]===u:false);l.length&&(n=l);});}),this._resolverHash[s]=n[0];}else this._resolverHash[s]=this._buildResolvedAsset({alias:[s],src:s},{});i[s]=this._resolverHash[s];}),t?i[e[0]]:i}hasKey(e){return !!this._assetMap[e]}hasBundle(e){return !!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let i=e[t],s=this._preferredOrder.find(n=>n.params.format.includes(i.format));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;let t=/\?/.test(e)?"&":"?";return `${e}${t}${this._defaultSearchParams}`}_buildResolvedAsset(e,t){let{aliases:i,data:s,loadParser:n,format:o}=t;return (this._basePath||this._rootPath)&&(e.src=De.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...s||{},...e.data},e.loadParser=n??e.loadParser,e.format=o??e.format??ay(e.src),e}};Pt.RETINA_PREFIX=/@([0-9\.]+)x/;});var Dn,Gf=f(()=>{Dn=(r,e)=>{let t=e.split("?")[1];return t&&(r+=`?${t}`),r};});var LA,hc,uy=f(()=>{Ze();ct();ce();LA=class cc{constructor(e,t){this.linkedSheets=[];let i=e;e?.source instanceof oe&&(i={texture:e,data:t});let{texture:s,data:n,cachePrefix:o=""}=i;this.cachePrefix=o,this._texture=s instanceof C?s:null,this.textureSource=s.source,this.textures={},this.animations={},this.data=n;let a=parseFloat(n.meta.scale);a?(this.resolution=a,s.source.resolution=this.resolution):this.resolution=s.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null;}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=cc.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch();})}_processFrames(e){let t=e,i=cc.BATCH_SIZE;for(;t-e<i&&t<this._frameKeys.length;){let s=this._frameKeys[t],n=this._frames[s],o=n.frame;if(o){let a=null,u=null,l=n.trimmed!==false&&n.sourceSize?n.sourceSize:n.frame,c=new Z(0,0,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution);n.rotated?a=new Z(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):a=new Z(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),n.trimmed!==false&&n.spriteSourceSize&&(u=new Z(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[s]=new C({source:this.textureSource,frame:a,orig:c,trim:u,rotate:n.rotated?2:0,defaultAnchor:n.anchor,defaultBorders:n.borders,label:s.toString()});}t++;}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let i=0;i<e[t].length;i++){let s=e[t][i];this.animations[t].push(this.textures[s]);}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures);}_nextBatch(){this._processFrames(this._batchIndex*cc.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*cc.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete());},0);}destroy(e=false){for(let t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[];}};LA.BATCH_SIZE=1e3;hc=LA;});function NA(r,e,t){let i={};if(r.forEach(s=>{i[s]=e;}),Object.keys(e.textures).forEach(s=>{i[`${e.cachePrefix}${s}`]=e.textures[s];}),!t){let s=De.dirname(r[0]);e.linkedSheets.forEach((n,o)=>{let a=NA([`${s}/${e.data.meta.related_multi_packs[o]}`],n,true);Object.assign(i,a);});}return i}var LM,Uf,ly=f(()=>{ar();ps();Gf();E();ce();fs();uy();LM=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];Uf={extension:m.Asset,cache:{test:r=>r instanceof hc,getCacheableAssets:(r,e)=>NA(r,e,false)},resolver:{extension:{type:m.ResolveParser,name:"resolveSpritesheet"},test:r=>{let t=r.split("?")[0].split("."),i=t.pop(),s=t.pop();return i==="json"&&LM.includes(s)},parse:r=>{let e=r.split(".");return {resolution:parseFloat(Pt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e[e.length-2],src:r}}},loader:{name:"spritesheetLoader",extension:{type:m.LoadParser,priority:Me.Normal,name:"spritesheetLoader"},async testParse(r,e){return De.extname(e.src).toLowerCase()===".json"&&!!r.frames},async parse(r,e,t){let{texture:i,imageFilename:s,textureOptions:n,cachePrefix:o}=e?.data??{},a=De.dirname(e.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let u;if(i instanceof C)u=i;else {let h=Dn(a+(s??r.meta.image),e.src);u=(await t.load([{src:h,data:n}]))[h];}let l=new hc({texture:u.source,data:r,cachePrefix:o});await l.parse();let c=r?.meta?.related_multi_packs;if(Array.isArray(c)){let h=[];for(let p of c){if(typeof p!="string")continue;let _=a+p;e.data?.ignoreMultiPack||(_=Dn(_,e.src),h.push(t.load({src:_,data:{textureOptions:n,ignoreMultiPack:true}})));}let d=await Promise.all(h);l.linkedSheets=d,d.forEach(p=>{p.linkedSheets=[l].concat(l.linkedSheets.filter(_=>_!==p));});}return l},async unload(r,e,t){await t.unload(r.textureSource._sourceOrigin),r.destroy(false);}}};});var Lf=f(()=>{E();ly();O.add(Uf);});function ka(r,e,t){let{width:i,height:s}=t.orig,n=t.trim;if(n){let o=n.width,a=n.height;r.minX=n.x-e._x*i,r.maxX=r.minX+o,r.minY=n.y-e._y*s,r.maxY=r.minY+a;}else r.minX=-e._x*i,r.maxX=r.minX+i,r.minY=-e._y*s,r.maxY=r.minY+s;}var Nf=f(()=>{});var Ee,ms=f(()=>{is();ce();Nf();xe();Gr();Ee=class r extends qe{constructor(e=C.EMPTY){e instanceof C&&(e={texture:e});let{texture:t=C.EMPTY,anchor:i,roundPixels:s,width:n,height:o,...a}=e;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=true,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new we({_onUpdate:()=>{this.onViewUpdate();}}),i?this.anchor=i:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=false,this.roundPixels=s??false,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o);}static from(e,t=false){return e instanceof C?new r(e):new r(C.from(e,t))}set texture(e){e||(e=C.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate());}get texture(){return this._texture}get visualBounds(){return ka(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return I("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){let e=this._anchor,t=this._texture,i=this._bounds,{width:s,height:n}=t.orig;i.minX=-e._x*s,i.maxX=i.minX+s,i.minY=-e._y*n,i.maxY=i.minY+n;}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null,this._gpuData=null;}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e;}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e;}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height);}};});function gs(r,e,t){let i=NM;r.measurable=true,ii(r,t,i),e.addBoundsMask(i),r.measurable=false;}var NM,dc=f(()=>{Et();vn();NM=new me;});function xs(r,e,t){let i=Nt.get();r.measurable=true;let s=je.get().identity(),n=HA(r,t,s);os(r,i,n),r.measurable=false,e.addBoundsMask(i),je.return(s),Nt.return(i);}function HA(r,e,t){return r?(r!==e&&(HA(r.parent,e,t),r.updateLocalTransform(),t.append(r.localTransform)),t):(F("Mask bounds, renderable is not inside the root container"),t)}var fc=f(()=>{Jl();ss();_e();});var In,cy=f(()=>{E();ms();dc();fc();In=class{constructor(e){this.priority=0,this.inverse=false,this.pipe="alphaMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof Ee),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=false;}reset(){this.mask.measurable=true,this.mask=null;}addBounds(e,t){this.inverse||gs(this.mask,e,t);}addLocalBounds(e,t){xs(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof Ee}};In.extension=m.MaskEffect;});var kn,hy=f(()=>{E();kn=class{constructor(e){this.priority=0,this.pipe="colorMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e;}destroy(){}static test(e){return typeof e=="number"}};kn.extension=m.MaskEffect;});var Fn,dy=f(()=>{E();qt();dc();fc();Fn=class{constructor(e){this.priority=0,this.pipe="stencilMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e,this.mask.includeInBuild=false,this.mask.measurable=false;}reset(){this.mask.measurable=true,this.mask.includeInBuild=true,this.mask=null;}addBounds(e,t){gs(this.mask,e,t);}addLocalBounds(e,t){xs(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof te}};Fn.extension=m.MaskEffect;});var ht,On=f(()=>{Se();E();ct();ht=class extends oe{constructor(e){e.resource||(e.resource=V.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent;}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight);}resize(e=this.width,t=this.height,i=this._resolution){let s=super.resize(e,t,i);return s&&this.resizeCanvas(),s}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}};ht.extension=m.TextureSource;});var Rt,Gn=f(()=>{E();ct();Rt=class extends oe{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=true;}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}};Rt.extension=m.TextureSource;});async function Fa(){return fy??(fy=(async()=>{let e=document.createElement("canvas").getContext("webgl");if(!e)return "premultiply-alpha-on-upload";let t=await new Promise(o=>{let a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=false,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load();});if(!t)return "premultiply-alpha-on-upload";let i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let n=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,n),e.deleteFramebuffer(s),e.deleteTexture(i),e.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),fy}var fy,Hf=f(()=>{});var Vf,_s,zf=f(()=>{E();ds();Hf();ct();Vf=class VA extends oe{constructor(e){super(e),this.isReady=false,this.uploadMethodId="video",e={...VA.defaultOptions,...e},this._autoUpdate=true,this._isConnectedToTicker=false,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==false,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",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._onCanPlayThrough=this._onCanPlayThrough.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),e.autoLoad!==false&&this.load();}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=ye.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e);}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update();}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback);}get isValid(){return !!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let e=this.resource,t=this.options;return (e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=true),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,true)),this.alphaMode=await Fa(),this._load=new Promise((i,s)=>{this.isValid?i(this):(this._resolve=i,this._reject=s,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`));})),e.load());}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,true),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null);}_isSourcePlaying(){let e=this.resource;return !e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate();}_onPlayStop(){this._configureAutoUpdate();}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0);}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady();}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady();}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=true,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play();}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,true),e.pause(),e.src="",e.load()),super.destroy();}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate());}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate());}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(ye.shared.remove(this.updateFrame,this),this._isConnectedToTicker=false,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ye.shared.add(this.updateFrame,this),this._isConnectedToTicker=true,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ye.shared.remove(this.updateFrame,this),this._isConnectedToTicker=false,this._msToNextUpdate=0));}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};Vf.extension=m.TextureSource;Vf.defaultOptions={...oe.defaultOptions,autoLoad:true,autoPlay:true,updateFPS:0,crossorigin:true,loop:false,muted:true,playsinline:true,preload:false};Vf.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};_s=Vf;});var py,de,ni=f(()=>{_e();Ia();py=class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map;}reset(){this._cacheMap.clear(),this._cache.clear();}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||F(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let i=Ct(e),s;for(let u=0;u<this.parsers.length;u++){let l=this.parsers[u];if(l.test(t)){s=l.getCacheableAssets(i,t);break}}let n=new Map(Object.entries(s||{}));s||i.forEach(u=>{n.set(u,t);});let o=[...n.keys()],a={cacheKeys:o,keys:i};i.forEach(u=>{this._cacheMap.set(u,a);}),o.forEach(u=>{let l=s?s[u]:t;this._cache.has(u)&&this._cache.get(u)!==l&&F("[Cache] already has key:",u),this._cache.set(u,n.get(u));});}remove(e){if(!this._cacheMap.has(e)){F(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(s=>{this._cache.delete(s);}),t.keys.forEach(s=>{this._cacheMap.delete(s);});}get parsers(){return this._parsers}},de=new py;});function zA(r={}){return gy(r)}function gy(r={}){let e=r&&r.resource,t=e?r.resource:r,i=e?r:{resource:r};for(let s=0;s<my.length;s++){let n=my[s];if(n.test(t))return new n(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function xy(r={},e=false){let t=r&&r.resource,i=t?r.resource:r,s=t?r:{resource:r};if(!e&&de.has(i))return de.get(i);let n=new C({source:gy(s)});return n.on("destroy",()=>{de.has(i)&&de.remove(i);}),e||de.set(i,n),n}function _y(r,e=false){return typeof r=="string"?de.get(r):r instanceof oe?new C({source:r}):xy(r,e)}var my,by=f(()=>{ni();E();ct();ce();my=[];O.handleByList(m.TextureSource,my);C.from=_y;oe.from=gy;});var Wf=f(()=>{E();cy();hy();dy();vf();On();Gn();zf();by();O.add(In,kn,Fn,_s,Rt,ht,Di);});var nt,Fi=f(()=>{nt=class{constructor(e){this.resources=Object.create(null),this._dirty=true;let t=0;for(let i in e){let s=e[i];this.setResource(s,t++);}this._updateKey();}_updateKey(){if(!this._dirty)return;this._dirty=false;let e=[],t=0;for(let i in this.resources)e[t++]=this.resources[i]._resourceId;this._key=e.join("|");}setResource(e,t){let i=this.resources[t];e!==i&&(i&&e.off?.("change",this.onResourceChange,this),e.on?.("change",this.onResourceChange,this),this.resources[t]=e,this._dirty=true);}getResource(e){return this.resources[e]}_touch(e){let t=this.resources;for(let i in t)t[i]._touched=e;}destroy(){let e=this.resources;for(let t in e)e[t].off?.("change",this.onResourceChange,this);this.resources=null;}onResourceChange(e){if(this._dirty=true,e.destroyed){let t=this.resources;for(let i in t)t[i]===e&&(t[i]=null);}else this._updateKey();}};});function bs(r,e,t){let i=2166136261;for(let s=0;s<e;s++)i^=r[s].uid,i=Math.imul(i,16777619),i>>>=0;return WA[i]||HM(r,e,i,t)}function HM(r,e,t,i){let s={},n=0;for(let a=0;a<i;a++){let u=a<e?r[a]:C.EMPTY.source;s[n++]=u.source,s[n++]=u.style;}let o=new nt(s);return WA[t]=o,o}var WA,pc=f(()=>{Fi();ce();WA={};});var yr,Xf=f(()=>{yr=class{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength;}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 int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(e){return this[`${e}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(e){switch(e){case "int8":case "uint8":return 1;case "int16":case "uint16":return 2;case "int32":case "uint32":case "float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}};});function Un(r,e){let t=r.byteLength/8|0,i=new Float64Array(r,0,t);new Float64Array(e,0,t).set(i);let n=r.byteLength-t*8;if(n>0){let o=new Uint8Array(r,t*8,n);new Uint8Array(e,t*8,n).set(o);}}var Yf=f(()=>{});var $f,Be,ys=f(()=>{$f={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},Be=(r=>(r[r.DISABLED=0]="DISABLED",r[r.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",r[r.MASK_ACTIVE=2]="MASK_ACTIVE",r[r.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",r[r.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",r[r.NONE=5]="NONE",r))(Be||{});});function Lr(r,e){return e.alphaMode==="no-premultiply-alpha"&&$f[r]||r}var Oa=f(()=>{ys();});function Ga(){return (!jf||jf?.isContextLost())&&(jf=V.get().createCanvas().getContext("webgl",{})),jf}var jf,qf=f(()=>{Se();});function zM(r){let e="";for(let t=0;t<r;++t)t>0&&(e+=`
|
|
19
|
+
`,e.accessibleText&&(t.innerText=e.accessibleText)),t.style.width=`${Cf}px`,t.style.height=`${Cf}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=wA.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=true,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e.interactive&&(e._accessibleDiv.tabIndex=e.tabIndex);}_dispatchEvent(e,t){let{container:i}=e.target,s=this._renderer.events.rootBoundary,n=Object.assign(new si(s),{target:i});s.rootTarget=this._renderer.lastObjectRendered,t.forEach(o=>s.dispatchEvent(n,o));}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"]);}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"]);}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"]);}_onKeyDown(e){e.keyCode!==CM||!this._activateOnTab||this._activate();}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate();}destroy(){this._deactivate(),this._destroyTouchHook(),this._div=null,this._pool=null,this._children=null,this._renderer=null,this._activateOnTab&&globalThis.removeEventListener("keydown",this._onKeyDown);}setAccessibilityEnabled(e){e?this._activate():this._deactivate();}};Xb.extension={type:[g.WebGLSystem,g.WebGPUSystem],name:"accessibility"};Xb.defaultOptions={enabledByDefault:false,debug:false,activateOnTab:true,deactivateOnMouseMove:true};Pf=Xb;});var wf,$b=f(()=>{wf={accessible:false,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:true,_accessibleActive:false,_accessibleDiv:null,_renderId:-1};});var MA=f(()=>{E();qt();Yb();$b();O.add(Pf);O.mixin(te,wf);});var wn,jb=f(()=>{E();wn=class{static init(e){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;this._cancelResize();let t,i;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight;else {let{clientWidth:s,clientHeight:n}=this._resizeTo;t=s,i=n;}this.renderer.resize(t,i),this.render();},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null;}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null;}};wn.extension=g.Application;});var Ht,Bn=f(()=>{Ht=(r=>(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(Ht||{});});var hs,qb=f(()=>{hs=class{constructor(e,t=null,i=0,s=false){this.next=null,this.previous=null,this._destroyed=false,this._fn=e,this._context=t,this.priority=i,this._once=s;}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));let t=this.next;return this._once&&this.destroy(true),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this;}destroy(e=false){this._destroyed=true,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}};});var DA,ye,ds=f(()=>{Bn();qb();DA=class or{constructor(){this.autoStart=false,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=false,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=false,this._lastFrame=-1,this._head=new hs(null,null,1/0),this.deltaMS=1/or.targetFPMS,this.elapsedMS=1/or.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)));};}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick));}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null);}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start();}add(e,t,i=Ht.NORMAL){return this._addListener(new hs(e,t,i))}addOnce(e,t,i=Ht.NORMAL){return this._addListener(new hs(e,t,i,true))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else {for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next;}e.previous||e.connect(i);}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=true,this._requestIfNeeded());}stop(){this.started&&(this.started=false,this._cancelIfNeeded());}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(true);this._head.destroy(),this._head=null;}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){let n=e-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=e-n%this._minElapsedMS;}this.deltaMS=t,this.deltaTime=this.deltaMS*or.targetFPMS;let i=this._head,s=i.next;for(;s;)s=s.emit(this);i.next||this._cancelIfNeeded();}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e;}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){let t=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,t)/1e3,or.targetFPMS);this._maxElapsedMS=1/i;}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else {let t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3);}}static get shared(){if(!or._shared){let e=or._shared=new or;e.autoStart=true,e._protected=true;}return or._shared}static get system(){if(!or._system){let e=or._system=new or;e.autoStart=true,e._protected=true;}return or._system}};DA.targetFPMS=.06;ye=DA;});var Rn,Kb=f(()=>{E();Bn();ds();Rn=class{static init(e){e=Object.assign({autoStart:true,sharedTicker:false},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ht.LOW);},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop();},this.start=()=>{this._ticker.start();},this._ticker=null,this.ticker=e.sharedTicker?ye.shared:new ye,e.autoStart&&this.start();}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy();}}};Rn.extension=g.Application;});var Zb=f(()=>{E();jb();Kb();O.add(wn);O.add(Rn);});function F(...r){Qb!==IA&&(Qb++,Qb===IA?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r));}var Qb,IA,_e=f(()=>{Qb=0,IA=500;});var Jb,_r,Bf=f(()=>{Bn();ds();Jb=class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=false,this._tickerAdded=false,this._pauseUpdate=true;}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=false,this._tickerAdded=false,this._pauseUpdate=true;}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e;}addTickerListener(){this._tickerAdded||!this.domElement||(ye.system.add(this._tickerUpdate,this,Ht.INTERACTION),this._tickerAdded=true);}removeTickerListener(){this._tickerAdded&&(ye.system.remove(this._tickerUpdate,this),this._tickerAdded=false);}pointerMoved(){this._didMove=true;}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=false;return}let e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}):new MouseEvent("mousemove",{clientX:e.clientX,clientY:e.clientY}));}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update());}},_r=new Jb;});var Or,oc=f(()=>{jt();sc();Or=class extends si{constructor(){super(...arguments),this.client=new ne,this.movement=new ne,this.offset=new ne,this.global=new ne,this.screen=new ne;}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}getLocalPosition(e,t,i){return e.worldTransform.applyInverse(i||this.global,t)}getModifierState(e){return "getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,i,s,n,o,a,u,l,c,h,d,p,_,b){throw new Error("Method not implemented.")}};});var At,Rf=f(()=>{oc();At=class extends Or{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=false;}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}};});var br,Mf=f(()=>{oc();br=class extends Or{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2;}};br.DOM_DELTA_PIXEL=0;br.DOM_DELTA_LINE=1;br.DOM_DELTA_PAGE=2;});var DM,IM,ac,Ma,ey=f(()=>{St();jt();_e();Bf();oc();Rf();Mf();DM=2048,IM=new ne,ac=new ne,Ma=class{constructor(e){this.dispatch=new ue,this.moveOnAll=false,this.enableGlobalMoveEvents=true,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=false,this.rootTarget=e,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(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((i,s)=>i.priority-s.priority);}dispatchEvent(e,t){e.propagationStopped=false,e.propagationImmediatelyStopped=false,this.propagate(e,t),this.dispatch.emit(t||e.type,e);}mapEvent(e){if(!this.rootTarget)return;let t=this.mappingTable[e.type];if(t)for(let i=0,s=t.length;i<s;i++)t[i].fn(e);else F(`[EventBoundary]: Event mapping not defined for ${e.type}`);}hitTest(e,t){_r.pauseUpdate=true;let s=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",n=this[s](this.rootTarget,this.rootTarget.eventMode,IM.set(e,t),this.hitTestFn,this.hitPruneFn);return n&&n[0]}propagate(e,t){if(!e.target)return;let i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let s=0,n=i.length-1;s<n;s++)if(e.currentTarget=i[s],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let s=i.length-2;s>=0;s--)if(e.currentTarget=i[s],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;let s=Array.isArray(t)?t:[t];for(let n=i.length-1;n>=0;n--)s.forEach(o=>{e.currentTarget=i[n],this.notifyTarget(e,o);});}propagationPath(e){let t=[e];for(let i=0;i<DM&&e!==this.rootTarget&&e.parent;i++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent;}return t.reverse(),t}hitTestMoveRecursive(e,t,i,s,n,o=false){let a=false;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(_r.pauseUpdate=false),e.interactiveChildren&&e.children){let c=e.children;for(let h=c.length-1;h>=0;h--){let d=c[h],p=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,s,n,o||n(e,i));if(p){if(p.length>0&&!p[p.length-1].parent)continue;let _=e.isInteractive();(p.length>0||_)&&(_&&this._allInteractiveElements.push(e),p.push(e)),this._hitElements.length===0&&(this._hitElements=p),a=true;}}}let u=this._isInteractive(t),l=e.isInteractive();return l&&l&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:u&&!n(e,i)&&s(e,i)?l?[e]:[]:null}hitTestRecursive(e,t,i,s,n){if(this._interactivePrune(e)||n(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(_r.pauseUpdate=false),e.interactiveChildren&&e.children){let u=e.children,l=i;for(let c=u.length-1;c>=0;c--){let h=u[c],d=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,l,s,n);if(d){if(d.length>0&&!d[d.length-1].parent)continue;let p=e.isInteractive();return (d.length>0||p)&&d.push(e),d}}}let o=this._isInteractive(t),a=e.isInteractive();return o&&s(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return !e||!e.visible||!e.renderable||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,ac),!e.hitArea.contains(ac.x,ac.y)))return true;if(e.effects&&e.effects.length)for(let i=0;i<e.effects.length;i++){let s=e.effects[i];if(s.containsPoint&&!s.containsPoint(t,this.hitTestFn))return true}return false}hitTestFn(e,t){return e.hitArea?true:e?.containsPoint?(e.worldTransform.applyInverse(t,ac),e.containsPoint(ac)):false}notifyTarget(e,t){if(!e.currentTarget.isInteractive())return;t??(t=e.type);let i=`on${t}`;e.currentTarget[i]?.(e);let s=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,s),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t);}mapPointerDown(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){let s=t.button===2;this.dispatchEvent(t,s?"rightdown":"mousedown");}let i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t);}mapPointerMove(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=true;let t=this.createPointerEvent(e);this._isPointerMoveEvent=false;let i=t.pointerType==="mouse"||t.pointerType==="pen",s=this.trackingData(e.pointerId),n=this.findMountedTarget(s.overTargets);if(s.overTargets?.length>0&&n!==t.target){let u=e.type==="mousemove"?"mouseout":"pointerout",l=this.createPointerEvent(e,u,n);if(this.dispatchEvent(l,"pointerout"),i&&this.dispatchEvent(l,"mouseout"),!t.composedPath().includes(n)){let c=this.createPointerEvent(e,"pointerleave",n);for(c.eventPhase=c.AT_TARGET;c.target&&!t.composedPath().includes(c.target);)c.currentTarget=c.target,this.notifyTarget(c),i&&this.notifyTarget(c,"mouseleave"),c.target=c.target.parent;this.freeEvent(c);}this.freeEvent(l);}if(n!==t.target){let u=e.type==="mousemove"?"mouseover":"pointerover",l=this.clonePointerEvent(t,u);this.dispatchEvent(l,"pointerover"),i&&this.dispatchEvent(l,"mouseover");let c=n?.parent;for(;c&&c!==this.rootTarget.parent&&c!==t.target;)c=c.parent;if(!c||c===this.rootTarget.parent){let d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==n&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d);}this.freeEvent(l);}let o=[],a=this.enableGlobalMoveEvents??true;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=t.target?.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,s.overTargets=t.composedPath(),this.freeEvent(t);}mapPointerOver(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),s=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=i.target?.cursor);let n=this.clonePointerEvent(i,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),s&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(n);}mapPointerOut(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId);if(t.overTargets){let i=e.pointerType==="mouse"||e.pointerType==="pen",s=this.findMountedTarget(t.overTargets),n=this.createPointerEvent(e,"pointerout",s);this.dispatchEvent(n),i&&this.dispatchEvent(n,"mouseout");let o=this.createPointerEvent(e,"pointerleave",s);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(n),this.freeEvent(o);}this.cursor=null;}mapPointerUp(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){let a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup");}let s=this.trackingData(e.pointerId),n=this.findMountedTarget(s.pressTargetsByButton[e.button]),o=n;if(n&&!i.composedPath().includes(n)){let a=n;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){let u=i.button===2;this.notifyTarget(i,u?"rightupoutside":"mouseupoutside");}a=a.parent;}delete s.pressTargetsByButton[e.button],o=a;}if(o){let a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,s.clicksByButton[e.button]||(s.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});let u=s.clicksByButton[e.button];if(u.target===a.target&&t-u.timeStamp<200?++u.clickCount:u.clickCount=1,u.target=a.target,u.timeStamp=t,a.detail=u.clickCount,a.pointerType==="mouse"){let l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click");}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a);}this.freeEvent(i);}mapPointerUpOutside(e){if(!(e instanceof At)){F("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),s=this.createPointerEvent(e);if(i){let n=i;for(;n;)s.currentTarget=n,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"?this.notifyTarget(s,"touchendoutside"):(s.pointerType==="mouse"||s.pointerType==="pen")&&this.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete t.pressTargetsByButton[e.button];}this.freeEvent(s);}mapWheel(e){if(!(e instanceof br)){F("EventBoundary cannot map a non-wheel event as a wheel event");return}let t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t);}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i<e.length&&e[i].parent===t;i++)t=e[i];return t}createPointerEvent(e,t,i){let s=this.allocateEvent(At);return this.copyPointerData(e,s),this.copyMouseData(e,s),this.copyData(e,s),s.nativeEvent=e.nativeEvent,s.originalEvent=e,s.target=i??this.hitTest(s.global.x,s.global.y)??this._hitElements[0],typeof t=="string"&&(s.type=t),s}createWheelEvent(e){let t=this.allocateEvent(br);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){let i=this.allocateEvent(At);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=t??i.type,i}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ;}copyPointerData(e,t){e instanceof At&&t instanceof At&&(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);}copyMouseData(e,t){e instanceof Or&&t instanceof Or&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global));}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page);}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);let t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=false,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");let t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e);}_notifyListeners(e,t){let i=e.currentTarget._events[t];if(i)if("fn"in i)i.once&&e.currentTarget.removeListener(t,i.fn,void 0,true),i.fn.call(i.context,e);else for(let s=0,n=i.length;s<n&&!e.propagationImmediatelyStopped;s++)i[s].once&&e.currentTarget.removeListener(t,i[s].fn,void 0,true),i[s].fn.call(i[s].context,e);}};});var kM,FM,ry,Da,Df=f(()=>{E();ey();Bf();Rf();Mf();kM=1,FM={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},ry=class ty{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new Ma(null),_r.init(this),this.autoPreventDefault=true,this._eventsAdded=false,this._rootPointerEvent=new At(null),this._rootWheelEvent=new br(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...ty.defaultEventFeatures},{set:(t,i,s)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=s),t[i]=s,true)}),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){let{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,ty._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove;}resolutionChange(e){this.resolution=e;}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null;}setCursor(e){e||(e="default");let t=true;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=false),this._currentCursor===e)return;this._currentCursor=e;let i=this.cursorStyles[e];if(i)switch(typeof i){case "string":t&&(this.domElement.style.cursor=i);break;case "function":i(e);break;case "object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e);}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,s=t.length;i<s;i++){let n=t[i],o=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(o);}this.setCursor(this.rootBoundary.cursor);}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,_r.pointerMoved();let t=this._normalizeToPointerData(e);for(let i=0,s=t.length;i<s;i++){let n=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(n);}this.setCursor(this.rootBoundary.cursor);}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);let i=t!==this.domElement?"outside":"",s=this._normalizeToPointerData(e);for(let n=0,o=s.length;n<o;n++){let a=this._bootstrapEvent(this._rootPointerEvent,s[n]);a.type+=i,this.rootBoundary.mapEvent(a);}this.setCursor(this.rootBoundary.cursor);}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);for(let i=0,s=t.length;i<s;i++){let n=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(n);}this.setCursor(this.rootBoundary.cursor);}onWheel(e){if(!this.features.wheel)return;let t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t);}setTargetElement(e){this._removeEvents(),this.domElement=e,_r.domElement=e,this._addEvents();}_addEvents(){if(this._eventsAdded||!this.domElement)return;_r.addTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,true),this.domElement.addEventListener("pointerdown",this._onPointerDown,true),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,true),this.domElement.addEventListener("pointerover",this._onPointerOverOut,true),globalThis.addEventListener("pointerup",this._onPointerUp,true)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,true),this.domElement.addEventListener("mousedown",this._onPointerDown,true),this.domElement.addEventListener("mouseout",this._onPointerOverOut,true),this.domElement.addEventListener("mouseover",this._onPointerOverOut,true),globalThis.addEventListener("mouseup",this._onPointerUp,true),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,true),this.domElement.addEventListener("touchend",this._onPointerUp,true),this.domElement.addEventListener("touchmove",this._onPointerMove,true))),this.domElement.addEventListener("wheel",this.onWheel,{passive:true,capture:true}),this._eventsAdded=true;}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;_r.removeTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,true),this.domElement.removeEventListener("pointerdown",this._onPointerDown,true),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,true),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,true),globalThis.removeEventListener("pointerup",this._onPointerUp,true)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,true),this.domElement.removeEventListener("mousedown",this._onPointerDown,true),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,true),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,true),globalThis.removeEventListener("mouseup",this._onPointerUp,true),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,true),this.domElement.removeEventListener("touchend",this._onPointerUp,true),this.domElement.removeEventListener("touchmove",this._onPointerMove,true))),this.domElement.removeEventListener("wheel",this.onWheel,true),this.domElement=null,this._eventsAdded=false;}mapPositionToPoint(e,t,i){let s=this.domElement.isConnected?this.domElement.getBoundingClientRect():{width:this.domElement.width,height:this.domElement.height,left:0,top:0},n=1/this.resolution;e.x=(t-s.left)*(this.domElement.width/s.width)*n,e.y=(i-s.top)*(this.domElement.height/s.height)*n;}_normalizeToPointerData(e){let t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let i=0,s=e.changedTouches.length;i<s;i++){let n=e.changedTouches[i];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=true,n.type=e.type,t.push(n);}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){let i=e;typeof i.isPrimary>"u"&&(i.isPrimary=true),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=kM),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=true,t.push(i);}else t.push(e);return t}normalizeWheelEvent(e){let t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=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.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=FM[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey;}};ry.extension={name:"events",type:[g.WebGLSystem,g.CanvasSystem,g.WebGPUSystem],priority:-1};ry.defaultEventFeatures={move:true,globalMove:true,click:true,wheel:true};Da=ry;});var If,iy=f(()=>{Df();sc();If={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,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(r){this.eventMode=r?"static":"passive";},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Da.defaultEventMode},set eventMode(r){this._internalEventMode=r;},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:true,hitArea:null,addEventListener(r,e,t){let i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,s=typeof t=="object"?t.signal:void 0,n=typeof t=="object"?t.once===true:false,o=typeof e=="function"?void 0:e;r=i?`${r}capture`:r;let a=typeof e=="function"?e:e.handleEvent,u=this;s&&s.addEventListener("abort",()=>{u.off(r,a,o);}),n?u.once(r,a,o):u.on(r,a,o);},removeEventListener(r,e,t){let i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,s=typeof e=="function"?void 0:e;r=i?`${r}capture`:r,e=typeof e=="function"?e:e.handleEvent,this.off(r,e,s);},dispatchEvent(r){if(!(r instanceof si))throw new Error("Container cannot propagate events outside of the Federated Events API");return r.defaultPrevented=false,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}};});var kA=f(()=>{E();qt();Df();iy();O.add(Da);O.mixin(te,If);});var Mn,sy=f(()=>{E();Mn=class{constructor(e){this._attachedDomElements=[],this._renderer=e,this._renderer.runners.postrender.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000";}addRenderable(e,t){this._attachedDomElements.includes(e)||this._attachedDomElements.push(e);}updateRenderable(e){}validateRenderable(e){return true}postrender(){let e=this._attachedDomElements;if(e.length===0){this._domElement.remove();return}let t=this._renderer.view.canvas;this._domElement.parentNode!==t.parentNode&&t.parentNode?.appendChild(this._domElement);let i=parseFloat(t.style.width)/t.width*this._renderer.resolution,s=parseFloat(t.style.height)/t.height*this._renderer.resolution;this._domElement.style.transform=`translate(${t.offsetLeft}px, ${t.offsetTop}px) scale(${i}, ${s})`;for(let n=0;n<e.length;n++){let o=e[n],a=o.element;if(!o.parent||o.globalDisplayStatus<7)a?.remove(),e.splice(n,1),n--;else {this._domElement.contains(a)||(a.style.position="absolute",a.style.pointerEvents="auto",this._domElement.appendChild(a));let u=o.worldTransform,l=o._anchor,c=o.width*l.x,h=o.height*l.y;a.style.transformOrigin=`${c}px ${h}px`,a.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, ${u.tx-c}, ${u.ty-h})`,a.style.opacity=o.groupAlpha.toString();}}}destroy(){this._renderer.runners.postrender.remove(this);for(let e=0;e<this._attachedDomElements.length;e++)this._attachedDomElements[e].element?.remove();this._attachedDomElements.length=0,this._domElement.remove(),this._renderer=null;}};Mn.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"dom"};});var qe,Gr=f(()=>{Et();qt();qe=class extends te{constructor(e){super(e),this.canBundle=true,this.allowChildren=false,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this._bounds=new me(0,1,0,0),this._boundsDirty=true;}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=false,this._bounds):this._bounds}get roundPixels(){return !!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0;}containsPoint(e){let t=this.bounds,{x:i,y:s}=e;return i>=t.minX&&i<=t.maxX&&s>=t.minY&&s<=t.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=true,this.didViewUpdate)return;this.didViewUpdate=true;let e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this);}destroy(e){super.destroy(e),this._bounds=null;for(let t in this._gpuData)this._gpuData[t].destroy?.();this._gpuData=null;}collectRenderablesSimple(e,t,i){let{renderPipes:s}=t;s.blendMode.setBlendMode(this,this.groupBlendMode,e),s[this.renderPipeId].addRenderable(this,e),this.didViewUpdate=false;let o=this.children,a=o.length;for(let u=0;u<a;u++)o[u].collectRenderables(e,t,i);}};});var kf,FA=f(()=>{jt();Gr();kf=class extends qe{constructor(e={}){let{element:t,anchor:i,...s}=e;super({label:"DOMContainer",...s}),this.renderPipeId="dom",this.batched=false,this._anchor=new ne(0,0),i&&(this.anchor=i),this.element=e.element||document.createElement("div");}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}set element(e){this._element!==e&&(this._element=e,this.onViewUpdate());}get element(){return this._element}updateBounds(){let e=this._bounds,t=this._element;if(!t){e.minX=0,e.minY=0,e.maxX=0,e.maxY=0;return}let{offsetWidth:i,offsetHeight:s}=t;e.minX=0,e.maxX=i,e.minY=0,e.maxY=s;}destroy(e=false){super.destroy(e),this._element?.parentNode?.removeChild(this._element),this._element=null,this._anchor=null;}};});var OA=f(()=>{E();sy();O.add(Mn);});var Me,ar=f(()=>{Me=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(Me||{});});var Ff,ny=f(()=>{Ff={createCanvas:(r,e)=>{let t=document.createElement("canvas");return t.width=r,t.height=e,t},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,e)=>fetch(r,e),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")};});var GA,V,Se=f(()=>{ny();GA=Ff,V={get(){return GA},set(r){GA=r;}};});function Ur(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function uc(r){return r.split("?")[0].split("#")[0]}function OM(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function GM(r,e,t){return r.replace(new RegExp(OM(e),"g"),t)}function UM(r,e){let t="",i=0,s=-1,n=0,o=-1;for(let a=0;a<=r.length;++a){if(a<r.length)o=r.charCodeAt(a);else {if(o===47)break;o=47;}if(o===47){if(!(s===a-1||n===1))if(s!==a-1&&n===2){if(t.length<2||i!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){let u=t.lastIndexOf("/");if(u!==t.length-1){u===-1?(t="",i=0):(t=t.slice(0,u),i=t.length-1-t.lastIndexOf("/")),s=a,n=0;continue}}else if(t.length===2||t.length===1){t="",i=0,s=a,n=0;continue}}}else t.length>0?t+=`/${r.slice(s+1,a)}`:t=r.slice(s+1,a),i=a-s-1;s=a,n=0;}else o===46&&n!==-1?++n:n=-1;}return t}var De,fs=f(()=>{Se();De={toPosix(r){return GM(r,"\\","/")},isUrl(r){return /^https?:/.test(this.toPosix(r))},isDataUrl(r){return /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},isBlobUrl(r){return r.startsWith("blob:")},hasProtocol(r){return /^[^/:]+:/.test(this.toPosix(r))},getProtocol(r){Ur(r),r=this.toPosix(r);let e=/^file:\/\/\//.exec(r);if(e)return e[0];let t=/^[^/:]+:\/{0,2}/.exec(r);return t?t[0]:""},toAbsolute(r,e,t){if(Ur(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;let i=uc(this.toPosix(e??V.get().getBaseUrl())),s=uc(this.toPosix(t??this.rootname(i)));return r=this.toPosix(r),r.startsWith("/")?De.join(s,r.slice(1)):this.isAbsolute(r)?r:this.join(i,r)},normalize(r){if(Ur(r),r.length===0)return ".";if(this.isDataUrl(r)||this.isBlobUrl(r))return r;r=this.toPosix(r);let e="",t=r.startsWith("/");this.hasProtocol(r)&&(e=this.rootname(r),r=r.slice(e.length));let i=r.endsWith("/");return r=UM(r),r.length>0&&i&&(r+="/"),t?`/${r}`:e+r},isAbsolute(r){return Ur(r),r=this.toPosix(r),this.hasProtocol(r)?true:r.startsWith("/")},join(...r){if(r.length===0)return ".";let e;for(let t=0;t<r.length;++t){let i=r[t];if(Ur(i),i.length>0)if(e===void 0)e=i;else {let s=r[t-1]??"";this.joinExtensions.includes(this.extname(s).toLowerCase())?e+=`/../${i}`:e+=`/${i}`;}}return e===void 0?".":this.normalize(e)},dirname(r){if(Ur(r),r.length===0)return ".";r=this.toPosix(r);let e=r.charCodeAt(0),t=e===47,i=-1,s=true,n=this.getProtocol(r),o=r;r=r.slice(n.length);for(let a=r.length-1;a>=1;--a)if(e=r.charCodeAt(a),e===47){if(!s){i=a;break}}else s=false;return i===-1?t?"/":this.isUrl(o)?n+r:n:t&&i===1?"//":n+r.slice(0,i)},rootname(r){Ur(r),r=this.toPosix(r);let e="";if(r.startsWith("/")?e="/":e=this.getProtocol(r),this.isUrl(r)){let t=r.indexOf("/",e.length);t!==-1?e=r.slice(0,t):e=r,e.endsWith("/")||(e+="/");}return e},basename(r,e){Ur(r),e&&Ur(e),r=uc(this.toPosix(r));let t=0,i=-1,s=true,n;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e.length===r.length&&e===r)return "";let o=e.length-1,a=-1;for(n=r.length-1;n>=0;--n){let u=r.charCodeAt(n);if(u===47){if(!s){t=n+1;break}}else a===-1&&(s=false,a=n+1),o>=0&&(u===e.charCodeAt(o)?--o===-1&&(i=n):(o=-1,i=a));}return t===i?i=a:i===-1&&(i=r.length),r.slice(t,i)}for(n=r.length-1;n>=0;--n)if(r.charCodeAt(n)===47){if(!s){t=n+1;break}}else i===-1&&(s=false,i=n+1);return i===-1?"":r.slice(t,i)},extname(r){Ur(r),r=uc(this.toPosix(r));let e=-1,t=0,i=-1,s=true,n=0;for(let o=r.length-1;o>=0;--o){let a=r.charCodeAt(o);if(a===47){if(!s){t=o+1;break}continue}i===-1&&(s=false,i=o+1),a===46?e===-1?e=o:n!==1&&(n=1):e!==-1&&(n=-1);}return e===-1||i===-1||n===0||n===1&&e===i-1&&e===t+1?"":r.slice(e,i)},parse(r){Ur(r);let e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;r=uc(this.toPosix(r));let t=r.charCodeAt(0),i=this.isAbsolute(r),s;e.root=this.rootname(r),i||this.hasProtocol(r)?s=1:s=0;let o=-1,a=0,u=-1,l=true,c=r.length-1,h=0;for(;c>=s;--c){if(t=r.charCodeAt(c),t===47){if(!l){a=c+1;break}continue}u===-1&&(l=false,u=c+1),t===46?o===-1?o=c:h!==1&&(h=1):o!==-1&&(h=-1);}return o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1?u!==-1&&(a===0&&i?e.base=e.name=r.slice(1,u):e.base=e.name=r.slice(a,u)):(a===0&&i?(e.name=r.slice(1,o),e.base=r.slice(1,u)):(e.name=r.slice(a,o),e.base=r.slice(a,u)),e.ext=r.slice(o,u)),e.dir=this.dirname(r),e},sep:"/",delimiter:":",joinExtensions:[".html"]};});var Ct,Ia=f(()=>{Ct=(r,e,t=false)=>(Array.isArray(r)||(r=[r]),e?r.map(i=>typeof i=="string"||t?e(i):i):r);});function UA(r,e,t,i,s){let n=e[t];for(let o=0;o<n.length;o++){let a=n[o];t<e.length-1?UA(r.replace(i[t],a),e,t+1,i,s):s.push(r.replace(i[t],a));}}function Of(r){let e=/\{(.*?)\}/g,t=r.match(e),i=[];if(t){let s=[];t.forEach(n=>{let o=n.substring(1,n.length-1).split(",");s.push(o);}),UA(r,s,0,t,i);}else i.push(r);return i}var oy=f(()=>{});var ki,lc=f(()=>{ki=r=>!Array.isArray(r);});function ay(r){return r.split(".").pop().split("?").shift().split("#").shift()}var Pt,ps=f(()=>{_e();fs();Ia();oy();lc();Pt=class{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${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(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params));}),this._resolverHash={};}set basePath(e){this._basePath=e;}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e;}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(e){if(typeof e=="string")this._defaultSearchParams=e;else {let t=e;this._defaultSearchParams=Object.keys(t).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`).join("&");}}getAlias(e){let{alias:t,src:i}=e;return Ct(t||i,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>o?.src??o):n?.src?n.src:n,true)}addManifest(e){this._manifest&&F("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets);});}addBundle(e,t){let i=[],s=t;Array.isArray(t)||(s=Object.entries(t).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),s.forEach(n=>{let o=n.src,a=n.alias,u;if(typeof a=="string"){let l=this._createBundleAssetId(e,a);i.push(l),u=[a,l];}else {let l=a.map(c=>this._createBundleAssetId(e,c));i.push(...l),u=[...a,...l];}this.add({...n,alias:u,src:o});}),this._bundles[e]=i;}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let i;i=n=>{this.hasKey(n)&&F(`[Resolver] already has key: ${n} overwriting`);},Ct(t).forEach(n=>{let{src:o}=n,{data:a,format:u,loadParser:l}=n,c=Ct(o).map(p=>typeof p=="string"?Of(p):Array.isArray(p)?p:[p]),h=this.getAlias(n);Array.isArray(h)?h.forEach(i):i(h);let d=[];c.forEach(p=>{p.forEach(_=>{let b={};if(typeof _!="object"){b.src=_;for(let x=0;x<this._parsers.length;x++){let m=this._parsers[x];if(m.test(_)){b=m.parse(_);break}}}else a=_.data??a,u=_.format??u,l=_.loadParser??l,b={...b,..._};if(!h)throw new Error(`[Resolver] alias is undefined for this asset: ${b.src}`);b=this._buildResolvedAsset(b,{aliases:h,data:a,format:u,loadParser:l}),d.push(b);});}),h.forEach(p=>{this._assetMap[p]=d;});});}resolveBundle(e){let t=ki(e);e=Ct(e);let i={};return e.forEach(s=>{let n=this._bundles[s];if(n){let o=this.resolve(n),a={};for(let u in o){let l=o[u];a[this._extractAssetIdFromBundle(s,u)]=l;}i[s]=a;}}),t?i[e[0]]:i}resolveUrl(e){let t=this.resolve(e);if(typeof e!="string"){let i={};for(let s in t)i[s]=t[s].src;return i}return t.src}resolve(e){let t=ki(e);e=Ct(e);let i={};return e.forEach(s=>{if(!this._resolverHash[s])if(this._assetMap[s]){let n=this._assetMap[s],o=this._getPreferredOrder(n);o?.priority.forEach(a=>{o.params[a].forEach(u=>{let l=n.filter(c=>c[a]?c[a]===u:false);l.length&&(n=l);});}),this._resolverHash[s]=n[0];}else this._resolverHash[s]=this._buildResolvedAsset({alias:[s],src:s},{});i[s]=this._resolverHash[s];}),t?i[e[0]]:i}hasKey(e){return !!this._assetMap[e]}hasBundle(e){return !!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let i=e[t],s=this._preferredOrder.find(n=>n.params.format.includes(i.format));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;let t=/\?/.test(e)?"&":"?";return `${e}${t}${this._defaultSearchParams}`}_buildResolvedAsset(e,t){let{aliases:i,data:s,loadParser:n,format:o}=t;return (this._basePath||this._rootPath)&&(e.src=De.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...s||{},...e.data},e.loadParser=n??e.loadParser,e.format=o??e.format??ay(e.src),e}};Pt.RETINA_PREFIX=/@([0-9\.]+)x/;});var Dn,Gf=f(()=>{Dn=(r,e)=>{let t=e.split("?")[1];return t&&(r+=`?${t}`),r};});var LA,hc,uy=f(()=>{Ze();ct();ce();LA=class cc{constructor(e,t){this.linkedSheets=[];let i=e;e?.source instanceof oe&&(i={texture:e,data:t});let{texture:s,data:n,cachePrefix:o=""}=i;this.cachePrefix=o,this._texture=s instanceof C?s:null,this.textureSource=s.source,this.textures={},this.animations={},this.data=n;let a=parseFloat(n.meta.scale);a?(this.resolution=a,s.source.resolution=this.resolution):this.resolution=s.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null;}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=cc.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch();})}_processFrames(e){let t=e,i=cc.BATCH_SIZE;for(;t-e<i&&t<this._frameKeys.length;){let s=this._frameKeys[t],n=this._frames[s],o=n.frame;if(o){let a=null,u=null,l=n.trimmed!==false&&n.sourceSize?n.sourceSize:n.frame,c=new Z(0,0,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution);n.rotated?a=new Z(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):a=new Z(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),n.trimmed!==false&&n.spriteSourceSize&&(u=new Z(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[s]=new C({source:this.textureSource,frame:a,orig:c,trim:u,rotate:n.rotated?2:0,defaultAnchor:n.anchor,defaultBorders:n.borders,label:s.toString()});}t++;}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let i=0;i<e[t].length;i++){let s=e[t][i];this.animations[t].push(this.textures[s]);}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures);}_nextBatch(){this._processFrames(this._batchIndex*cc.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*cc.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete());},0);}destroy(e=false){for(let t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[];}};LA.BATCH_SIZE=1e3;hc=LA;});function NA(r,e,t){let i={};if(r.forEach(s=>{i[s]=e;}),Object.keys(e.textures).forEach(s=>{i[`${e.cachePrefix}${s}`]=e.textures[s];}),!t){let s=De.dirname(r[0]);e.linkedSheets.forEach((n,o)=>{let a=NA([`${s}/${e.data.meta.related_multi_packs[o]}`],n,true);Object.assign(i,a);});}return i}var LM,Uf,ly=f(()=>{ar();ps();Gf();E();ce();fs();uy();LM=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];Uf={extension:g.Asset,cache:{test:r=>r instanceof hc,getCacheableAssets:(r,e)=>NA(r,e,false)},resolver:{extension:{type:g.ResolveParser,name:"resolveSpritesheet"},test:r=>{let t=r.split("?")[0].split("."),i=t.pop(),s=t.pop();return i==="json"&&LM.includes(s)},parse:r=>{let e=r.split(".");return {resolution:parseFloat(Pt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e[e.length-2],src:r}}},loader:{name:"spritesheetLoader",extension:{type:g.LoadParser,priority:Me.Normal,name:"spritesheetLoader"},async testParse(r,e){return De.extname(e.src).toLowerCase()===".json"&&!!r.frames},async parse(r,e,t){let{texture:i,imageFilename:s,textureOptions:n,cachePrefix:o}=e?.data??{},a=De.dirname(e.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let u;if(i instanceof C)u=i;else {let h=Dn(a+(s??r.meta.image),e.src);u=(await t.load([{src:h,data:n}]))[h];}let l=new hc({texture:u.source,data:r,cachePrefix:o});await l.parse();let c=r?.meta?.related_multi_packs;if(Array.isArray(c)){let h=[];for(let p of c){if(typeof p!="string")continue;let _=a+p;e.data?.ignoreMultiPack||(_=Dn(_,e.src),h.push(t.load({src:_,data:{textureOptions:n,ignoreMultiPack:true}})));}let d=await Promise.all(h);l.linkedSheets=d,d.forEach(p=>{p.linkedSheets=[l].concat(l.linkedSheets.filter(_=>_!==p));});}return l},async unload(r,e,t){await t.unload(r.textureSource._sourceOrigin),r.destroy(false);}}};});var Lf=f(()=>{E();ly();O.add(Uf);});function ka(r,e,t){let{width:i,height:s}=t.orig,n=t.trim;if(n){let o=n.width,a=n.height;r.minX=n.x-e._x*i,r.maxX=r.minX+o,r.minY=n.y-e._y*s,r.maxY=r.minY+a;}else r.minX=-e._x*i,r.maxX=r.minX+i,r.minY=-e._y*s,r.maxY=r.minY+s;}var Nf=f(()=>{});var Ee,ms=f(()=>{is();ce();Nf();xe();Gr();Ee=class r extends qe{constructor(e=C.EMPTY){e instanceof C&&(e={texture:e});let{texture:t=C.EMPTY,anchor:i,roundPixels:s,width:n,height:o,...a}=e;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=true,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new we({_onUpdate:()=>{this.onViewUpdate();}}),i?this.anchor=i:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=false,this.roundPixels=s??false,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o);}static from(e,t=false){return e instanceof C?new r(e):new r(C.from(e,t))}set texture(e){e||(e=C.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate());}get texture(){return this._texture}get visualBounds(){return ka(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return I("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){let e=this._anchor,t=this._texture,i=this._bounds,{width:s,height:n}=t.orig;i.minX=-e._x*s,i.maxX=i.minX+s,i.minY=-e._y*n,i.maxY=i.minY+n;}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null,this._gpuData=null;}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e;}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e;}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height);}};});function gs(r,e,t){let i=NM;r.measurable=true,ii(r,t,i),e.addBoundsMask(i),r.measurable=false;}var NM,dc=f(()=>{Et();vn();NM=new me;});function xs(r,e,t){let i=Nt.get();r.measurable=true;let s=je.get().identity(),n=HA(r,t,s);os(r,i,n),r.measurable=false,e.addBoundsMask(i),je.return(s),Nt.return(i);}function HA(r,e,t){return r?(r!==e&&(HA(r.parent,e,t),r.updateLocalTransform(),t.append(r.localTransform)),t):(F("Mask bounds, renderable is not inside the root container"),t)}var fc=f(()=>{Jl();ss();_e();});var In,cy=f(()=>{E();ms();dc();fc();In=class{constructor(e){this.priority=0,this.inverse=false,this.pipe="alphaMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof Ee),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=false;}reset(){this.mask.measurable=true,this.mask=null;}addBounds(e,t){this.inverse||gs(this.mask,e,t);}addLocalBounds(e,t){xs(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof Ee}};In.extension=g.MaskEffect;});var kn,hy=f(()=>{E();kn=class{constructor(e){this.priority=0,this.pipe="colorMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e;}destroy(){}static test(e){return typeof e=="number"}};kn.extension=g.MaskEffect;});var Fn,dy=f(()=>{E();qt();dc();fc();Fn=class{constructor(e){this.priority=0,this.pipe="stencilMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e,this.mask.includeInBuild=false,this.mask.measurable=false;}reset(){this.mask.measurable=true,this.mask.includeInBuild=true,this.mask=null;}addBounds(e,t){gs(this.mask,e,t);}addLocalBounds(e,t){xs(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof te}};Fn.extension=g.MaskEffect;});var ht,On=f(()=>{Se();E();ct();ht=class extends oe{constructor(e){e.resource||(e.resource=V.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent;}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight);}resize(e=this.width,t=this.height,i=this._resolution){let s=super.resize(e,t,i);return s&&this.resizeCanvas(),s}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}};ht.extension=g.TextureSource;});var Rt,Gn=f(()=>{E();ct();Rt=class extends oe{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=true;}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}};Rt.extension=g.TextureSource;});async function Fa(){return fy??(fy=(async()=>{let e=document.createElement("canvas").getContext("webgl");if(!e)return "premultiply-alpha-on-upload";let t=await new Promise(o=>{let a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=false,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load();});if(!t)return "premultiply-alpha-on-upload";let i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let n=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,n),e.deleteFramebuffer(s),e.deleteTexture(i),e.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),fy}var fy,Hf=f(()=>{});var Vf,_s,zf=f(()=>{E();ds();Hf();ct();Vf=class VA extends oe{constructor(e){super(e),this.isReady=false,this.uploadMethodId="video",e={...VA.defaultOptions,...e},this._autoUpdate=true,this._isConnectedToTicker=false,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==false,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",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._onCanPlayThrough=this._onCanPlayThrough.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),e.autoLoad!==false&&this.load();}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=ye.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e);}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update();}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback);}get isValid(){return !!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let e=this.resource,t=this.options;return (e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=true),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,true)),this.alphaMode=await Fa(),this._load=new Promise((i,s)=>{this.isValid?i(this):(this._resolve=i,this._reject=s,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`));})),e.load());}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,true),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null);}_isSourcePlaying(){let e=this.resource;return !e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate();}_onPlayStop(){this._configureAutoUpdate();}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0);}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady();}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady();}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=true,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play();}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,true),e.pause(),e.src="",e.load()),super.destroy();}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate());}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate());}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(ye.shared.remove(this.updateFrame,this),this._isConnectedToTicker=false,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ye.shared.add(this.updateFrame,this),this._isConnectedToTicker=true,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ye.shared.remove(this.updateFrame,this),this._isConnectedToTicker=false,this._msToNextUpdate=0));}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};Vf.extension=g.TextureSource;Vf.defaultOptions={...oe.defaultOptions,autoLoad:true,autoPlay:true,updateFPS:0,crossorigin:true,loop:false,muted:true,playsinline:true,preload:false};Vf.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};_s=Vf;});var py,de,ni=f(()=>{_e();Ia();py=class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map;}reset(){this._cacheMap.clear(),this._cache.clear();}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||F(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let i=Ct(e),s;for(let u=0;u<this.parsers.length;u++){let l=this.parsers[u];if(l.test(t)){s=l.getCacheableAssets(i,t);break}}let n=new Map(Object.entries(s||{}));s||i.forEach(u=>{n.set(u,t);});let o=[...n.keys()],a={cacheKeys:o,keys:i};i.forEach(u=>{this._cacheMap.set(u,a);}),o.forEach(u=>{let l=s?s[u]:t;this._cache.has(u)&&this._cache.get(u)!==l&&F("[Cache] already has key:",u),this._cache.set(u,n.get(u));});}remove(e){if(!this._cacheMap.has(e)){F(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(s=>{this._cache.delete(s);}),t.keys.forEach(s=>{this._cacheMap.delete(s);});}get parsers(){return this._parsers}},de=new py;});function zA(r={}){return gy(r)}function gy(r={}){let e=r&&r.resource,t=e?r.resource:r,i=e?r:{resource:r};for(let s=0;s<my.length;s++){let n=my[s];if(n.test(t))return new n(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function xy(r={},e=false){let t=r&&r.resource,i=t?r.resource:r,s=t?r:{resource:r};if(!e&&de.has(i))return de.get(i);let n=new C({source:gy(s)});return n.on("destroy",()=>{de.has(i)&&de.remove(i);}),e||de.set(i,n),n}function _y(r,e=false){return typeof r=="string"?de.get(r):r instanceof oe?new C({source:r}):xy(r,e)}var my,by=f(()=>{ni();E();ct();ce();my=[];O.handleByList(g.TextureSource,my);C.from=_y;oe.from=gy;});var Wf=f(()=>{E();cy();hy();dy();vf();On();Gn();zf();by();O.add(In,kn,Fn,_s,Rt,ht,Di);});var nt,Fi=f(()=>{nt=class{constructor(e){this.resources=Object.create(null),this._dirty=true;let t=0;for(let i in e){let s=e[i];this.setResource(s,t++);}this._updateKey();}_updateKey(){if(!this._dirty)return;this._dirty=false;let e=[],t=0;for(let i in this.resources)e[t++]=this.resources[i]._resourceId;this._key=e.join("|");}setResource(e,t){let i=this.resources[t];e!==i&&(i&&e.off?.("change",this.onResourceChange,this),e.on?.("change",this.onResourceChange,this),this.resources[t]=e,this._dirty=true);}getResource(e){return this.resources[e]}_touch(e){let t=this.resources;for(let i in t)t[i]._touched=e;}destroy(){let e=this.resources;for(let t in e)e[t].off?.("change",this.onResourceChange,this);this.resources=null;}onResourceChange(e){if(this._dirty=true,e.destroyed){let t=this.resources;for(let i in t)t[i]===e&&(t[i]=null);}else this._updateKey();}};});function bs(r,e,t){let i=2166136261;for(let s=0;s<e;s++)i^=r[s].uid,i=Math.imul(i,16777619),i>>>=0;return WA[i]||HM(r,e,i,t)}function HM(r,e,t,i){let s={},n=0;for(let a=0;a<i;a++){let u=a<e?r[a]:C.EMPTY.source;s[n++]=u.source,s[n++]=u.style;}let o=new nt(s);return WA[t]=o,o}var WA,pc=f(()=>{Fi();ce();WA={};});var yr,Xf=f(()=>{yr=class{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength;}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 int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(e){return this[`${e}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(e){switch(e){case "int8":case "uint8":return 1;case "int16":case "uint16":return 2;case "int32":case "uint32":case "float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}};});function Un(r,e){let t=r.byteLength/8|0,i=new Float64Array(r,0,t);new Float64Array(e,0,t).set(i);let n=r.byteLength-t*8;if(n>0){let o=new Uint8Array(r,t*8,n);new Uint8Array(e,t*8,n).set(o);}}var Yf=f(()=>{});var $f,Be,ys=f(()=>{$f={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},Be=(r=>(r[r.DISABLED=0]="DISABLED",r[r.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",r[r.MASK_ACTIVE=2]="MASK_ACTIVE",r[r.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",r[r.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",r[r.NONE=5]="NONE",r))(Be||{});});function Lr(r,e){return e.alphaMode==="no-premultiply-alpha"&&$f[r]||r}var Oa=f(()=>{ys();});function Ga(){return (!jf||jf?.isContextLost())&&(jf=V.get().createCanvas().getContext("webgl",{})),jf}var jf,qf=f(()=>{Se();});function zM(r){let e="";for(let t=0;t<r;++t)t>0&&(e+=`
|
|
20
20
|
else `),t<r-1&&(e+=`if(test == ${t}.0){}`);return e}function Ua(r,e){if(r===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");let t=e.createShader(e.FRAGMENT_SHADER);try{for(;;){let i=VM.replace(/%forloop%/gi,zM(r));if(e.shaderSource(t,i),e.compileShader(t),!e.getShaderParameter(t,e.COMPILE_STATUS))r=r/2|0;else break}}finally{e.deleteShader(t);}return r}var VM,Kf=f(()=>{VM=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
21
21
|
`);});function Zf(){if(La)return La;let r=Ga();return La=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),La=Ua(La,r),r.getExtension("WEBGL_lose_context")?.loseContext(),La}var La,yy=f(()=>{qf();Kf();La=null;});var Na,vy=f(()=>{Na=class{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0;}clear(){for(let e=0;e<this.count;e++){let t=this.textures[e];this.textures[e]=null,this.ids[t.uid]=null;}this.count=0;}};});function XA(){return Ty>0?$A[--Ty]:new gc}function YA(r){$A[Ty++]=r;}var gc,$A,Ty,mc,jA,Qf,Sy=f(()=>{lt();Xf();xe();Yf();Oa();yy();vy();gc=class{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new Na,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=true;}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null;}},$A=[],Ty=0;mc=0,jA=class qA{constructor(e){this.uid=re("batcher"),this.dirty=true,this.batchIndex=0,this.batches=[],this._elements=[],e={...qA.defaultOptions,...e},e.maxTextures||(I("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=Zf());let{maxTextures:t,attributesInitialSize:i,indicesInitialSize:s}=e;this.attributeBuffer=new yr(i*4),this.indexBuffer=new Uint16Array(s),this.maxTextures=t;}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)YA(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=true;}add(e){this._elements[this.elementSize++]=e,e._indexStart=this.indexSize,e._attributeStart=this.attributeSize,e._batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.attributeSize*this.vertexSize;}checkAndUpdateTexture(e,t){let i=e._batch.textures.ids[t._source.uid];return !i&&i!==0?false:(e._textureId=i,e.texture=t,true)}updateElement(e){this.dirty=true;let t=this.attributeBuffer;e.packAsQuad?this.packQuadAttributes(e,t.float32View,t.uint32View,e._attributeStart,e._textureId):this.packAttributes(e,t.float32View,t.uint32View,e._attributeStart,e._textureId);}break(e){let t=this._elements;if(!t[this.elementStart])return;let i=XA(),s=i.textures;s.clear();let n=t[this.elementStart],o=Lr(n.blendMode,n.texture._source),a=n.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);let u=this.attributeBuffer.float32View,l=this.attributeBuffer.uint32View,c=this.indexBuffer,h=this._batchIndexSize,d=this._batchIndexStart,p="startBatch",_=this.maxTextures;for(let b=this.elementStart;b<this.elementSize;++b){let x=t[b];t[b]=null;let v=x.texture._source,T=Lr(x.blendMode,v),S=o!==T||a!==x.topology;if(v._batchTick===mc&&!S){x._textureId=v._textureBindLocation,h+=x.indexSize,x.packAsQuad?(this.packQuadAttributes(x,u,l,x._attributeStart,x._textureId),this.packQuadIndex(c,x._indexStart,x._attributeStart/this.vertexSize)):(this.packAttributes(x,u,l,x._attributeStart,x._textureId),this.packIndex(x,c,x._indexStart,x._attributeStart/this.vertexSize)),x._batch=i;continue}v._batchTick=mc,(s.count>=_||S)&&(this._finishBatch(i,d,h-d,s,o,a,e,p),p="renderBatch",d=h,o=T,a=x.topology,i=XA(),s=i.textures,s.clear(),++mc),x._textureId=v._textureBindLocation=s.count,s.ids[v.uid]=s.count,s.textures[s.count++]=v,x._batch=i,h+=x.indexSize,x.packAsQuad?(this.packQuadAttributes(x,u,l,x._attributeStart,x._textureId),this.packQuadIndex(c,x._indexStart,x._attributeStart/this.vertexSize)):(this.packAttributes(x,u,l,x._attributeStart,x._textureId),this.packIndex(x,c,x._indexStart,x._attributeStart/this.vertexSize));}s.count>0&&(this._finishBatch(i,d,h-d,s,o,a,e,p),d=h,++mc),this.elementStart=this.elementSize,this._batchIndexStart=d,this._batchIndexSize=h;}_finishBatch(e,t,i,s,n,o,a,u){e.gpuBindGroup=null,e.bindGroup=null,e.action=u,e.batcher=this,e.textures=s,e.blendMode=n,e.topology=o,e.start=t,e.size=i,++mc,this.batches[this.batchIndex++]=e,a.add(e);}finish(e){this.break(e);}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4);}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e);}_resizeAttributeBuffer(e){let t=Math.max(e,this.attributeBuffer.size*2),i=new yr(t);Un(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i;}_resizeIndexBuffer(e){let t=this.indexBuffer,i=Math.max(e,t.length*1.5);i+=i%2;let s=i>65535?new Uint32Array(i):new Uint16Array(i);if(s.BYTES_PER_ELEMENT!==t.BYTES_PER_ELEMENT)for(let n=0;n<t.length;n++)s[n]=t[n];else Un(t.buffer,s.buffer);this.indexBuffer=s;}packQuadIndex(e,t,i){e[t]=i+0,e[t+1]=i+1,e[t+2]=i+2,e[t+3]=i+0,e[t+4]=i+2,e[t+5]=i+3;}packIndex(e,t,i,s){let n=e.indices,o=e.indexSize,a=e.indexOffset,u=e.attributeOffset;for(let l=0;l<o;l++)t[i++]=s+n[l+a]-u;}destroy(){for(let e=0;e<this.batches.length;e++)YA(this.batches[e]);this.batches=null;for(let e=0;e<this._elements.length;e++)this._elements[e]._batch=null;this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null;}};jA.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};Qf=jA;});var ie,oi=f(()=>{ie=(r=>(r[r.MAP_READ=1]="MAP_READ",r[r.MAP_WRITE=2]="MAP_WRITE",r[r.COPY_SRC=4]="COPY_SRC",r[r.COPY_DST=8]="COPY_DST",r[r.INDEX=16]="INDEX",r[r.VERTEX=32]="VERTEX",r[r.UNIFORM=64]="UNIFORM",r[r.STORAGE=128]="STORAGE",r[r.INDIRECT=256]="INDIRECT",r[r.QUERY_RESOLVE=512]="QUERY_RESOLVE",r[r.STATIC=1024]="STATIC",r))(ie||{});});var Ve,Oi=f(()=>{St();lt();oi();Ve=class extends ue{constructor(e){let{data:t,size:i}=e,{usage:s,label:n,shrinkToFit:o}=e;super(),this.uid=re("buffer"),this._resourceType="buffer",this._resourceId=re("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=true,this.destroyed=false,t instanceof Array&&(t=new Float32Array(t)),this._data=t,i??(i=t?.byteLength);let a=!!t;this.descriptor={size:i,usage:s,mappedAtCreation:a,label:n},this.shrinkToFit=o??true;}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,true);}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return !!(this.descriptor.usage&ie.STATIC)}set static(e){e?this.descriptor.usage|=ie.STATIC:this.descriptor.usage&=~ie.STATIC;}setDataWithSize(e,t,i){if(this._updateID++,this._updateSize=t*e.BYTES_PER_ELEMENT,this._data===e){i&&this.emit("update",this);return}let s=this._data;if(this._data=e,this._dataInt32=null,!s||s.length!==e.length){!this.shrinkToFit&&s&&e.byteLength<s.byteLength?i&&this.emit("update",this):(this.descriptor.size=e.byteLength,this._resourceId=re("resource"),this.emit("change",this));return}i&&this.emit("update",this);}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this);}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners();}};});function xc(r,e){if(!(r instanceof Ve)){let t=e?ie.INDEX:ie.VERTEX;r instanceof Array&&(e?(r=new Uint32Array(r),t=ie.INDEX|ie.COPY_DST):(r=new Float32Array(r),t=ie.VERTEX|ie.COPY_DST)),r=new Ve({data:r,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:t});}return r}var Ey=f(()=>{Oi();oi();});function Jf(r,e,t){let i=r.getAttribute(e);if(!i)return t.minX=0,t.minY=0,t.maxX=0,t.maxY=0,t;let s=i.buffer.data,n=1/0,o=1/0,a=-1/0,u=-1/0,l=s.BYTES_PER_ELEMENT,c=(i.offset||0)/l,h=(i.stride||2*4)/l;for(let d=c;d<s.length;d+=h){let p=s[d],_=s[d+1];p>a&&(a=p),_>u&&(u=_),p<n&&(n=p),_<o&&(o=_);}return t.minX=n,t.minY=o,t.maxX=a,t.maxY=u,t}var Ay=f(()=>{});function WM(r){return (r instanceof Ve||Array.isArray(r)||r.BYTES_PER_ELEMENT)&&(r={buffer:r}),r.buffer=xc(r.buffer,false),r}var Mt,vs=f(()=>{St();Et();lt();Oi();Ey();Ay();Mt=class extends ue{constructor(e={}){super(),this.uid=re("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new me,this._boundsDirty=true;let{attributes:t,indexBuffer:i,topology:s}=e;if(this.buffers=[],this.attributes={},t)for(let n in t)this.addAttribute(n,t[n]);this.instanceCount=e.instanceCount??1,i&&this.addIndex(i),this.topology=s||"triangle-list";}onBufferUpdate(){this._boundsDirty=true,this.emit("update",this);}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(let e in this.attributes){let t=this.attributes[e];return t.buffer.data.length/(t.stride/4||t.size)}return 0}addAttribute(e,t){let i=WM(t);this.buffers.indexOf(i.buffer)===-1&&(this.buffers.push(i.buffer),i.buffer.on("update",this.onBufferUpdate,this),i.buffer.on("change",this.onBufferUpdate,this)),this.attributes[e]=i;}addIndex(e){this.indexBuffer=xc(e,true),this.buffers.push(this.indexBuffer);}get bounds(){return this._boundsDirty?(this._boundsDirty=false,Jf(this,"aPosition",this._bounds)):this._bounds}destroy(e=false){this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(t=>t.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null;}};});var XM,YM,Ha,Cy=f(()=>{Oi();oi();vs();XM=new Float32Array(1),YM=new Uint32Array(1),Ha=class extends Mt{constructor(){let t=new Ve({data:XM,label:"attribute-batch-buffer",usage:ie.VERTEX|ie.COPY_DST,shrinkToFit:false}),i=new Ve({data:YM,label:"index-batch-buffer",usage:ie.INDEX|ie.COPY_DST,shrinkToFit:false}),s=6*4;super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:s,offset:0},aUV:{buffer:t,format:"float32x2",stride:s,offset:2*4},aColor:{buffer:t,format:"unorm8x4",stride:s,offset:4*4},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:s,offset:5*4}},indexBuffer:i});}};});function Nr(r,e){let t=KA[r];return t===void 0&&(Py[e]===void 0&&(Py[e]=1),KA[r]=t=Py[e]++),t}var Py,KA,Va=f(()=>{Py=Object.create(null),KA=Object.create(null);});function tp(){if(!ep){ep="mediump";let r=Ga();r&&r.getShaderPrecisionFormat&&(ep=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?"highp":"mediump");}return ep}var ep,wy=f(()=>{qf();});function rp(r,e,t){return e?r:t?(r=r.replace("out vec4 finalColor;",""),`
|
|
22
22
|
|
|
@@ -36,7 +36,7 @@ else `),t<r-1&&(e+=`if(test == ${t}.0){}`);return e}function Ua(r,e){if(r===0)th
|
|
|
36
36
|
`}var By=f(()=>{});function ip(r,e,t){let i=t?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(r.substring(0,9)!=="precision"){let s=t?e.requestedFragmentPrecision:e.requestedVertexPrecision;return s==="highp"&&i!=="highp"&&(s="mediump"),`precision ${s} float;
|
|
37
37
|
${r}`}else if(i!=="highp"&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var Ry=f(()=>{});function sp(r,e){return e?`#version 300 es
|
|
38
38
|
${r}`:r}var My=f(()=>{});function np(r,{name:e="pixi-program"},t=true){e=e.replace(/\s+/g,"-"),e+=t?"-fragment":"-vertex";let i=t?$M:jM;return i[e]?(i[e]++,e+=`-${i[e]}`):i[e]=1,r.indexOf("#define SHADER_NAME")!==-1?r:`${`#define SHADER_NAME ${e}`}
|
|
39
|
-
${r}`}var $M,jM,Dy=f(()=>{$M={},jM={};});function op(r,e){return e?r.replace("#version 300 es",""):r}var Iy=f(()=>{});var ky,Fy,ZA,ke,Kt=f(()=>{Va();wy();By();Ry();My();Dy();Iy();ky={stripVersion:op,ensurePrecision:ip,addProgramDefines:rp,setProgramName:np,insertVersion:sp},Fy=Object.create(null),ZA=class Oy{constructor(e){e={...Oy.defaultOptions,...e};let t=e.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:t,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:tp()},setProgramName:{name:e.name},addProgramDefines:t,insertVersion:t},s=e.fragment,n=e.vertex;Object.keys(ky).forEach(o=>{let a=i[o];s=ky[o](s,a,true),n=ky[o](n,a,false);}),this.fragment=s,this.vertex=n,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=Nr(`${this.vertex}:${this.fragment}`,"gl-program");}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null;}static from(e){let t=`${e.vertex}:${e.fragment}`;return Fy[t]||(Fy[t]=new Oy(e)),Fy[t]}};ZA.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};ke=ZA;});function Dt(r){return QA[r]??QA.float32}var QA,Ts=f(()=>{QA={uint8x2:{size:2,stride:2,normalised:false},uint8x4:{size:4,stride:4,normalised:false},sint8x2:{size:2,stride:2,normalised:false},sint8x4:{size:4,stride:4,normalised:false},unorm8x2:{size:2,stride:2,normalised:true},unorm8x4:{size:4,stride:4,normalised:true},snorm8x2:{size:2,stride:2,normalised:true},snorm8x4:{size:4,stride:4,normalised:true},uint16x2:{size:2,stride:4,normalised:false},uint16x4:{size:4,stride:8,normalised:false},sint16x2:{size:2,stride:4,normalised:false},sint16x4:{size:4,stride:8,normalised:false},unorm16x2:{size:2,stride:4,normalised:true},unorm16x4:{size:4,stride:8,normalised:true},snorm16x2:{size:2,stride:4,normalised:true},snorm16x4:{size:4,stride:8,normalised:true},float16x2:{size:2,stride:4,normalised:false},float16x4:{size:4,stride:8,normalised:false},float32:{size:1,stride:4,normalised:false},float32x2:{size:2,stride:8,normalised:false},float32x3:{size:3,stride:12,normalised:false},float32x4:{size:4,stride:16,normalised:false},uint32:{size:1,stride:4,normalised:false},uint32x2:{size:2,stride:8,normalised:false},uint32x3:{size:3,stride:12,normalised:false},uint32x4:{size:4,stride:16,normalised:false},sint32:{size:1,stride:4,normalised:false},sint32x2:{size:2,stride:8,normalised:false},sint32x3:{size:3,stride:12,normalised:false},sint32x4:{size:4,stride:16,normalised:false}};});function ap({source:r,entryPoint:e}){let t={},i=r.indexOf(`fn ${e}`);if(i!==-1){let s=r.indexOf("->",i);if(s!==-1){let n=r.substring(i,s),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g,a;for(;(a=o.exec(n))!==null;){let u=qM[a[3]]??"float32";t[a[2]]={location:parseInt(a[1],10),format:u,stride:Dt(u).stride,offset:0,instance:false,start:0};}}}return t}var qM,Gy=f(()=>{Ts();qM={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};});function za(r){let e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,t=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,s=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,u=/struct\s+(\w+)/,l=r.match(e)?.map(h=>({group:parseInt(h.match(t)[1],10),binding:parseInt(h.match(i)[1],10),name:h.match(s)[2],isUniform:h.match(s)[1]==="<uniform>",type:h.match(n)[1]}));if(!l)return {groups:[],structs:[]};let c=r.match(o)?.map(h=>{let d=h.match(u)[1],p=h.match(a).reduce((_,b)=>{let[x,
|
|
39
|
+
${r}`}var $M,jM,Dy=f(()=>{$M={},jM={};});function op(r,e){return e?r.replace("#version 300 es",""):r}var Iy=f(()=>{});var ky,Fy,ZA,ke,Kt=f(()=>{Va();wy();By();Ry();My();Dy();Iy();ky={stripVersion:op,ensurePrecision:ip,addProgramDefines:rp,setProgramName:np,insertVersion:sp},Fy=Object.create(null),ZA=class Oy{constructor(e){e={...Oy.defaultOptions,...e};let t=e.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:t,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:tp()},setProgramName:{name:e.name},addProgramDefines:t,insertVersion:t},s=e.fragment,n=e.vertex;Object.keys(ky).forEach(o=>{let a=i[o];s=ky[o](s,a,true),n=ky[o](n,a,false);}),this.fragment=s,this.vertex=n,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=Nr(`${this.vertex}:${this.fragment}`,"gl-program");}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null;}static from(e){let t=`${e.vertex}:${e.fragment}`;return Fy[t]||(Fy[t]=new Oy(e)),Fy[t]}};ZA.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};ke=ZA;});function Dt(r){return QA[r]??QA.float32}var QA,Ts=f(()=>{QA={uint8x2:{size:2,stride:2,normalised:false},uint8x4:{size:4,stride:4,normalised:false},sint8x2:{size:2,stride:2,normalised:false},sint8x4:{size:4,stride:4,normalised:false},unorm8x2:{size:2,stride:2,normalised:true},unorm8x4:{size:4,stride:4,normalised:true},snorm8x2:{size:2,stride:2,normalised:true},snorm8x4:{size:4,stride:4,normalised:true},uint16x2:{size:2,stride:4,normalised:false},uint16x4:{size:4,stride:8,normalised:false},sint16x2:{size:2,stride:4,normalised:false},sint16x4:{size:4,stride:8,normalised:false},unorm16x2:{size:2,stride:4,normalised:true},unorm16x4:{size:4,stride:8,normalised:true},snorm16x2:{size:2,stride:4,normalised:true},snorm16x4:{size:4,stride:8,normalised:true},float16x2:{size:2,stride:4,normalised:false},float16x4:{size:4,stride:8,normalised:false},float32:{size:1,stride:4,normalised:false},float32x2:{size:2,stride:8,normalised:false},float32x3:{size:3,stride:12,normalised:false},float32x4:{size:4,stride:16,normalised:false},uint32:{size:1,stride:4,normalised:false},uint32x2:{size:2,stride:8,normalised:false},uint32x3:{size:3,stride:12,normalised:false},uint32x4:{size:4,stride:16,normalised:false},sint32:{size:1,stride:4,normalised:false},sint32x2:{size:2,stride:8,normalised:false},sint32x3:{size:3,stride:12,normalised:false},sint32x4:{size:4,stride:16,normalised:false}};});function ap({source:r,entryPoint:e}){let t={},i=r.indexOf(`fn ${e}`);if(i!==-1){let s=r.indexOf("->",i);if(s!==-1){let n=r.substring(i,s),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g,a;for(;(a=o.exec(n))!==null;){let u=qM[a[3]]??"float32";t[a[2]]={location:parseInt(a[1],10),format:u,stride:Dt(u).stride,offset:0,instance:false,start:0};}}}return t}var qM,Gy=f(()=>{Ts();qM={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};});function za(r){let e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,t=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,s=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,u=/struct\s+(\w+)/,l=r.match(e)?.map(h=>({group:parseInt(h.match(t)[1],10),binding:parseInt(h.match(i)[1],10),name:h.match(s)[2],isUniform:h.match(s)[1]==="<uniform>",type:h.match(n)[1]}));if(!l)return {groups:[],structs:[]};let c=r.match(o)?.map(h=>{let d=h.match(u)[1],p=h.match(a).reduce((_,b)=>{let[x,m]=b.split(":");return _[x.trim()]=m.trim(),_},{});return p?{name:d,members:p}:null}).filter(({name:h})=>l.some(d=>d.type===h))??[];return {groups:l,structs:c}}var Uy=f(()=>{});var Ss,Ly=f(()=>{Ss=(r=>(r[r.VERTEX=1]="VERTEX",r[r.FRAGMENT=2]="FRAGMENT",r[r.COMPUTE=4]="COMPUTE",r))(Ss||{});});function up({groups:r}){let e=[];for(let t=0;t<r.length;t++){let i=r[t];e[i.group]||(e[i.group]=[]),i.isUniform?e[i.group].push({binding:i.binding,visibility:Ss.VERTEX|Ss.FRAGMENT,buffer:{type:"uniform"}}):i.type==="sampler"?e[i.group].push({binding:i.binding,visibility:Ss.FRAGMENT,sampler:{type:"filtering"}}):i.type==="texture_2d"&&e[i.group].push({binding:i.binding,visibility:Ss.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:false}});}return e}var Ny=f(()=>{Ly();});function lp({groups:r}){let e=[];for(let t=0;t<r.length;t++){let i=r[t];e[i.group]||(e[i.group]={}),e[i.group][i.name]=i.binding;}return e}var Hy=f(()=>{});function cp(r,e){let t=new Set,i=new Set,s=[...r.structs,...e.structs].filter(o=>t.has(o.name)?false:(t.add(o.name),true)),n=[...r.groups,...e.groups].filter(o=>{let a=`${o.name}-${o.binding}`;return i.has(a)?false:(i.add(a),true)});return {structs:s,groups:n}}var Vy=f(()=>{});var zy,Fe,ur=f(()=>{Va();Gy();Uy();Ny();Hy();Vy();zy=Object.create(null),Fe=class r{constructor(e){this._layoutKey=0,this._attributeLocationsKey=0;let{fragment:t,vertex:i,layout:s,gpuLayout:n,name:o}=e;if(this.name=o,this.fragment=t,this.vertex=i,t.source===i.source){let a=za(t.source);this.structsAndGroups=a;}else {let a=za(i.source),u=za(t.source);this.structsAndGroups=cp(a,u);}this.layout=s??lp(this.structsAndGroups),this.gpuLayout=n??up(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey();}_generateProgramKey(){let{vertex:e,fragment:t}=this,i=e.source+t.source+e.entryPoint+t.entryPoint;this._layoutKey=Nr(i,"program");}get attributeData(){return this._attributeData??(this._attributeData=ap(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null;}static from(e){let t=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return zy[t]||(zy[t]=new r(e)),zy[t]}};});function _c(r,e,t){if(r)for(let i in r){let s=i.toLocaleLowerCase(),n=e[s];if(n){let o=r[i];i==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),t&&n.push(`//----${t}----//`),n.push(o);}else F(`${i} placement hook does not exist in shader`);}}var Wy=f(()=>{_e();});function bc(r){let e={};return (r.match(KM)?.map(i=>i.replace(/[{()}]/g,""))??[]).forEach(i=>{e[i]=[];}),e}var KM,Xy=f(()=>{KM=/\{\{(.*?)\}\}/g;});function JA(r,e){let t,i=/@in\s+([^;]+);/g;for(;(t=i.exec(r))!==null;)e.push(t[1]);}function yc(r,e,t=false){let i=[];JA(e,i),r.forEach(a=>{a.header&&JA(a.header,i);});let s=i;t&&s.sort();let n=s.map((a,u)=>` @location(${u}) ${a},`).join(`
|
|
40
40
|
`),o=e.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",`
|
|
41
41
|
${n}
|
|
42
42
|
`),o}var Yy=f(()=>{});function eC(r,e){let t,i=/@out\s+([^;]+);/g;for(;(t=i.exec(r))!==null;)e.push(t[1]);}function ZM(r){let t=/\b(\w+)\s*:/g.exec(r);return t?t[1]:""}function QM(r){let e=/@.*?\s+/g;return r.replace(e,"")}function hp(r,e){let t=[];eC(e,t),r.forEach(u=>{u.header&&eC(u.header,t);});let i=0,s=t.sort().map(u=>u.indexOf("builtin")>-1?u:`@location(${i++}) ${u}`).join(`,
|
|
@@ -257,7 +257,7 @@ ${s.join(`
|
|
|
257
257
|
{
|
|
258
258
|
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
259
259
|
}
|
|
260
|
-
`}};});var Tc,yp,t0=f(()=>{Tc=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],yp=Tc.reduce((r,e)=>(r[e]=true,r),{});});function vp(r,e){switch(r){case "f32":return 0;case "vec2<f32>":return new Float32Array(2*e);case "vec3<f32>":return new Float32Array(3*e);case "vec4<f32>":return new Float32Array(4*e);case "mat2x2<f32>":return new Float32Array([1,0,0,1]);case "mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case "mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var r0=f(()=>{});var sC,ae,Qe=f(()=>{lt();Va();t0();r0();sC=class nC{constructor(e,t){this._touched=0,this.uid=re("uniform"),this._resourceType="uniformGroup",this._resourceId=re("resource"),this.isUniformGroup=true,this._dirtyId=0,this.destroyed=false,t={...nC.defaultOptions,...t},this.uniformStructures=e;let i={};for(let s in e){let n=e[s];if(n.name=s,n.size=n.size??1,!yp[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${Tc.join(", ")}`);n.value??(n.value=vp(n.type,n.size)),i[s]=n.value;}this.uniforms=i,this._dirtyId=1,this.ubo=t.ubo,this.isStatic=t.isStatic,this._signature=Nr(Object.keys(i).map(s=>`${s}-${e[s].type}`).join("-"),"uniform-group");}update(){this._dirtyId++;}};sC.defaultOptions={ubo:false,isStatic:false};ae=sC;});function Bs(r){let e=oC[r];if(e)return e;let t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=i;return e=oC[r]=new ae({uTextures:{value:t,type:"i32",size:r}},{isStatic:true}),e}var oC,Sc=f(()=>{Qe();oC={};});var Oe,lr=f(()=>{Oe=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.BOTH=3]="BOTH",r))(Oe||{});});var ze,Ar=f(()=>{St();lt();Kt();Fi();ur();lr();Qe();ze=class r extends ue{constructor(e){super(),this.uid=re("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:t,glProgram:i,groups:s,resources:n,compatibleRenderers:o,groupMap:a}=e;this.gpuProgram=t,this.glProgram=i,o===void 0&&(o=0,t&&(o|=Oe.WEBGPU),i&&(o|=Oe.WEBGL)),this.compatibleRenderers=o;let u={};if(!n&&!s&&(n={}),n&&s)throw new Error("[Shader] Cannot have both resources and groups");if(!t&&s&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!t&&s&&a)for(let l in a)for(let c in a[l]){let h=a[l][c];u[h]={group:l,binding:c,name:h};}else if(t&&s&&!a){let l=t.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,u[c.name]=c;});}else if(n){s={},a={},t&&t.structsAndGroups.groups.forEach(h=>{a[h.group]=a[h.group]||{},a[h.group][h.binding]=h.name,u[h.name]=h;});let l=0;for(let c in n)u[c]||(s[99]||(s[99]=new nt,this._ownedBindGroups.push(s[99])),u[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(let c in n){let h=c,d=n[c];!d.source&&!d._resourceType&&(d=new ae(d));let p=u[h];p&&(s[p.group]||(s[p.group]=new nt,this._ownedBindGroups.push(s[p.group])),s[p.group].setResource(d,p.binding));}}this.groups=s,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(s,u);}addResource(e,t,i){var s,n;(s=this._uniformBindMap)[t]||(s[t]={}),(n=this._uniformBindMap[t])[i]||(n[i]=e),this.groups[t]||(this.groups[t]=new nt,this._ownedBindGroups.push(this.groups[t]));}_buildResourceAccessor(e,t){let i={};for(let s in t){let n=t[s];Object.defineProperty(i,n.name,{get(){return e[n.group].getResource(n.binding)},set(o){e[n.group].setResource(o,n.binding);}});}return i}destroy(e=false){this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(t=>{t.destroy();}),this._ownedBindGroups=null,this.resources=null,this.groups=null;}static from(e){let{gpu:t,gl:i,...s}=e,n,o;return t&&(n=Fe.from(t)),i&&(o=ke.from(i)),new r({gpuProgram:n,glProgram:o,...s})}};});var Ya,i0=f(()=>{Gi();Wa();Xa();Ui();Sc();Ar();Ya=class extends ze{constructor(e){let t=Tr({name:"batch",bits:[Cs,ws(e),Er]}),i=vr({name:"batch",bits:[As,Ps(e),Sr]});super({glProgram:t,gpuProgram:i,resources:{batchSamplers:Bs(e)}});}};});var s0,aC,Ln,Tp=f(()=>{E();Sy();Cy();i0();s0=null,aC=class uC extends Qf{constructor(e){super(e),this.geometry=new Ha,this.name=uC.extension.name,this.vertexSize=6,s0??(s0=new Ya(e.maxTextures)),this.shader=s0;}packAttributes(e,t,i,s,n){let o=n<<16|e.roundPixels&65535,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,p=a.ty,{positions:_,uvs:b}=e,x=e.color,g=e.attributeOffset,v=g+e.attributeSize;for(let T=g;T<v;T++){let S=T*2,B=_[S],A=_[S+1];t[s++]=u*B+c*A+d,t[s++]=h*A+l*B+p,t[s++]=b[S],t[s++]=b[S+1],i[s++]=x,i[s++]=o;}}packQuadAttributes(e,t,i,s,n){let o=e.texture,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,p=a.ty,_=e.bounds,b=_.maxX,x=_.minX,g=_.maxY,v=_.minY,T=o.uvs,S=e.color,B=n<<16|e.roundPixels&65535;t[s+0]=u*x+c*v+d,t[s+1]=h*v+l*x+p,t[s+2]=T.x0,t[s+3]=T.y0,i[s+4]=S,i[s+5]=B,t[s+6]=u*b+c*v+d,t[s+7]=h*v+l*b+p,t[s+8]=T.x1,t[s+9]=T.y1,i[s+10]=S,i[s+11]=B,t[s+12]=u*b+c*g+d,t[s+13]=h*g+l*b+p,t[s+14]=T.x2,t[s+15]=T.y2,i[s+16]=S,i[s+17]=B,t[s+18]=u*x+c*g+d,t[s+19]=h*g+l*x+p,t[s+20]=T.x3,t[s+21]=T.y3,i[s+22]=S,i[s+23]=B;}};aC.extension={type:[m.Batcher],name:"default"};Ln=aC;});function Sp(r,e,t,i,s,n,o,a=null){let u=0;t*=e,s*=n;let l=a.a,c=a.b,h=a.c,d=a.d,p=a.tx,_=a.ty;for(;u<o;){let b=r[t],x=r[t+1];i[s]=l*b+h*x+p,i[s+1]=c*b+d*x+_,s+=n,t+=e,u++;}}function Ep(r,e,t,i){let s=0;for(e*=t;s<i;)r[e]=0,r[e+1]=0,e+=t,s++;}var n0=f(()=>{});function Ec(r,e,t,i,s){let n=e.a,o=e.b,a=e.c,u=e.d,l=e.tx,c=e.ty;t||(t=0),i||(i=2),s||(s=r.length/i-t);let h=t*i;for(let d=0;d<s;d++){let p=r[h],_=r[h+1];r[h]=n*p+a*_+l,r[h+1]=o*p+u*_+c,h+=i;}}var o0=f(()=>{});var sD,Li,Ap=f(()=>{he();cf();sD=new D,Li=class{constructor(){this.packAsQuad=false,this.batcherName="default",this.topology="triangle-list",this.applyTransform=true,this.roundPixels=0,this._batcher=null,this._batch=null;}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,i=this.renderable;return i?Ca(t,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||sD}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology;}reset(){this.applyTransform=true,this.renderable=null,this.topology="triangle-list";}};});var Rs,Cp,Pp,a0=f(()=>{E();Rs={extension:{type:m.ShapeBuilder,name:"circle"},build(r,e){let t,i,s,n,o,a;if(r.type==="circle"){let S=r;if(o=a=S.radius,o<=0)return false;t=S.x,i=S.y,s=n=0;}else if(r.type==="ellipse"){let S=r;if(o=S.halfWidth,a=S.halfHeight,o<=0||a<=0)return false;t=S.x,i=S.y,s=n=0;}else {let S=r,B=S.width/2,A=S.height/2;t=S.x+B,i=S.y+A,o=a=Math.max(0,Math.min(S.radius,Math.min(B,A))),s=B-o,n=A-a;}if(s<0||n<0)return false;let u=Math.ceil(2.3*Math.sqrt(o+a)),l=u*8+(s?4:0)+(n?4:0);if(l===0)return false;if(u===0)return e[0]=e[6]=t+s,e[1]=e[3]=i+n,e[2]=e[4]=t-s,e[5]=e[7]=i-n,true;let c=0,h=u*4+(s?2:0)+2,d=h,p=l,_=s+o,b=n,x=t+_,g=t-_,v=i+b;if(e[c++]=x,e[c++]=v,e[--h]=v,e[--h]=g,n){let S=i-b;e[d++]=g,e[d++]=S,e[--p]=S,e[--p]=x;}for(let S=1;S<u;S++){let B=Math.PI/2*(S/u),A=s+Math.cos(B)*o,R=n+Math.sin(B)*a,Y=t+A,M=t-A,U=i+R,k=i-R;e[c++]=Y,e[c++]=U,e[--h]=U,e[--h]=M,e[d++]=M,e[d++]=k,e[--p]=k,e[--p]=Y;}_=s,b=n+a,x=t+_,g=t-_,v=i+b;let T=i-b;return e[c++]=x,e[c++]=v,e[--p]=T,e[--p]=x,s&&(e[c++]=g,e[c++]=v,e[--p]=T,e[--p]=g),true},triangulate(r,e,t,i,s,n){if(r.length===0)return;let o=0,a=0;for(let c=0;c<r.length;c+=2)o+=r[c],a+=r[c+1];o/=r.length/2,a/=r.length/2;let u=i;e[u*t]=o,e[u*t+1]=a;let l=u++;for(let c=0;c<r.length;c+=2)e[u*t]=r[c],e[u*t+1]=r[c+1],c>0&&(s[n++]=u,s[n++]=l,s[n++]=u-1),u++;s[n++]=l+1,s[n++]=l,s[n++]=u-1;}},Cp={...Rs,extension:{...Rs.extension,name:"ellipse"}},Pp={...Rs,extension:{...Rs.extension,name:"roundedRectangle"}};});var wp,Bp,lC=f(()=>{wp=1e-4,Bp=1e-4;});function Rp(r){let e=r.length;if(e<6)return 1;let t=0;for(let i=0,s=r[e-2],n=r[e-1];i<e;i+=2){let o=r[i],a=r[i+1];t+=(o-s)*(a+n),s=o,n=a;}return t<0?-1:1}var u0=f(()=>{});function cC(r,e,t,i,s,n,o,a){let u=r-t*s,l=e-i*s,c=r+t*n,h=e+i*n,d,p;o?(d=i,p=-t):(d=-i,p=t);let _=u+d,b=l+p,x=c+d,g=h+p;return a.push(_,b),a.push(x,g),2}function Nn(r,e,t,i,s,n,o,a){let u=t-r,l=i-e,c=Math.atan2(u,l),h=Math.atan2(s-r,n-e);a&&c<h?c+=Math.PI*2:!a&&c>h&&(h+=Math.PI*2);let d=c,p=h-c,_=Math.abs(p),b=Math.sqrt(u*u+l*l),x=(15*_*Math.sqrt(b)/Math.PI>>0)+1,g=p/x;if(d+=g,a){o.push(r,e),o.push(t,i);for(let v=1,T=d;v<x;v++,T+=g)o.push(r,e),o.push(r+Math.sin(T)*b,e+Math.cos(T)*b);o.push(r,e),o.push(s,n);}else {o.push(t,i),o.push(r,e);for(let v=1,T=d;v<x;v++,T+=g)o.push(r+Math.sin(T)*b,e+Math.cos(T)*b),o.push(r,e);o.push(s,n),o.push(r,e);}return x*2}function Mp(r,e,t,i,s,n){let o=1e-4;if(r.length===0)return;let a=e,u=a.alignment;if(e.alignment!==.5){let Ie=Rp(r);t&&(Ie*=-1),u=(u-.5)*Ie+.5;}let l=new ne(r[0],r[1]),c=new ne(r[r.length-2],r[r.length-1]),h=i,d=Math.abs(l.x-c.x)<o&&Math.abs(l.y-c.y)<o;if(h){r=r.slice(),d&&(r.pop(),r.pop(),c.set(r[r.length-2],r[r.length-1]));let Ie=(l.x+c.x)*.5,rs=(c.y+l.y)*.5;r.unshift(Ie,rs),r.push(Ie,rs);}let p=s,_=r.length/2,b=r.length,x=p.length/2,g=a.width/2,v=g*g,T=a.miterLimit*a.miterLimit,S=r[0],B=r[1],A=r[2],R=r[3],Y=0,M=0,U=-(B-R),k=S-A,J=0,ge=0,Ke=Math.sqrt(U*U+k*k);U/=Ke,k/=Ke,U*=g,k*=g;let ts=u,z=(1-ts)*2,j=ts*2;h||(a.cap==="round"?b+=Nn(S-U*(z-j)*.5,B-k*(z-j)*.5,S-U*z,B-k*z,S+U*j,B+k*j,p,true)+2:a.cap==="square"&&(b+=cC(S,B,U,k,z,j,true,p))),p.push(S-U*z,B-k*z),p.push(S+U*j,B+k*j);for(let Ie=1;Ie<_-1;++Ie){S=r[(Ie-1)*2],B=r[(Ie-1)*2+1],A=r[Ie*2],R=r[Ie*2+1],Y=r[(Ie+1)*2],M=r[(Ie+1)*2+1],U=-(B-R),k=S-A,Ke=Math.sqrt(U*U+k*k),U/=Ke,k/=Ke,U*=g,k*=g,J=-(R-M),ge=A-Y,Ke=Math.sqrt(J*J+ge*ge),J/=Ke,ge/=Ke,J*=g,ge*=g;let rs=A-S,Vl=B-R,zl=A-Y,Wl=M-R,IE=rs*zl+Vl*Wl,Ld=Vl*zl-Wl*rs,Xl=Ld<0;if(Math.abs(Ld)<.001*Math.abs(IE)){p.push(A-U*z,R-k*z),p.push(A+U*j,R+k*j),IE>=0&&(a.join==="round"?b+=Nn(A,R,A-U*z,R-k*z,A-J*z,R-ge*z,p,false)+4:b+=2,p.push(A-J*j,R-ge*j),p.push(A+J*z,R+ge*z));continue}let kE=(-U+S)*(-k+R)-(-U+A)*(-k+B),FE=(-J+Y)*(-ge+R)-(-J+A)*(-ge+M),Nd=(rs*FE-zl*kE)/Ld,Hd=(Wl*kE-Vl*FE)/Ld,hb=(Nd-A)*(Nd-A)+(Hd-R)*(Hd-R),xn=A+(Nd-A)*z,_n=R+(Hd-R)*z,bn=A-(Nd-A)*j,yn=R-(Hd-R)*j,QR=Math.min(rs*rs+Vl*Vl,zl*zl+Wl*Wl),OE=Xl?z:j,JR=QR+OE*OE*v;hb<=JR?a.join==="bevel"||hb/v>T?(Xl?(p.push(xn,_n),p.push(A+U*j,R+k*j),p.push(xn,_n),p.push(A+J*j,R+ge*j)):(p.push(A-U*z,R-k*z),p.push(bn,yn),p.push(A-J*z,R-ge*z),p.push(bn,yn)),b+=2):a.join==="round"?Xl?(p.push(xn,_n),p.push(A+U*j,R+k*j),b+=Nn(A,R,A+U*j,R+k*j,A+J*j,R+ge*j,p,true)+4,p.push(xn,_n),p.push(A+J*j,R+ge*j)):(p.push(A-U*z,R-k*z),p.push(bn,yn),b+=Nn(A,R,A-U*z,R-k*z,A-J*z,R-ge*z,p,false)+4,p.push(A-J*z,R-ge*z),p.push(bn,yn)):(p.push(xn,_n),p.push(bn,yn)):(p.push(A-U*z,R-k*z),p.push(A+U*j,R+k*j),a.join==="round"?Xl?b+=Nn(A,R,A+U*j,R+k*j,A+J*j,R+ge*j,p,true)+2:b+=Nn(A,R,A-U*z,R-k*z,A-J*z,R-ge*z,p,false)+2:a.join==="miter"&&hb/v<=T&&(Xl?(p.push(bn,yn),p.push(bn,yn)):(p.push(xn,_n),p.push(xn,_n)),b+=2),p.push(A-J*z,R-ge*z),p.push(A+J*j,R+ge*j),b+=2);}S=r[(_-2)*2],B=r[(_-2)*2+1],A=r[(_-1)*2],R=r[(_-1)*2+1],U=-(B-R),k=S-A,Ke=Math.sqrt(U*U+k*k),U/=Ke,k/=Ke,U*=g,k*=g,p.push(A-U*z,R-k*z),p.push(A+U*j,R+k*j),h||(a.cap==="round"?b+=Nn(A-U*(z-j)*.5,R-k*(z-j)*.5,A-U*z,R-k*z,A+U*j,R+k*j,p,false)+2:a.cap==="square"&&(b+=cC(A,R,U,k,z,j,false,p)));let cb=1e-4*1e-4;for(let Ie=x;Ie<b+x-2;++Ie)S=p[Ie*2],B=p[Ie*2+1],A=p[(Ie+1)*2],R=p[(Ie+1)*2+1],Y=p[(Ie+2)*2],M=p[(Ie+2)*2+1],!(Math.abs(S*(R-M)+A*(M-B)+Y*(B-R))<cb)&&n.push(Ie,Ie+1,Ie+2);}var l0=f(()=>{jt();u0();});function Dp(r,e,t,i){let s=1e-4;if(r.length===0)return;let n=r[0],o=r[1],a=r[r.length-2],u=r[r.length-1],l=e||Math.abs(n-a)<s&&Math.abs(o-u)<s,c=t,h=r.length/2,d=c.length/2;for(let p=0;p<h;p++)c.push(r[p*2]),c.push(r[p*2+1]);for(let p=0;p<h-1;p++)i.push(d+p,d+p+1);l&&i.push(d+h-1,d);}var c0=f(()=>{});function Fp(r,e,t=2){let i=e&&e.length,s=i?e[0]*t:r.length,n=dC(r,0,s,t,true),o=[];if(!n||n.next===n.prev)return o;let a,u,l;if(i&&(n=lD(r,e,n,t)),r.length>80*t){a=1/0,u=1/0;let c=-1/0,h=-1/0;for(let d=t;d<s;d+=t){let p=r[d],_=r[d+1];p<a&&(a=p),_<u&&(u=_),p>c&&(c=p),_>h&&(h=_);}l=Math.max(c-a,h-u),l=l!==0?32767/l:0;}return Cc(n,o,t,a,u,l,0),o}function dC(r,e,t,i,s){let n;if(s===yD(r,e,t,i)>0)for(let o=e;o<t;o+=i)n=hC(o/i|0,r[o],r[o+1],n);else for(let o=t-i;o>=e;o-=i)n=hC(o/i|0,r[o],r[o+1],n);return n&&$a(n,n.next)&&(wc(n),n=n.next),n}function Hn(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=false,!t.steiner&&($a(t,t.next)||Ye(t.prev,t,t.next)===0)){if(wc(t),t=e=t.prev,t===t.next)break;i=true;}else t=t.next;while(i||t!==e);return e}function Cc(r,e,t,i,s,n,o){if(!r)return;!o&&n&&pD(r,i,s,n);let a=r;for(;r.prev!==r.next;){let u=r.prev,l=r.next;if(n?oD(r,i,s,n):nD(r)){e.push(u.i,r.i,l.i),wc(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=aD(Hn(r),e),Cc(r,e,t,i,s,n,2)):o===2&&uD(r,e,t,i,s,n):Cc(Hn(r),e,t,i,s,n,1);break}}}function nD(r){let e=r.prev,t=r,i=r.next;if(Ye(e,t,i)>=0)return false;let s=e.x,n=t.x,o=i.x,a=e.y,u=t.y,l=i.y,c=Math.min(s,n,o),h=Math.min(a,u,l),d=Math.max(s,n,o),p=Math.max(a,u,l),_=i.next;for(;_!==e;){if(_.x>=c&&_.x<=d&&_.y>=h&&_.y<=p&&Ac(s,a,n,u,o,l,_.x,_.y)&&Ye(_.prev,_,_.next)>=0)return false;_=_.next;}return true}function oD(r,e,t,i){let s=r.prev,n=r,o=r.next;if(Ye(s,n,o)>=0)return false;let a=s.x,u=n.x,l=o.x,c=s.y,h=n.y,d=o.y,p=Math.min(a,u,l),_=Math.min(c,h,d),b=Math.max(a,u,l),x=Math.max(c,h,d),g=h0(p,_,e,t,i),v=h0(b,x,e,t,i),T=r.prevZ,S=r.nextZ;for(;T&&T.z>=g&&S&&S.z<=v;){if(T.x>=p&&T.x<=b&&T.y>=_&&T.y<=x&&T!==s&&T!==o&&Ac(a,c,u,h,l,d,T.x,T.y)&&Ye(T.prev,T,T.next)>=0||(T=T.prevZ,S.x>=p&&S.x<=b&&S.y>=_&&S.y<=x&&S!==s&&S!==o&&Ac(a,c,u,h,l,d,S.x,S.y)&&Ye(S.prev,S,S.next)>=0))return false;S=S.nextZ;}for(;T&&T.z>=g;){if(T.x>=p&&T.x<=b&&T.y>=_&&T.y<=x&&T!==s&&T!==o&&Ac(a,c,u,h,l,d,T.x,T.y)&&Ye(T.prev,T,T.next)>=0)return false;T=T.prevZ;}for(;S&&S.z<=v;){if(S.x>=p&&S.x<=b&&S.y>=_&&S.y<=x&&S!==s&&S!==o&&Ac(a,c,u,h,l,d,S.x,S.y)&&Ye(S.prev,S,S.next)>=0)return false;S=S.nextZ;}return true}function aD(r,e){let t=r;do{let i=t.prev,s=t.next.next;!$a(i,s)&&pC(i,t,t.next,s)&&Pc(i,s)&&Pc(s,i)&&(e.push(i.i,t.i,s.i),wc(t),wc(t.next),t=r=s),t=t.next;}while(t!==r);return Hn(t)}function uD(r,e,t,i,s,n){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&xD(o,a)){let u=mC(o,a);o=Hn(o,o.next),u=Hn(u,u.next),Cc(o,e,t,i,s,n,0),Cc(u,e,t,i,s,n,0);return}a=a.next;}o=o.next;}while(o!==r)}function lD(r,e,t,i){let s=[];for(let n=0,o=e.length;n<o;n++){let a=e[n]*i,u=n<o-1?e[n+1]*i:r.length,l=dC(r,a,u,i,false);l===l.next&&(l.steiner=true),s.push(gD(l));}s.sort(cD);for(let n=0;n<s.length;n++)t=hD(s[n],t);return t}function cD(r,e){let t=r.x-e.x;if(t===0&&(t=r.y-e.y,t===0)){let i=(r.next.y-r.y)/(r.next.x-r.x),s=(e.next.y-e.y)/(e.next.x-e.x);t=i-s;}return t}function hD(r,e){let t=dD(r,e);if(!t)return e;let i=mC(t,r);return Hn(i,i.next),Hn(t,t.next)}function dD(r,e){let t=e,i=r.x,s=r.y,n=-1/0,o;if($a(r,t))return t;do{if($a(r,t.next))return t.next;if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){let h=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=i&&h>n&&(n=h,o=t.x<t.next.x?t:t.next,h===i))return o}t=t.next;}while(t!==e);if(!o)return null;let a=o,u=o.x,l=o.y,c=1/0;t=o;do{if(i>=t.x&&t.x>=u&&i!==t.x&&fC(s<l?i:n,s,u,l,s<l?n:i,s,t.x,t.y)){let h=Math.abs(s-t.y)/(i-t.x);Pc(t,r)&&(h<c||h===c&&(t.x>o.x||t.x===o.x&&fD(o,t)))&&(o=t,c=h);}t=t.next;}while(t!==a);return o}function fD(r,e){return Ye(r.prev,r,e.prev)<0&&Ye(e.next,r,r.next)<0}function pD(r,e,t,i){let s=r;do s.z===0&&(s.z=h0(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==r);s.prevZ.nextZ=null,s.prevZ=null,mD(s);}function mD(r){let e,t=1;do{let i=r,s;r=null;let n=null;for(e=0;i;){e++;let o=i,a=0;for(let l=0;l<t&&(a++,o=o.nextZ,!!o);l++);let u=t;for(;a>0||u>0&&o;)a!==0&&(u===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,u--),n?n.nextZ=s:r=s,s.prevZ=n,n=s;i=o;}n.nextZ=null,t*=2;}while(e>1);return r}function h0(r,e,t,i,s){return r=(r-t)*s|0,e=(e-i)*s|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function gD(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function fC(r,e,t,i,s,n,o,a){return (s-o)*(e-a)>=(r-o)*(n-a)&&(r-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(n-a)>=(s-o)*(i-a)}function Ac(r,e,t,i,s,n,o,a){return !(r===o&&e===a)&&fC(r,e,t,i,s,n,o,a)}function xD(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!_D(r,e)&&(Pc(r,e)&&Pc(e,r)&&bD(r,e)&&(Ye(r.prev,r,e.prev)||Ye(r,e.prev,e))||$a(r,e)&&Ye(r.prev,r,r.next)>0&&Ye(e.prev,e,e.next)>0)}function Ye(r,e,t){return (e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function $a(r,e){return r.x===e.x&&r.y===e.y}function pC(r,e,t,i){let s=kp(Ye(r,e,t)),n=kp(Ye(r,e,i)),o=kp(Ye(t,i,r)),a=kp(Ye(t,i,e));return !!(s!==n&&o!==a||s===0&&Ip(r,t,e)||n===0&&Ip(r,i,e)||o===0&&Ip(t,r,i)||a===0&&Ip(t,e,i))}function Ip(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function kp(r){return r>0?1:r<0?-1:0}function _D(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&pC(t,t.next,r,e))return true;t=t.next;}while(t!==r);return false}function Pc(r,e){return Ye(r.prev,r,r.next)<0?Ye(r,e,r.next)>=0&&Ye(r,r.prev,e)>=0:Ye(r,e,r.prev)<0||Ye(r,r.next,e)<0}function bD(r,e){let t=r,i=false,s=(r.x+e.x)/2,n=(r.y+e.y)/2;do t.y>n!=t.next.y>n&&t.next.y!==t.y&&s<(t.next.x-t.x)*(n-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function mC(r,e){let t=d0(r.i,r.x,r.y),i=d0(e.i,e.x,e.y),s=r.next,n=e.prev;return r.next=e,e.prev=r,t.next=s,s.prev=t,i.next=t,t.prev=i,n.next=i,i.prev=n,i}function hC(r,e,t,i){let s=d0(r,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function wc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ);}function d0(r,e,t){return {i:r,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:false}}function yD(r,e,t,i){let s=0;for(let n=e,o=t-i;n<t;n+=i)s+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return s}var gC=f(()=>{});var Op,f0=f(()=>{gC();St();Op=Fp.default||Fp;});function ja(r,e,t,i,s,n,o){let a=Op(r,e,2);if(!a)return;for(let l=0;l<a.length;l+=3)n[o++]=a[l]+s,n[o++]=a[l+1]+s,n[o++]=a[l+2]+s;let u=s*i;for(let l=0;l<r.length;l+=2)t[u]=r[l],t[u+1]=r[l+1],u+=i;}var Gp=f(()=>{f0();});var vD,Up,p0=f(()=>{E();Gp();vD=[],Up={extension:{type:m.ShapeBuilder,name:"polygon"},build(r,e){for(let t=0;t<r.points.length;t++)e[t]=r.points[t];return true},triangulate(r,e,t,i,s,n){ja(r,vD,e,t,i,s,n);}};});var Lp,m0=f(()=>{E();Lp={extension:{type:m.ShapeBuilder,name:"rectangle"},build(r,e){let t=r,i=t.x,s=t.y,n=t.width,o=t.height;return n>0&&o>0?(e[0]=i,e[1]=s,e[2]=i+n,e[3]=s,e[4]=i+n,e[5]=s+o,e[6]=i,e[7]=s+o,true):false},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[6],e[i+o+1]=r[7],o+=t,e[i+o]=r[4],e[i+o+1]=r[5],o+=t;let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2,s[n++]=a+1,s[n++]=a+3,s[n++]=a+2;}};});var Np,g0=f(()=>{E();Np={extension:{type:m.ShapeBuilder,name:"triangle"},build(r,e){return e[0]=r.x,e[1]=r.y,e[2]=r.x2,e[3]=r.y2,e[4]=r.x3,e[5]=r.y3,true},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[4],e[i+o+1]=r[5];let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2;}};});function _C(r,e){for(let t=0;t<e.length;t++){let i=e[t];r.addColorStop(i.offset,i.color);}}function bC(r,e){let t=V.get().createCanvas(r,e),i=t.getContext("2d");return {canvas:t,context:i}}function TD(r){let e=r[0]??{};return (typeof e=="number"||r[1])&&(I("8.5.2","use options object instead"),e={type:"linear",start:{x:r[0],y:r[1]},end:{x:r[2],y:r[3]},textureSpace:r[4],textureSize:r[5]??It.defaultLinearOptions.textureSize}),e}var xC,_0,It,Vn=f(()=>{it();Se();he();Gn();ce();lt();xe();us();xC=[{offset:0,color:"white"},{offset:1,color:"black"}],_0=class x0{constructor(...e){this.uid=re("fillGradient"),this.type="linear",this.colorStops=[];let t=TD(e);t={...t.type==="radial"?x0.defaultRadialOptions:x0.defaultLinearOptions,...mt(t)},this._textureSize=t.textureSize,this._wrapMode=t.wrapMode,t.type==="radial"?(this.center=t.center,this.outerCenter=t.outerCenter??this.center,this.innerRadius=t.innerRadius,this.outerRadius=t.outerRadius,this.scale=t.scale,this.rotation=t.rotation):(this.start=t.start,this.end=t.end),this.textureSpace=t.textureSpace,this.type=t.type,t.colorStops.forEach(s=>{this.addColorStop(s.offset,s.color);});}addColorStop(e,t){return this.colorStops.push({offset:e,color:K.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:i,y:s}=this.end,n=i-e,o=s-t,a=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){let x=e;e=i,i=x,n*=-1;}if(o<0){let x=t;t=s,s=x,o*=-1;}}let u=this.colorStops.length?this.colorStops:xC,l=this._textureSize,{canvas:c,context:h}=bC(l,1),d=a?h.createLinearGradient(this._textureSize,0,0,0):h.createLinearGradient(0,0,this._textureSize,0);_C(d,u),h.fillStyle=d,h.fillRect(0,0,l,1),this.texture=new C({source:new Rt({resource:c,addressMode:this._wrapMode})});let p=Math.sqrt(n*n+o*o),_=Math.atan2(o,n),b=new D;b.scale(p/l,1),b.rotate(_),b.translate(e,t),this.textureSpace==="local"&&b.scale(l,l),this.transform=b;}buildGradient(){this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient();}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:xC,t=this._textureSize,{canvas:i,context:s}=bC(t,t),{x:n,y:o}=this.center,{x:a,y:u}=this.outerCenter,l=this.innerRadius,c=this.outerRadius,h=a-c,d=u-c,p=t/(c*2),_=(n-h)*p,b=(o-d)*p,x=s.createRadialGradient(_,b,l*p,(a-h)*p,(u-d)*p,c*p);_C(x,e),s.fillStyle=e[e.length-1].color,s.fillRect(0,0,t,t),s.fillStyle=x,s.translate(_,b),s.rotate(this.rotation),s.scale(1,this.scale),s.translate(-_,-b),s.fillRect(0,0,t,t),this.texture=new C({source:new Rt({resource:i,addressMode:this._wrapMode})});let g=new D;g.scale(1/p,1/p),g.translate(h,d),this.textureSpace==="local"&&g.scale(t,t),this.transform=g;}get styleKey(){return this.uid}destroy(){this.texture?.destroy(true),this.texture=null;}};_0.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};_0.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};It=_0;});function Hp(r,e,t,i){let s=e.matrix?r.copyFrom(e.matrix).invert():r.identity();if(e.textureSpace==="local"){let o=t.getBounds(ED);e.width&&o.pad(e.width);let{x:a,y:u}=o,l=1/o.width,c=1/o.height,h=-a*l,d=-u*c,p=s.a,_=s.b,b=s.c,x=s.d;s.a*=l,s.b*=l,s.c*=c,s.d*=c,s.tx=h*p+d*b+s.tx,s.ty=h*_+d*x+s.ty;}else s.translate(e.texture.frame.x,e.texture.frame.y),s.scale(1/e.texture.source.width,1/e.texture.source.height);let n=e.texture.source.style;return !(e.fill instanceof It)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),i&&s.append(SD.copyFrom(i).invert()),s}var SD,ED,b0=f(()=>{he();Ze();Vn();SD=new D,ED=new Z;});function Vp(r,e){let{geometryData:t,batches:i}=e;i.length=0,t.indices.length=0,t.vertices.length=0,t.uvs.length=0;for(let s=0;s<r.instructions.length;s++){let n=r.instructions[s];if(n.action==="texture")PD(n.data,i,t);else if(n.action==="fill"||n.action==="stroke"){let o=n.action==="stroke",a=n.data.path.shapePath,u=n.data.style,l=n.data.hole;o&&l&&yC(l.shapePath,u,true,i,t),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),yC(a,u,o,i,t);}}}function PD(r,e,t){let i=[],s=qa.rectangle,n=AD;n.x=r.dx,n.y=r.dy,n.width=r.dw,n.height=r.dh;let o=r.transform;if(!s.build(n,i))return;let{vertices:a,uvs:u,indices:l}=t,c=l.length,h=a.length/2;o&&Ec(i,o),s.triangulate(i,a,2,h,l,c);let d=r.image,p=d.uvs;u.push(p.x0,p.y0,p.x1,p.y1,p.x3,p.y3,p.x2,p.y2);let _=Re.get(Li);_.indexOffset=c,_.indexSize=l.length-c,_.attributeOffset=h,_.attributeSize=a.length/2-h,_.baseColor=r.style,_.alpha=r.alpha,_.texture=d,_.geometryData=t,e.push(_);}function yC(r,e,t,i,s){let{vertices:n,uvs:o,indices:a}=s;r.shapePrimitives.forEach(({shape:u,transform:l,holes:c})=>{let h=[],d=qa[u.type];if(!d.build(u,h))return;let p=a.length,_=n.length/2,b="triangle-list";if(l&&Ec(h,l),t){let T=u.closePath??true,S=e;S.pixelLine?(Dp(h,T,n,a),b="line-list"):Mp(h,S,false,T,n,a);}else if(c){let T=[],S=h.slice();wD(c).forEach(A=>{T.push(S.length/2),S.push(...A);}),ja(S,T,n,2,_,a,p);}else d.triangulate(h,n,2,_,a,p);let x=o.length/2,g=e.texture;if(g!==C.WHITE){let T=Hp(CD,e,u,l);Sp(n,2,_,o,x,2,n.length/2-_,T);}else Ep(o,x,2,n.length/2-_);let v=Re.get(Li);v.indexOffset=p,v.indexSize=a.length-p,v.attributeOffset=_,v.attributeSize=n.length/2-_,v.baseColor=e.color,v.alpha=e.alpha,v.texture=g,v.geometryData=s,v.topology=b,i.push(v);});}function wD(r){let e=[];for(let t=0;t<r.length;t++){let i=r[t].shape,s=[];qa[i.type].build(i,s)&&e.push(s);}return e}var qa,AD,CD,y0=f(()=>{E();he();Ze();n0();o0();ce();ri();Ap();a0();l0();c0();p0();m0();g0();b0();Gp();qa={};O.handleByMap(m.ShapeBuilder,qa);O.add(Lp,Up,Np,Rs,Cp,Pp);AD=new Z,CD=new D;});var Bc,Rc,T0,Ms,Mc=f(()=>{E();pc();Tp();_f();xe();ri();y0();Bc=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]};}},Rc=class{constructor(){this.instructions=new as;}init(e){this.batcher=new Ln({maxTextures:e}),this.instructions.reset();}get geometry(){return I(Jd,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}},T0=class v0{constructor(e){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuContextHash"),e.renderableGC.addManagedHash(this,"_graphicsDataContextHash");}init(e){v0.defaultOptions.bezierSmoothness=e?.bezierSmoothness??v0.defaultOptions.bezierSmoothness;}getContextRenderData(e){return this._graphicsDataContextHash[e.uid]||this._initContextRenderData(e)}updateGpuContext(e){let t=this._gpuContextHash[e.uid]||this._initContext(e);if(e.dirty){t?this._cleanGraphicsContextData(e):t=this._initContext(e),Vp(e,t);let i=e.batchMode;e.customShader||i==="no-batch"?t.isBatchable=false:i==="auto"?t.isBatchable=t.geometryData.vertices.length<400:t.isBatchable=true,e.dirty=false;}return t}getGpuContext(e){return this._gpuContextHash[e.uid]||this._initContext(e)}_initContextRenderData(e){let t=Re.get(Rc,{maxTextures:this._renderer.limits.maxBatchableTextures}),{batches:i,geometryData:s}=this._gpuContextHash[e.uid],n=s.vertices.length,o=s.indices.length;for(let c=0;c<i.length;c++)i[c].applyTransform=false;let a=t.batcher;a.ensureAttributeBuffer(n),a.ensureIndexBuffer(o),a.begin();for(let c=0;c<i.length;c++){let h=i[c];a.add(h);}a.finish(t.instructions);let u=a.geometry;u.indexBuffer.setDataWithSize(a.indexBuffer,a.indexSize,true),u.buffers[0].setDataWithSize(a.attributeBuffer.float32View,a.attributeSize,true);let l=a.batches;for(let c=0;c<l.length;c++){let h=l[c];h.bindGroup=bs(h.textures.textures,h.textures.count,this._renderer.limits.maxBatchableTextures);}return this._graphicsDataContextHash[e.uid]=t,t}_initContext(e){let t=new Bc;return t.context=e,this._gpuContextHash[e.uid]=t,e.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]}onGraphicsContextDestroy(e){this._cleanGraphicsContextData(e),e.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]=null;}_cleanGraphicsContextData(e){let t=this._gpuContextHash[e.uid];t.isBatchable||this._graphicsDataContextHash[e.uid]&&(Re.return(this.getContextRenderData(e)),this._graphicsDataContextHash[e.uid]=null),t.batches&&t.batches.forEach(i=>{Re.return(i);});}destroy(){for(let e in this._gpuContextHash)this._gpuContextHash[e]&&this.onGraphicsContextDestroy(this._gpuContextHash[e].context);}};T0.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"graphicsContext"};T0.defaultOptions={bezierSmoothness:.5};Ms=T0;});var BD,S0,E0,A0,C0,P0,w0,B0,Ue,cr=f(()=>{BD={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},S0=0,E0=1,A0=2,C0=3,P0=4,w0=5,B0=class vC{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=true,this.depthMask=true;}get blend(){return !!(this.data&1<<S0)}set blend(e){!!(this.data&1<<S0)!==e&&(this.data^=1<<S0);}get offsets(){return !!(this.data&1<<E0)}set offsets(e){!!(this.data&1<<E0)!==e&&(this.data^=1<<E0);}set cullMode(e){if(e==="none"){this.culling=false;return}this.culling=true,this.clockwiseFrontFace=e==="front";}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return !!(this.data&1<<A0)}set culling(e){!!(this.data&1<<A0)!==e&&(this.data^=1<<A0);}get depthTest(){return !!(this.data&1<<C0)}set depthTest(e){!!(this.data&1<<C0)!==e&&(this.data^=1<<C0);}get depthMask(){return !!(this.data&1<<w0)}set depthMask(e){!!(this.data&1<<w0)!==e&&(this.data^=1<<w0);}get clockwiseFrontFace(){return !!(this.data&1<<P0)}set clockwiseFrontFace(e){!!(this.data&1<<P0)!==e&&(this.data^=1<<P0);}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=BD[e]||0;}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e;}toString(){return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let e=new vC;return e.depthTest=false,e.blend=true,e}};B0.default2d=B0.for2d();Ue=B0;});function TC(r,e,t,i){t[i++]=(r>>16&255)/255,t[i++]=(r>>8&255)/255,t[i++]=(r&255)/255,t[i++]=e;}function Cr(r,e,t){let i=(r>>24&255)/255;e[t++]=(r&255)/255*i,e[t++]=(r>>8&255)/255*i,e[t++]=(r>>16&255)/255*i,e[t++]=i;}var zn=f(()=>{});var Dc,Wn,R0=f(()=>{E();cr();ri();zn();Ap();Dc=class{constructor(){this.batches=[],this.batched=false;}destroy(){this.batches.forEach(e=>{Re.return(e);}),this.batches.length=0;}},Wn=class{constructor(e,t){this.state=Ue.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this);}contextChange(){this._adaptor.contextChange(this.renderer);}validateRenderable(e){let t=e.context,i=!!e._gpuData,s=this.renderer.graphicsContext.updateGpuContext(t);return !!(s.isBatchable||i!==s.isBatchable)}addRenderable(e,t){let i=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),i.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e));}updateRenderable(e){let i=this._getGpuDataForRenderable(e).batches;for(let s=0;s<i.length;s++){let n=i[s];n._batcher.updateElement(n);}}execute(e){if(!e.isRenderable)return;let t=this.renderer,i=e.context;if(!t.graphicsContext.getGpuContext(i).batches.length)return;let n=i.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;let o=n.resources.localUniforms.uniforms;o.uTransformMatrix=e.groupTransform,o.uRound=t._roundPixels|e._roundPixels,Cr(e.groupColorAlpha,o.uColor,0),this._adaptor.execute(this,e);}_rebuild(e){let t=this._getGpuDataForRenderable(e),i=this.renderer.graphicsContext.updateGpuContext(e.context);t.destroy(),i.isBatchable&&this._updateBatchesForRenderable(e,t);}_addToBatcher(e,t){let i=this.renderer.renderPipes.batch,s=this._getGpuDataForRenderable(e).batches;for(let n=0;n<s.length;n++){let o=s[n];i.addToBatch(o,t);}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){let t=new Dc;return e._gpuData[this.renderer.uid]=t,t}_updateBatchesForRenderable(e,t){let i=e.context,s=this.renderer.graphicsContext.getGpuContext(i),n=this.renderer._roundPixels|e._roundPixels;t.batches=s.batches.map(o=>{let a=Re.get(Li);return o.copyTo(a),a.renderable=e,a.roundPixels=n,a});}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;}};Wn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"graphics"};});var M0=f(()=>{E();Mc();R0();O.add(Wn);O.add(Ms);});var ai,Ic=f(()=>{ai=class{constructor(){this.batcherName="default",this.packAsQuad=false,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1;}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(e){this._topology=e;}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1;}setTexture(e){this.texture!==e&&(this.texture=e,this._textureMatrixUpdateId=-1);}get uvs(){let t=this.geometry.getBuffer("aUV"),i=t.data,s=i,n=this.texture.textureMatrix;return n.isSimple||(s=this._transformedUvs,(this._textureMatrixUpdateId!==n._updateID||this._uvUpdateId!==t._updateID)&&((!s||s.length<i.length)&&(s=this._transformedUvs=new Float32Array(i.length)),this._textureMatrixUpdateId=n._updateID,this._uvUpdateId=t._updateID,n.multiplyUvs(i,s))),s}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}};});var Ka,Xn,D0=f(()=>{E();he();Fi();Qe();Oa();zn();Ic();Ka=class{destroy(){}},Xn=class{constructor(e,t){this.localUniforms=new ae({uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new nt({0:this.localUniforms}),this.renderer=e,this._adaptor=t,this._adaptor.init();}validateRenderable(e){let t=this._getMeshData(e),i=t.batched,s=e.batched;if(t.batched=s,i!==s)return true;if(s){let n=e._geometry;if(n.indices.length!==t.indexSize||n.positions.length!==t.vertexSize)return t.indexSize=n.indices.length,t.vertexSize=n.positions.length,true;let o=this._getBatchableMesh(e);return o.texture.uid!==e._texture.uid&&(o._textureMatrixUpdateId=-1),!o._batcher.checkAndUpdateTexture(o,e._texture)}return false}addRenderable(e,t){let i=this.renderer.renderPipes.batch,{batched:s}=this._getMeshData(e);if(s){let n=this._getBatchableMesh(e);n.setTexture(e._texture),n.geometry=e._geometry,i.addToBatch(n,t);}else i.break(t),t.add(e);}updateRenderable(e){if(e.batched){let t=this._getBatchableMesh(e);t.setTexture(e._texture),t.geometry=e._geometry,t._batcher.updateElement(t);}}execute(e){if(!e.isRenderable)return;e.state.blendMode=Lr(e.groupBlendMode,e.texture._source);let t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),Cr(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e);}_getMeshData(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new Ka),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:e._geometry.indices?.length,vertexSize:e._geometry.positions?.length},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new Ka),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){let t=new ai;return t.renderable=e,t.setTexture(e._texture),t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,e._gpuData[this.renderer.uid].batchableMesh=t,t}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null;}};Xn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"mesh"};});var I0=f(()=>{E();D0();O.add(Xn);});var Za,k0=f(()=>{Za=class{execute(e,t){let i=e.state,s=e.renderer,n=t.shader||e.defaultShader;n.resources.uTexture=t.texture._source,n.resources.uniforms=e.localUniforms;let o=s.gl,a=e.getBuffers(t);s.shader.bind(n),s.state.set(i),s.geometry.bind(a.geometry,n.glProgram);let l=a.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;o.drawElements(o.TRIANGLES,t.particleChildren.length*6,l,0);}};});function kc(r,e=null){let t=r*6;if(t>65535?e||(e=new Uint32Array(t)):e||(e=new Uint16Array(t)),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let i=0,s=0;i<t;i+=6,s+=4)e[i+0]=s+0,e[i+1]=s+1,e[i+2]=s+2,e[i+3]=s+0,e[i+4]=s+2,e[i+5]=s+3;return e}var F0=f(()=>{});function zp(r){return {dynamicUpdate:SC(r,true),staticUpdate:SC(r,false)}}function SC(r,e){let t=[];t.push(`
|
|
260
|
+
`}};});var Tc,yp,t0=f(()=>{Tc=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],yp=Tc.reduce((r,e)=>(r[e]=true,r),{});});function vp(r,e){switch(r){case "f32":return 0;case "vec2<f32>":return new Float32Array(2*e);case "vec3<f32>":return new Float32Array(3*e);case "vec4<f32>":return new Float32Array(4*e);case "mat2x2<f32>":return new Float32Array([1,0,0,1]);case "mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case "mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var r0=f(()=>{});var sC,ae,Qe=f(()=>{lt();Va();t0();r0();sC=class nC{constructor(e,t){this._touched=0,this.uid=re("uniform"),this._resourceType="uniformGroup",this._resourceId=re("resource"),this.isUniformGroup=true,this._dirtyId=0,this.destroyed=false,t={...nC.defaultOptions,...t},this.uniformStructures=e;let i={};for(let s in e){let n=e[s];if(n.name=s,n.size=n.size??1,!yp[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${Tc.join(", ")}`);n.value??(n.value=vp(n.type,n.size)),i[s]=n.value;}this.uniforms=i,this._dirtyId=1,this.ubo=t.ubo,this.isStatic=t.isStatic,this._signature=Nr(Object.keys(i).map(s=>`${s}-${e[s].type}`).join("-"),"uniform-group");}update(){this._dirtyId++;}};sC.defaultOptions={ubo:false,isStatic:false};ae=sC;});function Bs(r){let e=oC[r];if(e)return e;let t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=i;return e=oC[r]=new ae({uTextures:{value:t,type:"i32",size:r}},{isStatic:true}),e}var oC,Sc=f(()=>{Qe();oC={};});var Oe,lr=f(()=>{Oe=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.BOTH=3]="BOTH",r))(Oe||{});});var ze,Ar=f(()=>{St();lt();Kt();Fi();ur();lr();Qe();ze=class r extends ue{constructor(e){super(),this.uid=re("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:t,glProgram:i,groups:s,resources:n,compatibleRenderers:o,groupMap:a}=e;this.gpuProgram=t,this.glProgram=i,o===void 0&&(o=0,t&&(o|=Oe.WEBGPU),i&&(o|=Oe.WEBGL)),this.compatibleRenderers=o;let u={};if(!n&&!s&&(n={}),n&&s)throw new Error("[Shader] Cannot have both resources and groups");if(!t&&s&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!t&&s&&a)for(let l in a)for(let c in a[l]){let h=a[l][c];u[h]={group:l,binding:c,name:h};}else if(t&&s&&!a){let l=t.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,u[c.name]=c;});}else if(n){s={},a={},t&&t.structsAndGroups.groups.forEach(h=>{a[h.group]=a[h.group]||{},a[h.group][h.binding]=h.name,u[h.name]=h;});let l=0;for(let c in n)u[c]||(s[99]||(s[99]=new nt,this._ownedBindGroups.push(s[99])),u[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(let c in n){let h=c,d=n[c];!d.source&&!d._resourceType&&(d=new ae(d));let p=u[h];p&&(s[p.group]||(s[p.group]=new nt,this._ownedBindGroups.push(s[p.group])),s[p.group].setResource(d,p.binding));}}this.groups=s,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(s,u);}addResource(e,t,i){var s,n;(s=this._uniformBindMap)[t]||(s[t]={}),(n=this._uniformBindMap[t])[i]||(n[i]=e),this.groups[t]||(this.groups[t]=new nt,this._ownedBindGroups.push(this.groups[t]));}_buildResourceAccessor(e,t){let i={};for(let s in t){let n=t[s];Object.defineProperty(i,n.name,{get(){return e[n.group].getResource(n.binding)},set(o){e[n.group].setResource(o,n.binding);}});}return i}destroy(e=false){this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(t=>{t.destroy();}),this._ownedBindGroups=null,this.resources=null,this.groups=null;}static from(e){let{gpu:t,gl:i,...s}=e,n,o;return t&&(n=Fe.from(t)),i&&(o=ke.from(i)),new r({gpuProgram:n,glProgram:o,...s})}};});var Ya,i0=f(()=>{Gi();Wa();Xa();Ui();Sc();Ar();Ya=class extends ze{constructor(e){let t=Tr({name:"batch",bits:[Cs,ws(e),Er]}),i=vr({name:"batch",bits:[As,Ps(e),Sr]});super({glProgram:t,gpuProgram:i,resources:{batchSamplers:Bs(e)}});}};});var s0,aC,Ln,Tp=f(()=>{E();Sy();Cy();i0();s0=null,aC=class uC extends Qf{constructor(e){super(e),this.geometry=new Ha,this.name=uC.extension.name,this.vertexSize=6,s0??(s0=new Ya(e.maxTextures)),this.shader=s0;}packAttributes(e,t,i,s,n){let o=n<<16|e.roundPixels&65535,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,p=a.ty,{positions:_,uvs:b}=e,x=e.color,m=e.attributeOffset,v=m+e.attributeSize;for(let T=m;T<v;T++){let S=T*2,B=_[S],A=_[S+1];t[s++]=u*B+c*A+d,t[s++]=h*A+l*B+p,t[s++]=b[S],t[s++]=b[S+1],i[s++]=x,i[s++]=o;}}packQuadAttributes(e,t,i,s,n){let o=e.texture,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,p=a.ty,_=e.bounds,b=_.maxX,x=_.minX,m=_.maxY,v=_.minY,T=o.uvs,S=e.color,B=n<<16|e.roundPixels&65535;t[s+0]=u*x+c*v+d,t[s+1]=h*v+l*x+p,t[s+2]=T.x0,t[s+3]=T.y0,i[s+4]=S,i[s+5]=B,t[s+6]=u*b+c*v+d,t[s+7]=h*v+l*b+p,t[s+8]=T.x1,t[s+9]=T.y1,i[s+10]=S,i[s+11]=B,t[s+12]=u*b+c*m+d,t[s+13]=h*m+l*b+p,t[s+14]=T.x2,t[s+15]=T.y2,i[s+16]=S,i[s+17]=B,t[s+18]=u*x+c*m+d,t[s+19]=h*m+l*x+p,t[s+20]=T.x3,t[s+21]=T.y3,i[s+22]=S,i[s+23]=B;}};aC.extension={type:[g.Batcher],name:"default"};Ln=aC;});function Sp(r,e,t,i,s,n,o,a=null){let u=0;t*=e,s*=n;let l=a.a,c=a.b,h=a.c,d=a.d,p=a.tx,_=a.ty;for(;u<o;){let b=r[t],x=r[t+1];i[s]=l*b+h*x+p,i[s+1]=c*b+d*x+_,s+=n,t+=e,u++;}}function Ep(r,e,t,i){let s=0;for(e*=t;s<i;)r[e]=0,r[e+1]=0,e+=t,s++;}var n0=f(()=>{});function Ec(r,e,t,i,s){let n=e.a,o=e.b,a=e.c,u=e.d,l=e.tx,c=e.ty;t||(t=0),i||(i=2),s||(s=r.length/i-t);let h=t*i;for(let d=0;d<s;d++){let p=r[h],_=r[h+1];r[h]=n*p+a*_+l,r[h+1]=o*p+u*_+c,h+=i;}}var o0=f(()=>{});var sD,Li,Ap=f(()=>{he();cf();sD=new D,Li=class{constructor(){this.packAsQuad=false,this.batcherName="default",this.topology="triangle-list",this.applyTransform=true,this.roundPixels=0,this._batcher=null,this._batch=null;}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,i=this.renderable;return i?Ca(t,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||sD}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology;}reset(){this.applyTransform=true,this.renderable=null,this.topology="triangle-list";}};});var Rs,Cp,Pp,a0=f(()=>{E();Rs={extension:{type:g.ShapeBuilder,name:"circle"},build(r,e){let t,i,s,n,o,a;if(r.type==="circle"){let S=r;if(o=a=S.radius,o<=0)return false;t=S.x,i=S.y,s=n=0;}else if(r.type==="ellipse"){let S=r;if(o=S.halfWidth,a=S.halfHeight,o<=0||a<=0)return false;t=S.x,i=S.y,s=n=0;}else {let S=r,B=S.width/2,A=S.height/2;t=S.x+B,i=S.y+A,o=a=Math.max(0,Math.min(S.radius,Math.min(B,A))),s=B-o,n=A-a;}if(s<0||n<0)return false;let u=Math.ceil(2.3*Math.sqrt(o+a)),l=u*8+(s?4:0)+(n?4:0);if(l===0)return false;if(u===0)return e[0]=e[6]=t+s,e[1]=e[3]=i+n,e[2]=e[4]=t-s,e[5]=e[7]=i-n,true;let c=0,h=u*4+(s?2:0)+2,d=h,p=l,_=s+o,b=n,x=t+_,m=t-_,v=i+b;if(e[c++]=x,e[c++]=v,e[--h]=v,e[--h]=m,n){let S=i-b;e[d++]=m,e[d++]=S,e[--p]=S,e[--p]=x;}for(let S=1;S<u;S++){let B=Math.PI/2*(S/u),A=s+Math.cos(B)*o,R=n+Math.sin(B)*a,Y=t+A,M=t-A,U=i+R,k=i-R;e[c++]=Y,e[c++]=U,e[--h]=U,e[--h]=M,e[d++]=M,e[d++]=k,e[--p]=k,e[--p]=Y;}_=s,b=n+a,x=t+_,m=t-_,v=i+b;let T=i-b;return e[c++]=x,e[c++]=v,e[--p]=T,e[--p]=x,s&&(e[c++]=m,e[c++]=v,e[--p]=T,e[--p]=m),true},triangulate(r,e,t,i,s,n){if(r.length===0)return;let o=0,a=0;for(let c=0;c<r.length;c+=2)o+=r[c],a+=r[c+1];o/=r.length/2,a/=r.length/2;let u=i;e[u*t]=o,e[u*t+1]=a;let l=u++;for(let c=0;c<r.length;c+=2)e[u*t]=r[c],e[u*t+1]=r[c+1],c>0&&(s[n++]=u,s[n++]=l,s[n++]=u-1),u++;s[n++]=l+1,s[n++]=l,s[n++]=u-1;}},Cp={...Rs,extension:{...Rs.extension,name:"ellipse"}},Pp={...Rs,extension:{...Rs.extension,name:"roundedRectangle"}};});var wp,Bp,lC=f(()=>{wp=1e-4,Bp=1e-4;});function Rp(r){let e=r.length;if(e<6)return 1;let t=0;for(let i=0,s=r[e-2],n=r[e-1];i<e;i+=2){let o=r[i],a=r[i+1];t+=(o-s)*(a+n),s=o,n=a;}return t<0?-1:1}var u0=f(()=>{});function cC(r,e,t,i,s,n,o,a){let u=r-t*s,l=e-i*s,c=r+t*n,h=e+i*n,d,p;o?(d=i,p=-t):(d=-i,p=t);let _=u+d,b=l+p,x=c+d,m=h+p;return a.push(_,b),a.push(x,m),2}function Nn(r,e,t,i,s,n,o,a){let u=t-r,l=i-e,c=Math.atan2(u,l),h=Math.atan2(s-r,n-e);a&&c<h?c+=Math.PI*2:!a&&c>h&&(h+=Math.PI*2);let d=c,p=h-c,_=Math.abs(p),b=Math.sqrt(u*u+l*l),x=(15*_*Math.sqrt(b)/Math.PI>>0)+1,m=p/x;if(d+=m,a){o.push(r,e),o.push(t,i);for(let v=1,T=d;v<x;v++,T+=m)o.push(r,e),o.push(r+Math.sin(T)*b,e+Math.cos(T)*b);o.push(r,e),o.push(s,n);}else {o.push(t,i),o.push(r,e);for(let v=1,T=d;v<x;v++,T+=m)o.push(r+Math.sin(T)*b,e+Math.cos(T)*b),o.push(r,e);o.push(s,n),o.push(r,e);}return x*2}function Mp(r,e,t,i,s,n){let o=1e-4;if(r.length===0)return;let a=e,u=a.alignment;if(e.alignment!==.5){let Ie=Rp(r);t&&(Ie*=-1),u=(u-.5)*Ie+.5;}let l=new ne(r[0],r[1]),c=new ne(r[r.length-2],r[r.length-1]),h=i,d=Math.abs(l.x-c.x)<o&&Math.abs(l.y-c.y)<o;if(h){r=r.slice(),d&&(r.pop(),r.pop(),c.set(r[r.length-2],r[r.length-1]));let Ie=(l.x+c.x)*.5,rs=(c.y+l.y)*.5;r.unshift(Ie,rs),r.push(Ie,rs);}let p=s,_=r.length/2,b=r.length,x=p.length/2,m=a.width/2,v=m*m,T=a.miterLimit*a.miterLimit,S=r[0],B=r[1],A=r[2],R=r[3],Y=0,M=0,U=-(B-R),k=S-A,J=0,ge=0,Ke=Math.sqrt(U*U+k*k);U/=Ke,k/=Ke,U*=m,k*=m;let ts=u,z=(1-ts)*2,j=ts*2;h||(a.cap==="round"?b+=Nn(S-U*(z-j)*.5,B-k*(z-j)*.5,S-U*z,B-k*z,S+U*j,B+k*j,p,true)+2:a.cap==="square"&&(b+=cC(S,B,U,k,z,j,true,p))),p.push(S-U*z,B-k*z),p.push(S+U*j,B+k*j);for(let Ie=1;Ie<_-1;++Ie){S=r[(Ie-1)*2],B=r[(Ie-1)*2+1],A=r[Ie*2],R=r[Ie*2+1],Y=r[(Ie+1)*2],M=r[(Ie+1)*2+1],U=-(B-R),k=S-A,Ke=Math.sqrt(U*U+k*k),U/=Ke,k/=Ke,U*=m,k*=m,J=-(R-M),ge=A-Y,Ke=Math.sqrt(J*J+ge*ge),J/=Ke,ge/=Ke,J*=m,ge*=m;let rs=A-S,Vl=B-R,zl=A-Y,Wl=M-R,IE=rs*zl+Vl*Wl,Ld=Vl*zl-Wl*rs,Xl=Ld<0;if(Math.abs(Ld)<.001*Math.abs(IE)){p.push(A-U*z,R-k*z),p.push(A+U*j,R+k*j),IE>=0&&(a.join==="round"?b+=Nn(A,R,A-U*z,R-k*z,A-J*z,R-ge*z,p,false)+4:b+=2,p.push(A-J*j,R-ge*j),p.push(A+J*z,R+ge*z));continue}let kE=(-U+S)*(-k+R)-(-U+A)*(-k+B),FE=(-J+Y)*(-ge+R)-(-J+A)*(-ge+M),Nd=(rs*FE-zl*kE)/Ld,Hd=(Wl*kE-Vl*FE)/Ld,hb=(Nd-A)*(Nd-A)+(Hd-R)*(Hd-R),xn=A+(Nd-A)*z,_n=R+(Hd-R)*z,bn=A-(Nd-A)*j,yn=R-(Hd-R)*j,QR=Math.min(rs*rs+Vl*Vl,zl*zl+Wl*Wl),OE=Xl?z:j,JR=QR+OE*OE*v;hb<=JR?a.join==="bevel"||hb/v>T?(Xl?(p.push(xn,_n),p.push(A+U*j,R+k*j),p.push(xn,_n),p.push(A+J*j,R+ge*j)):(p.push(A-U*z,R-k*z),p.push(bn,yn),p.push(A-J*z,R-ge*z),p.push(bn,yn)),b+=2):a.join==="round"?Xl?(p.push(xn,_n),p.push(A+U*j,R+k*j),b+=Nn(A,R,A+U*j,R+k*j,A+J*j,R+ge*j,p,true)+4,p.push(xn,_n),p.push(A+J*j,R+ge*j)):(p.push(A-U*z,R-k*z),p.push(bn,yn),b+=Nn(A,R,A-U*z,R-k*z,A-J*z,R-ge*z,p,false)+4,p.push(A-J*z,R-ge*z),p.push(bn,yn)):(p.push(xn,_n),p.push(bn,yn)):(p.push(A-U*z,R-k*z),p.push(A+U*j,R+k*j),a.join==="round"?Xl?b+=Nn(A,R,A+U*j,R+k*j,A+J*j,R+ge*j,p,true)+2:b+=Nn(A,R,A-U*z,R-k*z,A-J*z,R-ge*z,p,false)+2:a.join==="miter"&&hb/v<=T&&(Xl?(p.push(bn,yn),p.push(bn,yn)):(p.push(xn,_n),p.push(xn,_n)),b+=2),p.push(A-J*z,R-ge*z),p.push(A+J*j,R+ge*j),b+=2);}S=r[(_-2)*2],B=r[(_-2)*2+1],A=r[(_-1)*2],R=r[(_-1)*2+1],U=-(B-R),k=S-A,Ke=Math.sqrt(U*U+k*k),U/=Ke,k/=Ke,U*=m,k*=m,p.push(A-U*z,R-k*z),p.push(A+U*j,R+k*j),h||(a.cap==="round"?b+=Nn(A-U*(z-j)*.5,R-k*(z-j)*.5,A-U*z,R-k*z,A+U*j,R+k*j,p,false)+2:a.cap==="square"&&(b+=cC(A,R,U,k,z,j,false,p)));let cb=1e-4*1e-4;for(let Ie=x;Ie<b+x-2;++Ie)S=p[Ie*2],B=p[Ie*2+1],A=p[(Ie+1)*2],R=p[(Ie+1)*2+1],Y=p[(Ie+2)*2],M=p[(Ie+2)*2+1],!(Math.abs(S*(R-M)+A*(M-B)+Y*(B-R))<cb)&&n.push(Ie,Ie+1,Ie+2);}var l0=f(()=>{jt();u0();});function Dp(r,e,t,i){let s=1e-4;if(r.length===0)return;let n=r[0],o=r[1],a=r[r.length-2],u=r[r.length-1],l=e||Math.abs(n-a)<s&&Math.abs(o-u)<s,c=t,h=r.length/2,d=c.length/2;for(let p=0;p<h;p++)c.push(r[p*2]),c.push(r[p*2+1]);for(let p=0;p<h-1;p++)i.push(d+p,d+p+1);l&&i.push(d+h-1,d);}var c0=f(()=>{});function Fp(r,e,t=2){let i=e&&e.length,s=i?e[0]*t:r.length,n=dC(r,0,s,t,true),o=[];if(!n||n.next===n.prev)return o;let a,u,l;if(i&&(n=lD(r,e,n,t)),r.length>80*t){a=1/0,u=1/0;let c=-1/0,h=-1/0;for(let d=t;d<s;d+=t){let p=r[d],_=r[d+1];p<a&&(a=p),_<u&&(u=_),p>c&&(c=p),_>h&&(h=_);}l=Math.max(c-a,h-u),l=l!==0?32767/l:0;}return Cc(n,o,t,a,u,l,0),o}function dC(r,e,t,i,s){let n;if(s===yD(r,e,t,i)>0)for(let o=e;o<t;o+=i)n=hC(o/i|0,r[o],r[o+1],n);else for(let o=t-i;o>=e;o-=i)n=hC(o/i|0,r[o],r[o+1],n);return n&&$a(n,n.next)&&(wc(n),n=n.next),n}function Hn(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=false,!t.steiner&&($a(t,t.next)||Ye(t.prev,t,t.next)===0)){if(wc(t),t=e=t.prev,t===t.next)break;i=true;}else t=t.next;while(i||t!==e);return e}function Cc(r,e,t,i,s,n,o){if(!r)return;!o&&n&&pD(r,i,s,n);let a=r;for(;r.prev!==r.next;){let u=r.prev,l=r.next;if(n?oD(r,i,s,n):nD(r)){e.push(u.i,r.i,l.i),wc(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=aD(Hn(r),e),Cc(r,e,t,i,s,n,2)):o===2&&uD(r,e,t,i,s,n):Cc(Hn(r),e,t,i,s,n,1);break}}}function nD(r){let e=r.prev,t=r,i=r.next;if(Ye(e,t,i)>=0)return false;let s=e.x,n=t.x,o=i.x,a=e.y,u=t.y,l=i.y,c=Math.min(s,n,o),h=Math.min(a,u,l),d=Math.max(s,n,o),p=Math.max(a,u,l),_=i.next;for(;_!==e;){if(_.x>=c&&_.x<=d&&_.y>=h&&_.y<=p&&Ac(s,a,n,u,o,l,_.x,_.y)&&Ye(_.prev,_,_.next)>=0)return false;_=_.next;}return true}function oD(r,e,t,i){let s=r.prev,n=r,o=r.next;if(Ye(s,n,o)>=0)return false;let a=s.x,u=n.x,l=o.x,c=s.y,h=n.y,d=o.y,p=Math.min(a,u,l),_=Math.min(c,h,d),b=Math.max(a,u,l),x=Math.max(c,h,d),m=h0(p,_,e,t,i),v=h0(b,x,e,t,i),T=r.prevZ,S=r.nextZ;for(;T&&T.z>=m&&S&&S.z<=v;){if(T.x>=p&&T.x<=b&&T.y>=_&&T.y<=x&&T!==s&&T!==o&&Ac(a,c,u,h,l,d,T.x,T.y)&&Ye(T.prev,T,T.next)>=0||(T=T.prevZ,S.x>=p&&S.x<=b&&S.y>=_&&S.y<=x&&S!==s&&S!==o&&Ac(a,c,u,h,l,d,S.x,S.y)&&Ye(S.prev,S,S.next)>=0))return false;S=S.nextZ;}for(;T&&T.z>=m;){if(T.x>=p&&T.x<=b&&T.y>=_&&T.y<=x&&T!==s&&T!==o&&Ac(a,c,u,h,l,d,T.x,T.y)&&Ye(T.prev,T,T.next)>=0)return false;T=T.prevZ;}for(;S&&S.z<=v;){if(S.x>=p&&S.x<=b&&S.y>=_&&S.y<=x&&S!==s&&S!==o&&Ac(a,c,u,h,l,d,S.x,S.y)&&Ye(S.prev,S,S.next)>=0)return false;S=S.nextZ;}return true}function aD(r,e){let t=r;do{let i=t.prev,s=t.next.next;!$a(i,s)&&pC(i,t,t.next,s)&&Pc(i,s)&&Pc(s,i)&&(e.push(i.i,t.i,s.i),wc(t),wc(t.next),t=r=s),t=t.next;}while(t!==r);return Hn(t)}function uD(r,e,t,i,s,n){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&xD(o,a)){let u=mC(o,a);o=Hn(o,o.next),u=Hn(u,u.next),Cc(o,e,t,i,s,n,0),Cc(u,e,t,i,s,n,0);return}a=a.next;}o=o.next;}while(o!==r)}function lD(r,e,t,i){let s=[];for(let n=0,o=e.length;n<o;n++){let a=e[n]*i,u=n<o-1?e[n+1]*i:r.length,l=dC(r,a,u,i,false);l===l.next&&(l.steiner=true),s.push(gD(l));}s.sort(cD);for(let n=0;n<s.length;n++)t=hD(s[n],t);return t}function cD(r,e){let t=r.x-e.x;if(t===0&&(t=r.y-e.y,t===0)){let i=(r.next.y-r.y)/(r.next.x-r.x),s=(e.next.y-e.y)/(e.next.x-e.x);t=i-s;}return t}function hD(r,e){let t=dD(r,e);if(!t)return e;let i=mC(t,r);return Hn(i,i.next),Hn(t,t.next)}function dD(r,e){let t=e,i=r.x,s=r.y,n=-1/0,o;if($a(r,t))return t;do{if($a(r,t.next))return t.next;if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){let h=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=i&&h>n&&(n=h,o=t.x<t.next.x?t:t.next,h===i))return o}t=t.next;}while(t!==e);if(!o)return null;let a=o,u=o.x,l=o.y,c=1/0;t=o;do{if(i>=t.x&&t.x>=u&&i!==t.x&&fC(s<l?i:n,s,u,l,s<l?n:i,s,t.x,t.y)){let h=Math.abs(s-t.y)/(i-t.x);Pc(t,r)&&(h<c||h===c&&(t.x>o.x||t.x===o.x&&fD(o,t)))&&(o=t,c=h);}t=t.next;}while(t!==a);return o}function fD(r,e){return Ye(r.prev,r,e.prev)<0&&Ye(e.next,r,r.next)<0}function pD(r,e,t,i){let s=r;do s.z===0&&(s.z=h0(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==r);s.prevZ.nextZ=null,s.prevZ=null,mD(s);}function mD(r){let e,t=1;do{let i=r,s;r=null;let n=null;for(e=0;i;){e++;let o=i,a=0;for(let l=0;l<t&&(a++,o=o.nextZ,!!o);l++);let u=t;for(;a>0||u>0&&o;)a!==0&&(u===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,u--),n?n.nextZ=s:r=s,s.prevZ=n,n=s;i=o;}n.nextZ=null,t*=2;}while(e>1);return r}function h0(r,e,t,i,s){return r=(r-t)*s|0,e=(e-i)*s|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function gD(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function fC(r,e,t,i,s,n,o,a){return (s-o)*(e-a)>=(r-o)*(n-a)&&(r-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(n-a)>=(s-o)*(i-a)}function Ac(r,e,t,i,s,n,o,a){return !(r===o&&e===a)&&fC(r,e,t,i,s,n,o,a)}function xD(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!_D(r,e)&&(Pc(r,e)&&Pc(e,r)&&bD(r,e)&&(Ye(r.prev,r,e.prev)||Ye(r,e.prev,e))||$a(r,e)&&Ye(r.prev,r,r.next)>0&&Ye(e.prev,e,e.next)>0)}function Ye(r,e,t){return (e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function $a(r,e){return r.x===e.x&&r.y===e.y}function pC(r,e,t,i){let s=kp(Ye(r,e,t)),n=kp(Ye(r,e,i)),o=kp(Ye(t,i,r)),a=kp(Ye(t,i,e));return !!(s!==n&&o!==a||s===0&&Ip(r,t,e)||n===0&&Ip(r,i,e)||o===0&&Ip(t,r,i)||a===0&&Ip(t,e,i))}function Ip(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function kp(r){return r>0?1:r<0?-1:0}function _D(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&pC(t,t.next,r,e))return true;t=t.next;}while(t!==r);return false}function Pc(r,e){return Ye(r.prev,r,r.next)<0?Ye(r,e,r.next)>=0&&Ye(r,r.prev,e)>=0:Ye(r,e,r.prev)<0||Ye(r,r.next,e)<0}function bD(r,e){let t=r,i=false,s=(r.x+e.x)/2,n=(r.y+e.y)/2;do t.y>n!=t.next.y>n&&t.next.y!==t.y&&s<(t.next.x-t.x)*(n-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function mC(r,e){let t=d0(r.i,r.x,r.y),i=d0(e.i,e.x,e.y),s=r.next,n=e.prev;return r.next=e,e.prev=r,t.next=s,s.prev=t,i.next=t,t.prev=i,n.next=i,i.prev=n,i}function hC(r,e,t,i){let s=d0(r,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function wc(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ);}function d0(r,e,t){return {i:r,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:false}}function yD(r,e,t,i){let s=0;for(let n=e,o=t-i;n<t;n+=i)s+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return s}var gC=f(()=>{});var Op,f0=f(()=>{gC();St();Op=Fp.default||Fp;});function ja(r,e,t,i,s,n,o){let a=Op(r,e,2);if(!a)return;for(let l=0;l<a.length;l+=3)n[o++]=a[l]+s,n[o++]=a[l+1]+s,n[o++]=a[l+2]+s;let u=s*i;for(let l=0;l<r.length;l+=2)t[u]=r[l],t[u+1]=r[l+1],u+=i;}var Gp=f(()=>{f0();});var vD,Up,p0=f(()=>{E();Gp();vD=[],Up={extension:{type:g.ShapeBuilder,name:"polygon"},build(r,e){for(let t=0;t<r.points.length;t++)e[t]=r.points[t];return true},triangulate(r,e,t,i,s,n){ja(r,vD,e,t,i,s,n);}};});var Lp,m0=f(()=>{E();Lp={extension:{type:g.ShapeBuilder,name:"rectangle"},build(r,e){let t=r,i=t.x,s=t.y,n=t.width,o=t.height;return n>0&&o>0?(e[0]=i,e[1]=s,e[2]=i+n,e[3]=s,e[4]=i+n,e[5]=s+o,e[6]=i,e[7]=s+o,true):false},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[6],e[i+o+1]=r[7],o+=t,e[i+o]=r[4],e[i+o+1]=r[5],o+=t;let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2,s[n++]=a+1,s[n++]=a+3,s[n++]=a+2;}};});var Np,g0=f(()=>{E();Np={extension:{type:g.ShapeBuilder,name:"triangle"},build(r,e){return e[0]=r.x,e[1]=r.y,e[2]=r.x2,e[3]=r.y2,e[4]=r.x3,e[5]=r.y3,true},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[4],e[i+o+1]=r[5];let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2;}};});function _C(r,e){for(let t=0;t<e.length;t++){let i=e[t];r.addColorStop(i.offset,i.color);}}function bC(r,e){let t=V.get().createCanvas(r,e),i=t.getContext("2d");return {canvas:t,context:i}}function TD(r){let e=r[0]??{};return (typeof e=="number"||r[1])&&(I("8.5.2","use options object instead"),e={type:"linear",start:{x:r[0],y:r[1]},end:{x:r[2],y:r[3]},textureSpace:r[4],textureSize:r[5]??It.defaultLinearOptions.textureSize}),e}var xC,_0,It,Vn=f(()=>{it();Se();he();Gn();ce();lt();xe();us();xC=[{offset:0,color:"white"},{offset:1,color:"black"}],_0=class x0{constructor(...e){this.uid=re("fillGradient"),this.type="linear",this.colorStops=[];let t=TD(e);t={...t.type==="radial"?x0.defaultRadialOptions:x0.defaultLinearOptions,...mt(t)},this._textureSize=t.textureSize,this._wrapMode=t.wrapMode,t.type==="radial"?(this.center=t.center,this.outerCenter=t.outerCenter??this.center,this.innerRadius=t.innerRadius,this.outerRadius=t.outerRadius,this.scale=t.scale,this.rotation=t.rotation):(this.start=t.start,this.end=t.end),this.textureSpace=t.textureSpace,this.type=t.type,t.colorStops.forEach(s=>{this.addColorStop(s.offset,s.color);});}addColorStop(e,t){return this.colorStops.push({offset:e,color:K.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:i,y:s}=this.end,n=i-e,o=s-t,a=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){let x=e;e=i,i=x,n*=-1;}if(o<0){let x=t;t=s,s=x,o*=-1;}}let u=this.colorStops.length?this.colorStops:xC,l=this._textureSize,{canvas:c,context:h}=bC(l,1),d=a?h.createLinearGradient(this._textureSize,0,0,0):h.createLinearGradient(0,0,this._textureSize,0);_C(d,u),h.fillStyle=d,h.fillRect(0,0,l,1),this.texture=new C({source:new Rt({resource:c,addressMode:this._wrapMode})});let p=Math.sqrt(n*n+o*o),_=Math.atan2(o,n),b=new D;b.scale(p/l,1),b.rotate(_),b.translate(e,t),this.textureSpace==="local"&&b.scale(l,l),this.transform=b;}buildGradient(){this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient();}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:xC,t=this._textureSize,{canvas:i,context:s}=bC(t,t),{x:n,y:o}=this.center,{x:a,y:u}=this.outerCenter,l=this.innerRadius,c=this.outerRadius,h=a-c,d=u-c,p=t/(c*2),_=(n-h)*p,b=(o-d)*p,x=s.createRadialGradient(_,b,l*p,(a-h)*p,(u-d)*p,c*p);_C(x,e),s.fillStyle=e[e.length-1].color,s.fillRect(0,0,t,t),s.fillStyle=x,s.translate(_,b),s.rotate(this.rotation),s.scale(1,this.scale),s.translate(-_,-b),s.fillRect(0,0,t,t),this.texture=new C({source:new Rt({resource:i,addressMode:this._wrapMode})});let m=new D;m.scale(1/p,1/p),m.translate(h,d),this.textureSpace==="local"&&m.scale(t,t),this.transform=m;}get styleKey(){return this.uid}destroy(){this.texture?.destroy(true),this.texture=null;}};_0.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};_0.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};It=_0;});function Hp(r,e,t,i){let s=e.matrix?r.copyFrom(e.matrix).invert():r.identity();if(e.textureSpace==="local"){let o=t.getBounds(ED);e.width&&o.pad(e.width);let{x:a,y:u}=o,l=1/o.width,c=1/o.height,h=-a*l,d=-u*c,p=s.a,_=s.b,b=s.c,x=s.d;s.a*=l,s.b*=l,s.c*=c,s.d*=c,s.tx=h*p+d*b+s.tx,s.ty=h*_+d*x+s.ty;}else s.translate(e.texture.frame.x,e.texture.frame.y),s.scale(1/e.texture.source.width,1/e.texture.source.height);let n=e.texture.source.style;return !(e.fill instanceof It)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),i&&s.append(SD.copyFrom(i).invert()),s}var SD,ED,b0=f(()=>{he();Ze();Vn();SD=new D,ED=new Z;});function Vp(r,e){let{geometryData:t,batches:i}=e;i.length=0,t.indices.length=0,t.vertices.length=0,t.uvs.length=0;for(let s=0;s<r.instructions.length;s++){let n=r.instructions[s];if(n.action==="texture")PD(n.data,i,t);else if(n.action==="fill"||n.action==="stroke"){let o=n.action==="stroke",a=n.data.path.shapePath,u=n.data.style,l=n.data.hole;o&&l&&yC(l.shapePath,u,true,i,t),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),yC(a,u,o,i,t);}}}function PD(r,e,t){let i=[],s=qa.rectangle,n=AD;n.x=r.dx,n.y=r.dy,n.width=r.dw,n.height=r.dh;let o=r.transform;if(!s.build(n,i))return;let{vertices:a,uvs:u,indices:l}=t,c=l.length,h=a.length/2;o&&Ec(i,o),s.triangulate(i,a,2,h,l,c);let d=r.image,p=d.uvs;u.push(p.x0,p.y0,p.x1,p.y1,p.x3,p.y3,p.x2,p.y2);let _=Re.get(Li);_.indexOffset=c,_.indexSize=l.length-c,_.attributeOffset=h,_.attributeSize=a.length/2-h,_.baseColor=r.style,_.alpha=r.alpha,_.texture=d,_.geometryData=t,e.push(_);}function yC(r,e,t,i,s){let{vertices:n,uvs:o,indices:a}=s;r.shapePrimitives.forEach(({shape:u,transform:l,holes:c})=>{let h=[],d=qa[u.type];if(!d.build(u,h))return;let p=a.length,_=n.length/2,b="triangle-list";if(l&&Ec(h,l),t){let T=u.closePath??true,S=e;S.pixelLine?(Dp(h,T,n,a),b="line-list"):Mp(h,S,false,T,n,a);}else if(c){let T=[],S=h.slice();wD(c).forEach(A=>{T.push(S.length/2),S.push(...A);}),ja(S,T,n,2,_,a,p);}else d.triangulate(h,n,2,_,a,p);let x=o.length/2,m=e.texture;if(m!==C.WHITE){let T=Hp(CD,e,u,l);Sp(n,2,_,o,x,2,n.length/2-_,T);}else Ep(o,x,2,n.length/2-_);let v=Re.get(Li);v.indexOffset=p,v.indexSize=a.length-p,v.attributeOffset=_,v.attributeSize=n.length/2-_,v.baseColor=e.color,v.alpha=e.alpha,v.texture=m,v.geometryData=s,v.topology=b,i.push(v);});}function wD(r){let e=[];for(let t=0;t<r.length;t++){let i=r[t].shape,s=[];qa[i.type].build(i,s)&&e.push(s);}return e}var qa,AD,CD,y0=f(()=>{E();he();Ze();n0();o0();ce();ri();Ap();a0();l0();c0();p0();m0();g0();b0();Gp();qa={};O.handleByMap(g.ShapeBuilder,qa);O.add(Lp,Up,Np,Rs,Cp,Pp);AD=new Z,CD=new D;});var Bc,Rc,T0,Ms,Mc=f(()=>{E();pc();Tp();_f();xe();ri();y0();Bc=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]};}},Rc=class{constructor(){this.instructions=new as;}init(e){this.batcher=new Ln({maxTextures:e}),this.instructions.reset();}get geometry(){return I(Jd,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}},T0=class v0{constructor(e){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuContextHash"),e.renderableGC.addManagedHash(this,"_graphicsDataContextHash");}init(e){v0.defaultOptions.bezierSmoothness=e?.bezierSmoothness??v0.defaultOptions.bezierSmoothness;}getContextRenderData(e){return this._graphicsDataContextHash[e.uid]||this._initContextRenderData(e)}updateGpuContext(e){let t=this._gpuContextHash[e.uid]||this._initContext(e);if(e.dirty){t?this._cleanGraphicsContextData(e):t=this._initContext(e),Vp(e,t);let i=e.batchMode;e.customShader||i==="no-batch"?t.isBatchable=false:i==="auto"?t.isBatchable=t.geometryData.vertices.length<400:t.isBatchable=true,e.dirty=false;}return t}getGpuContext(e){return this._gpuContextHash[e.uid]||this._initContext(e)}_initContextRenderData(e){let t=Re.get(Rc,{maxTextures:this._renderer.limits.maxBatchableTextures}),{batches:i,geometryData:s}=this._gpuContextHash[e.uid],n=s.vertices.length,o=s.indices.length;for(let c=0;c<i.length;c++)i[c].applyTransform=false;let a=t.batcher;a.ensureAttributeBuffer(n),a.ensureIndexBuffer(o),a.begin();for(let c=0;c<i.length;c++){let h=i[c];a.add(h);}a.finish(t.instructions);let u=a.geometry;u.indexBuffer.setDataWithSize(a.indexBuffer,a.indexSize,true),u.buffers[0].setDataWithSize(a.attributeBuffer.float32View,a.attributeSize,true);let l=a.batches;for(let c=0;c<l.length;c++){let h=l[c];h.bindGroup=bs(h.textures.textures,h.textures.count,this._renderer.limits.maxBatchableTextures);}return this._graphicsDataContextHash[e.uid]=t,t}_initContext(e){let t=new Bc;return t.context=e,this._gpuContextHash[e.uid]=t,e.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]}onGraphicsContextDestroy(e){this._cleanGraphicsContextData(e),e.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]=null;}_cleanGraphicsContextData(e){let t=this._gpuContextHash[e.uid];t.isBatchable||this._graphicsDataContextHash[e.uid]&&(Re.return(this.getContextRenderData(e)),this._graphicsDataContextHash[e.uid]=null),t.batches&&t.batches.forEach(i=>{Re.return(i);});}destroy(){for(let e in this._gpuContextHash)this._gpuContextHash[e]&&this.onGraphicsContextDestroy(this._gpuContextHash[e].context);}};T0.extension={type:[g.WebGLSystem,g.WebGPUSystem,g.CanvasSystem],name:"graphicsContext"};T0.defaultOptions={bezierSmoothness:.5};Ms=T0;});var BD,S0,E0,A0,C0,P0,w0,B0,Ue,cr=f(()=>{BD={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},S0=0,E0=1,A0=2,C0=3,P0=4,w0=5,B0=class vC{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=true,this.depthMask=true;}get blend(){return !!(this.data&1<<S0)}set blend(e){!!(this.data&1<<S0)!==e&&(this.data^=1<<S0);}get offsets(){return !!(this.data&1<<E0)}set offsets(e){!!(this.data&1<<E0)!==e&&(this.data^=1<<E0);}set cullMode(e){if(e==="none"){this.culling=false;return}this.culling=true,this.clockwiseFrontFace=e==="front";}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return !!(this.data&1<<A0)}set culling(e){!!(this.data&1<<A0)!==e&&(this.data^=1<<A0);}get depthTest(){return !!(this.data&1<<C0)}set depthTest(e){!!(this.data&1<<C0)!==e&&(this.data^=1<<C0);}get depthMask(){return !!(this.data&1<<w0)}set depthMask(e){!!(this.data&1<<w0)!==e&&(this.data^=1<<w0);}get clockwiseFrontFace(){return !!(this.data&1<<P0)}set clockwiseFrontFace(e){!!(this.data&1<<P0)!==e&&(this.data^=1<<P0);}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=BD[e]||0;}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e;}toString(){return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let e=new vC;return e.depthTest=false,e.blend=true,e}};B0.default2d=B0.for2d();Ue=B0;});function TC(r,e,t,i){t[i++]=(r>>16&255)/255,t[i++]=(r>>8&255)/255,t[i++]=(r&255)/255,t[i++]=e;}function Cr(r,e,t){let i=(r>>24&255)/255;e[t++]=(r&255)/255*i,e[t++]=(r>>8&255)/255*i,e[t++]=(r>>16&255)/255*i,e[t++]=i;}var zn=f(()=>{});var Dc,Wn,R0=f(()=>{E();cr();ri();zn();Ap();Dc=class{constructor(){this.batches=[],this.batched=false;}destroy(){this.batches.forEach(e=>{Re.return(e);}),this.batches.length=0;}},Wn=class{constructor(e,t){this.state=Ue.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this);}contextChange(){this._adaptor.contextChange(this.renderer);}validateRenderable(e){let t=e.context,i=!!e._gpuData,s=this.renderer.graphicsContext.updateGpuContext(t);return !!(s.isBatchable||i!==s.isBatchable)}addRenderable(e,t){let i=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),i.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e));}updateRenderable(e){let i=this._getGpuDataForRenderable(e).batches;for(let s=0;s<i.length;s++){let n=i[s];n._batcher.updateElement(n);}}execute(e){if(!e.isRenderable)return;let t=this.renderer,i=e.context;if(!t.graphicsContext.getGpuContext(i).batches.length)return;let n=i.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;let o=n.resources.localUniforms.uniforms;o.uTransformMatrix=e.groupTransform,o.uRound=t._roundPixels|e._roundPixels,Cr(e.groupColorAlpha,o.uColor,0),this._adaptor.execute(this,e);}_rebuild(e){let t=this._getGpuDataForRenderable(e),i=this.renderer.graphicsContext.updateGpuContext(e.context);t.destroy(),i.isBatchable&&this._updateBatchesForRenderable(e,t);}_addToBatcher(e,t){let i=this.renderer.renderPipes.batch,s=this._getGpuDataForRenderable(e).batches;for(let n=0;n<s.length;n++){let o=s[n];i.addToBatch(o,t);}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){let t=new Dc;return e._gpuData[this.renderer.uid]=t,t}_updateBatchesForRenderable(e,t){let i=e.context,s=this.renderer.graphicsContext.getGpuContext(i),n=this.renderer._roundPixels|e._roundPixels;t.batches=s.batches.map(o=>{let a=Re.get(Li);return o.copyTo(a),a.renderable=e,a.roundPixels=n,a});}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;}};Wn.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"graphics"};});var M0=f(()=>{E();Mc();R0();O.add(Wn);O.add(Ms);});var ai,Ic=f(()=>{ai=class{constructor(){this.batcherName="default",this.packAsQuad=false,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1;}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(e){this._topology=e;}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1;}setTexture(e){this.texture!==e&&(this.texture=e,this._textureMatrixUpdateId=-1);}get uvs(){let t=this.geometry.getBuffer("aUV"),i=t.data,s=i,n=this.texture.textureMatrix;return n.isSimple||(s=this._transformedUvs,(this._textureMatrixUpdateId!==n._updateID||this._uvUpdateId!==t._updateID)&&((!s||s.length<i.length)&&(s=this._transformedUvs=new Float32Array(i.length)),this._textureMatrixUpdateId=n._updateID,this._uvUpdateId=t._updateID,n.multiplyUvs(i,s))),s}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}};});var Ka,Xn,D0=f(()=>{E();he();Fi();Qe();Oa();zn();Ic();Ka=class{destroy(){}},Xn=class{constructor(e,t){this.localUniforms=new ae({uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new nt({0:this.localUniforms}),this.renderer=e,this._adaptor=t,this._adaptor.init();}validateRenderable(e){let t=this._getMeshData(e),i=t.batched,s=e.batched;if(t.batched=s,i!==s)return true;if(s){let n=e._geometry;if(n.indices.length!==t.indexSize||n.positions.length!==t.vertexSize)return t.indexSize=n.indices.length,t.vertexSize=n.positions.length,true;let o=this._getBatchableMesh(e);return o.texture.uid!==e._texture.uid&&(o._textureMatrixUpdateId=-1),!o._batcher.checkAndUpdateTexture(o,e._texture)}return false}addRenderable(e,t){let i=this.renderer.renderPipes.batch,{batched:s}=this._getMeshData(e);if(s){let n=this._getBatchableMesh(e);n.setTexture(e._texture),n.geometry=e._geometry,i.addToBatch(n,t);}else i.break(t),t.add(e);}updateRenderable(e){if(e.batched){let t=this._getBatchableMesh(e);t.setTexture(e._texture),t.geometry=e._geometry,t._batcher.updateElement(t);}}execute(e){if(!e.isRenderable)return;e.state.blendMode=Lr(e.groupBlendMode,e.texture._source);let t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),Cr(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e);}_getMeshData(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new Ka),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:e._geometry.indices?.length,vertexSize:e._geometry.positions?.length},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new Ka),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){let t=new ai;return t.renderable=e,t.setTexture(e._texture),t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,e._gpuData[this.renderer.uid].batchableMesh=t,t}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null;}};Xn.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"mesh"};});var I0=f(()=>{E();D0();O.add(Xn);});var Za,k0=f(()=>{Za=class{execute(e,t){let i=e.state,s=e.renderer,n=t.shader||e.defaultShader;n.resources.uTexture=t.texture._source,n.resources.uniforms=e.localUniforms;let o=s.gl,a=e.getBuffers(t);s.shader.bind(n),s.state.set(i),s.geometry.bind(a.geometry,n.glProgram);let l=a.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;o.drawElements(o.TRIANGLES,t.particleChildren.length*6,l,0);}};});function kc(r,e=null){let t=r*6;if(t>65535?e||(e=new Uint32Array(t)):e||(e=new Uint16Array(t)),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let i=0,s=0;i<t;i+=6,s+=4)e[i+0]=s+0,e[i+1]=s+1,e[i+2]=s+2,e[i+3]=s+0,e[i+4]=s+2,e[i+5]=s+3;return e}var F0=f(()=>{});function zp(r){return {dynamicUpdate:SC(r,true),staticUpdate:SC(r,false)}}function SC(r,e){let t=[];t.push(`
|
|
261
261
|
|
|
262
262
|
var index = 0;
|
|
263
263
|
|
|
@@ -371,8 +371,8 @@ fn mainFragment(
|
|
|
371
371
|
var sample = textureSample(uTexture, uSampler, uv) * color;
|
|
372
372
|
|
|
373
373
|
return sample;
|
|
374
|
-
}`;});var Ja,H0=f(()=>{it();he();Kt();ur();Ar();ce();Mi();U0();L0();N0();Ja=class extends ze{constructor(){let e=ke.from({vertex:Xp,fragment:Wp}),t=Fe.from({fragment:{source:Fc,entryPoint:"mainFragment"},vertex:{source:Fc,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:C.WHITE.source,uSampler:new st({}),uniforms:{uTranslationMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new K(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}});}};});var Ds,Yp=f(()=>{he();Qe();Oa();cr();zn();G0();H0();Ds=class{constructor(e,t){this.state=Ue.for2d(),this.localUniforms=new ae({uTranslationMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=e,this.adaptor=t,this.defaultShader=new Ja,this.state=Ue.for2d();}validateRenderable(e){return false}addRenderable(e,t){this.renderer.renderPipes.batch.break(t),t.add(e);}getBuffers(e){return e._gpuData[this.renderer.uid]||this._initBuffer(e)}_initBuffer(e){return e._gpuData[this.renderer.uid]=new Qa({size:e.particleChildren.length,properties:e._properties}),e._gpuData[this.renderer.uid]}updateRenderable(e){}execute(e){let t=e.particleChildren;if(t.length===0)return;let i=this.renderer,s=this.getBuffers(e);e.texture||(e.texture=t[0].texture);let n=this.state;s.update(t,e._childrenDirty),e._childrenDirty=false,n.blendMode=Lr(e.blendMode,e.texture._source);let o=this.localUniforms.uniforms,a=o.uTranslationMatrix;e.worldTransform.copyTo(a),a.prepend(i.globalUniforms.globalUniformData.projectionMatrix),o.uResolution=i.globalUniforms.globalUniformData.resolution,o.uRound=i._roundPixels|e._roundPixels,Cr(e.groupColorAlpha,o.uColor,0),this.adaptor.execute(this,e);}destroy(){this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null);}};});var Yn,V0=f(()=>{E();k0();Yp();Yn=class extends Ds{constructor(e){super(e,new Za);}};Yn.extension={type:[m.WebGLPipes],name:"particle"};});var eu,z0=f(()=>{eu=class{execute(e,t){let i=e.renderer,s=t.shader||e.defaultShader;s.groups[0]=i.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms,true),s.groups[1]=i.texture.getTextureBindGroup(t.texture);let n=e.state,o=e.getBuffers(t);i.encoder.draw({geometry:o.geometry,shader:t.shader||e.defaultShader,state:n,size:t.particleChildren.length*6});}};});var $n,W0=f(()=>{E();z0();Yp();$n=class extends Ds{constructor(e){super(e,new eu);}};$n.extension={type:[m.WebGPUPipes],name:"particle"};});var X0=f(()=>{E();V0();W0();O.add(Yn);O.add($n);});function jn(r,e){let{texture:t,bounds:i}=r;ka(i,e._anchor,t);let s=e._style._getFinalPadding();i.minX-=s,i.minY-=s,i.maxX-=s,i.maxY-=s;}var $p=f(()=>{Nf();});var Pr,tu=f(()=>{Pr=class{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=true,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null;}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null;}destroy(){}};});var ru,Y0=f(()=>{tu();ru=class extends Pr{constructor(e){super(),this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.canvasText.returnTexture(this.texture),this._renderer=null;}};});var qn,$0=f(()=>{E();$p();Y0();qn=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e),e._didTextUpdate=false),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}_updateGpuText(e){let t=this._getGpuText(e);t.texture&&this._renderer.canvasText.returnTexture(t.texture),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=t.texture=this._renderer.canvasText.getTexture(e),jn(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new ru(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};qn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"text"};});var EC,Hr,Oc=f(()=>{he();lt();EC={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},Hr=class{constructor(e,t){this.uid=re("fillPattern"),this.transform=new D,this._styleKey=null,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=EC[t].addressModeU,e.source.style.addressModeV=EC[t].addressModeV);}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._styleKey=null;}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}};});var CC=ti((WV,AC)=>{AC.exports=DD;var j0={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},MD=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function DD(r){var e=[];return r.replace(MD,function(t,i,s){var n=i.toLowerCase();for(s=kD(s),n=="m"&&s.length>2&&(e.push([i].concat(s.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(s.length==j0[n])return s.unshift(i),e.push(s);if(s.length<j0[n])throw new Error("malformed path data");e.push([i].concat(s.splice(0,j0[n])));}}),e}var ID=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function kD(r){var e=r.match(ID);return e?e.map(Number):[]}});function jp(r,e){let t=(0, PC.default)(r),i=[],s=null,n=0,o=0;for(let a=0;a<t.length;a++){let u=t[a],l=u[0],c=u;switch(l){case "M":n=c[1],o=c[2],e.moveTo(n,o);break;case "m":n+=c[1],o+=c[2],e.moveTo(n,o);break;case "H":n=c[1],e.lineTo(n,o);break;case "h":n+=c[1],e.lineTo(n,o);break;case "V":o=c[1],e.lineTo(n,o);break;case "v":o+=c[1],e.lineTo(n,o);break;case "L":n=c[1],o=c[2],e.lineTo(n,o);break;case "l":n+=c[1],o+=c[2],e.lineTo(n,o);break;case "C":n=c[5],o=c[6],e.bezierCurveTo(c[1],c[2],c[3],c[4],n,o);break;case "c":e.bezierCurveTo(n+c[1],o+c[2],n+c[3],o+c[4],n+c[5],o+c[6]),n+=c[5],o+=c[6];break;case "S":n=c[3],o=c[4],e.bezierCurveToShort(c[1],c[2],n,o);break;case "s":e.bezierCurveToShort(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "Q":n=c[3],o=c[4],e.quadraticCurveTo(c[1],c[2],n,o);break;case "q":e.quadraticCurveTo(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "T":n=c[1],o=c[2],e.quadraticCurveToShort(n,o);break;case "t":n+=c[1],o+=c[2],e.quadraticCurveToShort(n,o);break;case "A":n=c[6],o=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "a":n+=c[6],o+=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "Z":case "z":e.closePath(),i.length>0&&(s=i.pop(),s?(n=s.startX,o=s.startY):(n=0,o=0)),s=null;break;default:F(`Unknown SVG path command: ${l}`);}l!=="Z"&&l!=="z"&&s===null&&(s={startX:n,startY:o},i.push(s));}return e}var PC,q0=f(()=>{PC=Wd(CC());_e();});var iu,K0=f(()=>{Ze();iu=class r{constructor(e=0,t=0,i=0){this.type="circle",this.x=e,this.y=t,this.radius=i;}clone(){return new r(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return false;let i=this.radius*this.radius,s=this.x-e,n=this.y-t;return s*=s,n*=n,s+n<=i}strokeContains(e,t,i,s=.5){if(this.radius===0)return false;let n=this.x-e,o=this.y-t,a=this.radius,u=(1-s)*i,l=Math.sqrt(n*n+o*o);return l<=a+u&&l>a-(i-u)}getBounds(e){return e||(e=new Z),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}};});var su,Z0=f(()=>{Ze();su=class r{constructor(e=0,t=0,i=0,s=0){this.type="ellipse",this.x=e,this.y=t,this.halfWidth=i,this.halfHeight=s;}clone(){return new r(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return false;let i=(e-this.x)/this.halfWidth,s=(t-this.y)/this.halfHeight;return i*=i,s*=s,i+s<=1}strokeContains(e,t,i,s=.5){let{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return false;let a=i*(1-s),u=i-a,l=n-u,c=o-u,h=n+a,d=o+a,p=e-this.x,_=t-this.y,b=p*p/(l*l)+_*_/(c*c),x=p*p/(h*h)+_*_/(d*d);return b>1&&x<=1}getBounds(e){return e||(e=new Z),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};});function Is(r,e,t,i,s,n){let o=r-t,a=e-i,u=s-t,l=n-i,c=o*u+a*l,h=u*u+l*l,d=-1;h!==0&&(d=c/h);let p,_;d<0?(p=t,_=i):d>1?(p=s,_=n):(p=t+d*u,_=i+d*l);let b=r-p,x=e-_;return b*b+x*x}var qp=f(()=>{});var FD,OD,ks,Q0=f(()=>{qp();Ze();ks=class r{constructor(...e){this.type="polygon";let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){let i=[];for(let s=0,n=t.length;s<n;s++)i.push(t[s].x,t[s].y);t=i;}this.points=t,this.closePath=true;}isClockwise(){let e=0,t=this.points,i=t.length;for(let s=0;s<i;s+=2){let n=t[s],o=t[s+1],a=t[(s+2)%i],u=t[(s+3)%i];e+=(a-n)*(u+o);}return e<0}containsPolygon(e){let t=this.getBounds(FD),i=e.getBounds(OD);if(!t.containsRect(i))return false;let s=e.points;for(let n=0;n<s.length;n+=2){let o=s[n],a=s[n+1];if(!this.contains(o,a))return false}return true}clone(){let e=this.points.slice(),t=new r(e);return t.closePath=this.closePath,t}contains(e,t){let i=false,s=this.points.length/2;for(let n=0,o=s-1;n<s;o=n++){let a=this.points[n*2],u=this.points[n*2+1],l=this.points[o*2],c=this.points[o*2+1];u>t!=c>t&&e<(l-a)*((t-u)/(c-u))+a&&(i=!i);}return i}strokeContains(e,t,i,s=.5){let n=i*i,o=n*(1-s),a=n-o,{points:u}=this,l=u.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){let h=u[c],d=u[c+1],p=u[(c+2)%u.length],_=u[(c+3)%u.length],b=Is(e,t,h,d,p,_),x=Math.sign((p-h)*(t-d)-(_-d)*(e-h));if(b<=(x<0?a:o))return true}return false}getBounds(e){e||(e=new Z);let t=this.points,i=1/0,s=-1/0,n=1/0,o=-1/0;for(let a=0,u=t.length;a<u;a+=2){let l=t[a],c=t[a+1];i=l<i?l:i,s=l>s?l:s,n=c<n?c:n,o=c>o?c:o;}return e.x=i,e.width=s-i,e.y=n,e.height=o-n,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}};});var Kp,nu,J0=f(()=>{Ze();Kp=(r,e,t,i,s,n,o)=>{let a=r-t,u=e-i,l=Math.sqrt(a*a+u*u);return l>=s-n&&l<=s+o},nu=class r{constructor(e=0,t=0,i=0,s=0,n=20){this.type="roundedRectangle",this.x=e,this.y=t,this.width=i,this.height=s,this.radius=n;}getBounds(e){return e||(e=new Z),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new r(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return false;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return true;let s=e-(this.x+i),n=t-(this.y+i),o=i*i;if(s*s+n*n<=o||(s=e-(this.x+this.width-i),s*s+n*n<=o)||(n=t-(this.y+this.height-i),s*s+n*n<=o)||(s=e-(this.x+i),s*s+n*n<=o))return true}return false}strokeContains(e,t,i,s=.5){let{x:n,y:o,width:a,height:u,radius:l}=this,c=i*(1-s),h=i-c,d=n+l,p=o+l,_=a-l*2,b=u-l*2,x=n+a,g=o+u;return (e>=n-c&&e<=n+h||e>=x-h&&e<=x+c)&&t>=p&&t<=p+b||(t>=o-c&&t<=o+h||t>=g-h&&t<=g+c)&&e>=d&&e<=d+_?true:e<d&&t<p&&Kp(e,t,d,p,l,h,c)||e>x-l&&t<p&&Kp(e,t,x-l,p,l,h,c)||e>x-l&&t>g-l&&Kp(e,t,x-l,g-l,l,h,c)||e<d&&t>g-l&&Kp(e,t,d,g-l,l,h,c)}toString(){return `[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};});function au(r,e,t,i,s,n,o,a,u,l){let h=Math.min(.99,Math.max(0,l??Ms.defaultOptions.bezierSmoothness)),d=(UD-h)/1;return d*=d,LD(e,t,i,s,n,o,a,u,r,d),r}function LD(r,e,t,i,s,n,o,a,u,l){tv(r,e,t,i,s,n,o,a,u,l,0),u.push(o,a);}function tv(r,e,t,i,s,n,o,a,u,l,c){if(c>GD)return;let h=Math.PI,d=(r+t)/2,p=(e+i)/2,_=(t+s)/2,b=(i+n)/2,x=(s+o)/2,g=(n+a)/2,v=(d+_)/2,T=(p+b)/2,S=(_+x)/2,B=(b+g)/2,A=(v+S)/2,R=(T+B)/2;if(c>0){let Y=o-r,M=a-e,U=Math.abs((t-o)*M-(i-a)*Y),k=Math.abs((s-o)*M-(n-a)*Y),J,ge;if(U>Zp&&k>Zp){if((U+k)*(U+k)<=l*(Y*Y+M*M)){if(ou<ev){u.push(A,R);return}let Ke=Math.atan2(n-i,s-t);if(J=Math.abs(Ke-Math.atan2(i-e,t-r)),ge=Math.abs(Math.atan2(a-n,o-s)-Ke),J>=h&&(J=2*h-J),ge>=h&&(ge=2*h-ge),J+ge<ou){u.push(A,R);return}if(Kn!==0){if(J>Kn){u.push(t,i);return}if(ge>Kn){u.push(s,n);return}}}}else if(U>Zp){if(U*U<=l*(Y*Y+M*M)){if(ou<ev){u.push(A,R);return}if(J=Math.abs(Math.atan2(n-i,s-t)-Math.atan2(i-e,t-r)),J>=h&&(J=2*h-J),J<ou){u.push(t,i),u.push(s,n);return}if(Kn!==0&&J>Kn){u.push(t,i);return}}}else if(k>Zp){if(k*k<=l*(Y*Y+M*M)){if(ou<ev){u.push(A,R);return}if(J=Math.abs(Math.atan2(a-n,o-s)-Math.atan2(n-i,s-t)),J>=h&&(J=2*h-J),J<ou){u.push(t,i),u.push(s,n);return}if(Kn!==0&&J>Kn){u.push(s,n);return}}}else if(Y=A-(r+o)/2,M=R-(e+a)/2,Y*Y+M*M<=l){u.push(A,R);return}}tv(r,e,d,p,v,T,A,R,u,l,c+1),tv(A,R,S,B,x,g,o,a,u,l,c+1);}var GD,Zp,UD,ev,ou,Kn,Qp=f(()=>{Mc();GD=8,Zp=11920929e-14,UD=1,ev=.01,ou=0,Kn=0;});function Jp(r,e,t,i,s,n,o,a){let l=Math.min(.99,Math.max(0,a??Ms.defaultOptions.bezierSmoothness)),c=(VD-l)/1;return c*=c,WD(e,t,i,s,n,o,r,c),r}function WD(r,e,t,i,s,n,o,a){rv(o,r,e,t,i,s,n,a,0),o.push(s,n);}function rv(r,e,t,i,s,n,o,a,u){if(u>ND)return;let l=Math.PI,c=(e+i)/2,h=(t+s)/2,d=(i+n)/2,p=(s+o)/2,_=(c+d)/2,b=(h+p)/2,x=n-e,g=o-t,v=Math.abs((i-n)*g-(s-o)*x);if(v>HD){if(v*v<=a*(x*x+g*g)){if(wC<zD){r.push(_,b);return}let T=Math.abs(Math.atan2(o-s,n-i)-Math.atan2(s-t,i-e));if(T>=l&&(T=2*l-T),T<wC){r.push(_,b);return}}}else if(x=_-(e+n)/2,g=b-(t+o)/2,x*x+g*g<=a){r.push(_,b);return}rv(r,e,t,c,h,_,b,a,u+1),rv(r,_,b,d,p,n,o,a,u+1);}var ND,HD,VD,zD,wC,iv=f(()=>{Mc();ND=8,HD=11920929e-14,VD=1,zD=.01,wC=0;});function uu(r,e,t,i,s,n,o,a){let u=Math.abs(s-n);(!o&&s>n||o&&n>s)&&(u=2*Math.PI-u),a||(a=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(u/Math.PI)))),a=Math.max(a,3);let l=u/a,c=s;l*=o?-1:1;for(let h=0;h<a+1;h++){let d=Math.cos(c),p=Math.sin(c),_=e+d*i,b=t+p*i;r.push(_,b),c+=l;}}var em=f(()=>{});function tm(r,e,t,i,s,n){let o=r[r.length-2],u=r[r.length-1]-t,l=o-e,c=s-t,h=i-e,d=Math.abs(u*h-l*c);if(d<1e-8||n===0){(r[r.length-2]!==e||r[r.length-1]!==t)&&r.push(e,t);return}let p=u*u+l*l,_=c*c+h*h,b=u*c+l*h,x=n*Math.sqrt(p)/d,g=n*Math.sqrt(_)/d,v=x*b/p,T=g*b/_,S=x*h+g*l,B=x*c+g*u,A=l*(g+v),R=u*(g+v),Y=h*(x+T),M=c*(x+T),U=Math.atan2(R-B,A-S),k=Math.atan2(M-B,Y-S);uu(r,S+e,B+t,n,U,k,l*c>h*u);}var sv=f(()=>{em();});function XD(r,e){let t=e===-1.5707963267948966?-0.551915024494:1.3333333333333333*Math.tan(e/4),i=e===1.5707963267948966?.551915024494:t,s=Math.cos(r),n=Math.sin(r),o=Math.cos(r+e),a=Math.sin(r+e);return [{x:s-n*i,y:n+s*i},{x:o+a*i,y:a-o*i},{x:o,y:a}]}function rm(r,e,t,i,s,n,o,a=0,u=0,l=0){if(n===0||o===0)return;let c=Math.sin(a*Gc/360),h=Math.cos(a*Gc/360),d=h*(e-i)/2+c*(t-s)/2,p=-c*(e-i)/2+h*(t-s)/2;if(d===0&&p===0)return;n=Math.abs(n),o=Math.abs(o);let _=Math.pow(d,2)/Math.pow(n,2)+Math.pow(p,2)/Math.pow(o,2);_>1&&(n*=Math.sqrt(_),o*=Math.sqrt(_)),YD(e,t,i,s,n,o,u,l,c,h,d,p,nv);let{ang1:b,ang2:x}=nv,{centerX:g,centerY:v}=nv,T=Math.abs(x)/(Gc/4);Math.abs(1-T)<1e-7&&(T=1);let S=Math.max(Math.ceil(T),1);x/=S;let B=r[r.length-2],A=r[r.length-1],R={x:0,y:0};for(let Y=0;Y<S;Y++){let M=XD(b,x),{x:U,y:k}=ov(M[0],n,o,h,c,g,v,R),{x:J,y:ge}=ov(M[1],n,o,h,c,g,v,R),{x:Ke,y:ts}=ov(M[2],n,o,h,c,g,v,R);au(r,B,A,U,k,J,ge,Ke,ts),B=Ke,A=ts,b+=x;}}var Gc,nv,ov,BC,YD,av=f(()=>{Qp();Gc=Math.PI*2,nv={centerX:0,centerY:0,ang1:0,ang2:0},ov=({x:r,y:e},t,i,s,n,o,a,u)=>{r*=t,e*=i;let l=s*r-n*e,c=n*r+s*e;return u.x=l+o,u.y=c+a,u};BC=(r,e,t,i)=>{let s=r*i-e*t<0?-1:1,n=r*t+e*i;return n>1&&(n=1),n<-1&&(n=-1),s*Math.acos(n)},YD=(r,e,t,i,s,n,o,a,u,l,c,h,d)=>{let p=Math.pow(s,2),_=Math.pow(n,2),b=Math.pow(c,2),x=Math.pow(h,2),g=p*_-p*x-_*b;g<0&&(g=0),g/=p*x+_*b,g=Math.sqrt(g)*(o===a?-1:1);let v=g*s/n*h,T=g*-n/s*c,S=l*v-u*T+(r+t)/2,B=u*v+l*T+(e+i)/2,A=(c-v)/s,R=(h-T)/n,Y=(-c-v)/s,M=(-h-T)/n,U=BC(1,0,A,R),k=BC(A,R,Y,M);a===0&&k>0&&(k-=Gc),a===1&&k<0&&(k+=Gc),d.centerX=S,d.centerY=B,d.ang1=U,d.ang2=k;};});function im(r,e,t){let i=(o,a)=>{let u=a.x-o.x,l=a.y-o.y,c=Math.sqrt(u*u+l*l),h=u/c,d=l/c;return {len:c,nx:h,ny:d}},s=(o,a)=>{o===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y);},n=e[e.length-1];for(let o=0;o<e.length;o++){let a=e[o%e.length],u=a.radius??t;if(u<=0){s(o,a),n=a;continue}let l=e[(o+1)%e.length],c=i(a,n),h=i(a,l);if(c.len<1e-4||h.len<1e-4){s(o,a),n=a;continue}let d=Math.asin(c.nx*h.ny-c.ny*h.nx),p=1,_=false;c.nx*h.nx-c.ny*-h.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,p=-1,_=true):d>0&&(p=-1,_=true);let b=d/2,x,g=Math.abs(Math.cos(b)*u/Math.sin(b));g>Math.min(c.len/2,h.len/2)?(g=Math.min(c.len/2,h.len/2),x=Math.abs(g*Math.sin(b)/Math.cos(b))):x=u;let v=a.x+h.nx*g+-h.ny*x*p,T=a.y+h.ny*g+h.nx*x*p,S=Math.atan2(c.ny,c.nx)+Math.PI/2*p,B=Math.atan2(h.ny,h.nx)-Math.PI/2*p;o===0&&r.moveTo(v+Math.cos(S)*x,T+Math.sin(S)*x),r.arc(v,T,x,S,B,_),n=a;}}function sm(r,e,t,i){let s=(a,u)=>Math.sqrt((a.x-u.x)**2+(a.y-u.y)**2),n=(a,u,l)=>({x:a.x+(u.x-a.x)*l,y:a.y+(u.y-a.y)*l}),o=e.length;for(let a=0;a<o;a++){let u=e[(a+1)%o],l=u.radius??t;if(l<=0){a===0?r.moveTo(u.x,u.y):r.lineTo(u.x,u.y);continue}let c=e[a],h=e[(a+2)%o],d=s(c,u),p;if(d<1e-4)p=u;else {let x=Math.min(d/2,l);p=n(u,c,x/d);}let _=s(h,u),b;if(_<1e-4)b=u;else {let x=Math.min(_/2,l);b=n(u,h,x/_);}a===0?r.moveTo(p.x,p.y):r.lineTo(p.x,p.y),r.quadraticCurveTo(u.x,u.y,b.x,b.y,i);}}var uv=f(()=>{});var $D,lu,lv=f(()=>{K0();Z0();Q0();Ze();J0();Et();Qp();iv();em();sv();av();uv();$D=new Z,lu=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new me,this._graphicsPath2D=e,this.signed=e.checkForHoles;}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let i=this._currentPoly.points,s=i[i.length-2],n=i[i.length-1];return (s!==e||n!==t)&&i.push(e,t),this}arc(e,t,i,s,n,o){this._ensurePoly(false);let a=this._currentPoly.points;return uu(a,e,t,i,s,n,o),this}arcTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly.points;return tm(o,e,t,i,s,n),this}arcToSvg(e,t,i,s,n,o,a){let u=this._currentPoly.points;return rm(u,this._currentPoly.lastX,this._currentPoly.lastY,o,a,e,t,i,s,n),this}bezierCurveTo(e,t,i,s,n,o,a){this._ensurePoly();let u=this._currentPoly;return au(this._currentPoly.points,u.lastX,u.lastY,e,t,i,s,n,o,a),this}quadraticCurveTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly;return Jp(this._currentPoly.points,o.lastX,o.lastY,e,t,i,s,n),this}closePath(){return this.endPoly(true),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(true),e.transform(t));let i=this.shapePrimitives,s=i.length;for(let n=0;n<e.instructions.length;n++){let o=e.instructions[n];this[o.action](...o.data);}if(e.checkForHoles&&i.length-s>1){let n=null;for(let o=s;o<i.length;o++){let a=i[o];if(a.shape.type==="polygon"){let u=a.shape,l=n?.shape;l&&l.containsPolygon(u)?(n.holes||(n.holes=[]),n.holes.push(a),i.copyWithin(o,o+1),i.length--,o--):n=a;}}}return this}finish(e=false){this.endPoly(e);}rect(e,t,i,s,n){return this.drawShape(new Z(e,t,i,s),n),this}circle(e,t,i,s){return this.drawShape(new iu(e,t,i),s),this}poly(e,t,i){let s=new ks(e);return s.closePath=t,this.drawShape(s,i),this}regularPoly(e,t,i,s,n=0,o){s=Math.max(s|0,3);let a=-1*Math.PI/2+n,u=Math.PI*2/s,l=[];for(let c=0;c<s;c++){let h=a-c*u;l.push(e+i*Math.cos(h),t+i*Math.sin(h));}return this.poly(l,true,o),this}roundPoly(e,t,i,s,n,o=0,a){if(s=Math.max(s|0,3),n<=0)return this.regularPoly(e,t,i,s,o);let u=i*Math.sin(Math.PI/s)-.001;n=Math.min(n,u);let l=-1*Math.PI/2+o,c=Math.PI*2/s,h=(s-2)*Math.PI/s/2;for(let d=0;d<s;d++){let p=d*c+l,_=e+i*Math.cos(p),b=t+i*Math.sin(p),x=p+Math.PI+h,g=p-Math.PI-h,v=_+n*Math.cos(x),T=b+n*Math.sin(x),S=_+n*Math.cos(g),B=b+n*Math.sin(g);d===0?this.moveTo(v,T):this.lineTo(v,T),this.quadraticCurveTo(_,b,S,B,a);}return this.closePath()}roundShape(e,t,i=false,s){return e.length<3?this:(i?sm(this,e,t,s):im(this,e,t),this.closePath())}filletRect(e,t,i,s,n){if(n===0)return this.rect(e,t,i,s);let o=Math.min(i,s)/2,a=Math.min(o,Math.max(-o,n)),u=e+i,l=t+s,c=a<0?-a:0,h=Math.abs(a);return this.moveTo(e,t+h).arcTo(e+c,t+c,e+h,t,h).lineTo(u-h,t).arcTo(u-c,t+c,u,t+h,h).lineTo(u,l-h).arcTo(u-c,l-c,e+i-h,l,h).lineTo(e+h,l).arcTo(e+c,l-c,e,l-h,h).closePath()}chamferRect(e,t,i,s,n,o){if(n<=0)return this.rect(e,t,i,s);let a=Math.min(n,Math.min(i,s)/2),u=e+i,l=t+s,c=[e+a,t,u-a,t,u,t+a,u,l-a,u-a,l,e+a,l,e,l-a,e,t+a];for(let h=c.length-1;h>=2;h-=2)c[h]===c[h-2]&&c[h-1]===c[h-3]&&c.splice(h-1,2);return this.poly(c,true,o)}ellipse(e,t,i,s,n){return this.drawShape(new su(e,t,i,s),n),this}roundRect(e,t,i,s,n,o){return this.drawShape(new nu(e,t,i,s,n),o),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let i=this._currentPoly;return i&&this.endPoly(),i=new ks,i.points.push(e,t),this._currentPoly=i,this}endPoly(e=false){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=true){if(!this._currentPoly&&(this._currentPoly=new ks,e)){let t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let i=t.shape.x,s=t.shape.y;if(t.transform&&!t.transform.isIdentity()){let n=t.transform,o=i;i=n.a*i+n.c*s+n.tx,s=n.b*o+n.d*s+n.ty;}this._currentPoly.points.push(i,s);}else this._currentPoly.points.push(0,0);}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];this[i.action](...i.data);}this.finish();}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let i=0;i<t.length;i++){let s=t[i],n=s.shape.getBounds($D);s.transform?e.addRect(n,s.transform):e.addRect(n);}return e}};});function Uc(r,e){return r?r.prepend(e):e.clone()}var ui,nm=f(()=>{jt();lt();_e();q0();lv();ui=class r{constructor(e,t=false){this.instructions=[],this.uid=re("graphicsPath"),this._dirty=true,this.checkForHoles=t,typeof e=="string"?jp(e,this):this.instructions=e?.slice()??[];}get shapePath(){return this._shapePath||(this._shapePath=new lu(this)),this._dirty&&(this._dirty=false,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,t]}),this._dirty=true,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=true,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=true,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=true,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=true,this}bezierCurveToShort(e,t,i,s,n){let o=this.instructions[this.instructions.length-1],a=this.getLastPoint(ne.shared),u=0,l=0;if(!o||o.action!=="bezierCurveTo")u=a.x,l=a.y;else {u=o.data[2],l=o.data[3];let c=a.x,h=a.y;u=c+(c-u),l=h+(h-l);}return this.instructions.push({action:"bezierCurveTo",data:[u,l,e,t,i,s,n]}),this._dirty=true,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=true,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=true,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=true,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=true,this}quadraticCurveToShort(e,t,i){let s=this.instructions[this.instructions.length-1],n=this.getLastPoint(ne.shared),o=0,a=0;if(!s||s.action!=="quadraticCurveTo")o=n.x,a=n.y;else {o=s.data[0],a=s.data[1];let u=n.x,l=n.y;o=u+(u-o),a=l+(l-a);}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,e,t,i]}),this._dirty=true,this}rect(e,t,i,s,n){return this.instructions.push({action:"rect",data:[e,t,i,s,n]}),this._dirty=true,this}circle(e,t,i,s){return this.instructions.push({action:"circle",data:[e,t,i,s]}),this._dirty=true,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=true,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=true,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=true,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=true,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=true,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=true,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=true,this}star(e,t,i,s,n,o,a){n||(n=s/2);let u=-1*Math.PI/2+o,l=i*2,c=Math.PI*2/l,h=[];for(let d=0;d<l;d++){let p=d%2?n:s,_=d*c+u;h.push(e+p*Math.cos(_),t+p*Math.sin(_));}return this.poly(h,true,a),this}clone(e=false){let t=new r;if(t.checkForHoles=this.checkForHoles,!e)t.instructions=this.instructions.slice();else for(let i=0;i<this.instructions.length;i++){let s=this.instructions[i];t.instructions.push({action:s.action,data:s.data.slice()});}return t}clear(){return this.instructions.length=0,this._dirty=true,this}transform(e){if(e.isIdentity())return this;let t=e.a,i=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,u=0,l=0,c=0,h=0,d=0,p=0,_=0,b=0;for(let x=0;x<this.instructions.length;x++){let g=this.instructions[x],v=g.data;switch(g.action){case "moveTo":case "lineTo":u=v[0],l=v[1],v[0]=t*u+s*l+o,v[1]=i*u+n*l+a;break;case "bezierCurveTo":c=v[0],h=v[1],d=v[2],p=v[3],u=v[4],l=v[5],v[0]=t*c+s*h+o,v[1]=i*c+n*h+a,v[2]=t*d+s*p+o,v[3]=i*d+n*p+a,v[4]=t*u+s*l+o,v[5]=i*u+n*l+a;break;case "quadraticCurveTo":c=v[0],h=v[1],u=v[2],l=v[3],v[0]=t*c+s*h+o,v[1]=i*c+n*h+a,v[2]=t*u+s*l+o,v[3]=i*u+n*l+a;break;case "arcToSvg":u=v[5],l=v[6],_=v[0],b=v[1],v[0]=t*_+s*b,v[1]=i*_+n*b,v[5]=t*u+s*l+o,v[6]=i*u+n*l+a;break;case "circle":v[4]=Uc(v[3],e);break;case "rect":v[4]=Uc(v[4],e);break;case "ellipse":v[8]=Uc(v[8],e);break;case "roundRect":v[5]=Uc(v[5],e);break;case "addPath":v[0].transform(e);break;case "poly":v[2]=Uc(v[2],e);break;default:F("unknown transform action",g.action);break}}return this._dirty=true,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,i=this.instructions[t];if(!i)return e.x=0,e.y=0,e;for(;i.action==="closePath";){if(t--,t<0)return e.x=0,e.y=0,e;i=this.instructions[t];}switch(i.action){case "moveTo":case "lineTo":e.x=i.data[0],e.y=i.data[1];break;case "quadraticCurveTo":e.x=i.data[2],e.y=i.data[3];break;case "bezierCurveTo":e.x=i.data[4],e.y=i.data[5];break;case "arc":case "arcToSvg":e.x=i.data[5],e.y=i.data[6];break;case "addPath":i.data[0].getLastPoint(e);break}return e}};});function Ge(r,e,t){let i=r.getAttribute(e);return i?Number(i):t}var om=f(()=>{});function am(r,e){let t=r.querySelectorAll("defs");for(let i=0;i<t.length;i++){let s=t[i];for(let n=0;n<s.children.length;n++){let o=s.children[n];switch(o.nodeName.toLowerCase()){case "lineargradient":e.defs[o.id]=jD(o);break;case "radialgradient":e.defs[o.id]=qD();break;}}}}function jD(r){let e=Ge(r,"x1",0),t=Ge(r,"y1",0),i=Ge(r,"x2",1),s=Ge(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new It(e,t,i,s,n==="objectBoundingBox"?"local":"global");for(let a=0;a<r.children.length;a++){let u=r.children[a],l=Ge(u,"offset",0),c=K.shared.setValue(u.getAttribute("stop-color")).toNumber();o.addColorStop(l,c);}return o}function qD(r){return F("[SVG Parser] Radial gradients are not yet supported"),new It(0,0,1,0)}var cv=f(()=>{it();_e();Vn();om();});function Lc(r){let e=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}var hv=f(()=>{});function Nc(r,e){let t=r.getAttribute("style"),i={},s={},n={strokeStyle:i,fillStyle:s,useFill:false,useStroke:false};for(let o in um){let a=r.getAttribute(o);a&&RC(e,n,o,a.trim());}if(t){let o=t.split(";");for(let a=0;a<o.length;a++){let u=o[a].trim(),[l,c]=u.split(":");um[l]&&RC(e,n,l,c.trim());}}return {strokeStyle:n.useStroke?i:null,fillStyle:n.useFill?s:null,useFill:n.useFill,useStroke:n.useStroke}}function RC(r,e,t,i){switch(t){case "stroke":if(i!=="none"){if(i.startsWith("url(")){let s=Lc(i);e.strokeStyle.fill=r.defs[s];}else e.strokeStyle.color=K.shared.setValue(i).toNumber();e.useStroke=true;}break;case "stroke-width":e.strokeStyle.width=Number(i);break;case "fill":if(i!=="none"){if(i.startsWith("url(")){let s=Lc(i);e.fillStyle.fill=r.defs[s];}else e.fillStyle.color=K.shared.setValue(i).toNumber();e.useFill=true;}break;case "fill-opacity":e.fillStyle.alpha=Number(i);break;case "stroke-opacity":e.strokeStyle.alpha=Number(i);break;case "opacity":e.fillStyle.alpha=Number(i),e.strokeStyle.alpha=Number(i);break}}var um,dv=f(()=>{it();hv();um={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};});function lm(r,e){if(typeof r=="string"){let o=document.createElement("div");o.innerHTML=r.trim(),r=o.querySelector("svg");}let t={context:e,defs:{},path:new ui};am(r,t);let i=r.children,{fillStyle:s,strokeStyle:n}=Nc(r,t);for(let o=0;o<i.length;o++){let a=i[o];a.nodeName.toLowerCase()!=="defs"&&MC(a,t,s,n);}return e}function MC(r,e,t,i){let s=r.children,{fillStyle:n,strokeStyle:o}=Nc(r,e);n&&t?t={...t,...n}:n&&(t=n),o&&i?i={...i,...o}:o&&(i=o);let a=!t&&!i;a&&(t={color:0});let u,l,c,h,d,p,_,b,x,g,v,T,S,B,A,R,Y;switch(r.nodeName.toLowerCase()){case "path":B=r.getAttribute("d"),r.getAttribute("fill-rule")==="evenodd"&&F("SVG Evenodd fill rule not supported, your svg may render incorrectly"),A=new ui(B,true),e.context.path(A),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "circle":_=Ge(r,"cx",0),b=Ge(r,"cy",0),x=Ge(r,"r",0),e.context.ellipse(_,b,x,x),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "rect":u=Ge(r,"x",0),l=Ge(r,"y",0),R=Ge(r,"width",0),Y=Ge(r,"height",0),g=Ge(r,"rx",0),v=Ge(r,"ry",0),g||v?e.context.roundRect(u,l,R,Y,g||v):e.context.rect(u,l,R,Y),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "ellipse":_=Ge(r,"cx",0),b=Ge(r,"cy",0),g=Ge(r,"rx",0),v=Ge(r,"ry",0),e.context.beginPath(),e.context.ellipse(_,b,g,v),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "line":c=Ge(r,"x1",0),h=Ge(r,"y1",0),d=Ge(r,"x2",0),p=Ge(r,"y2",0),e.context.beginPath(),e.context.moveTo(c,h),e.context.lineTo(d,p),i&&e.context.stroke(i);break;case "polygon":S=r.getAttribute("points"),T=S.match(/\d+/g).map(M=>parseInt(M,10)),e.context.poly(T,true),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "polyline":S=r.getAttribute("points"),T=S.match(/\d+/g).map(M=>parseInt(M,10)),e.context.poly(T,false),i&&e.context.stroke(i);break;case "g":case "svg":break;default:{F(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}a&&(t=null);for(let M=0;M<s.length;M++)MC(s[M],e,t,i);}var fv=f(()=>{_e();nm();cv();om();dv();});function KD(r){return K.isColorLike(r)}function DC(r){return r instanceof Hr}function IC(r){return r instanceof It}function ZD(r){return r instanceof C}function QD(r,e,t){let i=K.shared.setValue(e??0);return r.color=i.toNumber(),r.alpha=i.alpha===1?t.alpha:i.alpha,r.texture=C.WHITE,{...t,...r}}function JD(r,e,t){return r.texture=e,{...t,...r}}function kC(r,e,t){return r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,{...t,...r}}function FC(r,e,t){return e.buildGradient(),r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,r.textureSpace=e.textureSpace,{...t,...r}}function eI(r,e){let t={...e,...r},i=K.shared.setValue(t.color);return t.alpha*=i.alpha,t.color=i.toNumber(),t}function Vr(r,e){if(r==null)return null;let t={},i=r;return KD(r)?QD(t,r,e):ZD(r)?JD(t,r,e):DC(r)?kC(t,r,e):IC(r)?FC(t,r,e):i.fill&&DC(i.fill)?kC(i,i.fill,e):i.fill&&IC(i.fill)?FC(i,i.fill,e):eI(i,e)}function Fs(r,e){let{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...u}=e,l=Vr(r,u);return l?{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...l}:null}var cm=f(()=>{it();ce();Vn();Oc();});var tI,OC,pv,Je,Zn=f(()=>{St();it();he();jt();ce();lt();xe();Et();nm();fv();cm();tI=new ne,OC=new D,pv=class li extends ue{constructor(){super(...arguments),this.uid=re("graphicsContext"),this.dirty=true,this.batchMode="auto",this.instructions=[],this._activePath=new ui,this._transform=new D,this._fillStyle={...li.defaultFillStyle},this._strokeStyle={...li.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new me,this._boundsDirty=true;}clone(){let e=new li;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=true,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=Vr(e,li.defaultFillStyle);}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=Fs(e,li.defaultStrokeStyle);}setFillStyle(e){return this._fillStyle=Vr(e,li.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=Vr(e,li.defaultStrokeStyle),this}texture(e,t,i,s,n,o){return this.instructions.push({action:"texture",data:{image:e,dx:i||0,dy:s||0,dw:n||e.frame.width,dh:o||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t?K.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new ui,this}fill(e,t){let i,s=this.instructions[this.instructions.length-1];return this._tick===0&&s&&s.action==="stroke"?i=s.data.path:i=this._activePath.clone(),i?(e!=null&&(t!==void 0&&typeof e=="number"&&(I(H,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:t}),this._fillStyle=Vr(e,li.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(ne.shared);this._activePath.clear(),this._activePath.moveTo(e,t);}stroke(e){let t,i=this.instructions[this.instructions.length-1];return this._tick===0&&i&&i.action==="fill"?t=i.data.path:t=this._activePath.clone(),t?(e!=null&&(this._strokeStyle=Fs(e,li.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:t}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],i=this._activePath.clone();if(t&&(t.action==="stroke"||t.action==="fill"))if(t.data.hole)t.data.hole.addPath(i);else {t.data.hole=i;break}}return this._initNextPathLocation(),this}arc(e,t,i,s,n,o){this._tick++;let a=this._transform;return this._activePath.arc(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,i,s,n,o),this}arcTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.arcTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}arcToSvg(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.arcToSvg(e,t,i,s,n,u.a*o+u.c*a+u.tx,u.b*o+u.d*a+u.ty),this}bezierCurveTo(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.bezierCurveTo(u.a*e+u.c*t+u.tx,u.b*e+u.d*t+u.ty,u.a*i+u.c*s+u.tx,u.b*i+u.d*s+u.ty,u.a*n+u.c*o+u.tx,u.b*n+u.d*o+u.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,i,s){return this._tick++,this._activePath.ellipse(e,t,i,s,this._transform.clone()),this}circle(e,t,i){return this._tick++,this._activePath.circle(e,t,i,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let i=this._transform;return this._activePath.lineTo(i.a*e+i.c*t+i.tx,i.b*e+i.d*t+i.ty),this}moveTo(e,t){this._tick++;let i=this._transform,s=this._activePath.instructions,n=i.a*e+i.c*t+i.tx,o=i.b*e+i.d*t+i.ty;return s.length===1&&s[0].action==="moveTo"?(s[0].data[0]=n,s[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.quadraticCurveTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}rect(e,t,i,s){return this._tick++,this._activePath.rect(e,t,i,s,this._transform.clone()),this}roundRect(e,t,i,s,n){return this._tick++,this._activePath.roundRect(e,t,i,s,n,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,i,s,n=0,o){return this._tick++,this._activePath.regularPoly(e,t,i,s,n,o),this}roundPoly(e,t,i,s,n,o){return this._tick++,this._activePath.roundPoly(e,t,i,s,n,o),this}roundShape(e,t,i,s){return this._tick++,this._activePath.roundShape(e,t,i,s),this}filletRect(e,t,i,s,n){return this._tick++,this._activePath.filletRect(e,t,i,s,n),this}chamferRect(e,t,i,s,n,o){return this._tick++,this._activePath.chamferRect(e,t,i,s,n,o),this}star(e,t,i,s,n=0,o=0){return this._tick++,this._activePath.star(e,t,i,s,n,o,this._transform.clone()),this}svg(e){return this._tick++,lm(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,i,s,n,o){return e instanceof D?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,i,s,n,o),this)}transform(e,t,i,s,n,o){return e instanceof D?(this._transform.append(e),this):(OC.set(e,t,i,s,n,o),this._transform.append(OC),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=true,this._boundsDirty=true);}get bounds(){if(!this._boundsDirty)return this._bounds;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let i=this.instructions[t],s=i.action;if(s==="fill"){let n=i.data;e.addBounds(n.path.bounds);}else if(s==="texture"){let n=i.data;e.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform);}if(s==="stroke"){let n=i.data,o=n.style.alignment,a=n.style.width*(1-o),u=n.path.bounds;e.addFrame(u.minX-a,u.minY-a,u.maxX+a,u.maxY+a);}}return e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return false;let t=this.instructions,i=false;for(let s=0;s<t.length;s++){let n=t[s],o=n.data,a=o.path;if(!n.action||!a)continue;let u=o.style,l=a.shapePath.shapePrimitives;for(let c=0;c<l.length;c++){let h=l[c].shape;if(!u||!h)continue;let d=l[c].transform,p=d?d.applyInverse(e,tI):e;if(n.action==="fill")i=h.contains(p.x,p.y);else {let b=u;i=h.strokeContains(p.x,p.y,b.width,b.alignment);}let _=o.hole;if(_){let b=_.shapePath?.shapePrimitives;if(b)for(let x=0;x<b.length;x++)b[x].shape.contains(p.x,p.y)&&(i=false);}if(i)return true}}return i}destroy(e=false){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fillStyle.texture&&this._fillStyle.texture.destroy(i),this._strokeStyle.texture&&this._strokeStyle.texture.destroy(i);}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null;}};pv.defaultFillStyle={color:16777215,alpha:1,texture:C.WHITE,matrix:null,fill:null,textureSpace:"local"};pv.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:C.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:false};Je=pv;});function hm(r){let e=[],t=0;for(let i=0;i<GC.length;i++){let s=`_${GC[i]}`;e[t++]=r[s];}return t=UC(r._fill,e,t),t=iI(r._stroke,e,t),t=sI(r.dropShadow,e,t),t=rI(r.filters,e,t),e.join("-")}function rI(r,e,t){if(!r)return t;for(let i of r)e[t++]=i.uid;return t}function UC(r,e,t){return r&&(e[t++]=r.color,e[t++]=r.alpha,e[t++]=r.fill?.styleKey),t}function iI(r,e,t){return r&&(t=UC(r,e,t),e[t++]=r.width,e[t++]=r.alignment,e[t++]=r.cap,e[t++]=r.join,e[t++]=r.miterLimit),t}function sI(r,e,t){return r&&(e[t++]=r.alpha,e[t++]=r.angle,e[t++]=r.blur,e[t++]=r.distance,e[t++]=K.shared.setValue(r.color).toNumber()),t}var GC,mv=f(()=>{it();GC=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];});function nI(r){let e=r;if(typeof e.dropShadow=="boolean"&&e.dropShadow){let t=gt.defaultDropShadow;r.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance};}if(e.strokeThickness!==void 0){I(H,"strokeThickness is now a part of stroke");let t=e.stroke,i={};if(K.isColorLike(t))i.color=t;else if(t instanceof It||t instanceof Hr)i.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))i=t;else throw new Error("Invalid stroke value.");r.stroke={...i,width:e.strokeThickness};}if(Array.isArray(e.fillGradientStops)){I(H,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;r.fontSize==null?r.fontSize=gt.defaultTextStyle.fontSize:typeof r.fontSize=="string"?t=parseInt(r.fontSize,10):t=r.fontSize;let i=new It({start:{x:0,y:0},end:{x:0,y:(t||0)*1.7}}),s=e.fillGradientStops.map(n=>K.shared.setValue(n).toNumber());s.forEach((n,o)=>{let a=o/(s.length-1);i.addColorStop(a,n);}),r.fill={fill:i};}}var gv,gt,Os=f(()=>{St();it();xe();Vn();Oc();Zn();cm();mv();gv=class cu extends ue{constructor(e={}){super(),nI(e);let t={...cu.defaultTextStyle,...e};for(let i in t){let s=i;this[s]=t[i];}this.update();}get align(){return this._align}set align(e){this._align=e,this.update();}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update();}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...cu.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...cu.defaultDropShadow}):null,this.update();}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update();}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update();}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e.toLowerCase(),this.update();}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update();}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update();}get leading(){return this._leading}set leading(e){this._leading=e,this.update();}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update();}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update();}get padding(){return this._padding}set padding(e){this._padding=e,this.update();}get filters(){return this._filters}set filters(e){this._filters=e,this.update();}get trim(){return this._trim}set trim(e){this._trim=e,this.update();}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update();}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update();}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update();}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update();}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...Je.defaultFillStyle,...e},()=>{this._fill=Vr({...this._originalFill},Je.defaultFillStyle);})),this._fill=Vr(e===0?"black":e,Je.defaultFillStyle),this.update());}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...Je.defaultStrokeStyle,...e},()=>{this._stroke=Fs({...this._originalStroke},Je.defaultStrokeStyle);})),this._stroke=Fs(e,Je.defaultStrokeStyle),this.update());}_generateKey(){return this._styleKey=hm(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this);}reset(){let e=cu.defaultTextStyle;for(let t in e)this[t]=e[t];}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new cu({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0})}_getFinalPadding(){let e=0;if(this._filters)for(let t=0;t<this._filters.length;t++)e+=this._filters[t].padding;return Math.max(this._padding,e)}destroy(e=false){if(this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(i),this._originalFill?.texture&&this._originalFill.texture.destroy(i),this._stroke?.texture&&this._stroke.texture.destroy(i),this._originalStroke?.texture&&this._originalStroke.texture.destroy(i);}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null;}_createProxy(e,t){return new Proxy(e,{set:(i,s,n)=>(i[s]=n,t?.(s,n),this.update(),true)})}_isFillStyle(e){return (e??null)!==null&&!(K.isColorLike(e)||e instanceof It||e instanceof Hr)}};gv.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};gv.defaultTextStyle={align:"left",breakWords:false,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:false,whiteSpace:"pre",wordWrap:false,wordWrapWidth:100};gt=gv;});function hu(r,e,t,i){let s=oI;s.minX=0,s.minY=0,s.maxX=r.width/i|0,s.maxY=r.height/i|0;let n=be.getOptimalTexture(s.width,s.height,i,false);return n.source.uploadMethodId="image",n.source.resource=r,n.source.alphaMode="premultiply-alpha-on-upload",n.frame.width=e/i,n.frame.height=t/i,n.source.emit("update",n.source),n.updateUvs(),n}var oI,dm=f(()=>{Fr();Et();oI=new me;});var Hc,Vt,Qn=f(()=>{Se();Pa();Hc=class{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=false;}_createCanvasAndContext(e,t){let i=V.get().createCanvas();i.width=e,i.height=t;let s=i.getContext("2d");return {canvas:i,context:s}}getOptimalCanvasAndContext(e,t,i=1){e=Math.ceil(e*i-1e-6),t=Math.ceil(t*i-1e-6),e=kr(e),t=kr(t);let s=(e<<17)+(t<<1);this._canvasPool[s]||(this._canvasPool[s]=[]);let n=this._canvasPool[s].pop();return n||(n=this._createCanvasAndContext(e,t)),n}returnCanvasAndContext(e){let t=e.canvas,{width:i,height:s}=t,n=(i<<17)+(s<<1);e.context.clearRect(0,0,i,s),this._canvasPool[n].push(e);}clear(){this._canvasPool={};}},Vt=new Hc;});function aI(r,e){Jn||(Jn=V.get().createCanvas(256,128),Ni=Jn.getContext("2d",{willReadFrequently:true}),Ni.globalCompositeOperation="copy",Ni.globalAlpha=1),(Jn.width<r||Jn.height<e)&&(Jn.width=kr(r),Jn.height=kr(e));}function LC(r,e,t){for(let i=0,s=4*t*e;i<e;++i,s+=4)if(r[s+3]!==0)return false;return true}function NC(r,e,t,i,s){let n=4*e;for(let o=i,a=i*n+4*t;o<=s;++o,a+=n)if(r[a+3]!==0)return false;return true}function fm(...r){let e=r[0];e.canvas||(e={canvas:r[0],resolution:r[1]});let{canvas:t}=e,i=Math.min(e.resolution??1,1),s=e.width??t.width,n=e.height??t.height,o=e.output;if(aI(s,n),!Ni)throw new TypeError("Failed to get canvas 2D context");Ni.drawImage(t,0,0,s,n,0,0,s*i,n*i);let u=Ni.getImageData(0,0,s,n).data,l=0,c=0,h=s-1,d=n-1;for(;c<n&&LC(u,s,c);)++c;if(c===n)return Z.EMPTY;for(;LC(u,s,d);)--d;for(;NC(u,s,l,c,d);)++l;for(;NC(u,s,h,c,d);)--h;return ++h,++d,Ni.globalCompositeOperation="source-over",Ni.strokeRect(l,c,h-l,d-c),Ni.globalCompositeOperation="copy",o??(o=new Z),o.set(l/i,c/i,(h-l)/i,(d-c)/i),o}var Jn,Ni,xv=f(()=>{Se();Pa();Ze();Jn=null,Ni=null;});function Hi(r){let e=typeof r.fontSize=="number"?`${r.fontSize}px`:r.fontSize,t=r.fontFamily;Array.isArray(r.fontFamily)||(t=r.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let s=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(s)&&!uI.includes(s)&&(s=`"${s}"`),t[i]=s;}return `${r.fontStyle} ${r.fontVariant} ${r.fontWeight} ${e} ${t.join(",")}`}var uI,Vc=f(()=>{uI=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];});var _v,ci,xt,eo=f(()=>{Se();Vc();_v={willReadFrequently:true},ci=class ${static get experimentalLetterSpacingSupported(){let e=$._experimentalLetterSpacingSupported;if(e===void 0){let t=V.get().getCanvasRenderingContext2D().prototype;e=$._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t;}return e}constructor(e,t,i,s,n,o,a,u,l){this.text=e,this.style=t,this.width=i,this.height=s,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=u,this.fontProperties=l;}static measureText(e=" ",t,i=$._canvas,s=t.wordWrap){let n=Hi(t),o=$.measureFont(n);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);let a=$.__context;a.font=n;let l=(s?$._wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),c=new Array(l.length),h=0;for(let g=0;g<l.length;g++){let v=$._measureText(l[g],t.letterSpacing,a);c[g]=v,h=Math.max(h,v);}let d=t._stroke?.width||0,p=h+d;t.dropShadow&&(p+=t.dropShadow.distance);let _=t.lineHeight||o.fontSize,b=Math.max(_,o.fontSize+d)+(l.length-1)*(_+t.leading);return t.dropShadow&&(b+=t.dropShadow.distance),new $(e,t,p,b,l,c,_+t.leading,h,o)}static _measureText(e,t,i){let s=false;$.experimentalLetterSpacingSupported&&($.experimentalLetterSpacing?(i.letterSpacing=`${t}px`,i.textLetterSpacing=`${t}px`,s=true):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(e),o=n.width,a=-n.actualBoundingBoxLeft,l=n.actualBoundingBoxRight-a;if(o>0)if(s)o-=t,l-=t;else {let c=($.graphemeSegmenter(e).length-1)*t;o+=c,l+=c;}return Math.max(o,l)}static _wordWrap(e,t,i=$._canvas){let s=i.getContext("2d",_v),n=0,o="",a="",u=Object.create(null),{letterSpacing:l,whiteSpace:c}=t,h=$._collapseSpaces(c),d=$._collapseNewlines(c),p=!h,_=t.wordWrapWidth+l,b=$._tokenize(e);for(let x=0;x<b.length;x++){let g=b[x];if($._isNewline(g)){if(!d){a+=$._addLine(o),p=!h,o="",n=0;continue}g=" ";}if(h){let T=$.isBreakingSpace(g),S=$.isBreakingSpace(o[o.length-1]);if(T&&S)continue}let v=$._getFromCache(g,l,u,s);if(v>_)if(o!==""&&(a+=$._addLine(o),o="",n=0),$.canBreakWords(g,t.breakWords)){let T=$.wordWrapSplit(g);for(let S=0;S<T.length;S++){let B=T[S],A=B,R=1;for(;T[S+R];){let M=T[S+R];if(!$.canBreakChars(A,M,g,S,t.breakWords))B+=M;else break;A=M,R++;}S+=R-1;let Y=$._getFromCache(B,l,u,s);Y+n>_&&(a+=$._addLine(o),p=false,o="",n=0),o+=B,n+=Y;}}else {o.length>0&&(a+=$._addLine(o),o="",n=0);let T=x===b.length-1;a+=$._addLine(g,!T),p=false,o="",n=0;}else v+n>_&&(p=false,a+=$._addLine(o),o="",n=0),(o.length>0||!$.isBreakingSpace(g)||p)&&(o+=g,n+=v);}return a+=$._addLine(o,false),a}static _addLine(e,t=true){return e=$._trimRight(e),e=t?`${e}
|
|
375
|
-
`:e,e}static _getFromCache(e,t,i,s){let n=i[e];return typeof n!="number"&&(n=$._measureText(e,t,s)+t,i[e]=n),n}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return "";for(let t=e.length-1;t>=0;t--){let i=e[t];if(!$.isBreakingSpace(i))break;e=e.slice(0,-1);}return e}static _isNewline(e){return typeof e!="string"?false:$._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?false:$._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){let t=[],i="";if(typeof e!="string")return t;for(let s=0;s<e.length;s++){let n=e[s],o=e[s+1];if($.isBreakingSpace(n,o)||$._isNewline(n)){i!==""&&(t.push(i),i=""),t.push(n);continue}i+=n;}return i!==""&&t.push(i),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,i,s,n){return true}static wordWrapSplit(e){return $.graphemeSegmenter(e)}static measureFont(e){if($._fonts[e])return $._fonts[e];let t=$._context;t.font=e;let i=t.measureText($.METRICS_STRING+$.BASELINE_SYMBOL),s={ascent:i.actualBoundingBoxAscent,descent:i.actualBoundingBoxDescent,fontSize:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent};return $._fonts[e]=s,s}static clearMetrics(e=""){e?delete $._fonts[e]:$._fonts={};}static get _canvas(){if(!$.__canvas){let e;try{let t=new OffscreenCanvas(0,0);if(t.getContext("2d",_v)?.measureText)return $.__canvas=t,t;e=V.get().createCanvas();}catch{e=V.get().createCanvas();}e.width=e.height=10,$.__canvas=e;}return $.__canvas}static get _context(){return $.__context||($.__context=$._canvas.getContext("2d",_v)),$.__context}};ci.METRICS_STRING="|\xC9q\xC5";ci.BASELINE_SYMBOL="M";ci.BASELINE_MULTIPLIER=1.4;ci.HEIGHT_MULTIPLIER=2;ci.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){let r=new Intl.Segmenter;return e=>{let t=r.segment(e),i=[],s=0;for(let n of t)i[s++]=n.segment;return i}}return r=>[...r]})();ci.experimentalLetterSpacing=false;ci._fonts={};ci._newlines=[10,13];ci._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];xt=ci;});function Gs(r,e,t,i=0){if(r.texture===C.WHITE&&!r.fill)return K.shared.setValue(r.color).setAlpha(r.alpha??1).toHexa();if(r.fill){if(r.fill instanceof Hr){let s=r.fill,n=e.createPattern(s.texture.source.resource,"repeat"),o=s.transform.copyTo(D.shared);return o.scale(s.texture.frame.width,s.texture.frame.height),n.setTransform(o),n}else if(r.fill instanceof It){let s=r.fill,n=s.type==="linear",o=s.textureSpace==="local",a=1,u=1;o&&t&&(a=t.width+i,u=t.height+i);let l,c=false;if(n){let{start:h,end:d}=s;l=e.createLinearGradient(h.x*a,h.y*u,d.x*a,d.y*u),c=Math.abs(d.x-h.x)<Math.abs((d.y-h.y)*.1);}else {let{center:h,innerRadius:d,outerCenter:p,outerRadius:_}=s;l=e.createRadialGradient(h.x*a,h.y*u,d*a,p.x*a,p.y*u,_*a);}if(c&&o&&t){let h=t.lineHeight/u;for(let d=0;d<t.lines.length;d++){let p=(d*t.lineHeight+i/2)/u;s.colorStops.forEach(_=>{let b=p+_.offset*h;l.addColorStop(Math.floor(b*HC)/HC,K.shared.setValue(_.color).toHex());});}}else s.colorStops.forEach(h=>{l.addColorStop(h.offset,K.shared.setValue(h.color).toHex());});return l}}else {let s=e.createPattern(r.texture.source.resource,"repeat"),n=r.matrix.copyTo(D.shared);return n.scale(r.texture.frame.width,r.texture.frame.height),s.setTransform(n),s}return F("FillStyle not recognised",r),"red"}var HC,pm=f(()=>{it();he();ce();_e();Vn();Oc();HC=1e5;});var VC,bv,Vi,mm=f(()=>{it();Ze();Qn();xv();eo();Vc();pm();VC=new Z,bv=class{getCanvasAndContext(e){let{text:t,style:i,resolution:s=1}=e,n=i._getFinalPadding(),o=xt.measureText(t||" ",i),a=Math.ceil(Math.ceil(Math.max(1,o.width)+n*2)*s),u=Math.ceil(Math.ceil(Math.max(1,o.height)+n*2)*s),l=Vt.getOptimalCanvasAndContext(a,u);this._renderTextToCanvas(t,i,n,s,l);let c=i.trim?fm({canvas:l.canvas,width:a,height:u,resolution:1,output:VC}):VC.set(0,0,a,u);return {canvasAndContext:l,frame:c}}returnCanvasAndContext(e){Vt.returnCanvasAndContext(e);}_renderTextToCanvas(e,t,i,s,n){let{canvas:o,context:a}=n,u=Hi(t),l=xt.measureText(e||" ",t),c=l.lines,h=l.lineHeight,d=l.lineWidths,p=l.maxLineWidth,_=l.fontProperties,b=o.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=t.textBaseline,t._stroke?.width){let T=t._stroke;a.lineWidth=T.width,a.miterLimit=T.miterLimit,a.lineJoin=T.join,a.lineCap=T.cap;}a.font=u;let x,g,v=t.dropShadow?2:1;for(let T=0;T<v;++T){let S=t.dropShadow&&T===0,B=S?Math.ceil(Math.max(1,b)+i*2):0,A=B*s;if(S){a.fillStyle="black",a.strokeStyle="black";let M=t.dropShadow,U=M.color,k=M.alpha;a.shadowColor=K.shared.setValue(U).setAlpha(k).toRgbaString();let J=M.blur*s,ge=M.distance*s;a.shadowBlur=J,a.shadowOffsetX=Math.cos(M.angle)*ge,a.shadowOffsetY=Math.sin(M.angle)*ge+A;}else {if(a.fillStyle=t._fill?Gs(t._fill,a,l):null,t._stroke?.width){let M=t._stroke.width*t._stroke.alignment;a.strokeStyle=Gs(t._stroke,a,l,M);}a.shadowColor="black";}let R=(h-_.fontSize)/2;h-_.fontSize<0&&(R=0);let Y=t._stroke?.width??0;for(let M=0;M<c.length;M++)x=Y/2,g=Y/2+M*h+_.ascent+R,t.align==="right"?x+=p-d[M]:t.align==="center"&&(x+=(p-d[M])/2),t._stroke?.width&&this._drawLetterSpacing(c[M],t,n,x+i,g+i-B,true),t._fill!==void 0&&this._drawLetterSpacing(c[M],t,n,x+i,g+i-B);}}_drawLetterSpacing(e,t,i,s,n,o=false){let{context:a}=i,u=t.letterSpacing,l=false;if(xt.experimentalLetterSpacingSupported&&(xt.experimentalLetterSpacing?(a.letterSpacing=`${u}px`,a.textLetterSpacing=`${u}px`,l=true):(a.letterSpacing="0px",a.textLetterSpacing="0px")),u===0||l){o?a.strokeText(e,s,n):a.fillText(e,s,n);return}let c=s,h=xt.graphemeSegmenter(e),d=a.measureText(e).width,p=0;for(let _=0;_<h.length;++_){let b=h[_];o?a.strokeText(b,c,n):a.fillText(b,c,n);let x="";for(let g=_+1;g<h.length;++g)x+=h[g];p=a.measureText(x).width,c+=d-p+u,d=p;}}},Vi=new bv;});var to,yv=f(()=>{E();Fr();Mi();xe();Os();dm();mm();to=class{constructor(e){this._renderer=e;}getTexture(e,t,i,s){typeof e=="string"&&(I("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:i,resolution:t}),e.style instanceof gt||(e.style=new gt(e.style)),e.textureStyle instanceof st||(e.textureStyle=new st(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());let{text:n,style:o,textureStyle:a}=e,u=e.resolution??this._renderer.resolution,{frame:l,canvasAndContext:c}=Vi.getCanvasAndContext({text:n,style:o,resolution:u}),h=hu(c.canvas,l.width,l.height,u);if(a&&(h.source.style=a),o.trim&&(l.pad(o.padding),h.frame.copyFrom(l),h.updateUvs()),o.filters){let d=this._applyFilters(h,o.filters);return this.returnTexture(h),Vi.returnCanvasAndContext(c),d}return this._renderer.texture.initSource(h._source),Vi.returnCanvasAndContext(c),h}returnTexture(e){let t=e.source;t.resource=null,t.uploadMethodId="unknown",t.alphaMode="no-premultiply-alpha",be.returnTexture(e,true);}renderTextToCanvas(){I("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead");}_applyFilters(e,t){let i=this._renderer.renderTarget.renderTarget,s=this._renderer.filter.generateFilteredTexture({texture:e,filters:t});return this._renderer.renderTarget.bind(i,false),s}destroy(){this._renderer=null;}};to.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"canvasText"};});var vv=f(()=>{E();$0();yv();O.add(to);O.add(qn);});var Us,gm=f(()=>{xe();Gr();Zn();Us=class r extends qe{constructor(e){e instanceof Je&&(e={context:e});let{context:t,roundPixels:i,...s}=e||{};super({label:"Graphics",...s}),this.renderPipeId="graphics",t?this._context=t:this._context=this._ownedContext=new Je,this._context.on("update",this.onViewUpdate,this),this.didViewUpdate=true,this.allowChildren=false,this.roundPixels=i??false;}set context(e){e!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=e,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate());}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(e){return this._context.containsPoint(e)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):(e===true||e?.context===true)&&this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e);}_callContextMethod(e,t){return this.context[e](...t),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e;}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e;}clone(e=false){return e?new r(this._context.clone()):(this._ownedContext=null,new r(this._context))}lineStyle(e,t,i){I(H,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");let s={};return e&&(s.width=e),t&&(s.color=t),i&&(s.alpha=i),this.context.strokeStyle=s,this}beginFill(e,t){I(H,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");let i={};return e!==void 0&&(i.color=e),t!==void 0&&(i.alpha=t),this.context.fillStyle=i,this}endFill(){I(H,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();let e=this.context.strokeStyle;return (e.width!==Je.defaultStrokeStyle.width||e.color!==Je.defaultStrokeStyle.color||e.alpha!==Je.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return I(H,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return I(H,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return I(H,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return I(H,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return I(H,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return I(H,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}};});var xm,_m,Tv=f(()=>{xm={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
374
|
+
}`;});var Ja,H0=f(()=>{it();he();Kt();ur();Ar();ce();Mi();U0();L0();N0();Ja=class extends ze{constructor(){let e=ke.from({vertex:Xp,fragment:Wp}),t=Fe.from({fragment:{source:Fc,entryPoint:"mainFragment"},vertex:{source:Fc,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:C.WHITE.source,uSampler:new st({}),uniforms:{uTranslationMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new K(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}});}};});var Ds,Yp=f(()=>{he();Qe();Oa();cr();zn();G0();H0();Ds=class{constructor(e,t){this.state=Ue.for2d(),this.localUniforms=new ae({uTranslationMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=e,this.adaptor=t,this.defaultShader=new Ja,this.state=Ue.for2d();}validateRenderable(e){return false}addRenderable(e,t){this.renderer.renderPipes.batch.break(t),t.add(e);}getBuffers(e){return e._gpuData[this.renderer.uid]||this._initBuffer(e)}_initBuffer(e){return e._gpuData[this.renderer.uid]=new Qa({size:e.particleChildren.length,properties:e._properties}),e._gpuData[this.renderer.uid]}updateRenderable(e){}execute(e){let t=e.particleChildren;if(t.length===0)return;let i=this.renderer,s=this.getBuffers(e);e.texture||(e.texture=t[0].texture);let n=this.state;s.update(t,e._childrenDirty),e._childrenDirty=false,n.blendMode=Lr(e.blendMode,e.texture._source);let o=this.localUniforms.uniforms,a=o.uTranslationMatrix;e.worldTransform.copyTo(a),a.prepend(i.globalUniforms.globalUniformData.projectionMatrix),o.uResolution=i.globalUniforms.globalUniformData.resolution,o.uRound=i._roundPixels|e._roundPixels,Cr(e.groupColorAlpha,o.uColor,0),this.adaptor.execute(this,e);}destroy(){this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null);}};});var Yn,V0=f(()=>{E();k0();Yp();Yn=class extends Ds{constructor(e){super(e,new Za);}};Yn.extension={type:[g.WebGLPipes],name:"particle"};});var eu,z0=f(()=>{eu=class{execute(e,t){let i=e.renderer,s=t.shader||e.defaultShader;s.groups[0]=i.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms,true),s.groups[1]=i.texture.getTextureBindGroup(t.texture);let n=e.state,o=e.getBuffers(t);i.encoder.draw({geometry:o.geometry,shader:t.shader||e.defaultShader,state:n,size:t.particleChildren.length*6});}};});var $n,W0=f(()=>{E();z0();Yp();$n=class extends Ds{constructor(e){super(e,new eu);}};$n.extension={type:[g.WebGPUPipes],name:"particle"};});var X0=f(()=>{E();V0();W0();O.add(Yn);O.add($n);});function jn(r,e){let{texture:t,bounds:i}=r;ka(i,e._anchor,t);let s=e._style._getFinalPadding();i.minX-=s,i.minY-=s,i.maxX-=s,i.maxY-=s;}var $p=f(()=>{Nf();});var Pr,tu=f(()=>{Pr=class{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=true,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null;}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null;}destroy(){}};});var ru,Y0=f(()=>{tu();ru=class extends Pr{constructor(e){super(),this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.canvasText.returnTexture(this.texture),this._renderer=null;}};});var qn,$0=f(()=>{E();$p();Y0();qn=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e),e._didTextUpdate=false),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}_updateGpuText(e){let t=this._getGpuText(e);t.texture&&this._renderer.canvasText.returnTexture(t.texture),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=t.texture=this._renderer.canvasText.getTexture(e),jn(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new ru(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};qn.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"text"};});var EC,Hr,Oc=f(()=>{he();lt();EC={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},Hr=class{constructor(e,t){this.uid=re("fillPattern"),this.transform=new D,this._styleKey=null,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=EC[t].addressModeU,e.source.style.addressModeV=EC[t].addressModeV);}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._styleKey=null;}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}};});var CC=ti((WV,AC)=>{AC.exports=DD;var j0={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},MD=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function DD(r){var e=[];return r.replace(MD,function(t,i,s){var n=i.toLowerCase();for(s=kD(s),n=="m"&&s.length>2&&(e.push([i].concat(s.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(s.length==j0[n])return s.unshift(i),e.push(s);if(s.length<j0[n])throw new Error("malformed path data");e.push([i].concat(s.splice(0,j0[n])));}}),e}var ID=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function kD(r){var e=r.match(ID);return e?e.map(Number):[]}});function jp(r,e){let t=(0, PC.default)(r),i=[],s=null,n=0,o=0;for(let a=0;a<t.length;a++){let u=t[a],l=u[0],c=u;switch(l){case "M":n=c[1],o=c[2],e.moveTo(n,o);break;case "m":n+=c[1],o+=c[2],e.moveTo(n,o);break;case "H":n=c[1],e.lineTo(n,o);break;case "h":n+=c[1],e.lineTo(n,o);break;case "V":o=c[1],e.lineTo(n,o);break;case "v":o+=c[1],e.lineTo(n,o);break;case "L":n=c[1],o=c[2],e.lineTo(n,o);break;case "l":n+=c[1],o+=c[2],e.lineTo(n,o);break;case "C":n=c[5],o=c[6],e.bezierCurveTo(c[1],c[2],c[3],c[4],n,o);break;case "c":e.bezierCurveTo(n+c[1],o+c[2],n+c[3],o+c[4],n+c[5],o+c[6]),n+=c[5],o+=c[6];break;case "S":n=c[3],o=c[4],e.bezierCurveToShort(c[1],c[2],n,o);break;case "s":e.bezierCurveToShort(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "Q":n=c[3],o=c[4],e.quadraticCurveTo(c[1],c[2],n,o);break;case "q":e.quadraticCurveTo(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "T":n=c[1],o=c[2],e.quadraticCurveToShort(n,o);break;case "t":n+=c[1],o+=c[2],e.quadraticCurveToShort(n,o);break;case "A":n=c[6],o=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "a":n+=c[6],o+=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "Z":case "z":e.closePath(),i.length>0&&(s=i.pop(),s?(n=s.startX,o=s.startY):(n=0,o=0)),s=null;break;default:F(`Unknown SVG path command: ${l}`);}l!=="Z"&&l!=="z"&&s===null&&(s={startX:n,startY:o},i.push(s));}return e}var PC,q0=f(()=>{PC=Wd(CC());_e();});var iu,K0=f(()=>{Ze();iu=class r{constructor(e=0,t=0,i=0){this.type="circle",this.x=e,this.y=t,this.radius=i;}clone(){return new r(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return false;let i=this.radius*this.radius,s=this.x-e,n=this.y-t;return s*=s,n*=n,s+n<=i}strokeContains(e,t,i,s=.5){if(this.radius===0)return false;let n=this.x-e,o=this.y-t,a=this.radius,u=(1-s)*i,l=Math.sqrt(n*n+o*o);return l<=a+u&&l>a-(i-u)}getBounds(e){return e||(e=new Z),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}};});var su,Z0=f(()=>{Ze();su=class r{constructor(e=0,t=0,i=0,s=0){this.type="ellipse",this.x=e,this.y=t,this.halfWidth=i,this.halfHeight=s;}clone(){return new r(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return false;let i=(e-this.x)/this.halfWidth,s=(t-this.y)/this.halfHeight;return i*=i,s*=s,i+s<=1}strokeContains(e,t,i,s=.5){let{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return false;let a=i*(1-s),u=i-a,l=n-u,c=o-u,h=n+a,d=o+a,p=e-this.x,_=t-this.y,b=p*p/(l*l)+_*_/(c*c),x=p*p/(h*h)+_*_/(d*d);return b>1&&x<=1}getBounds(e){return e||(e=new Z),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};});function Is(r,e,t,i,s,n){let o=r-t,a=e-i,u=s-t,l=n-i,c=o*u+a*l,h=u*u+l*l,d=-1;h!==0&&(d=c/h);let p,_;d<0?(p=t,_=i):d>1?(p=s,_=n):(p=t+d*u,_=i+d*l);let b=r-p,x=e-_;return b*b+x*x}var qp=f(()=>{});var FD,OD,ks,Q0=f(()=>{qp();Ze();ks=class r{constructor(...e){this.type="polygon";let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){let i=[];for(let s=0,n=t.length;s<n;s++)i.push(t[s].x,t[s].y);t=i;}this.points=t,this.closePath=true;}isClockwise(){let e=0,t=this.points,i=t.length;for(let s=0;s<i;s+=2){let n=t[s],o=t[s+1],a=t[(s+2)%i],u=t[(s+3)%i];e+=(a-n)*(u+o);}return e<0}containsPolygon(e){let t=this.getBounds(FD),i=e.getBounds(OD);if(!t.containsRect(i))return false;let s=e.points;for(let n=0;n<s.length;n+=2){let o=s[n],a=s[n+1];if(!this.contains(o,a))return false}return true}clone(){let e=this.points.slice(),t=new r(e);return t.closePath=this.closePath,t}contains(e,t){let i=false,s=this.points.length/2;for(let n=0,o=s-1;n<s;o=n++){let a=this.points[n*2],u=this.points[n*2+1],l=this.points[o*2],c=this.points[o*2+1];u>t!=c>t&&e<(l-a)*((t-u)/(c-u))+a&&(i=!i);}return i}strokeContains(e,t,i,s=.5){let n=i*i,o=n*(1-s),a=n-o,{points:u}=this,l=u.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){let h=u[c],d=u[c+1],p=u[(c+2)%u.length],_=u[(c+3)%u.length],b=Is(e,t,h,d,p,_),x=Math.sign((p-h)*(t-d)-(_-d)*(e-h));if(b<=(x<0?a:o))return true}return false}getBounds(e){e||(e=new Z);let t=this.points,i=1/0,s=-1/0,n=1/0,o=-1/0;for(let a=0,u=t.length;a<u;a+=2){let l=t[a],c=t[a+1];i=l<i?l:i,s=l>s?l:s,n=c<n?c:n,o=c>o?c:o;}return e.x=i,e.width=s-i,e.y=n,e.height=o-n,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}};});var Kp,nu,J0=f(()=>{Ze();Kp=(r,e,t,i,s,n,o)=>{let a=r-t,u=e-i,l=Math.sqrt(a*a+u*u);return l>=s-n&&l<=s+o},nu=class r{constructor(e=0,t=0,i=0,s=0,n=20){this.type="roundedRectangle",this.x=e,this.y=t,this.width=i,this.height=s,this.radius=n;}getBounds(e){return e||(e=new Z),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new r(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return false;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return true;let s=e-(this.x+i),n=t-(this.y+i),o=i*i;if(s*s+n*n<=o||(s=e-(this.x+this.width-i),s*s+n*n<=o)||(n=t-(this.y+this.height-i),s*s+n*n<=o)||(s=e-(this.x+i),s*s+n*n<=o))return true}return false}strokeContains(e,t,i,s=.5){let{x:n,y:o,width:a,height:u,radius:l}=this,c=i*(1-s),h=i-c,d=n+l,p=o+l,_=a-l*2,b=u-l*2,x=n+a,m=o+u;return (e>=n-c&&e<=n+h||e>=x-h&&e<=x+c)&&t>=p&&t<=p+b||(t>=o-c&&t<=o+h||t>=m-h&&t<=m+c)&&e>=d&&e<=d+_?true:e<d&&t<p&&Kp(e,t,d,p,l,h,c)||e>x-l&&t<p&&Kp(e,t,x-l,p,l,h,c)||e>x-l&&t>m-l&&Kp(e,t,x-l,m-l,l,h,c)||e<d&&t>m-l&&Kp(e,t,d,m-l,l,h,c)}toString(){return `[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};});function au(r,e,t,i,s,n,o,a,u,l){let h=Math.min(.99,Math.max(0,l??Ms.defaultOptions.bezierSmoothness)),d=(UD-h)/1;return d*=d,LD(e,t,i,s,n,o,a,u,r,d),r}function LD(r,e,t,i,s,n,o,a,u,l){tv(r,e,t,i,s,n,o,a,u,l,0),u.push(o,a);}function tv(r,e,t,i,s,n,o,a,u,l,c){if(c>GD)return;let h=Math.PI,d=(r+t)/2,p=(e+i)/2,_=(t+s)/2,b=(i+n)/2,x=(s+o)/2,m=(n+a)/2,v=(d+_)/2,T=(p+b)/2,S=(_+x)/2,B=(b+m)/2,A=(v+S)/2,R=(T+B)/2;if(c>0){let Y=o-r,M=a-e,U=Math.abs((t-o)*M-(i-a)*Y),k=Math.abs((s-o)*M-(n-a)*Y),J,ge;if(U>Zp&&k>Zp){if((U+k)*(U+k)<=l*(Y*Y+M*M)){if(ou<ev){u.push(A,R);return}let Ke=Math.atan2(n-i,s-t);if(J=Math.abs(Ke-Math.atan2(i-e,t-r)),ge=Math.abs(Math.atan2(a-n,o-s)-Ke),J>=h&&(J=2*h-J),ge>=h&&(ge=2*h-ge),J+ge<ou){u.push(A,R);return}if(Kn!==0){if(J>Kn){u.push(t,i);return}if(ge>Kn){u.push(s,n);return}}}}else if(U>Zp){if(U*U<=l*(Y*Y+M*M)){if(ou<ev){u.push(A,R);return}if(J=Math.abs(Math.atan2(n-i,s-t)-Math.atan2(i-e,t-r)),J>=h&&(J=2*h-J),J<ou){u.push(t,i),u.push(s,n);return}if(Kn!==0&&J>Kn){u.push(t,i);return}}}else if(k>Zp){if(k*k<=l*(Y*Y+M*M)){if(ou<ev){u.push(A,R);return}if(J=Math.abs(Math.atan2(a-n,o-s)-Math.atan2(n-i,s-t)),J>=h&&(J=2*h-J),J<ou){u.push(t,i),u.push(s,n);return}if(Kn!==0&&J>Kn){u.push(s,n);return}}}else if(Y=A-(r+o)/2,M=R-(e+a)/2,Y*Y+M*M<=l){u.push(A,R);return}}tv(r,e,d,p,v,T,A,R,u,l,c+1),tv(A,R,S,B,x,m,o,a,u,l,c+1);}var GD,Zp,UD,ev,ou,Kn,Qp=f(()=>{Mc();GD=8,Zp=11920929e-14,UD=1,ev=.01,ou=0,Kn=0;});function Jp(r,e,t,i,s,n,o,a){let l=Math.min(.99,Math.max(0,a??Ms.defaultOptions.bezierSmoothness)),c=(VD-l)/1;return c*=c,WD(e,t,i,s,n,o,r,c),r}function WD(r,e,t,i,s,n,o,a){rv(o,r,e,t,i,s,n,a,0),o.push(s,n);}function rv(r,e,t,i,s,n,o,a,u){if(u>ND)return;let l=Math.PI,c=(e+i)/2,h=(t+s)/2,d=(i+n)/2,p=(s+o)/2,_=(c+d)/2,b=(h+p)/2,x=n-e,m=o-t,v=Math.abs((i-n)*m-(s-o)*x);if(v>HD){if(v*v<=a*(x*x+m*m)){if(wC<zD){r.push(_,b);return}let T=Math.abs(Math.atan2(o-s,n-i)-Math.atan2(s-t,i-e));if(T>=l&&(T=2*l-T),T<wC){r.push(_,b);return}}}else if(x=_-(e+n)/2,m=b-(t+o)/2,x*x+m*m<=a){r.push(_,b);return}rv(r,e,t,c,h,_,b,a,u+1),rv(r,_,b,d,p,n,o,a,u+1);}var ND,HD,VD,zD,wC,iv=f(()=>{Mc();ND=8,HD=11920929e-14,VD=1,zD=.01,wC=0;});function uu(r,e,t,i,s,n,o,a){let u=Math.abs(s-n);(!o&&s>n||o&&n>s)&&(u=2*Math.PI-u),a||(a=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(u/Math.PI)))),a=Math.max(a,3);let l=u/a,c=s;l*=o?-1:1;for(let h=0;h<a+1;h++){let d=Math.cos(c),p=Math.sin(c),_=e+d*i,b=t+p*i;r.push(_,b),c+=l;}}var em=f(()=>{});function tm(r,e,t,i,s,n){let o=r[r.length-2],u=r[r.length-1]-t,l=o-e,c=s-t,h=i-e,d=Math.abs(u*h-l*c);if(d<1e-8||n===0){(r[r.length-2]!==e||r[r.length-1]!==t)&&r.push(e,t);return}let p=u*u+l*l,_=c*c+h*h,b=u*c+l*h,x=n*Math.sqrt(p)/d,m=n*Math.sqrt(_)/d,v=x*b/p,T=m*b/_,S=x*h+m*l,B=x*c+m*u,A=l*(m+v),R=u*(m+v),Y=h*(x+T),M=c*(x+T),U=Math.atan2(R-B,A-S),k=Math.atan2(M-B,Y-S);uu(r,S+e,B+t,n,U,k,l*c>h*u);}var sv=f(()=>{em();});function XD(r,e){let t=e===-1.5707963267948966?-0.551915024494:1.3333333333333333*Math.tan(e/4),i=e===1.5707963267948966?.551915024494:t,s=Math.cos(r),n=Math.sin(r),o=Math.cos(r+e),a=Math.sin(r+e);return [{x:s-n*i,y:n+s*i},{x:o+a*i,y:a-o*i},{x:o,y:a}]}function rm(r,e,t,i,s,n,o,a=0,u=0,l=0){if(n===0||o===0)return;let c=Math.sin(a*Gc/360),h=Math.cos(a*Gc/360),d=h*(e-i)/2+c*(t-s)/2,p=-c*(e-i)/2+h*(t-s)/2;if(d===0&&p===0)return;n=Math.abs(n),o=Math.abs(o);let _=Math.pow(d,2)/Math.pow(n,2)+Math.pow(p,2)/Math.pow(o,2);_>1&&(n*=Math.sqrt(_),o*=Math.sqrt(_)),YD(e,t,i,s,n,o,u,l,c,h,d,p,nv);let{ang1:b,ang2:x}=nv,{centerX:m,centerY:v}=nv,T=Math.abs(x)/(Gc/4);Math.abs(1-T)<1e-7&&(T=1);let S=Math.max(Math.ceil(T),1);x/=S;let B=r[r.length-2],A=r[r.length-1],R={x:0,y:0};for(let Y=0;Y<S;Y++){let M=XD(b,x),{x:U,y:k}=ov(M[0],n,o,h,c,m,v,R),{x:J,y:ge}=ov(M[1],n,o,h,c,m,v,R),{x:Ke,y:ts}=ov(M[2],n,o,h,c,m,v,R);au(r,B,A,U,k,J,ge,Ke,ts),B=Ke,A=ts,b+=x;}}var Gc,nv,ov,BC,YD,av=f(()=>{Qp();Gc=Math.PI*2,nv={centerX:0,centerY:0,ang1:0,ang2:0},ov=({x:r,y:e},t,i,s,n,o,a,u)=>{r*=t,e*=i;let l=s*r-n*e,c=n*r+s*e;return u.x=l+o,u.y=c+a,u};BC=(r,e,t,i)=>{let s=r*i-e*t<0?-1:1,n=r*t+e*i;return n>1&&(n=1),n<-1&&(n=-1),s*Math.acos(n)},YD=(r,e,t,i,s,n,o,a,u,l,c,h,d)=>{let p=Math.pow(s,2),_=Math.pow(n,2),b=Math.pow(c,2),x=Math.pow(h,2),m=p*_-p*x-_*b;m<0&&(m=0),m/=p*x+_*b,m=Math.sqrt(m)*(o===a?-1:1);let v=m*s/n*h,T=m*-n/s*c,S=l*v-u*T+(r+t)/2,B=u*v+l*T+(e+i)/2,A=(c-v)/s,R=(h-T)/n,Y=(-c-v)/s,M=(-h-T)/n,U=BC(1,0,A,R),k=BC(A,R,Y,M);a===0&&k>0&&(k-=Gc),a===1&&k<0&&(k+=Gc),d.centerX=S,d.centerY=B,d.ang1=U,d.ang2=k;};});function im(r,e,t){let i=(o,a)=>{let u=a.x-o.x,l=a.y-o.y,c=Math.sqrt(u*u+l*l),h=u/c,d=l/c;return {len:c,nx:h,ny:d}},s=(o,a)=>{o===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y);},n=e[e.length-1];for(let o=0;o<e.length;o++){let a=e[o%e.length],u=a.radius??t;if(u<=0){s(o,a),n=a;continue}let l=e[(o+1)%e.length],c=i(a,n),h=i(a,l);if(c.len<1e-4||h.len<1e-4){s(o,a),n=a;continue}let d=Math.asin(c.nx*h.ny-c.ny*h.nx),p=1,_=false;c.nx*h.nx-c.ny*-h.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,p=-1,_=true):d>0&&(p=-1,_=true);let b=d/2,x,m=Math.abs(Math.cos(b)*u/Math.sin(b));m>Math.min(c.len/2,h.len/2)?(m=Math.min(c.len/2,h.len/2),x=Math.abs(m*Math.sin(b)/Math.cos(b))):x=u;let v=a.x+h.nx*m+-h.ny*x*p,T=a.y+h.ny*m+h.nx*x*p,S=Math.atan2(c.ny,c.nx)+Math.PI/2*p,B=Math.atan2(h.ny,h.nx)-Math.PI/2*p;o===0&&r.moveTo(v+Math.cos(S)*x,T+Math.sin(S)*x),r.arc(v,T,x,S,B,_),n=a;}}function sm(r,e,t,i){let s=(a,u)=>Math.sqrt((a.x-u.x)**2+(a.y-u.y)**2),n=(a,u,l)=>({x:a.x+(u.x-a.x)*l,y:a.y+(u.y-a.y)*l}),o=e.length;for(let a=0;a<o;a++){let u=e[(a+1)%o],l=u.radius??t;if(l<=0){a===0?r.moveTo(u.x,u.y):r.lineTo(u.x,u.y);continue}let c=e[a],h=e[(a+2)%o],d=s(c,u),p;if(d<1e-4)p=u;else {let x=Math.min(d/2,l);p=n(u,c,x/d);}let _=s(h,u),b;if(_<1e-4)b=u;else {let x=Math.min(_/2,l);b=n(u,h,x/_);}a===0?r.moveTo(p.x,p.y):r.lineTo(p.x,p.y),r.quadraticCurveTo(u.x,u.y,b.x,b.y,i);}}var uv=f(()=>{});var $D,lu,lv=f(()=>{K0();Z0();Q0();Ze();J0();Et();Qp();iv();em();sv();av();uv();$D=new Z,lu=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new me,this._graphicsPath2D=e,this.signed=e.checkForHoles;}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let i=this._currentPoly.points,s=i[i.length-2],n=i[i.length-1];return (s!==e||n!==t)&&i.push(e,t),this}arc(e,t,i,s,n,o){this._ensurePoly(false);let a=this._currentPoly.points;return uu(a,e,t,i,s,n,o),this}arcTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly.points;return tm(o,e,t,i,s,n),this}arcToSvg(e,t,i,s,n,o,a){let u=this._currentPoly.points;return rm(u,this._currentPoly.lastX,this._currentPoly.lastY,o,a,e,t,i,s,n),this}bezierCurveTo(e,t,i,s,n,o,a){this._ensurePoly();let u=this._currentPoly;return au(this._currentPoly.points,u.lastX,u.lastY,e,t,i,s,n,o,a),this}quadraticCurveTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly;return Jp(this._currentPoly.points,o.lastX,o.lastY,e,t,i,s,n),this}closePath(){return this.endPoly(true),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(true),e.transform(t));let i=this.shapePrimitives,s=i.length;for(let n=0;n<e.instructions.length;n++){let o=e.instructions[n];this[o.action](...o.data);}if(e.checkForHoles&&i.length-s>1){let n=null;for(let o=s;o<i.length;o++){let a=i[o];if(a.shape.type==="polygon"){let u=a.shape,l=n?.shape;l&&l.containsPolygon(u)?(n.holes||(n.holes=[]),n.holes.push(a),i.copyWithin(o,o+1),i.length--,o--):n=a;}}}return this}finish(e=false){this.endPoly(e);}rect(e,t,i,s,n){return this.drawShape(new Z(e,t,i,s),n),this}circle(e,t,i,s){return this.drawShape(new iu(e,t,i),s),this}poly(e,t,i){let s=new ks(e);return s.closePath=t,this.drawShape(s,i),this}regularPoly(e,t,i,s,n=0,o){s=Math.max(s|0,3);let a=-1*Math.PI/2+n,u=Math.PI*2/s,l=[];for(let c=0;c<s;c++){let h=a-c*u;l.push(e+i*Math.cos(h),t+i*Math.sin(h));}return this.poly(l,true,o),this}roundPoly(e,t,i,s,n,o=0,a){if(s=Math.max(s|0,3),n<=0)return this.regularPoly(e,t,i,s,o);let u=i*Math.sin(Math.PI/s)-.001;n=Math.min(n,u);let l=-1*Math.PI/2+o,c=Math.PI*2/s,h=(s-2)*Math.PI/s/2;for(let d=0;d<s;d++){let p=d*c+l,_=e+i*Math.cos(p),b=t+i*Math.sin(p),x=p+Math.PI+h,m=p-Math.PI-h,v=_+n*Math.cos(x),T=b+n*Math.sin(x),S=_+n*Math.cos(m),B=b+n*Math.sin(m);d===0?this.moveTo(v,T):this.lineTo(v,T),this.quadraticCurveTo(_,b,S,B,a);}return this.closePath()}roundShape(e,t,i=false,s){return e.length<3?this:(i?sm(this,e,t,s):im(this,e,t),this.closePath())}filletRect(e,t,i,s,n){if(n===0)return this.rect(e,t,i,s);let o=Math.min(i,s)/2,a=Math.min(o,Math.max(-o,n)),u=e+i,l=t+s,c=a<0?-a:0,h=Math.abs(a);return this.moveTo(e,t+h).arcTo(e+c,t+c,e+h,t,h).lineTo(u-h,t).arcTo(u-c,t+c,u,t+h,h).lineTo(u,l-h).arcTo(u-c,l-c,e+i-h,l,h).lineTo(e+h,l).arcTo(e+c,l-c,e,l-h,h).closePath()}chamferRect(e,t,i,s,n,o){if(n<=0)return this.rect(e,t,i,s);let a=Math.min(n,Math.min(i,s)/2),u=e+i,l=t+s,c=[e+a,t,u-a,t,u,t+a,u,l-a,u-a,l,e+a,l,e,l-a,e,t+a];for(let h=c.length-1;h>=2;h-=2)c[h]===c[h-2]&&c[h-1]===c[h-3]&&c.splice(h-1,2);return this.poly(c,true,o)}ellipse(e,t,i,s,n){return this.drawShape(new su(e,t,i,s),n),this}roundRect(e,t,i,s,n,o){return this.drawShape(new nu(e,t,i,s,n),o),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let i=this._currentPoly;return i&&this.endPoly(),i=new ks,i.points.push(e,t),this._currentPoly=i,this}endPoly(e=false){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=true){if(!this._currentPoly&&(this._currentPoly=new ks,e)){let t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let i=t.shape.x,s=t.shape.y;if(t.transform&&!t.transform.isIdentity()){let n=t.transform,o=i;i=n.a*i+n.c*s+n.tx,s=n.b*o+n.d*s+n.ty;}this._currentPoly.points.push(i,s);}else this._currentPoly.points.push(0,0);}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];this[i.action](...i.data);}this.finish();}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let i=0;i<t.length;i++){let s=t[i],n=s.shape.getBounds($D);s.transform?e.addRect(n,s.transform):e.addRect(n);}return e}};});function Uc(r,e){return r?r.prepend(e):e.clone()}var ui,nm=f(()=>{jt();lt();_e();q0();lv();ui=class r{constructor(e,t=false){this.instructions=[],this.uid=re("graphicsPath"),this._dirty=true,this.checkForHoles=t,typeof e=="string"?jp(e,this):this.instructions=e?.slice()??[];}get shapePath(){return this._shapePath||(this._shapePath=new lu(this)),this._dirty&&(this._dirty=false,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,t]}),this._dirty=true,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=true,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=true,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=true,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=true,this}bezierCurveToShort(e,t,i,s,n){let o=this.instructions[this.instructions.length-1],a=this.getLastPoint(ne.shared),u=0,l=0;if(!o||o.action!=="bezierCurveTo")u=a.x,l=a.y;else {u=o.data[2],l=o.data[3];let c=a.x,h=a.y;u=c+(c-u),l=h+(h-l);}return this.instructions.push({action:"bezierCurveTo",data:[u,l,e,t,i,s,n]}),this._dirty=true,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=true,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=true,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=true,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=true,this}quadraticCurveToShort(e,t,i){let s=this.instructions[this.instructions.length-1],n=this.getLastPoint(ne.shared),o=0,a=0;if(!s||s.action!=="quadraticCurveTo")o=n.x,a=n.y;else {o=s.data[0],a=s.data[1];let u=n.x,l=n.y;o=u+(u-o),a=l+(l-a);}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,e,t,i]}),this._dirty=true,this}rect(e,t,i,s,n){return this.instructions.push({action:"rect",data:[e,t,i,s,n]}),this._dirty=true,this}circle(e,t,i,s){return this.instructions.push({action:"circle",data:[e,t,i,s]}),this._dirty=true,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=true,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=true,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=true,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=true,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=true,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=true,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=true,this}star(e,t,i,s,n,o,a){n||(n=s/2);let u=-1*Math.PI/2+o,l=i*2,c=Math.PI*2/l,h=[];for(let d=0;d<l;d++){let p=d%2?n:s,_=d*c+u;h.push(e+p*Math.cos(_),t+p*Math.sin(_));}return this.poly(h,true,a),this}clone(e=false){let t=new r;if(t.checkForHoles=this.checkForHoles,!e)t.instructions=this.instructions.slice();else for(let i=0;i<this.instructions.length;i++){let s=this.instructions[i];t.instructions.push({action:s.action,data:s.data.slice()});}return t}clear(){return this.instructions.length=0,this._dirty=true,this}transform(e){if(e.isIdentity())return this;let t=e.a,i=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,u=0,l=0,c=0,h=0,d=0,p=0,_=0,b=0;for(let x=0;x<this.instructions.length;x++){let m=this.instructions[x],v=m.data;switch(m.action){case "moveTo":case "lineTo":u=v[0],l=v[1],v[0]=t*u+s*l+o,v[1]=i*u+n*l+a;break;case "bezierCurveTo":c=v[0],h=v[1],d=v[2],p=v[3],u=v[4],l=v[5],v[0]=t*c+s*h+o,v[1]=i*c+n*h+a,v[2]=t*d+s*p+o,v[3]=i*d+n*p+a,v[4]=t*u+s*l+o,v[5]=i*u+n*l+a;break;case "quadraticCurveTo":c=v[0],h=v[1],u=v[2],l=v[3],v[0]=t*c+s*h+o,v[1]=i*c+n*h+a,v[2]=t*u+s*l+o,v[3]=i*u+n*l+a;break;case "arcToSvg":u=v[5],l=v[6],_=v[0],b=v[1],v[0]=t*_+s*b,v[1]=i*_+n*b,v[5]=t*u+s*l+o,v[6]=i*u+n*l+a;break;case "circle":v[4]=Uc(v[3],e);break;case "rect":v[4]=Uc(v[4],e);break;case "ellipse":v[8]=Uc(v[8],e);break;case "roundRect":v[5]=Uc(v[5],e);break;case "addPath":v[0].transform(e);break;case "poly":v[2]=Uc(v[2],e);break;default:F("unknown transform action",m.action);break}}return this._dirty=true,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,i=this.instructions[t];if(!i)return e.x=0,e.y=0,e;for(;i.action==="closePath";){if(t--,t<0)return e.x=0,e.y=0,e;i=this.instructions[t];}switch(i.action){case "moveTo":case "lineTo":e.x=i.data[0],e.y=i.data[1];break;case "quadraticCurveTo":e.x=i.data[2],e.y=i.data[3];break;case "bezierCurveTo":e.x=i.data[4],e.y=i.data[5];break;case "arc":case "arcToSvg":e.x=i.data[5],e.y=i.data[6];break;case "addPath":i.data[0].getLastPoint(e);break}return e}};});function Ge(r,e,t){let i=r.getAttribute(e);return i?Number(i):t}var om=f(()=>{});function am(r,e){let t=r.querySelectorAll("defs");for(let i=0;i<t.length;i++){let s=t[i];for(let n=0;n<s.children.length;n++){let o=s.children[n];switch(o.nodeName.toLowerCase()){case "lineargradient":e.defs[o.id]=jD(o);break;case "radialgradient":e.defs[o.id]=qD();break;}}}}function jD(r){let e=Ge(r,"x1",0),t=Ge(r,"y1",0),i=Ge(r,"x2",1),s=Ge(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new It(e,t,i,s,n==="objectBoundingBox"?"local":"global");for(let a=0;a<r.children.length;a++){let u=r.children[a],l=Ge(u,"offset",0),c=K.shared.setValue(u.getAttribute("stop-color")).toNumber();o.addColorStop(l,c);}return o}function qD(r){return F("[SVG Parser] Radial gradients are not yet supported"),new It(0,0,1,0)}var cv=f(()=>{it();_e();Vn();om();});function Lc(r){let e=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}var hv=f(()=>{});function Nc(r,e){let t=r.getAttribute("style"),i={},s={},n={strokeStyle:i,fillStyle:s,useFill:false,useStroke:false};for(let o in um){let a=r.getAttribute(o);a&&RC(e,n,o,a.trim());}if(t){let o=t.split(";");for(let a=0;a<o.length;a++){let u=o[a].trim(),[l,c]=u.split(":");um[l]&&RC(e,n,l,c.trim());}}return {strokeStyle:n.useStroke?i:null,fillStyle:n.useFill?s:null,useFill:n.useFill,useStroke:n.useStroke}}function RC(r,e,t,i){switch(t){case "stroke":if(i!=="none"){if(i.startsWith("url(")){let s=Lc(i);e.strokeStyle.fill=r.defs[s];}else e.strokeStyle.color=K.shared.setValue(i).toNumber();e.useStroke=true;}break;case "stroke-width":e.strokeStyle.width=Number(i);break;case "fill":if(i!=="none"){if(i.startsWith("url(")){let s=Lc(i);e.fillStyle.fill=r.defs[s];}else e.fillStyle.color=K.shared.setValue(i).toNumber();e.useFill=true;}break;case "fill-opacity":e.fillStyle.alpha=Number(i);break;case "stroke-opacity":e.strokeStyle.alpha=Number(i);break;case "opacity":e.fillStyle.alpha=Number(i),e.strokeStyle.alpha=Number(i);break}}var um,dv=f(()=>{it();hv();um={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};});function lm(r,e){if(typeof r=="string"){let o=document.createElement("div");o.innerHTML=r.trim(),r=o.querySelector("svg");}let t={context:e,defs:{},path:new ui};am(r,t);let i=r.children,{fillStyle:s,strokeStyle:n}=Nc(r,t);for(let o=0;o<i.length;o++){let a=i[o];a.nodeName.toLowerCase()!=="defs"&&MC(a,t,s,n);}return e}function MC(r,e,t,i){let s=r.children,{fillStyle:n,strokeStyle:o}=Nc(r,e);n&&t?t={...t,...n}:n&&(t=n),o&&i?i={...i,...o}:o&&(i=o);let a=!t&&!i;a&&(t={color:0});let u,l,c,h,d,p,_,b,x,m,v,T,S,B,A,R,Y;switch(r.nodeName.toLowerCase()){case "path":B=r.getAttribute("d"),r.getAttribute("fill-rule")==="evenodd"&&F("SVG Evenodd fill rule not supported, your svg may render incorrectly"),A=new ui(B,true),e.context.path(A),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "circle":_=Ge(r,"cx",0),b=Ge(r,"cy",0),x=Ge(r,"r",0),e.context.ellipse(_,b,x,x),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "rect":u=Ge(r,"x",0),l=Ge(r,"y",0),R=Ge(r,"width",0),Y=Ge(r,"height",0),m=Ge(r,"rx",0),v=Ge(r,"ry",0),m||v?e.context.roundRect(u,l,R,Y,m||v):e.context.rect(u,l,R,Y),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "ellipse":_=Ge(r,"cx",0),b=Ge(r,"cy",0),m=Ge(r,"rx",0),v=Ge(r,"ry",0),e.context.beginPath(),e.context.ellipse(_,b,m,v),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "line":c=Ge(r,"x1",0),h=Ge(r,"y1",0),d=Ge(r,"x2",0),p=Ge(r,"y2",0),e.context.beginPath(),e.context.moveTo(c,h),e.context.lineTo(d,p),i&&e.context.stroke(i);break;case "polygon":S=r.getAttribute("points"),T=S.match(/\d+/g).map(M=>parseInt(M,10)),e.context.poly(T,true),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "polyline":S=r.getAttribute("points"),T=S.match(/\d+/g).map(M=>parseInt(M,10)),e.context.poly(T,false),i&&e.context.stroke(i);break;case "g":case "svg":break;default:{F(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}a&&(t=null);for(let M=0;M<s.length;M++)MC(s[M],e,t,i);}var fv=f(()=>{_e();nm();cv();om();dv();});function KD(r){return K.isColorLike(r)}function DC(r){return r instanceof Hr}function IC(r){return r instanceof It}function ZD(r){return r instanceof C}function QD(r,e,t){let i=K.shared.setValue(e??0);return r.color=i.toNumber(),r.alpha=i.alpha===1?t.alpha:i.alpha,r.texture=C.WHITE,{...t,...r}}function JD(r,e,t){return r.texture=e,{...t,...r}}function kC(r,e,t){return r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,{...t,...r}}function FC(r,e,t){return e.buildGradient(),r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,r.textureSpace=e.textureSpace,{...t,...r}}function eI(r,e){let t={...e,...r},i=K.shared.setValue(t.color);return t.alpha*=i.alpha,t.color=i.toNumber(),t}function Vr(r,e){if(r==null)return null;let t={},i=r;return KD(r)?QD(t,r,e):ZD(r)?JD(t,r,e):DC(r)?kC(t,r,e):IC(r)?FC(t,r,e):i.fill&&DC(i.fill)?kC(i,i.fill,e):i.fill&&IC(i.fill)?FC(i,i.fill,e):eI(i,e)}function Fs(r,e){let{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...u}=e,l=Vr(r,u);return l?{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...l}:null}var cm=f(()=>{it();ce();Vn();Oc();});var tI,OC,pv,Je,Zn=f(()=>{St();it();he();jt();ce();lt();xe();Et();nm();fv();cm();tI=new ne,OC=new D,pv=class li extends ue{constructor(){super(...arguments),this.uid=re("graphicsContext"),this.dirty=true,this.batchMode="auto",this.instructions=[],this._activePath=new ui,this._transform=new D,this._fillStyle={...li.defaultFillStyle},this._strokeStyle={...li.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new me,this._boundsDirty=true;}clone(){let e=new li;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=true,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=Vr(e,li.defaultFillStyle);}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=Fs(e,li.defaultStrokeStyle);}setFillStyle(e){return this._fillStyle=Vr(e,li.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=Vr(e,li.defaultStrokeStyle),this}texture(e,t,i,s,n,o){return this.instructions.push({action:"texture",data:{image:e,dx:i||0,dy:s||0,dw:n||e.frame.width,dh:o||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t?K.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new ui,this}fill(e,t){let i,s=this.instructions[this.instructions.length-1];return this._tick===0&&s&&s.action==="stroke"?i=s.data.path:i=this._activePath.clone(),i?(e!=null&&(t!==void 0&&typeof e=="number"&&(I(H,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:t}),this._fillStyle=Vr(e,li.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(ne.shared);this._activePath.clear(),this._activePath.moveTo(e,t);}stroke(e){let t,i=this.instructions[this.instructions.length-1];return this._tick===0&&i&&i.action==="fill"?t=i.data.path:t=this._activePath.clone(),t?(e!=null&&(this._strokeStyle=Fs(e,li.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:t}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],i=this._activePath.clone();if(t&&(t.action==="stroke"||t.action==="fill"))if(t.data.hole)t.data.hole.addPath(i);else {t.data.hole=i;break}}return this._initNextPathLocation(),this}arc(e,t,i,s,n,o){this._tick++;let a=this._transform;return this._activePath.arc(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,i,s,n,o),this}arcTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.arcTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}arcToSvg(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.arcToSvg(e,t,i,s,n,u.a*o+u.c*a+u.tx,u.b*o+u.d*a+u.ty),this}bezierCurveTo(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.bezierCurveTo(u.a*e+u.c*t+u.tx,u.b*e+u.d*t+u.ty,u.a*i+u.c*s+u.tx,u.b*i+u.d*s+u.ty,u.a*n+u.c*o+u.tx,u.b*n+u.d*o+u.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,i,s){return this._tick++,this._activePath.ellipse(e,t,i,s,this._transform.clone()),this}circle(e,t,i){return this._tick++,this._activePath.circle(e,t,i,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let i=this._transform;return this._activePath.lineTo(i.a*e+i.c*t+i.tx,i.b*e+i.d*t+i.ty),this}moveTo(e,t){this._tick++;let i=this._transform,s=this._activePath.instructions,n=i.a*e+i.c*t+i.tx,o=i.b*e+i.d*t+i.ty;return s.length===1&&s[0].action==="moveTo"?(s[0].data[0]=n,s[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.quadraticCurveTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}rect(e,t,i,s){return this._tick++,this._activePath.rect(e,t,i,s,this._transform.clone()),this}roundRect(e,t,i,s,n){return this._tick++,this._activePath.roundRect(e,t,i,s,n,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,i,s,n=0,o){return this._tick++,this._activePath.regularPoly(e,t,i,s,n,o),this}roundPoly(e,t,i,s,n,o){return this._tick++,this._activePath.roundPoly(e,t,i,s,n,o),this}roundShape(e,t,i,s){return this._tick++,this._activePath.roundShape(e,t,i,s),this}filletRect(e,t,i,s,n){return this._tick++,this._activePath.filletRect(e,t,i,s,n),this}chamferRect(e,t,i,s,n,o){return this._tick++,this._activePath.chamferRect(e,t,i,s,n,o),this}star(e,t,i,s,n=0,o=0){return this._tick++,this._activePath.star(e,t,i,s,n,o,this._transform.clone()),this}svg(e){return this._tick++,lm(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,i,s,n,o){return e instanceof D?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,i,s,n,o),this)}transform(e,t,i,s,n,o){return e instanceof D?(this._transform.append(e),this):(OC.set(e,t,i,s,n,o),this._transform.append(OC),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=true,this._boundsDirty=true);}get bounds(){if(!this._boundsDirty)return this._bounds;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let i=this.instructions[t],s=i.action;if(s==="fill"){let n=i.data;e.addBounds(n.path.bounds);}else if(s==="texture"){let n=i.data;e.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform);}if(s==="stroke"){let n=i.data,o=n.style.alignment,a=n.style.width*(1-o),u=n.path.bounds;e.addFrame(u.minX-a,u.minY-a,u.maxX+a,u.maxY+a);}}return e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return false;let t=this.instructions,i=false;for(let s=0;s<t.length;s++){let n=t[s],o=n.data,a=o.path;if(!n.action||!a)continue;let u=o.style,l=a.shapePath.shapePrimitives;for(let c=0;c<l.length;c++){let h=l[c].shape;if(!u||!h)continue;let d=l[c].transform,p=d?d.applyInverse(e,tI):e;if(n.action==="fill")i=h.contains(p.x,p.y);else {let b=u;i=h.strokeContains(p.x,p.y,b.width,b.alignment);}let _=o.hole;if(_){let b=_.shapePath?.shapePrimitives;if(b)for(let x=0;x<b.length;x++)b[x].shape.contains(p.x,p.y)&&(i=false);}if(i)return true}}return i}destroy(e=false){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fillStyle.texture&&this._fillStyle.texture.destroy(i),this._strokeStyle.texture&&this._strokeStyle.texture.destroy(i);}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null;}};pv.defaultFillStyle={color:16777215,alpha:1,texture:C.WHITE,matrix:null,fill:null,textureSpace:"local"};pv.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:C.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:false};Je=pv;});function hm(r){let e=[],t=0;for(let i=0;i<GC.length;i++){let s=`_${GC[i]}`;e[t++]=r[s];}return t=UC(r._fill,e,t),t=iI(r._stroke,e,t),t=sI(r.dropShadow,e,t),t=rI(r.filters,e,t),e.join("-")}function rI(r,e,t){if(!r)return t;for(let i of r)e[t++]=i.uid;return t}function UC(r,e,t){return r&&(e[t++]=r.color,e[t++]=r.alpha,e[t++]=r.fill?.styleKey),t}function iI(r,e,t){return r&&(t=UC(r,e,t),e[t++]=r.width,e[t++]=r.alignment,e[t++]=r.cap,e[t++]=r.join,e[t++]=r.miterLimit),t}function sI(r,e,t){return r&&(e[t++]=r.alpha,e[t++]=r.angle,e[t++]=r.blur,e[t++]=r.distance,e[t++]=K.shared.setValue(r.color).toNumber()),t}var GC,mv=f(()=>{it();GC=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];});function nI(r){let e=r;if(typeof e.dropShadow=="boolean"&&e.dropShadow){let t=gt.defaultDropShadow;r.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance};}if(e.strokeThickness!==void 0){I(H,"strokeThickness is now a part of stroke");let t=e.stroke,i={};if(K.isColorLike(t))i.color=t;else if(t instanceof It||t instanceof Hr)i.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))i=t;else throw new Error("Invalid stroke value.");r.stroke={...i,width:e.strokeThickness};}if(Array.isArray(e.fillGradientStops)){I(H,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;r.fontSize==null?r.fontSize=gt.defaultTextStyle.fontSize:typeof r.fontSize=="string"?t=parseInt(r.fontSize,10):t=r.fontSize;let i=new It({start:{x:0,y:0},end:{x:0,y:(t||0)*1.7}}),s=e.fillGradientStops.map(n=>K.shared.setValue(n).toNumber());s.forEach((n,o)=>{let a=o/(s.length-1);i.addColorStop(a,n);}),r.fill={fill:i};}}var gv,gt,Os=f(()=>{St();it();xe();Vn();Oc();Zn();cm();mv();gv=class cu extends ue{constructor(e={}){super(),nI(e);let t={...cu.defaultTextStyle,...e};for(let i in t){let s=i;this[s]=t[i];}this.update();}get align(){return this._align}set align(e){this._align=e,this.update();}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update();}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...cu.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...cu.defaultDropShadow}):null,this.update();}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update();}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update();}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e.toLowerCase(),this.update();}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update();}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update();}get leading(){return this._leading}set leading(e){this._leading=e,this.update();}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update();}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update();}get padding(){return this._padding}set padding(e){this._padding=e,this.update();}get filters(){return this._filters}set filters(e){this._filters=e,this.update();}get trim(){return this._trim}set trim(e){this._trim=e,this.update();}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update();}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update();}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update();}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update();}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...Je.defaultFillStyle,...e},()=>{this._fill=Vr({...this._originalFill},Je.defaultFillStyle);})),this._fill=Vr(e===0?"black":e,Je.defaultFillStyle),this.update());}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...Je.defaultStrokeStyle,...e},()=>{this._stroke=Fs({...this._originalStroke},Je.defaultStrokeStyle);})),this._stroke=Fs(e,Je.defaultStrokeStyle),this.update());}_generateKey(){return this._styleKey=hm(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this);}reset(){let e=cu.defaultTextStyle;for(let t in e)this[t]=e[t];}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new cu({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0})}_getFinalPadding(){let e=0;if(this._filters)for(let t=0;t<this._filters.length;t++)e+=this._filters[t].padding;return Math.max(this._padding,e)}destroy(e=false){if(this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(i),this._originalFill?.texture&&this._originalFill.texture.destroy(i),this._stroke?.texture&&this._stroke.texture.destroy(i),this._originalStroke?.texture&&this._originalStroke.texture.destroy(i);}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null;}_createProxy(e,t){return new Proxy(e,{set:(i,s,n)=>(i[s]=n,t?.(s,n),this.update(),true)})}_isFillStyle(e){return (e??null)!==null&&!(K.isColorLike(e)||e instanceof It||e instanceof Hr)}};gv.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};gv.defaultTextStyle={align:"left",breakWords:false,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:false,whiteSpace:"pre",wordWrap:false,wordWrapWidth:100};gt=gv;});function hu(r,e,t,i){let s=oI;s.minX=0,s.minY=0,s.maxX=r.width/i|0,s.maxY=r.height/i|0;let n=be.getOptimalTexture(s.width,s.height,i,false);return n.source.uploadMethodId="image",n.source.resource=r,n.source.alphaMode="premultiply-alpha-on-upload",n.frame.width=e/i,n.frame.height=t/i,n.source.emit("update",n.source),n.updateUvs(),n}var oI,dm=f(()=>{Fr();Et();oI=new me;});var Hc,Vt,Qn=f(()=>{Se();Pa();Hc=class{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=false;}_createCanvasAndContext(e,t){let i=V.get().createCanvas();i.width=e,i.height=t;let s=i.getContext("2d");return {canvas:i,context:s}}getOptimalCanvasAndContext(e,t,i=1){e=Math.ceil(e*i-1e-6),t=Math.ceil(t*i-1e-6),e=kr(e),t=kr(t);let s=(e<<17)+(t<<1);this._canvasPool[s]||(this._canvasPool[s]=[]);let n=this._canvasPool[s].pop();return n||(n=this._createCanvasAndContext(e,t)),n}returnCanvasAndContext(e){let t=e.canvas,{width:i,height:s}=t,n=(i<<17)+(s<<1);e.context.clearRect(0,0,i,s),this._canvasPool[n].push(e);}clear(){this._canvasPool={};}},Vt=new Hc;});function aI(r,e){Jn||(Jn=V.get().createCanvas(256,128),Ni=Jn.getContext("2d",{willReadFrequently:true}),Ni.globalCompositeOperation="copy",Ni.globalAlpha=1),(Jn.width<r||Jn.height<e)&&(Jn.width=kr(r),Jn.height=kr(e));}function LC(r,e,t){for(let i=0,s=4*t*e;i<e;++i,s+=4)if(r[s+3]!==0)return false;return true}function NC(r,e,t,i,s){let n=4*e;for(let o=i,a=i*n+4*t;o<=s;++o,a+=n)if(r[a+3]!==0)return false;return true}function fm(...r){let e=r[0];e.canvas||(e={canvas:r[0],resolution:r[1]});let{canvas:t}=e,i=Math.min(e.resolution??1,1),s=e.width??t.width,n=e.height??t.height,o=e.output;if(aI(s,n),!Ni)throw new TypeError("Failed to get canvas 2D context");Ni.drawImage(t,0,0,s,n,0,0,s*i,n*i);let u=Ni.getImageData(0,0,s,n).data,l=0,c=0,h=s-1,d=n-1;for(;c<n&&LC(u,s,c);)++c;if(c===n)return Z.EMPTY;for(;LC(u,s,d);)--d;for(;NC(u,s,l,c,d);)++l;for(;NC(u,s,h,c,d);)--h;return ++h,++d,Ni.globalCompositeOperation="source-over",Ni.strokeRect(l,c,h-l,d-c),Ni.globalCompositeOperation="copy",o??(o=new Z),o.set(l/i,c/i,(h-l)/i,(d-c)/i),o}var Jn,Ni,xv=f(()=>{Se();Pa();Ze();Jn=null,Ni=null;});function Hi(r){let e=typeof r.fontSize=="number"?`${r.fontSize}px`:r.fontSize,t=r.fontFamily;Array.isArray(r.fontFamily)||(t=r.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let s=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(s)&&!uI.includes(s)&&(s=`"${s}"`),t[i]=s;}return `${r.fontStyle} ${r.fontVariant} ${r.fontWeight} ${e} ${t.join(",")}`}var uI,Vc=f(()=>{uI=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];});var _v,ci,xt,eo=f(()=>{Se();Vc();_v={willReadFrequently:true},ci=class ${static get experimentalLetterSpacingSupported(){let e=$._experimentalLetterSpacingSupported;if(e===void 0){let t=V.get().getCanvasRenderingContext2D().prototype;e=$._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t;}return e}constructor(e,t,i,s,n,o,a,u,l){this.text=e,this.style=t,this.width=i,this.height=s,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=u,this.fontProperties=l;}static measureText(e=" ",t,i=$._canvas,s=t.wordWrap){let n=Hi(t),o=$.measureFont(n);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);let a=$.__context;a.font=n;let l=(s?$._wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),c=new Array(l.length),h=0;for(let m=0;m<l.length;m++){let v=$._measureText(l[m],t.letterSpacing,a);c[m]=v,h=Math.max(h,v);}let d=t._stroke?.width||0,p=h+d;t.dropShadow&&(p+=t.dropShadow.distance);let _=t.lineHeight||o.fontSize,b=Math.max(_,o.fontSize+d)+(l.length-1)*(_+t.leading);return t.dropShadow&&(b+=t.dropShadow.distance),new $(e,t,p,b,l,c,_+t.leading,h,o)}static _measureText(e,t,i){let s=false;$.experimentalLetterSpacingSupported&&($.experimentalLetterSpacing?(i.letterSpacing=`${t}px`,i.textLetterSpacing=`${t}px`,s=true):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(e),o=n.width,a=-n.actualBoundingBoxLeft,l=n.actualBoundingBoxRight-a;if(o>0)if(s)o-=t,l-=t;else {let c=($.graphemeSegmenter(e).length-1)*t;o+=c,l+=c;}return Math.max(o,l)}static _wordWrap(e,t,i=$._canvas){let s=i.getContext("2d",_v),n=0,o="",a="",u=Object.create(null),{letterSpacing:l,whiteSpace:c}=t,h=$._collapseSpaces(c),d=$._collapseNewlines(c),p=!h,_=t.wordWrapWidth+l,b=$._tokenize(e);for(let x=0;x<b.length;x++){let m=b[x];if($._isNewline(m)){if(!d){a+=$._addLine(o),p=!h,o="",n=0;continue}m=" ";}if(h){let T=$.isBreakingSpace(m),S=$.isBreakingSpace(o[o.length-1]);if(T&&S)continue}let v=$._getFromCache(m,l,u,s);if(v>_)if(o!==""&&(a+=$._addLine(o),o="",n=0),$.canBreakWords(m,t.breakWords)){let T=$.wordWrapSplit(m);for(let S=0;S<T.length;S++){let B=T[S],A=B,R=1;for(;T[S+R];){let M=T[S+R];if(!$.canBreakChars(A,M,m,S,t.breakWords))B+=M;else break;A=M,R++;}S+=R-1;let Y=$._getFromCache(B,l,u,s);Y+n>_&&(a+=$._addLine(o),p=false,o="",n=0),o+=B,n+=Y;}}else {o.length>0&&(a+=$._addLine(o),o="",n=0);let T=x===b.length-1;a+=$._addLine(m,!T),p=false,o="",n=0;}else v+n>_&&(p=false,a+=$._addLine(o),o="",n=0),(o.length>0||!$.isBreakingSpace(m)||p)&&(o+=m,n+=v);}return a+=$._addLine(o,false),a}static _addLine(e,t=true){return e=$._trimRight(e),e=t?`${e}
|
|
375
|
+
`:e,e}static _getFromCache(e,t,i,s){let n=i[e];return typeof n!="number"&&(n=$._measureText(e,t,s)+t,i[e]=n),n}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return "";for(let t=e.length-1;t>=0;t--){let i=e[t];if(!$.isBreakingSpace(i))break;e=e.slice(0,-1);}return e}static _isNewline(e){return typeof e!="string"?false:$._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?false:$._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){let t=[],i="";if(typeof e!="string")return t;for(let s=0;s<e.length;s++){let n=e[s],o=e[s+1];if($.isBreakingSpace(n,o)||$._isNewline(n)){i!==""&&(t.push(i),i=""),t.push(n);continue}i+=n;}return i!==""&&t.push(i),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,i,s,n){return true}static wordWrapSplit(e){return $.graphemeSegmenter(e)}static measureFont(e){if($._fonts[e])return $._fonts[e];let t=$._context;t.font=e;let i=t.measureText($.METRICS_STRING+$.BASELINE_SYMBOL),s={ascent:i.actualBoundingBoxAscent,descent:i.actualBoundingBoxDescent,fontSize:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent};return $._fonts[e]=s,s}static clearMetrics(e=""){e?delete $._fonts[e]:$._fonts={};}static get _canvas(){if(!$.__canvas){let e;try{let t=new OffscreenCanvas(0,0);if(t.getContext("2d",_v)?.measureText)return $.__canvas=t,t;e=V.get().createCanvas();}catch{e=V.get().createCanvas();}e.width=e.height=10,$.__canvas=e;}return $.__canvas}static get _context(){return $.__context||($.__context=$._canvas.getContext("2d",_v)),$.__context}};ci.METRICS_STRING="|\xC9q\xC5";ci.BASELINE_SYMBOL="M";ci.BASELINE_MULTIPLIER=1.4;ci.HEIGHT_MULTIPLIER=2;ci.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){let r=new Intl.Segmenter;return e=>{let t=r.segment(e),i=[],s=0;for(let n of t)i[s++]=n.segment;return i}}return r=>[...r]})();ci.experimentalLetterSpacing=false;ci._fonts={};ci._newlines=[10,13];ci._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];xt=ci;});function Gs(r,e,t,i=0){if(r.texture===C.WHITE&&!r.fill)return K.shared.setValue(r.color).setAlpha(r.alpha??1).toHexa();if(r.fill){if(r.fill instanceof Hr){let s=r.fill,n=e.createPattern(s.texture.source.resource,"repeat"),o=s.transform.copyTo(D.shared);return o.scale(s.texture.frame.width,s.texture.frame.height),n.setTransform(o),n}else if(r.fill instanceof It){let s=r.fill,n=s.type==="linear",o=s.textureSpace==="local",a=1,u=1;o&&t&&(a=t.width+i,u=t.height+i);let l,c=false;if(n){let{start:h,end:d}=s;l=e.createLinearGradient(h.x*a,h.y*u,d.x*a,d.y*u),c=Math.abs(d.x-h.x)<Math.abs((d.y-h.y)*.1);}else {let{center:h,innerRadius:d,outerCenter:p,outerRadius:_}=s;l=e.createRadialGradient(h.x*a,h.y*u,d*a,p.x*a,p.y*u,_*a);}if(c&&o&&t){let h=t.lineHeight/u;for(let d=0;d<t.lines.length;d++){let p=(d*t.lineHeight+i/2)/u;s.colorStops.forEach(_=>{let b=p+_.offset*h;l.addColorStop(Math.floor(b*HC)/HC,K.shared.setValue(_.color).toHex());});}}else s.colorStops.forEach(h=>{l.addColorStop(h.offset,K.shared.setValue(h.color).toHex());});return l}}else {let s=e.createPattern(r.texture.source.resource,"repeat"),n=r.matrix.copyTo(D.shared);return n.scale(r.texture.frame.width,r.texture.frame.height),s.setTransform(n),s}return F("FillStyle not recognised",r),"red"}var HC,pm=f(()=>{it();he();ce();_e();Vn();Oc();HC=1e5;});var VC,bv,Vi,mm=f(()=>{it();Ze();Qn();xv();eo();Vc();pm();VC=new Z,bv=class{getCanvasAndContext(e){let{text:t,style:i,resolution:s=1}=e,n=i._getFinalPadding(),o=xt.measureText(t||" ",i),a=Math.ceil(Math.ceil(Math.max(1,o.width)+n*2)*s),u=Math.ceil(Math.ceil(Math.max(1,o.height)+n*2)*s),l=Vt.getOptimalCanvasAndContext(a,u);this._renderTextToCanvas(t,i,n,s,l);let c=i.trim?fm({canvas:l.canvas,width:a,height:u,resolution:1,output:VC}):VC.set(0,0,a,u);return {canvasAndContext:l,frame:c}}returnCanvasAndContext(e){Vt.returnCanvasAndContext(e);}_renderTextToCanvas(e,t,i,s,n){let{canvas:o,context:a}=n,u=Hi(t),l=xt.measureText(e||" ",t),c=l.lines,h=l.lineHeight,d=l.lineWidths,p=l.maxLineWidth,_=l.fontProperties,b=o.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=t.textBaseline,t._stroke?.width){let T=t._stroke;a.lineWidth=T.width,a.miterLimit=T.miterLimit,a.lineJoin=T.join,a.lineCap=T.cap;}a.font=u;let x,m,v=t.dropShadow?2:1;for(let T=0;T<v;++T){let S=t.dropShadow&&T===0,B=S?Math.ceil(Math.max(1,b)+i*2):0,A=B*s;if(S){a.fillStyle="black",a.strokeStyle="black";let M=t.dropShadow,U=M.color,k=M.alpha;a.shadowColor=K.shared.setValue(U).setAlpha(k).toRgbaString();let J=M.blur*s,ge=M.distance*s;a.shadowBlur=J,a.shadowOffsetX=Math.cos(M.angle)*ge,a.shadowOffsetY=Math.sin(M.angle)*ge+A;}else {if(a.fillStyle=t._fill?Gs(t._fill,a,l):null,t._stroke?.width){let M=t._stroke.width*t._stroke.alignment;a.strokeStyle=Gs(t._stroke,a,l,M);}a.shadowColor="black";}let R=(h-_.fontSize)/2;h-_.fontSize<0&&(R=0);let Y=t._stroke?.width??0;for(let M=0;M<c.length;M++)x=Y/2,m=Y/2+M*h+_.ascent+R,t.align==="right"?x+=p-d[M]:t.align==="center"&&(x+=(p-d[M])/2),t._stroke?.width&&this._drawLetterSpacing(c[M],t,n,x+i,m+i-B,true),t._fill!==void 0&&this._drawLetterSpacing(c[M],t,n,x+i,m+i-B);}}_drawLetterSpacing(e,t,i,s,n,o=false){let{context:a}=i,u=t.letterSpacing,l=false;if(xt.experimentalLetterSpacingSupported&&(xt.experimentalLetterSpacing?(a.letterSpacing=`${u}px`,a.textLetterSpacing=`${u}px`,l=true):(a.letterSpacing="0px",a.textLetterSpacing="0px")),u===0||l){o?a.strokeText(e,s,n):a.fillText(e,s,n);return}let c=s,h=xt.graphemeSegmenter(e),d=a.measureText(e).width,p=0;for(let _=0;_<h.length;++_){let b=h[_];o?a.strokeText(b,c,n):a.fillText(b,c,n);let x="";for(let m=_+1;m<h.length;++m)x+=h[m];p=a.measureText(x).width,c+=d-p+u,d=p;}}},Vi=new bv;});var to,yv=f(()=>{E();Fr();Mi();xe();Os();dm();mm();to=class{constructor(e){this._renderer=e;}getTexture(e,t,i,s){typeof e=="string"&&(I("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:i,resolution:t}),e.style instanceof gt||(e.style=new gt(e.style)),e.textureStyle instanceof st||(e.textureStyle=new st(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());let{text:n,style:o,textureStyle:a}=e,u=e.resolution??this._renderer.resolution,{frame:l,canvasAndContext:c}=Vi.getCanvasAndContext({text:n,style:o,resolution:u}),h=hu(c.canvas,l.width,l.height,u);if(a&&(h.source.style=a),o.trim&&(l.pad(o.padding),h.frame.copyFrom(l),h.updateUvs()),o.filters){let d=this._applyFilters(h,o.filters);return this.returnTexture(h),Vi.returnCanvasAndContext(c),d}return this._renderer.texture.initSource(h._source),Vi.returnCanvasAndContext(c),h}returnTexture(e){let t=e.source;t.resource=null,t.uploadMethodId="unknown",t.alphaMode="no-premultiply-alpha",be.returnTexture(e,true);}renderTextToCanvas(){I("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead");}_applyFilters(e,t){let i=this._renderer.renderTarget.renderTarget,s=this._renderer.filter.generateFilteredTexture({texture:e,filters:t});return this._renderer.renderTarget.bind(i,false),s}destroy(){this._renderer=null;}};to.extension={type:[g.WebGLSystem,g.WebGPUSystem,g.CanvasSystem],name:"canvasText"};});var vv=f(()=>{E();$0();yv();O.add(to);O.add(qn);});var Us,gm=f(()=>{xe();Gr();Zn();Us=class r extends qe{constructor(e){e instanceof Je&&(e={context:e});let{context:t,roundPixels:i,...s}=e||{};super({label:"Graphics",...s}),this.renderPipeId="graphics",t?this._context=t:this._context=this._ownedContext=new Je,this._context.on("update",this.onViewUpdate,this),this.didViewUpdate=true,this.allowChildren=false,this.roundPixels=i??false;}set context(e){e!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=e,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate());}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(e){return this._context.containsPoint(e)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):(e===true||e?.context===true)&&this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e);}_callContextMethod(e,t){return this.context[e](...t),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e;}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e;}clone(e=false){return e?new r(this._context.clone()):(this._ownedContext=null,new r(this._context))}lineStyle(e,t,i){I(H,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");let s={};return e&&(s.width=e),t&&(s.color=t),i&&(s.alpha=i),this.context.strokeStyle=s,this}beginFill(e,t){I(H,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");let i={};return e!==void 0&&(i.color=e),t!==void 0&&(i.alpha=t),this.context.fillStyle=i,this}endFill(){I(H,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();let e=this.context.strokeStyle;return (e.width!==Je.defaultStrokeStyle.width||e.color!==Je.defaultStrokeStyle.color||e.alpha!==Je.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return I(H,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return I(H,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return I(H,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return I(H,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return I(H,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return I(H,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}};});var xm,_m,Tv=f(()=>{xm={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
376
376
|
struct LocalUniforms {
|
|
377
377
|
uColor:vec4<f32>,
|
|
378
378
|
uTransformMatrix:mat3x3<f32>,
|
|
@@ -469,16 +469,16 @@ fn mainFragment(
|
|
|
469
469
|
|
|
470
470
|
return coverage;
|
|
471
471
|
}
|
|
472
|
-
`}};});var Ev,Av,du,Cv=f(()=>{he();Gi();Wa();Xa();Ui();Sc();Ar();Qe();Tv();Sv();du=class extends ze{constructor(e){let t=new ae({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});Ev??(Ev=vr({name:"sdf-shader",bits:[As,Ps(e),xm,bm,Sr]})),Av??(Av=Tr({name:"sdf-shader",bits:[Cs,ws(e),_m,ym,Er]})),super({glProgram:Av,gpuProgram:Ev,resources:{localUniforms:t,batchSamplers:Bs(e)}});}};});var Ls,vm=f(()=>{St();xe();Ls=class extends ue{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=true,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100;}get font(){return I(H,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return I(H,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return I(H,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return I(H,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return I(H,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=false){this.emit("destroy",this),this.removeAllListeners();for(let t in this.chars)this.chars[t].texture?.destroy();this.chars=null,e&&(this.pages.forEach(t=>t.texture.destroy(true)),this.pages=null);}};});var zC,zc,Pv=f(()=>{it();Ze();Qn();Gn();ce();Mi();xe();eo();Vc();pm();Os();vm();zC=class WC extends Ls{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=false;let t={...WC.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;let i=t.style.clone();t.overrideFill&&(i._fill.color=16777215,i._fill.alpha=1,i._fill.texture=C.WHITE,i._fill.fill=null),this.applyFillAsTint=t.overrideFill;let s=i.fontSize;i.fontSize=this.baseMeasurementFontSize;let n=Hi(i);t.overrideSize?i._stroke&&(i._stroke.width*=this.baseRenderedFontSize/s):i.fontSize=this.baseRenderedFontSize=s,this._style=i,this._skipKerning=t.skipKerning??false,this.resolution=t.resolution??1,this._padding=t.padding??4,t.textureStyle&&(this._textureStyle=t.textureStyle instanceof st?t.textureStyle:new st(t.textureStyle)),this.fontMetrics=xt.measureFont(n),this.lineHeight=i.lineHeight||this.fontMetrics.fontSize||i.fontSize;}ensureCharacters(e){let t=xt.graphemeSegmenter(e).filter(x=>!this._currentChars.includes(x)).filter((x,
|
|
473
|
-
`&&
|
|
472
|
+
`}};});var Ev,Av,du,Cv=f(()=>{he();Gi();Wa();Xa();Ui();Sc();Ar();Qe();Tv();Sv();du=class extends ze{constructor(e){let t=new ae({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});Ev??(Ev=vr({name:"sdf-shader",bits:[As,Ps(e),xm,bm,Sr]})),Av??(Av=Tr({name:"sdf-shader",bits:[Cs,ws(e),_m,ym,Er]})),super({glProgram:Av,gpuProgram:Ev,resources:{localUniforms:t,batchSamplers:Bs(e)}});}};});var Ls,vm=f(()=>{St();xe();Ls=class extends ue{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=true,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100;}get font(){return I(H,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return I(H,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return I(H,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return I(H,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return I(H,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=false){this.emit("destroy",this),this.removeAllListeners();for(let t in this.chars)this.chars[t].texture?.destroy();this.chars=null,e&&(this.pages.forEach(t=>t.texture.destroy(true)),this.pages=null);}};});var zC,zc,Pv=f(()=>{it();Ze();Qn();Gn();ce();Mi();xe();eo();Vc();pm();Os();vm();zC=class WC extends Ls{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=false;let t={...WC.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;let i=t.style.clone();t.overrideFill&&(i._fill.color=16777215,i._fill.alpha=1,i._fill.texture=C.WHITE,i._fill.fill=null),this.applyFillAsTint=t.overrideFill;let s=i.fontSize;i.fontSize=this.baseMeasurementFontSize;let n=Hi(i);t.overrideSize?i._stroke&&(i._stroke.width*=this.baseRenderedFontSize/s):i.fontSize=this.baseRenderedFontSize=s,this._style=i,this._skipKerning=t.skipKerning??false,this.resolution=t.resolution??1,this._padding=t.padding??4,t.textureStyle&&(this._textureStyle=t.textureStyle instanceof st?t.textureStyle:new st(t.textureStyle)),this.fontMetrics=xt.measureFont(n),this.lineHeight=i.lineHeight||this.fontMetrics.fontSize||i.fontSize;}ensureCharacters(e){let t=xt.graphemeSegmenter(e).filter(x=>!this._currentChars.includes(x)).filter((x,m,v)=>v.indexOf(x)===m);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let i;this._currentPageIndex===-1?i=this._nextPage():i=this.pages[this._currentPageIndex];let{canvas:s,context:n}=i.canvasAndContext,o=i.texture.source,a=this._style,u=this._currentX,l=this._currentY,c=this._currentMaxCharHeight,h=this.baseRenderedFontSize/this.baseMeasurementFontSize,d=this._padding*h,p=false,_=s.width/this.resolution,b=s.height/this.resolution;for(let x=0;x<t.length;x++){let m=t[x],v=xt.measureText(m,a,s,false);v.lineHeight=v.height;let T=v.width*h,S=Math.ceil((a.fontStyle==="italic"?2:1)*T),B=v.height*h,A=S+d*2,R=B+d*2;if(p=false,m!==`
|
|
473
|
+
`&&m!=="\r"&&m!==" "&&m!==" "&&(p=true,c=Math.ceil(Math.max(R,c))),u+A>_&&(l+=c,c=R,u=0,l+c>b)){o.update();let M=this._nextPage();s=M.canvasAndContext.canvas,n=M.canvasAndContext.context,o=M.texture.source,u=0,l=0,c=0;}let Y=T/h-(a.dropShadow?.distance??0)-(a._stroke?.width??0);if(this.chars[m]={id:m.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:Y,kerning:{}},p){this._drawGlyph(n,v,u+d,l+d,h,a);let M=o.width*h,U=o.height*h,k=new Z(u/M*o.width,l/U*o.height,A/M*o.width,R/U*o.height);this.chars[m].texture=new C({source:o,frame:k}),u+=Math.ceil(A);}}o.update(),this._currentX=u,this._currentY=l,this._currentMaxCharHeight=c,this._skipKerning&&this._applyKerning(t,n);}get pageTextures(){return I(H,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){let i=this._measureCache;for(let s=0;s<e.length;s++){let n=e[s];for(let o=0;o<this._currentChars.length;o++){let a=this._currentChars[o],u=i[n];u||(u=i[n]=t.measureText(n).width);let l=i[a];l||(l=i[a]=t.measureText(a).width);let c=t.measureText(n+a).width,h=c-(u+l);h&&(this.chars[n].kerning[a]=h),c=t.measureText(n+a).width,h=c-(u+l),h&&(this.chars[a].kerning[n]=h);}}}_nextPage(){this._currentPageIndex++;let e=this.resolution,t=Vt.getOptimalCanvasAndContext(this._textureSize,this._textureSize,e);this._setupContext(t.context,this._style,e);let i=e*(this.baseRenderedFontSize/this.baseMeasurementFontSize),s=new C({source:new Rt({resource:t.canvas,resolution:i,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})});this._textureStyle&&(s.source.style=this._textureStyle);let n={canvasAndContext:t,texture:s};return this.pages[this._currentPageIndex]=n,n}_setupContext(e,t,i){t.fontSize=this.baseRenderedFontSize,e.scale(i,i),e.font=Hi(t),t.fontSize=this.baseMeasurementFontSize,e.textBaseline=t.textBaseline;let s=t._stroke,n=s?.width??0;if(s&&(e.lineWidth=n,e.lineJoin=s.join,e.miterLimit=s.miterLimit,e.strokeStyle=Gs(s,e)),t._fill&&(e.fillStyle=Gs(t._fill,e)),t.dropShadow){let o=t.dropShadow,a=K.shared.setValue(o.color).toArray(),u=o.blur*i,l=o.distance*i;e.shadowColor=`rgba(${a[0]*255},${a[1]*255},${a[2]*255},${o.alpha})`,e.shadowBlur=u,e.shadowOffsetX=Math.cos(o.angle)*l,e.shadowOffsetY=Math.sin(o.angle)*l;}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;}_drawGlyph(e,t,i,s,n,o){let a=t.text,u=t.fontProperties,c=(o._stroke?.width??0)*n,h=i+c/2,d=s-c/2,p=u.descent*n,_=t.lineHeight*n;o.stroke&&c&&e.strokeText(a,h,d+_-p),o._fill&&e.fillText(a,h,d+_-p);}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){let{canvasAndContext:t,texture:i}=this.pages[e];Vt.returnCanvasAndContext(t),i.destroy(true);}this.pages=null;}};zC.defaultOptions={textureSize:512,style:new gt,mipmap:true};zc=zC;});function fu(r,e,t,i){let s={width:0,height:0,offsetY:0,scale:e.fontSize/t.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};s.offsetY=t.baseLineOffset;let n=s.lines[0],o=null,a=true,u={width:0,start:0,index:0,positions:[],chars:[]},l=_=>{let b=n.width;for(let x=0;x<u.index;x++){let m=_.positions[x];n.chars.push(_.chars[x]),n.charPositions.push(m+b);}n.width+=_.width,a=false,u.width=0,u.index=0,u.chars.length=0;},c=()=>{let _=n.chars.length-1;if(i){let b=n.chars[_];for(;b===" ";)n.width-=t.chars[b].xAdvance,b=n.chars[--_];}s.width=Math.max(s.width,n.width),n={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},a=true,s.lines.push(n),s.height+=t.lineHeight;},h=t.baseMeasurementFontSize/e.fontSize,d=e.letterSpacing*h,p=e.wordWrapWidth*h;for(let _=0;_<r.length+1;_++){let b,x=_===r.length;x||(b=r[_]);let m=t.chars[b]||t.chars[" "];if(/(?:\s)/.test(b)||b==="\r"||b===`
|
|
474
474
|
`||x){if(!a&&e.wordWrap&&n.width+u.width-d>p?(c(),l(u),x||n.charPositions.push(0)):(u.start=n.width,l(u),x||n.charPositions.push(0)),b==="\r"||b===`
|
|
475
|
-
`)n.width!==0&&c();else if(!x){let B=g.xAdvance+(g.kerning[o]||0)+d;n.width+=B,n.spaceWidth=B,n.spacesIndex.push(n.charPositions.length),n.chars.push(b);}}else {let S=g.kerning[o]||0,B=g.xAdvance+S+d;u.positions[u.index++]=u.width+S,u.chars.push(b),u.width+=B;}o=b;}return c(),e.align==="center"?lI(s):e.align==="right"?cI(s):e.align==="justify"&&hI(s),s}function lI(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width/2-t.width/2;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function cI(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width-t.width;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function hI(r){let e=r.width;for(let t=0;t<r.lines.length;t++){let i=r.lines[t],s=0,n=i.spacesIndex[s++],o=0,a=i.spacesIndex.length,l=(e-i.width)/a;for(let c=0;c<i.charPositions.length;c++)c===n&&(n=i.spacesIndex[s++],o+=l),i.charPositions[c]+=o;}}var Tm=f(()=>{});function Sm(r){if(r==="")return [];typeof r=="string"&&(r=[r]);let e=[];for(let t=0,i=r.length;t<i;t++){let s=r[t];if(Array.isArray(s)){if(s.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${s.length}.`);if(s[0].length===0||s[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");let n=s[0].charCodeAt(0),o=s[1].charCodeAt(0);if(o<n)throw new Error("[BitmapFont]: Invalid character range.");for(let a=n,u=o;a<=u;a++)e.push(String.fromCharCode(a));}else e.push(...Array.from(s));}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}var wv=f(()=>{});var Em,Bv,zi,Wc=f(()=>{ni();xe();_e();eo();Os();Pv();Tm();wv();Em=0,Bv=class{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:false,textureStyle:null};}getFont(e,t){let i=`${t.fontFamily}-bitmap`,s=true;if(t._fill.fill&&!t._stroke)i+=t._fill.fill.styleKey,s=false;else if(t._stroke||t.dropShadow){let o=t.styleKey;o=o.substring(0,o.lastIndexOf("-")),i=`${o}-bitmap`,s=false;}if(!de.has(i)){let o=new zc({style:t,overrideFill:s,overrideSize:true,...this.defaultOptions});Em++,Em>50&&F("BitmapText",`You have dynamically created ${Em} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),o.once("destroy",()=>{Em--,de.remove(i);}),de.set(i,o);}let n=de.get(i);return n.ensureCharacters?.(e),n}getLayout(e,t,i=true){let s=this.getFont(e,t),n=xt.graphemeSegmenter(e);return fu(n,t,s,i)}measureText(e,t,i=true){return this.getLayout(e,t,i)}install(...e){let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},I(H,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));let i=t?.name;if(!i)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};let s=t.style,n=s instanceof gt?s:new gt(s),o=n._fill.fill!==null&&n._fill.fill!==void 0,a=new zc({style:n,overrideFill:o,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:false,textureStyle:t.textureStyle}),u=Sm(t.chars);return a.ensureCharacters(u.join("")),de.set(`${i}-bitmap`,a),a.once("destroy",()=>de.remove(`${i}-bitmap`)),a}uninstall(e){let t=`${e}-bitmap`,i=de.get(t);i&&i.destroy();}},zi=new Bv;});function XC(r,e){e.groupTransform=r.groupTransform,e.groupColorAlpha=r.groupColorAlpha,e.groupColor=r.groupColor,e.groupBlendMode=r.groupBlendMode,e.globalDisplayStatus=r.globalDisplayStatus,e.groupTransform=r.groupTransform,e.localDisplayStatus=r.localDisplayStatus,e.groupAlpha=r.groupAlpha,e._roundPixels=r._roundPixels;}var Xc,ro,Rv=f(()=>{ni();E();gm();eo();Cv();Wc();Tm();Xc=class extends Us{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy();}},ro=class{constructor(e){this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBitmapText");}validateRenderable(e){let t=this._getGpuBitmapText(e);return e._didTextUpdate&&(e._didTextUpdate=false,this._updateContext(e,t)),this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){let i=this._getGpuBitmapText(e);XC(e,i),e._didTextUpdate&&(e._didTextUpdate=false,this._updateContext(e,i)),this._renderer.renderPipes.graphics.addRenderable(i,t),i.context.customShader&&this._updateDistanceField(e);}updateRenderable(e){let t=this._getGpuBitmapText(e);XC(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e);}_updateContext(e,t){let{context:i}=t,s=zi.getFont(e.text,e._style);i.clear(),s.distanceField.type!=="none"&&(i.customShader||(i.customShader=new du(this._renderer.limits.maxBatchableTextures)));let n=xt.graphemeSegmenter(e.text),o=e._style,a=s.baseLineOffset,u=fu(n,o,s,true),l=0,c=o.padding,h=u.scale,d=u.width,p=u.height+u.offsetY;o._stroke&&(d+=o._stroke.width/h,p+=o._stroke.width/h),i.translate(-e._anchor._x*d-c,-e._anchor._y*p-c).scale(h,h);let _=s.applyFillAsTint?o._fill.color:16777215;for(let b=0;b<u.lines.length;b++){let x=u.lines[b];for(let g=0;g<x.charPositions.length;g++){let v=n[l++],T=s.chars[v];T?.texture&&i.texture(T.texture,_||"black",Math.round(x.charPositions[g]+T.xOffset),Math.round(a+T.yOffset));}a+=s.lineHeight;}}_getGpuBitmapText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Xc;return e._gpuData[this._renderer.uid]=t,this._updateContext(e,t),t}_updateDistanceField(e){let t=this._getGpuBitmapText(e).context,i=e._style.fontFamily,s=de.get(`${i}-bitmap`),{a:n,b:o,c:a,d:u}=e.groupTransform,l=Math.sqrt(n*n+o*o),c=Math.sqrt(a*a+u*u),h=(Math.abs(l)+Math.abs(c))/2,d=s.baseRenderedFontSize/e._style.fontSize,p=h*s.distanceField.range*(1/d);t.customShader.resources.localUniforms.uniforms.uDistance=p;}destroy(){this._renderer=null;}};ro.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"bitmapText"};});var Mv=f(()=>{E();Rv();O.add(ro);});var pu,Dv=f(()=>{tu();pu=class extends Pr{constructor(e){super(),this.generatingTexture=false,this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.htmlText.returnTexturePromise(this.texturePromise),this.texturePromise=null,this._renderer=null;}};});var io,Iv=f(()=>{E();ce();$p();Dv();io=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e).catch(s=>{console.error(s);}),e._didTextUpdate=false,jn(i,e)),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}async _updateGpuText(e){e._didTextUpdate=false;let t=this._getGpuText(e);if(t.generatingTexture)return;t.texturePromise&&(this._renderer.htmlText.returnTexturePromise(t.texturePromise),t.texturePromise=null),t.generatingTexture=true,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let i=this._renderer.htmlText.getTexturePromise(e);t.texturePromise=i,t.texture=await i;let s=e.renderGroup||e.parentRenderGroup;s&&(s.structureDidChange=true),t.generatingTexture=false,jn(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new pu(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.texture=C.EMPTY,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};io.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"htmlText"};});function Am(){let{userAgent:r}=V.get().getNavigator();return /^((?!chrome|android).)*safari/i.test(r)}var kv=f(()=>{Se();});var YC,$C,Ns,Cm=f(()=>{YC="http://www.w3.org/2000/svg",$C="http://www.w3.org/1999/xhtml",Ns=class{constructor(){this.svgRoot=document.createElementNS(YC,"svg"),this.foreignObject=document.createElementNS(YC,"foreignObject"),this.domElement=document.createElementNS($C,"div"),this.styleElement=document.createElementNS($C,"style"),this.image=new Image;let{foreignObject:e,svgRoot:t,styleElement:i,domElement:s}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(i),e.appendChild(s);}};});function Pm(r){let e=r._stroke,t=r._fill,s=[`div { ${[`color: ${K.shared.setValue(t.color).toHex()}`,`font-size: ${r.fontSize}px`,`font-family: ${r.fontFamily}`,`font-weight: ${r.fontWeight}`,`font-style: ${r.fontStyle}`,`font-variant: ${r.fontVariant}`,`letter-spacing: ${r.letterSpacing}px`,`text-align: ${r.align}`,`padding: ${r.padding}px`,`white-space: ${r.whiteSpace==="pre"&&r.wordWrap?"pre-wrap":r.whiteSpace}`,...r.lineHeight?[`line-height: ${r.lineHeight}px`]:[],...r.wordWrap?[`word-wrap: ${r.breakWords?"break-all":"break-word"}`,`max-width: ${r.wordWrapWidth}px`]:[],...e?[ZC(e)]:[],...r.dropShadow?[KC(r.dropShadow)]:[],...r.cssOverrides].join(";")} }`];return dI(r.tagStyles,s),s.join(" ")}function KC(r){let e=K.shared.setValue(r.color).setAlpha(r.alpha).toHexa(),t=Math.round(Math.cos(r.angle)*r.distance),i=Math.round(Math.sin(r.angle)*r.distance),s=`${t}px ${i}px`;return r.blur>0?`text-shadow: ${s} ${r.blur}px ${e}`:`text-shadow: ${s} ${e}`}function ZC(r){return [`-webkit-text-stroke-width: ${r.width}px`,`-webkit-text-stroke-color: ${K.shared.setValue(r.color).toHex()}`,`text-stroke-width: ${r.width}px`,`text-stroke-color: ${K.shared.setValue(r.color).toHex()}`,"paint-order: stroke"].join(";")}function dI(r,e){for(let t in r){let i=r[t],s=[];for(let n in i)qC[n]?s.push(qC[n](i[n])):jC[n]&&s.push(jC[n].replace("{{VALUE}}",i[n]));e.push(`${t} { ${s.join(";")} }`);}}var jC,qC,Fv=f(()=>{it();jC={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},qC={fill:r=>`color: ${K.shared.setValue(r).toHex()}`,breakWords:r=>`word-wrap: ${r?"break-all":"break-word"}`,stroke:ZC,dropShadow:KC};});var Hs,wm=f(()=>{_e();Os();Fv();Hs=class r extends gt{constructor(e={}){super(e),this._cssOverrides=[],this.cssOverrides=e.cssOverrides??[],this.tagStyles=e.tagStyles??{};}set cssOverrides(e){this._cssOverrides=e instanceof Array?e:[e],this.update();}get cssOverrides(){return this._cssOverrides}update(){this._cssStyle=null,super.update();}clone(){return new r({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{...this.dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides,tagStyles:{...this.tagStyles}})}get cssStyle(){return this._cssStyle||(this._cssStyle=Pm(this)),this._cssStyle}addOverride(...e){let t=e.filter(i=>!this.cssOverrides.includes(i));t.length>0&&(this.cssOverrides.push(...t),this.update());}removeOverride(...e){let t=e.filter(i=>this.cssOverrides.includes(i));t.length>0&&(this.cssOverrides=this.cssOverrides.filter(i=>!t.includes(i)),this.update());}set fill(e){typeof e!="string"&&typeof e!="number"&&F("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e;}set stroke(e){e&&typeof e!="string"&&typeof e!="number"&&F("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e;}};});function Bm(r,e){let t=e.fontFamily,i=[],s={},n=/font-family:([^;"\s]+)/g,o=r.match(n);function a(u){s[u]||(i.push(u),s[u]=true);}if(Array.isArray(t))for(let u=0;u<t.length;u++)a(t[u]);else a(t);o&&o.forEach(u=>{let l=u.split(":")[1].trim();a(l);});for(let u in e.tagStyles){let l=e.tagStyles[u].fontFamily;a(l);}return i}var Ov=f(()=>{});async function Rm(r){let t=await(await V.get().fetch(r)).blob(),i=new FileReader;return await new Promise((n,o)=>{i.onloadend=()=>n(i.result),i.onerror=o,i.readAsDataURL(t);})}var Gv=f(()=>{Se();});async function Yc(r,e){let t=await Rm(e);return `@font-face {
|
|
475
|
+
`)n.width!==0&&c();else if(!x){let B=m.xAdvance+(m.kerning[o]||0)+d;n.width+=B,n.spaceWidth=B,n.spacesIndex.push(n.charPositions.length),n.chars.push(b);}}else {let S=m.kerning[o]||0,B=m.xAdvance+S+d;u.positions[u.index++]=u.width+S,u.chars.push(b),u.width+=B;}o=b;}return c(),e.align==="center"?lI(s):e.align==="right"?cI(s):e.align==="justify"&&hI(s),s}function lI(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width/2-t.width/2;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function cI(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width-t.width;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function hI(r){let e=r.width;for(let t=0;t<r.lines.length;t++){let i=r.lines[t],s=0,n=i.spacesIndex[s++],o=0,a=i.spacesIndex.length,l=(e-i.width)/a;for(let c=0;c<i.charPositions.length;c++)c===n&&(n=i.spacesIndex[s++],o+=l),i.charPositions[c]+=o;}}var Tm=f(()=>{});function Sm(r){if(r==="")return [];typeof r=="string"&&(r=[r]);let e=[];for(let t=0,i=r.length;t<i;t++){let s=r[t];if(Array.isArray(s)){if(s.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${s.length}.`);if(s[0].length===0||s[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");let n=s[0].charCodeAt(0),o=s[1].charCodeAt(0);if(o<n)throw new Error("[BitmapFont]: Invalid character range.");for(let a=n,u=o;a<=u;a++)e.push(String.fromCharCode(a));}else e.push(...Array.from(s));}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}var wv=f(()=>{});var Em,Bv,zi,Wc=f(()=>{ni();xe();_e();eo();Os();Pv();Tm();wv();Em=0,Bv=class{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:false,textureStyle:null};}getFont(e,t){let i=`${t.fontFamily}-bitmap`,s=true;if(t._fill.fill&&!t._stroke)i+=t._fill.fill.styleKey,s=false;else if(t._stroke||t.dropShadow){let o=t.styleKey;o=o.substring(0,o.lastIndexOf("-")),i=`${o}-bitmap`,s=false;}if(!de.has(i)){let o=new zc({style:t,overrideFill:s,overrideSize:true,...this.defaultOptions});Em++,Em>50&&F("BitmapText",`You have dynamically created ${Em} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),o.once("destroy",()=>{Em--,de.remove(i);}),de.set(i,o);}let n=de.get(i);return n.ensureCharacters?.(e),n}getLayout(e,t,i=true){let s=this.getFont(e,t),n=xt.graphemeSegmenter(e);return fu(n,t,s,i)}measureText(e,t,i=true){return this.getLayout(e,t,i)}install(...e){let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},I(H,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));let i=t?.name;if(!i)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};let s=t.style,n=s instanceof gt?s:new gt(s),o=n._fill.fill!==null&&n._fill.fill!==void 0,a=new zc({style:n,overrideFill:o,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:false,textureStyle:t.textureStyle}),u=Sm(t.chars);return a.ensureCharacters(u.join("")),de.set(`${i}-bitmap`,a),a.once("destroy",()=>de.remove(`${i}-bitmap`)),a}uninstall(e){let t=`${e}-bitmap`,i=de.get(t);i&&i.destroy();}},zi=new Bv;});function XC(r,e){e.groupTransform=r.groupTransform,e.groupColorAlpha=r.groupColorAlpha,e.groupColor=r.groupColor,e.groupBlendMode=r.groupBlendMode,e.globalDisplayStatus=r.globalDisplayStatus,e.groupTransform=r.groupTransform,e.localDisplayStatus=r.localDisplayStatus,e.groupAlpha=r.groupAlpha,e._roundPixels=r._roundPixels;}var Xc,ro,Rv=f(()=>{ni();E();gm();eo();Cv();Wc();Tm();Xc=class extends Us{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy();}},ro=class{constructor(e){this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBitmapText");}validateRenderable(e){let t=this._getGpuBitmapText(e);return e._didTextUpdate&&(e._didTextUpdate=false,this._updateContext(e,t)),this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){let i=this._getGpuBitmapText(e);XC(e,i),e._didTextUpdate&&(e._didTextUpdate=false,this._updateContext(e,i)),this._renderer.renderPipes.graphics.addRenderable(i,t),i.context.customShader&&this._updateDistanceField(e);}updateRenderable(e){let t=this._getGpuBitmapText(e);XC(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e);}_updateContext(e,t){let{context:i}=t,s=zi.getFont(e.text,e._style);i.clear(),s.distanceField.type!=="none"&&(i.customShader||(i.customShader=new du(this._renderer.limits.maxBatchableTextures)));let n=xt.graphemeSegmenter(e.text),o=e._style,a=s.baseLineOffset,u=fu(n,o,s,true),l=0,c=o.padding,h=u.scale,d=u.width,p=u.height+u.offsetY;o._stroke&&(d+=o._stroke.width/h,p+=o._stroke.width/h),i.translate(-e._anchor._x*d-c,-e._anchor._y*p-c).scale(h,h);let _=s.applyFillAsTint?o._fill.color:16777215;for(let b=0;b<u.lines.length;b++){let x=u.lines[b];for(let m=0;m<x.charPositions.length;m++){let v=n[l++],T=s.chars[v];T?.texture&&i.texture(T.texture,_||"black",Math.round(x.charPositions[m]+T.xOffset),Math.round(a+T.yOffset));}a+=s.lineHeight;}}_getGpuBitmapText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Xc;return e._gpuData[this._renderer.uid]=t,this._updateContext(e,t),t}_updateDistanceField(e){let t=this._getGpuBitmapText(e).context,i=e._style.fontFamily,s=de.get(`${i}-bitmap`),{a:n,b:o,c:a,d:u}=e.groupTransform,l=Math.sqrt(n*n+o*o),c=Math.sqrt(a*a+u*u),h=(Math.abs(l)+Math.abs(c))/2,d=s.baseRenderedFontSize/e._style.fontSize,p=h*s.distanceField.range*(1/d);t.customShader.resources.localUniforms.uniforms.uDistance=p;}destroy(){this._renderer=null;}};ro.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"bitmapText"};});var Mv=f(()=>{E();Rv();O.add(ro);});var pu,Dv=f(()=>{tu();pu=class extends Pr{constructor(e){super(),this.generatingTexture=false,this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.htmlText.returnTexturePromise(this.texturePromise),this.texturePromise=null,this._renderer=null;}};});var io,Iv=f(()=>{E();ce();$p();Dv();io=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e).catch(s=>{console.error(s);}),e._didTextUpdate=false,jn(i,e)),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}async _updateGpuText(e){e._didTextUpdate=false;let t=this._getGpuText(e);if(t.generatingTexture)return;t.texturePromise&&(this._renderer.htmlText.returnTexturePromise(t.texturePromise),t.texturePromise=null),t.generatingTexture=true,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let i=this._renderer.htmlText.getTexturePromise(e);t.texturePromise=i,t.texture=await i;let s=e.renderGroup||e.parentRenderGroup;s&&(s.structureDidChange=true),t.generatingTexture=false,jn(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new pu(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.texture=C.EMPTY,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};io.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"htmlText"};});function Am(){let{userAgent:r}=V.get().getNavigator();return /^((?!chrome|android).)*safari/i.test(r)}var kv=f(()=>{Se();});var YC,$C,Ns,Cm=f(()=>{YC="http://www.w3.org/2000/svg",$C="http://www.w3.org/1999/xhtml",Ns=class{constructor(){this.svgRoot=document.createElementNS(YC,"svg"),this.foreignObject=document.createElementNS(YC,"foreignObject"),this.domElement=document.createElementNS($C,"div"),this.styleElement=document.createElementNS($C,"style"),this.image=new Image;let{foreignObject:e,svgRoot:t,styleElement:i,domElement:s}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(i),e.appendChild(s);}};});function Pm(r){let e=r._stroke,t=r._fill,s=[`div { ${[`color: ${K.shared.setValue(t.color).toHex()}`,`font-size: ${r.fontSize}px`,`font-family: ${r.fontFamily}`,`font-weight: ${r.fontWeight}`,`font-style: ${r.fontStyle}`,`font-variant: ${r.fontVariant}`,`letter-spacing: ${r.letterSpacing}px`,`text-align: ${r.align}`,`padding: ${r.padding}px`,`white-space: ${r.whiteSpace==="pre"&&r.wordWrap?"pre-wrap":r.whiteSpace}`,...r.lineHeight?[`line-height: ${r.lineHeight}px`]:[],...r.wordWrap?[`word-wrap: ${r.breakWords?"break-all":"break-word"}`,`max-width: ${r.wordWrapWidth}px`]:[],...e?[ZC(e)]:[],...r.dropShadow?[KC(r.dropShadow)]:[],...r.cssOverrides].join(";")} }`];return dI(r.tagStyles,s),s.join(" ")}function KC(r){let e=K.shared.setValue(r.color).setAlpha(r.alpha).toHexa(),t=Math.round(Math.cos(r.angle)*r.distance),i=Math.round(Math.sin(r.angle)*r.distance),s=`${t}px ${i}px`;return r.blur>0?`text-shadow: ${s} ${r.blur}px ${e}`:`text-shadow: ${s} ${e}`}function ZC(r){return [`-webkit-text-stroke-width: ${r.width}px`,`-webkit-text-stroke-color: ${K.shared.setValue(r.color).toHex()}`,`text-stroke-width: ${r.width}px`,`text-stroke-color: ${K.shared.setValue(r.color).toHex()}`,"paint-order: stroke"].join(";")}function dI(r,e){for(let t in r){let i=r[t],s=[];for(let n in i)qC[n]?s.push(qC[n](i[n])):jC[n]&&s.push(jC[n].replace("{{VALUE}}",i[n]));e.push(`${t} { ${s.join(";")} }`);}}var jC,qC,Fv=f(()=>{it();jC={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},qC={fill:r=>`color: ${K.shared.setValue(r).toHex()}`,breakWords:r=>`word-wrap: ${r?"break-all":"break-word"}`,stroke:ZC,dropShadow:KC};});var Hs,wm=f(()=>{_e();Os();Fv();Hs=class r extends gt{constructor(e={}){super(e),this._cssOverrides=[],this.cssOverrides=e.cssOverrides??[],this.tagStyles=e.tagStyles??{};}set cssOverrides(e){this._cssOverrides=e instanceof Array?e:[e],this.update();}get cssOverrides(){return this._cssOverrides}update(){this._cssStyle=null,super.update();}clone(){return new r({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{...this.dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides,tagStyles:{...this.tagStyles}})}get cssStyle(){return this._cssStyle||(this._cssStyle=Pm(this)),this._cssStyle}addOverride(...e){let t=e.filter(i=>!this.cssOverrides.includes(i));t.length>0&&(this.cssOverrides.push(...t),this.update());}removeOverride(...e){let t=e.filter(i=>this.cssOverrides.includes(i));t.length>0&&(this.cssOverrides=this.cssOverrides.filter(i=>!t.includes(i)),this.update());}set fill(e){typeof e!="string"&&typeof e!="number"&&F("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e;}set stroke(e){e&&typeof e!="string"&&typeof e!="number"&&F("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e;}};});function Bm(r,e){let t=e.fontFamily,i=[],s={},n=/font-family:([^;"\s]+)/g,o=r.match(n);function a(u){s[u]||(i.push(u),s[u]=true);}if(Array.isArray(t))for(let u=0;u<t.length;u++)a(t[u]);else a(t);o&&o.forEach(u=>{let l=u.split(":")[1].trim();a(l);});for(let u in e.tagStyles){let l=e.tagStyles[u].fontFamily;a(l);}return i}var Ov=f(()=>{});async function Rm(r){let t=await(await V.get().fetch(r)).blob(),i=new FileReader;return await new Promise((n,o)=>{i.onloadend=()=>n(i.result),i.onerror=o,i.readAsDataURL(t);})}var Gv=f(()=>{Se();});async function Yc(r,e){let t=await Rm(e);return `@font-face {
|
|
476
476
|
font-family: "${r.fontFamily}";
|
|
477
477
|
src: url('${t}');
|
|
478
478
|
font-weight: ${r.fontWeight};
|
|
479
479
|
font-style: ${r.fontStyle};
|
|
480
480
|
}`}var Uv=f(()=>{Gv();});async function Mm(r,e,t){let i=r.filter(s=>de.has(`${s}-and-url`)).map((s,n)=>{if(!mu.has(s)){let{url:o}=de.get(`${s}-and-url`);n===0?mu.set(s,Yc({fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:s},o)):mu.set(s,Yc({fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:s},o));}return mu.get(s)});return (await Promise.all(i)).join(`
|
|
481
|
-
`)}var mu,Lv=f(()=>{ni();Uv();mu=new Map;});function Dm(r,e,t,i,s){let{domElement:n,styleElement:o,svgRoot:a}=s;n.innerHTML=`<style>${e.cssStyle}</style><div style='padding:0;'>${r}</div>`,n.setAttribute("style",`transform: scale(${t});transform-origin: top left; display: inline-block`),o.textContent=i;let{width:u,height:l}=s.image;return a.setAttribute("width",u.toString()),a.setAttribute("height",l.toString()),new XMLSerializer().serializeToString(a)}var Nv=f(()=>{});function Im(r,e){let t=Vt.getOptimalCanvasAndContext(r.width,r.height,e),{context:i}=t;return i.clearRect(0,0,r.width,r.height),i.drawImage(r,0,0),t}var Hv=f(()=>{Qn();});function km(r,e,t){return new Promise(async i=>{t&&await new Promise(s=>setTimeout(s,100)),r.onload=()=>{i();},r.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,r.crossOrigin="anonymous";})}var Vv=f(()=>{});function gu(r,e,t,i){i||(i=QC||(QC=new Ns));let{domElement:s,styleElement:n,svgRoot:o}=i;s.innerHTML=`<style>${e.cssStyle};</style><div style='padding:0'>${r}</div>`,s.setAttribute("style","transform-origin: top left; display: inline-block"),t&&(n.textContent=t),document.body.appendChild(o);let a=s.getBoundingClientRect();o.remove();let u=e.padding*2;return {width:a.width-u,height:a.height-u}}var QC,Fm=f(()=>{Cm();});var so,zv=f(()=>{E();Qn();Fr();lr();kv();_e();ri();dm();Cm();wm();Ov();Lv();Nv();Hv();Vv();Fm();so=class{constructor(e){this._renderer=e,this._createCanvas=e.type===Oe.WEBGPU;}getTexture(e){return this.getTexturePromise(e)}getTexturePromise(e){return this._buildTexturePromise(e)}async _buildTexturePromise(e){let{text:t,style:i,resolution:s,textureStyle:n}=e,o=Re.get(Ns),a=Bm(t,i),u=await Mm(a,i,Hs.defaultTextStyle),l=gu(t,i,u,o),c=Math.ceil(Math.ceil(Math.max(1,l.width)+i.padding*2)*s),h=Math.ceil(Math.ceil(Math.max(1,l.height)+i.padding*2)*s),d=o.image,p=2;d.width=(c|0)+p,d.height=(h|0)+p;let _=Dm(t,i,s,u,o);await km(d,_,Am()&&a.length>0);let b=d,x;this._createCanvas&&(x=Im(d,s));let
|
|
481
|
+
`)}var mu,Lv=f(()=>{ni();Uv();mu=new Map;});function Dm(r,e,t,i,s){let{domElement:n,styleElement:o,svgRoot:a}=s;n.innerHTML=`<style>${e.cssStyle}</style><div style='padding:0;'>${r}</div>`,n.setAttribute("style",`transform: scale(${t});transform-origin: top left; display: inline-block`),o.textContent=i;let{width:u,height:l}=s.image;return a.setAttribute("width",u.toString()),a.setAttribute("height",l.toString()),new XMLSerializer().serializeToString(a)}var Nv=f(()=>{});function Im(r,e){let t=Vt.getOptimalCanvasAndContext(r.width,r.height,e),{context:i}=t;return i.clearRect(0,0,r.width,r.height),i.drawImage(r,0,0),t}var Hv=f(()=>{Qn();});function km(r,e,t){return new Promise(async i=>{t&&await new Promise(s=>setTimeout(s,100)),r.onload=()=>{i();},r.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,r.crossOrigin="anonymous";})}var Vv=f(()=>{});function gu(r,e,t,i){i||(i=QC||(QC=new Ns));let{domElement:s,styleElement:n,svgRoot:o}=i;s.innerHTML=`<style>${e.cssStyle};</style><div style='padding:0'>${r}</div>`,s.setAttribute("style","transform-origin: top left; display: inline-block"),t&&(n.textContent=t),document.body.appendChild(o);let a=s.getBoundingClientRect();o.remove();let u=e.padding*2;return {width:a.width-u,height:a.height-u}}var QC,Fm=f(()=>{Cm();});var so,zv=f(()=>{E();Qn();Fr();lr();kv();_e();ri();dm();Cm();wm();Ov();Lv();Nv();Hv();Vv();Fm();so=class{constructor(e){this._renderer=e,this._createCanvas=e.type===Oe.WEBGPU;}getTexture(e){return this.getTexturePromise(e)}getTexturePromise(e){return this._buildTexturePromise(e)}async _buildTexturePromise(e){let{text:t,style:i,resolution:s,textureStyle:n}=e,o=Re.get(Ns),a=Bm(t,i),u=await Mm(a,i,Hs.defaultTextStyle),l=gu(t,i,u,o),c=Math.ceil(Math.ceil(Math.max(1,l.width)+i.padding*2)*s),h=Math.ceil(Math.ceil(Math.max(1,l.height)+i.padding*2)*s),d=o.image,p=2;d.width=(c|0)+p,d.height=(h|0)+p;let _=Dm(t,i,s,u,o);await km(d,_,Am()&&a.length>0);let b=d,x;this._createCanvas&&(x=Im(d,s));let m=hu(x?x.canvas:b,d.width-p,d.height-p,s);return n&&(m.source.style=n),this._createCanvas&&(this._renderer.texture.initSource(m.source),Vt.returnCanvasAndContext(x)),Re.return(o),m}returnTexturePromise(e){e.then(t=>{this._cleanUp(t);}).catch(()=>{F("HTMLTextSystem: Failed to clean texture");});}_cleanUp(e){be.returnTexture(e,true),e.source.resource=null,e.source.uploadMethodId="unknown";}destroy(){this._renderer=null;}};so.extension={type:[g.WebGLSystem,g.WebGPUSystem,g.CanvasSystem],name:"htmlText"};});var Wv=f(()=>{E();Iv();zv();O.add(so);O.add(io);});var JC,Zt,Vs=f(()=>{Oi();oi();vs();xe();JC=class eP extends Mt{constructor(...e){let t=e[0]??{};t instanceof Float32Array&&(I(H,"use new MeshGeometry({ positions, uvs, indices }) instead"),t={positions:t,uvs:e[1],indices:e[2]}),t={...eP.defaultOptions,...t};let i=t.positions||new Float32Array([0,0,1,0,1,1,0,1]),s=t.uvs;s||(t.positions?s=new Float32Array(i.length):s=new Float32Array([0,0,1,0,1,1,0,1]));let n=t.indices||new Uint32Array([0,1,2,0,2,3]),o=t.shrinkBuffersToFit,a=new Ve({data:i,label:"attribute-mesh-positions",shrinkToFit:o,usage:ie.VERTEX|ie.COPY_DST}),u=new Ve({data:s,label:"attribute-mesh-uvs",shrinkToFit:o,usage:ie.VERTEX|ie.COPY_DST}),l=new Ve({data:n,label:"index-mesh-buffer",shrinkToFit:o,usage:ie.INDEX|ie.COPY_DST});super({attributes:{aPosition:{buffer:a,format:"float32x2",stride:2*4,offset:0},aUV:{buffer:u,format:"float32x2",stride:2*4,offset:0}},indexBuffer:l,topology:t.topology}),this.batchMode="auto";}get positions(){return this.attributes.aPosition.buffer.data}set positions(e){this.attributes.aPosition.buffer.data=e;}get uvs(){return this.attributes.aUV.buffer.data}set uvs(e){this.attributes.aUV.buffer.data=e;}get indices(){return this.indexBuffer.data}set indices(e){this.indexBuffer.data=e;}};JC.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:false};Zt=JC;});var Wi,Om,zs,no=f(()=>{Wi={name:"local-uniform-bit",vertex:{header:`
|
|
482
482
|
|
|
483
483
|
struct LocalUniforms {
|
|
484
484
|
uTransformMatrix:mat3x3<f32>,
|
|
@@ -573,7 +573,7 @@ fn mainFragment(
|
|
|
573
573
|
|
|
574
574
|
outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
|
|
575
575
|
|
|
576
|
-
`}};});var Yv,$v,xu,jv=f(()=>{he();Gi();no();Ui();Ar();Qe();ce();Xv();xu=class extends ze{constructor(){Yv??(Yv=vr({name:"tiling-sprite-shader",bits:[Wi,Gm,Sr]})),$v??($v=Tr({name:"tiling-sprite-shader",bits:[zs,Um,Er]}));let e=new ae({uMapCoord:{value:new D,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new D,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:$v,gpuProgram:Yv,resources:{localUniforms:new ae({uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:C.EMPTY.source,uSampler:C.EMPTY.source.style}});}updateUniforms(e,t,i,s,n,o){let a=this.resources.tilingUniforms,u=o.width,l=o.height,c=o.textureMatrix,h=a.uniforms.uTextureTransform;h.set(i.a*u/e,i.b*u/t,i.c*l/e,i.d*l/t,i.tx/e,i.ty/t),h.invert(),a.uniforms.uMapCoord=c.mapCoord,a.uniforms.uClampFrame=c.uClampFrame,a.uniforms.uClampOffset=c.uClampOffset,a.uniforms.uTextureTransform=h,a.uniforms.uSizeAnchor[0]=e,a.uniforms.uSizeAnchor[1]=t,a.uniforms.uSizeAnchor[2]=s,a.uniforms.uSizeAnchor[3]=n,o&&(this.resources.uTexture=o.source,this.resources.uSampler=o.source.style);}};});var _u,qv=f(()=>{Vs();_u=class extends Zt{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])});}};});function Lm(r,e){let t=r.anchor.x,i=r.anchor.y;e[0]=-t*r.width,e[1]=-i*r.height,e[2]=(1-t)*r.width,e[3]=-i*r.height,e[4]=(1-t)*r.width,e[5]=(1-i)*r.height,e[6]=-t*r.width,e[7]=(1-i)*r.height;}var Kv=f(()=>{});function Nm(r,e,t,i){let s=0,n=r.length/(e||2),o=i.a,a=i.b,u=i.c,l=i.d,c=i.tx,h=i.ty;for(t*=e;s<n;){let d=r[t],p=r[t+1];r[t]=o*d+u*p+c,r[t+1]=a*d+l*p+h,t+=e,s++;}}var Zv=f(()=>{});function Hm(r,e){let t=r.texture,i=t.frame.width,s=t.frame.height,n=0,o=0;r.applyAnchorToTexture&&(n=r.anchor.x,o=r.anchor.y),e[0]=e[6]=-n,e[2]=e[4]=1-n,e[1]=e[3]=-o,e[5]=e[7]=1-o;let a=D.shared;a.copyFrom(r._tileTransform.matrix),a.tx/=r.width,a.ty/=r.height,a.invert(),a.scale(r.width/i,r.height/s),Nm(e,2,0,a);}var Qv=f(()=>{he();Zv();});var Vm,$c,oo,Jv=f(()=>{E();Oa();cr();lr();zn();Ic();Vs();jv();qv();Kv();Qv();Vm=new _u,$c=class{constructor(){this.canBatch=true,this.geometry=new Zt({indices:Vm.indices.slice(),positions:Vm.positions.slice(),uvs:Vm.uvs.slice()});}destroy(){this.geometry.destroy(),this.shader?.destroy();}},oo=class{constructor(e){this._state=Ue.default2d,this._renderer=e;}validateRenderable(e){let t=this._getTilingSpriteData(e),i=t.canBatch;this._updateCanBatch(e);let s=t.canBatch;if(s&&s===i){let{batchableMesh:n}=t;return !n._batcher.checkAndUpdateTexture(n,e.texture)}return i!==s}addRenderable(e,t){let i=this._renderer.renderPipes.batch;this._updateCanBatch(e);let s=this._getTilingSpriteData(e),{geometry:n,canBatch:o}=s;if(o){s.batchableMesh||(s.batchableMesh=new ai);let a=s.batchableMesh;e.didViewUpdate&&(this._updateBatchableMesh(e),a.geometry=n,a.renderable=e,a.transform=e.groupTransform,a.setTexture(e._texture)),a.roundPixels=this._renderer._roundPixels|e._roundPixels,i.addToBatch(a,t);}else i.break(t),s.shader||(s.shader=new xu),this.updateRenderable(e),t.add(e);}execute(e){let{shader:t}=this._getTilingSpriteData(e);t.groups[0]=this._renderer.globalUniforms.bindGroup;let i=t.resources.localUniforms.uniforms;i.uTransformMatrix=e.groupTransform,i.uRound=this._renderer._roundPixels|e._roundPixels,Cr(e.groupColorAlpha,i.uColor,0),this._state.blendMode=Lr(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:Vm,shader:t,state:this._state});}updateRenderable(e){let t=this._getTilingSpriteData(e),{canBatch:i}=t;if(i){let{batchableMesh:s}=t;e.didViewUpdate&&this._updateBatchableMesh(e),s._batcher.updateElement(s);}else if(e.didViewUpdate){let{shader:s}=t;s.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture);}}_getTilingSpriteData(e){return e._gpuData[this._renderer.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){let t=new $c;return t.renderable=e,e._gpuData[this._renderer.uid]=t,t}_updateBatchableMesh(e){let t=this._getTilingSpriteData(e),{geometry:i}=t,s=e.texture.source.style;s.addressMode!=="repeat"&&(s.addressMode="repeat",s.update()),Hm(e,i.uvs),Lm(e,i.positions);}destroy(){this._renderer=null;}_updateCanBatch(e){let t=this._getTilingSpriteData(e),i=e.texture,s=true;return this._renderer.type===Oe.WEBGL&&(s=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=i.textureMatrix.isSimple&&(s||i.source.isPowerOfTwo),t.canBatch}};oo.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"tilingSprite"};});var e2=f(()=>{E();Jv();O.add(oo);});var tP,Ws,jc=f(()=>{xe();Vs();tP=class rP extends Zt{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(I(H,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t);}build(e){e={...rP.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;let t=this.verticesX*this.verticesY,i=[],s=[],n=[],o=this.verticesX-1,a=this.verticesY-1,u=this.width/o,l=this.height/a;for(let h=0;h<t;h++){let d=h%this.verticesX,p=h/this.verticesX|0;i.push(d*u,p*l),s.push(d/o,p/a);}let c=o*a;for(let h=0;h<c;h++){let d=h%o,p=h/o|0,_=p*this.verticesX+d,b=p*this.verticesX+d+1,x=(p+1)*this.verticesX+d,g=(p+1)*this.verticesX+d+1;n.push(_,b,x,b,g,x);}this.buffers[0].data=new Float32Array(i),this.buffers[1].data=new Float32Array(s),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update();}};tP.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};Ws=tP;});var iP,zr,zm=f(()=>{jc();iP=class sP extends Ws{constructor(e={}){e={...sP.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e);}update(e){this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this._anchorX=e.anchor?.x,this._anchorY=e.anchor?.y,this.updateUvs(),this.updatePositions();}updatePositions(){let e=this.positions,{width:t,height:i,_leftWidth:s,_rightWidth:n,_topHeight:o,_bottomHeight:a,_anchorX:u,_anchorY:l}=this,c=s+n,h=t>c?1:t/c,d=o+a,p=i>d?1:i/d,_=Math.min(h,p),b=u*t,x=l*i;e[0]=e[8]=e[16]=e[24]=-b,e[2]=e[10]=e[18]=e[26]=s*_-b,e[4]=e[12]=e[20]=e[28]=t-n*_-b,e[6]=e[14]=e[22]=e[30]=t-b,e[1]=e[3]=e[5]=e[7]=-x,e[9]=e[11]=e[13]=e[15]=o*_-x,e[17]=e[19]=e[21]=e[23]=i-a*_-x,e[25]=e[27]=e[29]=e[31]=i-x,this.getBuffer("aPosition").update();}updateUvs(){let e=this.uvs;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;let t=1/this._originalWidth,i=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.getBuffer("aUV").update();}};iP.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};zr=iP;});var qc,ao,t2=f(()=>{E();Ic();zm();qc=class extends ai{constructor(){super(),this.geometry=new zr;}destroy(){this.geometry.destroy();}},ao=class{constructor(e){this._renderer=e;}addRenderable(e,t){let i=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,i),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t);}validateRenderable(e){let t=this._getGpuSprite(e);return !t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.geometry.update(e),t.setTexture(e._texture);}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){let t=e._gpuData[this._renderer.uid]=new qc,i=t;return i.renderable=e,i.transform=e.groupTransform,i.texture=e._texture,i.roundPixels=this._renderer._roundPixels|e._roundPixels,e.didViewUpdate||this._updateBatchableSprite(e,i),t}destroy(){this._renderer=null;}};ao.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"nineSliceSprite"};});var r2=f(()=>{E();t2();O.add(ao);});var uo,i2=f(()=>{E();uo=class{constructor(e){this._renderer=e;}push(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"filter",canBundle:false,action:"pushFilter",container:t,filterEffect:e});}pop(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"filter",action:"popFilter",canBundle:false});}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop();}destroy(){this._renderer=null;}};uo.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"filter"};});function Wm(r,e){e.clear();let t=e.matrix;for(let i=0;i<r.length;i++){let s=r[i];s.globalDisplayStatus<7||(e.matrix=s.worldTransform,e.addBounds(s.bounds));}return e.matrix=t,e}var s2=f(()=>{});var fI,n2,lo,o2=f(()=>{E();he();Fi();vs();Qe();ce();Fr();lr();Et();s2();_e();fI=new Mt({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:2*4,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),n2=class{constructor(){this.skip=false,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new me,this.container=null,this.blendRequired=false,this.outputRenderSurface=null,this.outputOffset={x:0,y:0},this.globalFrame={x:0,y:0,width:0,height:0};}},lo=class{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new ae({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new nt({}),this.renderer=e;}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){let t=this.renderer,i=e.filterEffect.filters,s=this._pushFilterData();s.skip=false,s.filters=i,s.container=e.container,s.outputRenderSurface=t.renderTarget.renderSurface;let n=t.renderTarget.renderTarget.colorTexture.source,o=n.resolution,a=n.antialias;if(i.length===0){s.skip=true;return}let u=s.bounds;if(e.renderables?Wm(e.renderables,u):e.filterEffect.filterArea?(u.clear(),u.addRect(e.filterEffect.filterArea),u.applyMatrix(e.container.worldTransform)):e.container.getFastGlobalBounds(true,u),e.container){let b=(e.container.renderGroup||e.container.parentRenderGroup).cacheToLocalTransform;b&&u.applyMatrix(b);}if(this._calculateFilterBounds(s,t.renderTarget.rootViewPort,a,o,1),s.skip)return;let l=this._getPreviousFilterData(),c=o,h=0,d=0;l&&(h=l.bounds.minX,d=l.bounds.minY,c=l.inputTexture.source._resolution),s.outputOffset.x=u.minX-h,s.outputOffset.y=u.minY-d;let p=s.globalFrame;if(p.x=h*c,p.y=d*c,p.width=n.width*c,p.height=n.height*c,s.backTexture=C.EMPTY,s.blendRequired){t.renderTarget.finishRenderPass();let _=t.renderTarget.getRenderTarget(s.outputRenderSurface);s.backTexture=this.getBackTexture(_,u,l?.bounds);}s.inputTexture=be.getOptimalTexture(u.width,u.height,s.resolution,s.antialias),t.renderTarget.bind(s.inputTexture,true),t.globalUniforms.push({offset:u});}generateFilteredTexture({texture:e,filters:t}){let i=this._pushFilterData();this._activeFilterData=i,i.skip=false,i.filters=t;let s=e.source,n=s.resolution,o=s.antialias;if(t.length===0)return i.skip=true,e;let a=i.bounds;if(a.addRect(e.frame),this._calculateFilterBounds(i,a.rectangle,o,n,0),i.skip)return e;let u=n,l=0,c=0;i.outputOffset.x=-a.minX,i.outputOffset.y=-a.minY;let h=i.globalFrame;h.x=l*u,h.y=c*u,h.width=s.width*u,h.height=s.height*u,i.outputRenderSurface=be.getOptimalTexture(a.width,a.height,i.resolution,i.antialias),i.backTexture=C.EMPTY,i.inputTexture=e,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(i,true);let p=i.outputRenderSurface;return p.source.alphaMode="premultiplied-alpha",p}pop(){let e=this.renderer,t=this._popFilterData();t.skip||(e.globalUniforms.pop(),e.renderTarget.finishRenderPass(),this._activeFilterData=t,this._applyFiltersToTexture(t,false),t.blendRequired&&be.returnTexture(t.backTexture),be.returnTexture(t.inputTexture));}getBackTexture(e,t,i){let s=e.colorTexture.source._resolution,n=be.getOptimalTexture(t.width,t.height,s,false),o=t.minX,a=t.minY;i&&(o-=i.minX,a-=i.minY),o=Math.floor(o*s),a=Math.floor(a*s);let u=Math.ceil(t.width*s),l=Math.ceil(t.height*s);return this.renderer.renderTarget.copyToTexture(e,n,{x:o,y:a},{width:u,height:l},{x:0,y:0}),n}applyFilter(e,t,i,s){let n=this.renderer,o=this._activeFilterData,a=o.outputRenderSurface,u=this._filterGlobalUniforms,l=u.uniforms,c=l.uOutputFrame,h=l.uInputSize,d=l.uInputPixel,p=l.uInputClamp,_=l.uGlobalFrame,b=l.uOutputTexture;a===i?(c[0]=o.outputOffset.x,c[1]=o.outputOffset.y):(c[0]=0,c[1]=0),c[2]=t.frame.width,c[3]=t.frame.height,h[0]=t.source.width,h[1]=t.source.height,h[2]=1/h[0],h[3]=1/h[1],d[0]=t.source.pixelWidth,d[1]=t.source.pixelHeight,d[2]=1/d[0],d[3]=1/d[1],p[0]=.5*d[2],p[1]=.5*d[3],p[2]=t.frame.width*h[2]-.5*d[2],p[3]=t.frame.height*h[3]-.5*d[3],_[0]=o.globalFrame.x,_[1]=o.globalFrame.y,_[2]=o.globalFrame.width,_[3]=o.globalFrame.height,i instanceof C&&(i.source.resource=null);let x=this.renderer.renderTarget.getRenderTarget(i);if(n.renderTarget.bind(i,!!s),i instanceof C?(b[0]=i.frame.width,b[1]=i.frame.height):(b[0]=x.width,b[1]=x.height),b[2]=x.isRoot?-1:1,u.update(),n.renderPipes.uniformBatch){let g=n.renderPipes.uniformBatch.getUboResource(u);this._globalFilterBindGroup.setResource(g,0);}else this._globalFilterBindGroup.setResource(u,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,n.encoder.draw({geometry:fI,shader:e,state:e._state,topology:"triangle-list"}),n.type===Oe.WEBGL&&n.renderTarget.finishRenderPass();}calculateSpriteMatrix(e,t){let i=this._activeFilterData,s=e.set(i.inputTexture._source.width,0,0,i.inputTexture._source.height,i.bounds.minX,i.bounds.minY),n=t.worldTransform.copyTo(D.shared),o=t.renderGroup||t.parentRenderGroup;return o&&o.cacheToLocalTransform&&n.prepend(o.cacheToLocalTransform),n.invert(),s.prepend(n),s.scale(1/t.texture.frame.width,1/t.texture.frame.height),s.translate(t.anchor.x,t.anchor.y),s}destroy(){}_applyFiltersToTexture(e,t){let i=e.inputTexture,s=e.bounds,n=e.filters;if(this._globalFilterBindGroup.setResource(i.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),n.length===1)n[0].apply(this,i,e.outputRenderSurface,t);else {let o=e.inputTexture,a=be.getOptimalTexture(s.width,s.height,o.source._resolution,false),u=a,l=0;for(l=0;l<n.length-1;++l){n[l].apply(this,o,u,true);let h=o;o=u,u=h;}n[l].apply(this,o,e.outputRenderSurface,t),be.returnTexture(a);}}_calculateFilterBounds(e,t,i,s,n){let o=this.renderer,a=e.bounds,u=e.filters,l=1/0,c=0,h=true,d=false,p=false,_=true;for(let b=0;b<u.length;b++){let x=u[b];if(l=Math.min(l,x.resolution==="inherit"?s:x.resolution),c+=x.padding,x.antialias==="off"?h=false:x.antialias==="inherit"&&h&&(h=i),x.clipToViewport||(_=false),!!!(x.compatibleRenderers&o.type)){p=false;break}if(x.blendRequired&&!(o.backBuffer?.useBackBuffer??true)){F("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),p=false;break}p=x.enabled||p,d||(d=x.blendRequired);}if(!p){e.skip=true;return}if(_&&a.fitBounds(0,t.width/s,0,t.height/s),a.scale(l).ceil().scale(1/l).pad((c|0)*n),!a.isPositive){e.skip=true;return}e.antialias=h,e.resolution=l,e.blendRequired=d;}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let e,t=this._filterStackIndex-1;for(;t>1&&(t--,e=this._filterStack[t],!!e.skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||(e=this._filterStack[this._filterStackIndex]=new n2),this._filterStackIndex++,e}};lo.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"filter"};});var a2=f(()=>{E();i2();o2();O.add(lo);O.add(uo);});var pI={};var nP=f(()=>{MA();Zb();kA();OA();Lf();Wf();M0();I0();X0();vv();Mv();Wv();e2();r2();a2();});var u2,oP=f(()=>{E();u2={extension:{type:m.Environment,name:"browser",priority:-1},test:()=>true,load:async()=>{await Promise.resolve().then(()=>(nP(),pI));}};});var mI={};var aP=f(()=>{Zb();Lf();Wf();M0();I0();X0();vv();Mv();Wv();e2();r2();a2();});var l2,uP=f(()=>{E();l2={extension:{type:m.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>(aP(),mI));}};});var lP,_t,hi=f(()=>{Kt();ur();Ar();cr();lP=class c2 extends ze{constructor(e){e={...c2.defaultOptions,...e},super(e),this.enabled=true,this._state=Ue.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1);}apply(e,t,i,s){e.applyFilter(this,t,i,s);}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e;}static from(e){let{gpu:t,gl:i,...s}=e,n,o;return t&&(n=Fe.from(t)),i&&(o=ke.from(i)),new c2({gpuProgram:n,glProgram:o,...s})}};lP.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:false,clipToViewport:true};_t=lP;});var Xm,h2=f(()=>{Xm=`
|
|
576
|
+
`}};});var Yv,$v,xu,jv=f(()=>{he();Gi();no();Ui();Ar();Qe();ce();Xv();xu=class extends ze{constructor(){Yv??(Yv=vr({name:"tiling-sprite-shader",bits:[Wi,Gm,Sr]})),$v??($v=Tr({name:"tiling-sprite-shader",bits:[zs,Um,Er]}));let e=new ae({uMapCoord:{value:new D,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new D,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:$v,gpuProgram:Yv,resources:{localUniforms:new ae({uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:C.EMPTY.source,uSampler:C.EMPTY.source.style}});}updateUniforms(e,t,i,s,n,o){let a=this.resources.tilingUniforms,u=o.width,l=o.height,c=o.textureMatrix,h=a.uniforms.uTextureTransform;h.set(i.a*u/e,i.b*u/t,i.c*l/e,i.d*l/t,i.tx/e,i.ty/t),h.invert(),a.uniforms.uMapCoord=c.mapCoord,a.uniforms.uClampFrame=c.uClampFrame,a.uniforms.uClampOffset=c.uClampOffset,a.uniforms.uTextureTransform=h,a.uniforms.uSizeAnchor[0]=e,a.uniforms.uSizeAnchor[1]=t,a.uniforms.uSizeAnchor[2]=s,a.uniforms.uSizeAnchor[3]=n,o&&(this.resources.uTexture=o.source,this.resources.uSampler=o.source.style);}};});var _u,qv=f(()=>{Vs();_u=class extends Zt{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])});}};});function Lm(r,e){let t=r.anchor.x,i=r.anchor.y;e[0]=-t*r.width,e[1]=-i*r.height,e[2]=(1-t)*r.width,e[3]=-i*r.height,e[4]=(1-t)*r.width,e[5]=(1-i)*r.height,e[6]=-t*r.width,e[7]=(1-i)*r.height;}var Kv=f(()=>{});function Nm(r,e,t,i){let s=0,n=r.length/(e||2),o=i.a,a=i.b,u=i.c,l=i.d,c=i.tx,h=i.ty;for(t*=e;s<n;){let d=r[t],p=r[t+1];r[t]=o*d+u*p+c,r[t+1]=a*d+l*p+h,t+=e,s++;}}var Zv=f(()=>{});function Hm(r,e){let t=r.texture,i=t.frame.width,s=t.frame.height,n=0,o=0;r.applyAnchorToTexture&&(n=r.anchor.x,o=r.anchor.y),e[0]=e[6]=-n,e[2]=e[4]=1-n,e[1]=e[3]=-o,e[5]=e[7]=1-o;let a=D.shared;a.copyFrom(r._tileTransform.matrix),a.tx/=r.width,a.ty/=r.height,a.invert(),a.scale(r.width/i,r.height/s),Nm(e,2,0,a);}var Qv=f(()=>{he();Zv();});var Vm,$c,oo,Jv=f(()=>{E();Oa();cr();lr();zn();Ic();Vs();jv();qv();Kv();Qv();Vm=new _u,$c=class{constructor(){this.canBatch=true,this.geometry=new Zt({indices:Vm.indices.slice(),positions:Vm.positions.slice(),uvs:Vm.uvs.slice()});}destroy(){this.geometry.destroy(),this.shader?.destroy();}},oo=class{constructor(e){this._state=Ue.default2d,this._renderer=e;}validateRenderable(e){let t=this._getTilingSpriteData(e),i=t.canBatch;this._updateCanBatch(e);let s=t.canBatch;if(s&&s===i){let{batchableMesh:n}=t;return !n._batcher.checkAndUpdateTexture(n,e.texture)}return i!==s}addRenderable(e,t){let i=this._renderer.renderPipes.batch;this._updateCanBatch(e);let s=this._getTilingSpriteData(e),{geometry:n,canBatch:o}=s;if(o){s.batchableMesh||(s.batchableMesh=new ai);let a=s.batchableMesh;e.didViewUpdate&&(this._updateBatchableMesh(e),a.geometry=n,a.renderable=e,a.transform=e.groupTransform,a.setTexture(e._texture)),a.roundPixels=this._renderer._roundPixels|e._roundPixels,i.addToBatch(a,t);}else i.break(t),s.shader||(s.shader=new xu),this.updateRenderable(e),t.add(e);}execute(e){let{shader:t}=this._getTilingSpriteData(e);t.groups[0]=this._renderer.globalUniforms.bindGroup;let i=t.resources.localUniforms.uniforms;i.uTransformMatrix=e.groupTransform,i.uRound=this._renderer._roundPixels|e._roundPixels,Cr(e.groupColorAlpha,i.uColor,0),this._state.blendMode=Lr(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:Vm,shader:t,state:this._state});}updateRenderable(e){let t=this._getTilingSpriteData(e),{canBatch:i}=t;if(i){let{batchableMesh:s}=t;e.didViewUpdate&&this._updateBatchableMesh(e),s._batcher.updateElement(s);}else if(e.didViewUpdate){let{shader:s}=t;s.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture);}}_getTilingSpriteData(e){return e._gpuData[this._renderer.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){let t=new $c;return t.renderable=e,e._gpuData[this._renderer.uid]=t,t}_updateBatchableMesh(e){let t=this._getTilingSpriteData(e),{geometry:i}=t,s=e.texture.source.style;s.addressMode!=="repeat"&&(s.addressMode="repeat",s.update()),Hm(e,i.uvs),Lm(e,i.positions);}destroy(){this._renderer=null;}_updateCanBatch(e){let t=this._getTilingSpriteData(e),i=e.texture,s=true;return this._renderer.type===Oe.WEBGL&&(s=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=i.textureMatrix.isSimple&&(s||i.source.isPowerOfTwo),t.canBatch}};oo.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"tilingSprite"};});var e2=f(()=>{E();Jv();O.add(oo);});var tP,Ws,jc=f(()=>{xe();Vs();tP=class rP extends Zt{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(I(H,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t);}build(e){e={...rP.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;let t=this.verticesX*this.verticesY,i=[],s=[],n=[],o=this.verticesX-1,a=this.verticesY-1,u=this.width/o,l=this.height/a;for(let h=0;h<t;h++){let d=h%this.verticesX,p=h/this.verticesX|0;i.push(d*u,p*l),s.push(d/o,p/a);}let c=o*a;for(let h=0;h<c;h++){let d=h%o,p=h/o|0,_=p*this.verticesX+d,b=p*this.verticesX+d+1,x=(p+1)*this.verticesX+d,m=(p+1)*this.verticesX+d+1;n.push(_,b,x,b,m,x);}this.buffers[0].data=new Float32Array(i),this.buffers[1].data=new Float32Array(s),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update();}};tP.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};Ws=tP;});var iP,zr,zm=f(()=>{jc();iP=class sP extends Ws{constructor(e={}){e={...sP.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e);}update(e){this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this._anchorX=e.anchor?.x,this._anchorY=e.anchor?.y,this.updateUvs(),this.updatePositions();}updatePositions(){let e=this.positions,{width:t,height:i,_leftWidth:s,_rightWidth:n,_topHeight:o,_bottomHeight:a,_anchorX:u,_anchorY:l}=this,c=s+n,h=t>c?1:t/c,d=o+a,p=i>d?1:i/d,_=Math.min(h,p),b=u*t,x=l*i;e[0]=e[8]=e[16]=e[24]=-b,e[2]=e[10]=e[18]=e[26]=s*_-b,e[4]=e[12]=e[20]=e[28]=t-n*_-b,e[6]=e[14]=e[22]=e[30]=t-b,e[1]=e[3]=e[5]=e[7]=-x,e[9]=e[11]=e[13]=e[15]=o*_-x,e[17]=e[19]=e[21]=e[23]=i-a*_-x,e[25]=e[27]=e[29]=e[31]=i-x,this.getBuffer("aPosition").update();}updateUvs(){let e=this.uvs;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;let t=1/this._originalWidth,i=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.getBuffer("aUV").update();}};iP.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};zr=iP;});var qc,ao,t2=f(()=>{E();Ic();zm();qc=class extends ai{constructor(){super(),this.geometry=new zr;}destroy(){this.geometry.destroy();}},ao=class{constructor(e){this._renderer=e;}addRenderable(e,t){let i=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,i),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t);}validateRenderable(e){let t=this._getGpuSprite(e);return !t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.geometry.update(e),t.setTexture(e._texture);}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){let t=e._gpuData[this._renderer.uid]=new qc,i=t;return i.renderable=e,i.transform=e.groupTransform,i.texture=e._texture,i.roundPixels=this._renderer._roundPixels|e._roundPixels,e.didViewUpdate||this._updateBatchableSprite(e,i),t}destroy(){this._renderer=null;}};ao.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"nineSliceSprite"};});var r2=f(()=>{E();t2();O.add(ao);});var uo,i2=f(()=>{E();uo=class{constructor(e){this._renderer=e;}push(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"filter",canBundle:false,action:"pushFilter",container:t,filterEffect:e});}pop(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"filter",action:"popFilter",canBundle:false});}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop();}destroy(){this._renderer=null;}};uo.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"filter"};});function Wm(r,e){e.clear();let t=e.matrix;for(let i=0;i<r.length;i++){let s=r[i];s.globalDisplayStatus<7||(e.matrix=s.worldTransform,e.addBounds(s.bounds));}return e.matrix=t,e}var s2=f(()=>{});var fI,n2,lo,o2=f(()=>{E();he();Fi();vs();Qe();ce();Fr();lr();Et();s2();_e();fI=new Mt({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:2*4,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),n2=class{constructor(){this.skip=false,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new me,this.container=null,this.blendRequired=false,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0};}},lo=class{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new ae({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new nt({}),this.renderer=e;}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){let t=this.renderer,i=e.filterEffect.filters,s=this._pushFilterData();s.skip=false,s.filters=i,s.container=e.container,s.outputRenderSurface=t.renderTarget.renderSurface;let n=t.renderTarget.renderTarget.colorTexture.source,o=n.resolution,a=n.antialias;if(i.length===0){s.skip=true;return}let u=s.bounds;if(this._calculateFilterArea(e,u),this._calculateFilterBounds(s,t.renderTarget.rootViewPort,a,o,1),s.skip)return;let l=this._getPreviousFilterData(),c=this._findFilterResolution(o),h=0,d=0;l&&(h=l.bounds.minX,d=l.bounds.minY),this._calculateGlobalFrame(s,h,d,c,n.width,n.height),this._setupFilterTextures(s,u,t,l);}generateFilteredTexture({texture:e,filters:t}){let i=this._pushFilterData();this._activeFilterData=i,i.skip=false,i.filters=t;let s=e.source,n=s.resolution,o=s.antialias;if(t.length===0)return i.skip=true,e;let a=i.bounds;if(a.addRect(e.frame),this._calculateFilterBounds(i,a.rectangle,o,n,0),i.skip)return e;let u=n;this._calculateGlobalFrame(i,0,0,u,s.width,s.height),i.outputRenderSurface=be.getOptimalTexture(a.width,a.height,i.resolution,i.antialias),i.backTexture=C.EMPTY,i.inputTexture=e,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(i,true);let d=i.outputRenderSurface;return d.source.alphaMode="premultiplied-alpha",d}pop(){let e=this.renderer,t=this._popFilterData();t.skip||(e.globalUniforms.pop(),e.renderTarget.finishRenderPass(),this._activeFilterData=t,this._applyFiltersToTexture(t,false),t.blendRequired&&be.returnTexture(t.backTexture),be.returnTexture(t.inputTexture));}getBackTexture(e,t,i){let s=e.colorTexture.source._resolution,n=be.getOptimalTexture(t.width,t.height,s,false),o=t.minX,a=t.minY;i&&(o-=i.minX,a-=i.minY),o=Math.floor(o*s),a=Math.floor(a*s);let u=Math.ceil(t.width*s),l=Math.ceil(t.height*s);return this.renderer.renderTarget.copyToTexture(e,n,{x:o,y:a},{width:u,height:l},{x:0,y:0}),n}applyFilter(e,t,i,s){let n=this.renderer,o=this._activeFilterData,u=o.outputRenderSurface===i,l=n.renderTarget.rootRenderTarget.colorTexture.source._resolution,c=this._findFilterResolution(l),h=0,d=0;if(u){let p=this._findPreviousFilterOffset();h=p.x,d=p.y;}this._updateFilterUniforms(t,i,o,h,d,c,u,s),this._setupBindGroupsAndRender(e,t,n);}calculateSpriteMatrix(e,t){let i=this._activeFilterData,s=e.set(i.inputTexture._source.width,0,0,i.inputTexture._source.height,i.bounds.minX,i.bounds.minY),n=t.worldTransform.copyTo(D.shared),o=t.renderGroup||t.parentRenderGroup;return o&&o.cacheToLocalTransform&&n.prepend(o.cacheToLocalTransform),n.invert(),s.prepend(n),s.scale(1/t.texture.frame.width,1/t.texture.frame.height),s.translate(t.anchor.x,t.anchor.y),s}destroy(){}_setupBindGroupsAndRender(e,t,i){if(i.renderPipes.uniformBatch){let s=i.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(s,0);}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,i.encoder.draw({geometry:fI,shader:e,state:e._state,topology:"triangle-list"}),i.type===Oe.WEBGL&&i.renderTarget.finishRenderPass();}_setupFilterTextures(e,t,i,s){if(e.backTexture=C.EMPTY,e.blendRequired){i.renderTarget.finishRenderPass();let n=i.renderTarget.getRenderTarget(e.outputRenderSurface);e.backTexture=this.getBackTexture(n,t,s?.bounds);}e.inputTexture=be.getOptimalTexture(t.width,t.height,e.resolution,e.antialias),i.renderTarget.bind(e.inputTexture,true),i.globalUniforms.push({offset:t});}_calculateGlobalFrame(e,t,i,s,n,o){let a=e.globalFrame;a.x=t*s,a.y=i*s,a.width=n*s,a.height=o*s;}_updateFilterUniforms(e,t,i,s,n,o,a,u){let l=this._filterGlobalUniforms.uniforms,c=l.uOutputFrame,h=l.uInputSize,d=l.uInputPixel,p=l.uInputClamp,_=l.uGlobalFrame,b=l.uOutputTexture;a?(c[0]=i.bounds.minX-s,c[1]=i.bounds.minY-n):(c[0]=0,c[1]=0),c[2]=e.frame.width,c[3]=e.frame.height,h[0]=e.source.width,h[1]=e.source.height,h[2]=1/h[0],h[3]=1/h[1],d[0]=e.source.pixelWidth,d[1]=e.source.pixelHeight,d[2]=1/d[0],d[3]=1/d[1],p[0]=.5*d[2],p[1]=.5*d[3],p[2]=e.frame.width*h[2]-.5*d[2],p[3]=e.frame.height*h[3]-.5*d[3];let x=this.renderer.renderTarget.rootRenderTarget.colorTexture;_[0]=s*o,_[1]=n*o,_[2]=x.source.width*o,_[3]=x.source.height*o,t instanceof C&&(t.source.resource=null);let m=this.renderer.renderTarget.getRenderTarget(t);this.renderer.renderTarget.bind(t,!!u),t instanceof C?(b[0]=t.frame.width,b[1]=t.frame.height):(b[0]=m.width,b[1]=m.height),b[2]=m.isRoot?-1:1,this._filterGlobalUniforms.update();}_findFilterResolution(e){let t=this._filterStackIndex-1;for(;t>0&&this._filterStack[t].skip;)--t;return t>0&&this._filterStack[t].inputTexture?this._filterStack[t].inputTexture.source._resolution:e}_findPreviousFilterOffset(){let e=0,t=0,i=this._filterStackIndex;for(;i>0;){i--;let s=this._filterStack[i];if(!s.skip){e=s.bounds.minX,t=s.bounds.minY;break}}return {x:e,y:t}}_calculateFilterArea(e,t){if(e.renderables?Wm(e.renderables,t):e.filterEffect.filterArea?(t.clear(),t.addRect(e.filterEffect.filterArea),t.applyMatrix(e.container.worldTransform)):e.container.getFastGlobalBounds(true,t),e.container){let s=(e.container.renderGroup||e.container.parentRenderGroup).cacheToLocalTransform;s&&t.applyMatrix(s);}}_applyFiltersToTexture(e,t){let i=e.inputTexture,s=e.bounds,n=e.filters;if(this._globalFilterBindGroup.setResource(i.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),n.length===1)n[0].apply(this,i,e.outputRenderSurface,t);else {let o=e.inputTexture,a=be.getOptimalTexture(s.width,s.height,o.source._resolution,false),u=a,l=0;for(l=0;l<n.length-1;++l){n[l].apply(this,o,u,true);let h=o;o=u,u=h;}n[l].apply(this,o,e.outputRenderSurface,t),be.returnTexture(a);}}_calculateFilterBounds(e,t,i,s,n){let o=this.renderer,a=e.bounds,u=e.filters,l=1/0,c=0,h=true,d=false,p=false,_=true;for(let b=0;b<u.length;b++){let x=u[b];if(l=Math.min(l,x.resolution==="inherit"?s:x.resolution),c+=x.padding,x.antialias==="off"?h=false:x.antialias==="inherit"&&h&&(h=i),x.clipToViewport||(_=false),!!!(x.compatibleRenderers&o.type)){p=false;break}if(x.blendRequired&&!(o.backBuffer?.useBackBuffer??true)){F("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),p=false;break}p=x.enabled||p,d||(d=x.blendRequired);}if(!p){e.skip=true;return}if(_&&a.fitBounds(0,t.width/s,0,t.height/s),a.scale(l).ceil().scale(1/l).pad((c|0)*n),!a.isPositive){e.skip=true;return}e.antialias=h,e.resolution=l,e.blendRequired=d;}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let e,t=this._filterStackIndex-1;for(;t>1&&(t--,e=this._filterStack[t],!!e.skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||(e=this._filterStack[this._filterStackIndex]=new n2),this._filterStackIndex++,e}};lo.extension={type:[g.WebGLSystem,g.WebGPUSystem],name:"filter"};});var a2=f(()=>{E();i2();o2();O.add(lo);O.add(uo);});var pI={};var nP=f(()=>{MA();Zb();kA();OA();Lf();Wf();M0();I0();X0();vv();Mv();Wv();e2();r2();a2();});var u2,oP=f(()=>{E();u2={extension:{type:g.Environment,name:"browser",priority:-1},test:()=>true,load:async()=>{await Promise.resolve().then(()=>(nP(),pI));}};});var mI={};var aP=f(()=>{Zb();Lf();Wf();M0();I0();X0();vv();Mv();Wv();e2();r2();a2();});var l2,uP=f(()=>{E();l2={extension:{type:g.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>(aP(),mI));}};});var lP,_t,hi=f(()=>{Kt();ur();Ar();cr();lP=class c2 extends ze{constructor(e){e={...c2.defaultOptions,...e},super(e),this.enabled=true,this._state=Ue.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1);}apply(e,t,i,s){e.applyFilter(this,t,i,s);}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e;}static from(e){let{gpu:t,gl:i,...s}=e,n,o;return t&&(n=Fe.from(t)),i&&(o=ke.from(i)),new c2({gpuProgram:n,glProgram:o,...s})}};lP.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:false,clipToViewport:true};_t=lP;});var Xm,h2=f(()=>{Xm=`
|
|
577
577
|
in vec2 vTextureCoord;
|
|
578
578
|
in vec4 vColor;
|
|
579
579
|
|
|
@@ -890,7 +890,7 @@ fn mainFragment(
|
|
|
890
890
|
}
|
|
891
891
|
`,main:`
|
|
892
892
|
out = vec4<f32>(blendColorOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
893
|
-
`}});}};Qc.extension={name:"color",type:
|
|
893
|
+
`}});}};Qc.extension={name:"color",type:g.BlendMode};});var Jc,dP=f(()=>{E();$e();Jc=class extends ee{constructor(){super({gl:{functions:`
|
|
894
894
|
float colorBurn(float base, float blend)
|
|
895
895
|
{
|
|
896
896
|
return max((1.0 - ((1.0 - base) / blend)), 0.0);
|
|
@@ -926,7 +926,7 @@ fn mainFragment(
|
|
|
926
926
|
}
|
|
927
927
|
`,main:`
|
|
928
928
|
out = vec4<f32>(blendColorBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
929
|
-
`}});}};Jc.extension={name:"color-burn",type:
|
|
929
|
+
`}});}};Jc.extension={name:"color-burn",type:g.BlendMode};});var eh,fP=f(()=>{E();$e();eh=class extends ee{constructor(){super({gl:{functions:`
|
|
930
930
|
float colorDodge(float base, float blend)
|
|
931
931
|
{
|
|
932
932
|
return base / (1.0 - blend);
|
|
@@ -962,7 +962,7 @@ fn mainFragment(
|
|
|
962
962
|
}
|
|
963
963
|
`,main:`
|
|
964
964
|
out = vec4<f32>(blendColorDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
965
|
-
`}});}};eh.extension={name:"color-dodge",type:
|
|
965
|
+
`}});}};eh.extension={name:"color-dodge",type:g.BlendMode};});var th,pP=f(()=>{E();$e();th=class extends ee{constructor(){super({gl:{functions:`
|
|
966
966
|
vec3 blendDarken(vec3 base, vec3 blend, float opacity)
|
|
967
967
|
{
|
|
968
968
|
return (min(base, blend) * opacity + base * (1.0 - opacity));
|
|
@@ -976,7 +976,7 @@ fn mainFragment(
|
|
|
976
976
|
}
|
|
977
977
|
`,main:`
|
|
978
978
|
out = vec4<f32>(blendDarken(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
979
|
-
`}});}};th.extension={name:"darken",type:
|
|
979
|
+
`}});}};th.extension={name:"darken",type:g.BlendMode};});var rh,mP=f(()=>{E();$e();rh=class extends ee{constructor(){super({gl:{functions:`
|
|
980
980
|
vec3 blendDifference(vec3 base, vec3 blend, float opacity)
|
|
981
981
|
{
|
|
982
982
|
return (abs(blend - base) * opacity + base * (1.0 - opacity));
|
|
@@ -990,7 +990,7 @@ fn mainFragment(
|
|
|
990
990
|
}
|
|
991
991
|
`,main:`
|
|
992
992
|
out = vec4<f32>(blendDifference(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
993
|
-
`}});}};rh.extension={name:"difference",type:
|
|
993
|
+
`}});}};rh.extension={name:"difference",type:g.BlendMode};});var ih,gP=f(()=>{E();$e();ih=class extends ee{constructor(){super({gl:{functions:`
|
|
994
994
|
float divide(float base, float blend)
|
|
995
995
|
{
|
|
996
996
|
return (blend > 0.0) ? clamp(base / blend, 0.0, 1.0) : 1.0;
|
|
@@ -1025,7 +1025,7 @@ fn mainFragment(
|
|
|
1025
1025
|
}
|
|
1026
1026
|
`,main:`
|
|
1027
1027
|
out = vec4<f32>(blendDivide(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1028
|
-
`}});}};ih.extension={name:"divide",type:
|
|
1028
|
+
`}});}};ih.extension={name:"divide",type:g.BlendMode};});var sh,xP=f(()=>{E();$e();sh=class extends ee{constructor(){super({gl:{functions:`
|
|
1029
1029
|
vec3 exclusion(vec3 base, vec3 blend)
|
|
1030
1030
|
{
|
|
1031
1031
|
return base + blend - 2.0 * base * blend;
|
|
@@ -1049,7 +1049,7 @@ fn mainFragment(
|
|
|
1049
1049
|
}
|
|
1050
1050
|
`,main:`
|
|
1051
1051
|
out = vec4<f32>(blendExclusion(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1052
|
-
`}});}};sh.extension={name:"exclusion",type:
|
|
1052
|
+
`}});}};sh.extension={name:"exclusion",type:g.BlendMode};});var nh,_P=f(()=>{E();$e();nh=class extends ee{constructor(){super({gl:{functions:`
|
|
1053
1053
|
float hardLight(float base, float blend)
|
|
1054
1054
|
{
|
|
1055
1055
|
return (blend < 0.5) ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
|
|
@@ -1084,7 +1084,7 @@ fn mainFragment(
|
|
|
1084
1084
|
}
|
|
1085
1085
|
`,main:`
|
|
1086
1086
|
out = vec4<f32>(blendHardLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1087
|
-
`}});}};nh.extension={name:"hard-light",type:
|
|
1087
|
+
`}});}};nh.extension={name:"hard-light",type:g.BlendMode};});var oh,bP=f(()=>{E();$e();oh=class extends ee{constructor(){super({gl:{functions:`
|
|
1088
1088
|
float hardMix(float base, float blend)
|
|
1089
1089
|
{
|
|
1090
1090
|
return (base + blend >= 1.0) ? 1.0 : 0.0;
|
|
@@ -1118,7 +1118,7 @@ fn mainFragment(
|
|
|
1118
1118
|
}
|
|
1119
1119
|
`,main:`
|
|
1120
1120
|
out = vec4<f32>(blendHardMix(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1121
|
-
`}});}};oh.extension={name:"hard-mix",type:
|
|
1121
|
+
`}});}};oh.extension={name:"hard-mix",type:g.BlendMode};});var ah,yP=f(()=>{E();$e();ah=class extends ee{constructor(){super({gl:{functions:`
|
|
1122
1122
|
vec3 blendLighten(vec3 base, vec3 blend, float opacity)
|
|
1123
1123
|
{
|
|
1124
1124
|
return (max(base, blend) * opacity + base * (1.0 - opacity));
|
|
@@ -1132,7 +1132,7 @@ fn mainFragment(
|
|
|
1132
1132
|
}
|
|
1133
1133
|
`,main:`
|
|
1134
1134
|
out = vec4<f32>(blendLighten(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1135
|
-
`}});}};ah.extension={name:"lighten",type:
|
|
1135
|
+
`}});}};ah.extension={name:"lighten",type:g.BlendMode};});var uh,vP=f(()=>{E();$e();uh=class extends ee{constructor(){super({gl:{functions:`
|
|
1136
1136
|
float linearBurn(float base, float blend)
|
|
1137
1137
|
{
|
|
1138
1138
|
return max(0.0, base + blend - 1.0);
|
|
@@ -1168,7 +1168,7 @@ fn mainFragment(
|
|
|
1168
1168
|
}
|
|
1169
1169
|
`,main:`
|
|
1170
1170
|
out = vec4<f32>(blendLinearBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1171
|
-
`}});}};uh.extension={name:"linear-burn",type:
|
|
1171
|
+
`}});}};uh.extension={name:"linear-burn",type:g.BlendMode};});var lh,TP=f(()=>{E();$e();lh=class extends ee{constructor(){super({gl:{functions:`
|
|
1172
1172
|
float linearDodge(float base, float blend) {
|
|
1173
1173
|
return min(1.0, base + blend);
|
|
1174
1174
|
}
|
|
@@ -1201,7 +1201,7 @@ fn mainFragment(
|
|
|
1201
1201
|
}
|
|
1202
1202
|
`,main:`
|
|
1203
1203
|
out = vec4<f32>(blendLinearDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1204
|
-
`}});}};lh.extension={name:"linear-dodge",type:
|
|
1204
|
+
`}});}};lh.extension={name:"linear-dodge",type:g.BlendMode};});var ch,SP=f(()=>{E();$e();ch=class extends ee{constructor(){super({gl:{functions:`
|
|
1205
1205
|
float linearBurn(float base, float blend) {
|
|
1206
1206
|
return max(0.0, base + blend - 1.0);
|
|
1207
1207
|
}
|
|
@@ -1253,7 +1253,7 @@ fn mainFragment(
|
|
|
1253
1253
|
}
|
|
1254
1254
|
`,main:`
|
|
1255
1255
|
out = vec4<f32>(blendLinearLightOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1256
|
-
`}});}};ch.extension={name:"linear-light",type:
|
|
1256
|
+
`}});}};ch.extension={name:"linear-light",type:g.BlendMode};});var hh,EP=f(()=>{E();$e();Kc();Zc();hh=class extends ee{constructor(){super({gl:{functions:`
|
|
1257
1257
|
${Xs}
|
|
1258
1258
|
|
|
1259
1259
|
vec3 blendLuminosity(vec3 base, vec3 blend, float opacity)
|
|
@@ -1273,7 +1273,7 @@ fn mainFragment(
|
|
|
1273
1273
|
}
|
|
1274
1274
|
`,main:`
|
|
1275
1275
|
out = vec4<f32>(blendLuminosity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1276
|
-
`}});}};hh.extension={name:"luminosity",type:
|
|
1276
|
+
`}});}};hh.extension={name:"luminosity",type:g.BlendMode};});var dh,AP=f(()=>{E();$e();dh=class extends ee{constructor(){super({gl:{functions:`
|
|
1277
1277
|
vec3 negation(vec3 base, vec3 blend)
|
|
1278
1278
|
{
|
|
1279
1279
|
return 1.0-abs(1.0-base-blend);
|
|
@@ -1297,7 +1297,7 @@ fn mainFragment(
|
|
|
1297
1297
|
}
|
|
1298
1298
|
`,main:`
|
|
1299
1299
|
out = vec4<f32>(blendNegationOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1300
|
-
`}});}};dh.extension={name:"negation",type:
|
|
1300
|
+
`}});}};dh.extension={name:"negation",type:g.BlendMode};});var fh,CP=f(()=>{E();$e();fh=class extends ee{constructor(){super({gl:{functions:`
|
|
1301
1301
|
float overlay(float base, float blend)
|
|
1302
1302
|
{
|
|
1303
1303
|
return (base < 0.5) ? (2.0*base*blend) : (1.0-2.0*(1.0-base)*(1.0-blend));
|
|
@@ -1333,7 +1333,7 @@ fn mainFragment(
|
|
|
1333
1333
|
}
|
|
1334
1334
|
`,main:`
|
|
1335
1335
|
out = vec4<f32>(blendOverlay(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1336
|
-
`}});}};fh.extension={name:"overlay",type:
|
|
1336
|
+
`}});}};fh.extension={name:"overlay",type:g.BlendMode};});var ph,PP=f(()=>{E();$e();ph=class extends ee{constructor(){super({gl:{functions:`
|
|
1337
1337
|
float pinLight(float base, float blend)
|
|
1338
1338
|
{
|
|
1339
1339
|
return (blend <= 0.5) ? min(base, 2.0 * blend) : max(base, 2.0 * (blend - 0.5));
|
|
@@ -1369,7 +1369,7 @@ fn mainFragment(
|
|
|
1369
1369
|
}
|
|
1370
1370
|
`,main:`
|
|
1371
1371
|
out = vec4<f32>(blendPinLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1372
|
-
`}});}};ph.extension={name:"pin-light",type:
|
|
1372
|
+
`}});}};ph.extension={name:"pin-light",type:g.BlendMode};});var mh,wP=f(()=>{E();$e();Kc();Zc();mh=class extends ee{constructor(){super({gl:{functions:`
|
|
1373
1373
|
${Xs}
|
|
1374
1374
|
|
|
1375
1375
|
vec3 blendSaturation(vec3 base, vec3 blend, float opacity)
|
|
@@ -1389,7 +1389,7 @@ fn mainFragment(
|
|
|
1389
1389
|
}
|
|
1390
1390
|
`,main:`
|
|
1391
1391
|
out = vec4<f32>(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1392
|
-
`}});}};mh.extension={name:"saturation",type:
|
|
1392
|
+
`}});}};mh.extension={name:"saturation",type:g.BlendMode};});var gh,BP=f(()=>{E();$e();gh=class extends ee{constructor(){super({gl:{functions:`
|
|
1393
1393
|
float softLight(float base, float blend)
|
|
1394
1394
|
{
|
|
1395
1395
|
return (blend < 0.5) ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));
|
|
@@ -1425,7 +1425,7 @@ fn mainFragment(
|
|
|
1425
1425
|
}
|
|
1426
1426
|
`,main:`
|
|
1427
1427
|
out = vec4<f32>(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1428
|
-
`}});}};gh.extension={name:"soft-light",type:
|
|
1428
|
+
`}});}};gh.extension={name:"soft-light",type:g.BlendMode};});var xh,RP=f(()=>{E();$e();xh=class extends ee{constructor(){super({gl:{functions:`
|
|
1429
1429
|
float subtract(float base, float blend)
|
|
1430
1430
|
{
|
|
1431
1431
|
return max(0.0, base - blend);
|
|
@@ -1461,7 +1461,7 @@ fn mainFragment(
|
|
|
1461
1461
|
}
|
|
1462
1462
|
`,main:`
|
|
1463
1463
|
out = vec4<f32>(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1464
|
-
`}});}};xh.extension={name:"subtract",type:
|
|
1464
|
+
`}});}};xh.extension={name:"subtract",type:g.BlendMode};});var _h,MP=f(()=>{E();$e();_h=class extends ee{constructor(){super({gl:{functions:`
|
|
1465
1465
|
float colorBurn(float base, float blend)
|
|
1466
1466
|
{
|
|
1467
1467
|
return max((1.0-((1.0-base)/blend)),0.0);
|
|
@@ -1517,7 +1517,7 @@ fn mainFragment(
|
|
|
1517
1517
|
}
|
|
1518
1518
|
`,main:`
|
|
1519
1519
|
out = vec4<f32>(blendVividLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1520
|
-
`}});}};_h.extension={name:"vivid-light",type:
|
|
1520
|
+
`}});}};_h.extension={name:"vivid-light",type:g.BlendMode};});async function bh(r){if(!r)for(let e=0;e<p2.length;e++){let t=p2[e];if(t.value.test()){await t.value.load();return}}}async function DP(r){return bh(!r)}var p2,m2=f(()=>{E();p2=[];O.handleByNamedList(g.Environment,p2);});function bu(){if(typeof yh=="boolean")return yh;try{yh=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0;}catch{yh=false;}return yh}var yh,jm=f(()=>{});var ot,co=f(()=>{ot=(r=>(r[r.NONE=0]="NONE",r[r.COLOR=16384]="COLOR",r[r.STENCIL=1024]="STENCIL",r[r.DEPTH=256]="DEPTH",r[r.COLOR_DEPTH=16640]="COLOR_DEPTH",r[r.COLOR_STENCIL=17408]="COLOR_STENCIL",r[r.DEPTH_STENCIL=1280]="DEPTH_STENCIL",r[r.ALL=17664]="ALL",r))(ot||{});});var $s,qm=f(()=>{$s=class{constructor(e){this.items=[],this._name=e;}emit(e,t,i,s,n,o,a,u){let{name:l,items:c}=this;for(let h=0,d=c.length;h<d;h++)c[h][l](e,t,i,s,n,o,a,u);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){let t=this.items.indexOf(e);return t!==-1&&this.items.splice(t,1),this}contains(e){return this.items.indexOf(e)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null;}get empty(){return this.items.length===0}get name(){return this._name}};});var gI,IP,di,yu=f(()=>{it();m2();qt();jm();lt();xe();co();qm();St();gI=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],IP=class kP extends ue{constructor(e){super(),this.uid=re("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;let t=[...gI,...this.config.runners??[]];this._addRunners(...t),this._unsafeEvalCheck();}async init(e={}){let t=e.skipExtensionImports===true?true:e.manageImports===false;await bh(t),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(let i in this._systemsHash)e={...this._systemsHash[i].constructor.defaultOptions,...e};e={...kP.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let i=0;i<this.runners.init.items.length;i++)await this.runners.init.items[i].init(e);this._initOptions=e;}render(e,t){let i=e;if(i instanceof te&&(i={container:i},t&&(I(H,"passing a second argument is deprecated, please use render options instead"),i.target=t.renderTexture)),i.target||(i.target=this.view.renderTarget),i.target===this.view.renderTarget&&(this._lastObjectRendered=i.container,i.clearColor??(i.clearColor=this.background.colorRgba),i.clear??(i.clear=this.background.clearBeforeRender)),i.clearColor){let s=Array.isArray(i.clearColor)&&i.clearColor.length===4;i.clearColor=s?i.clearColor:K.shared.setValue(i.clearColor).toArray();}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.enableRenderGroup(),this.runners.prerender.emit(i),this.runners.renderStart.emit(i),this.runners.render.emit(i),this.runners.renderEnd.emit(i),this.runners.postrender.emit(i);}resize(e,t,i){let s=this.view.resolution;this.view.resize(e,t,i),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),i!==void 0&&i!==s&&this.runners.resolutionChange.emit(i);}clear(e={}){let t=this;e.target||(e.target=t.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=ot.ALL);let{clear:i,clearColor:s,target:n}=e;K.shared.setValue(s??this.background.colorRgba),t.renderTarget.clear(n,i,K.shared.toArray());}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e);}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...e){e.forEach(t=>{this.runners[t]=new $s(t);});}_addSystems(e){let t;for(t in e){let i=e[t];this._addSystem(i.value,i.name);}}_addSystem(e,t){let i=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=i,this._systemsHash[t]=i;for(let s in this.runners)this.runners[s].add(i);return this}_addPipes(e,t){let i=t.reduce((s,n)=>(s[n.name]=n.value,s),{});e.forEach(s=>{let n=s.value,o=s.name,a=i[o];this.renderPipes[o]=new n(this,a?new a:null);});}destroy(e=false){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),Object.values(this.runners).forEach(t=>{t.destroy();}),this._systemsHash=null,this.renderPipes=null;}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return !!this._roundPixels}_unsafeEvalCheck(){if(!bu())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit();}};IP.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:false,roundPixels:false};di=IP;});function fi(r){return Km!==void 0||(Km=(()=>{let e={stencil:true,failIfMajorPerformanceCaveat:r??di.defaultOptions.failIfMajorPerformanceCaveat};try{if(!V.get().getWebGLRenderingContext())return !1;let i=V.get().createCanvas().getContext("webgl",e),s=!!i?.getContextAttributes()?.stencil;if(i){let n=i.getExtension("WEBGL_lose_context");n&&n.loseContext();}return i=null,s}catch{return false}})()),Km}var Km,vu=f(()=>{Se();yu();});async function pi(r={}){return Zm!==void 0||(Zm=await(async()=>{let e=V.get().getNavigator().gpu;if(!e)return false;try{return await(await e.requestAdapter(r)).requestDevice(),!0}catch{return false}})()),Zm}var Zm,Tu=f(()=>{Se();});var ho,g2=f(()=>{E();he();pc();Gi();Wa();Xa();no();Ui();Ar();Qe();ho=class{constructor(){this._maxTextures=0;}contextChange(e){let t=new ae({uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}});this._maxTextures=e.limits.maxBatchableTextures;let i=vr({name:"graphics",bits:[As,Ps(this._maxTextures),Om,Sr]});this.shader=new ze({gpuProgram:i,resources:{localUniforms:t}});}execute(e,t){let i=t.context,s=i.customShader||this.shader,n=e.renderer,o=n.graphicsContext,{batcher:a,instructions:u}=o.getContextRenderData(i),l=n.encoder;l.setGeometry(a.geometry,s.gpuProgram);let c=n.globalUniforms.bindGroup;l.setBindGroup(0,c,s.gpuProgram);let h=n.renderPipes.uniformBatch.getUniformBindGroup(s.resources.localUniforms,true);l.setBindGroup(2,h,s.gpuProgram);let d=u.instructions,p=null;for(let _=0;_<u.instructionSize;_++){let b=d[_];if(b.topology!==p&&(p=b.topology,l.setPipelineFromGeometryProgramAndState(a.geometry,s.gpuProgram,e.state,b.topology)),s.groups[1]=b.bindGroup,!b.gpuBindGroup){let x=b.textures;b.bindGroup=bs(x.textures,x.count,this._maxTextures),b.gpuBindGroup=n.bindGroup.getBindGroup(b.bindGroup,s.gpuProgram,1);}l.setBindGroup(1,b.bindGroup,s.gpuProgram),l.renderPassEncoder.drawIndexed(b.size,1,b.start);}}destroy(){this.shader.destroy(true),this.shader=null;}};ho.extension={type:[g.WebGPUPipesAdaptor],name:"graphics"};});var Qm,Jm,eg=f(()=>{Qm={name:"texture-bit",vertex:{header:`
|
|
1521
1521
|
|
|
1522
1522
|
struct TextureUniforms {
|
|
1523
1523
|
uTextureMatrix:mat3x3<f32>,
|
|
@@ -1543,7 +1543,7 @@ fn mainFragment(
|
|
|
1543
1543
|
|
|
1544
1544
|
`,main:`
|
|
1545
1545
|
outColor = texture(uTexture, vUV);
|
|
1546
|
-
`}};});var fo,x2=f(()=>{E();he();Gi();no();Ui();eg();Ar();ce();_e();fo=class{init(){let e=vr({name:"mesh",bits:[Wi,Qm,Sr]});this._shader=new ze({gpuProgram:e,resources:{uTexture:C.EMPTY._source,uSampler:C.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new D}}}});}execute(e,t){let i=e.renderer,s=t._shader;if(!s)s=this._shader,s.groups[2]=i.texture.getTextureBindGroup(t.texture);else if(!s.gpuProgram){F("Mesh shader has no gpuProgram",t.shader);return}let n=s.gpuProgram;if(n.autoAssignGlobalUniforms&&(s.groups[0]=i.globalUniforms.bindGroup),n.autoAssignLocalUniforms){let o=e.localUniforms;s.groups[1]=i.renderPipes.uniformBatch.getUniformBindGroup(o,true);}i.encoder.draw({geometry:t._geometry,shader:s,state:t.state});}destroy(){this._shader.destroy(true),this._shader=null;}};fo.extension={type:[m.WebGPUPipesAdaptor],name:"mesh"};});var tg,po,_2=f(()=>{E();cr();pc();tg=Ue.for2d(),po=class{start(e,t,i){let s=e.renderer,n=s.encoder,o=i.gpuProgram;this._shader=i,this._geometry=t,n.setGeometry(t,o),tg.blendMode="normal",s.pipeline.getPipeline(t,o,tg);let a=s.globalUniforms.bindGroup;n.resetBindGroup(1),n.setBindGroup(0,a,o);}execute(e,t){let i=this._shader.gpuProgram,s=e.renderer,n=s.encoder;if(!t.bindGroup){let u=t.textures;t.bindGroup=bs(u.textures,u.count,s.limits.maxBatchableTextures);}tg.blendMode=t.blendMode;let o=s.bindGroup.getBindGroup(t.bindGroup,i,1),a=s.pipeline.getPipeline(this._geometry,i,tg,t.topology);t.bindGroup._touch(s.textureGC.count),n.setPipeline(a),n.renderPassEncoder.setBindGroup(1,o),n.renderPassEncoder.drawIndexed(t.size,1,t.start);}};po.extension={type:[m.WebGPUPipesAdaptor],name:"batch"};});var mo,b2=f(()=>{E();mo=class{constructor(e){this._renderer=e;}updateRenderable(){}destroyRenderable(){}validateRenderable(){return false}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e);}execute(e){e.isRenderable&&e.render(this._renderer);}destroy(){this._renderer=null;}};mo.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"customRender"};});function go(r,e){let t=r.instructionSet,i=t.instructions;for(let s=0;s<t.instructionSize;s++){let n=i[s];e[n.renderPipeId].execute(n);}}var rg=f(()=>{});var xI,xo,y2=f(()=>{E();he();ri();tu();rg();xI=new D,xo=class{constructor(e){this._renderer=e;}addRenderGroup(e,t){e.isCachedAsTexture?this._addRenderableCacheAsTexture(e,t):this._addRenderableDirect(e,t);}execute(e){e.isRenderable&&(e.isCachedAsTexture?this._executeCacheAsTexture(e):this._executeDirect(e));}destroy(){this._renderer=null;}_addRenderableDirect(e,t){this._renderer.renderPipes.batch.break(t),e._batchableRenderGroup&&(Re.return(e._batchableRenderGroup),e._batchableRenderGroup=null),t.add(e);}_addRenderableCacheAsTexture(e,t){let i=e._batchableRenderGroup??(e._batchableRenderGroup=Re.get(Pr));i.renderable=e.root,i.transform=e.root.relativeGroupTransform,i.texture=e.texture,i.bounds=e._textureBounds,t.add(e),this._renderer.renderPipes.batch.addToBatch(i,t);}_executeCacheAsTexture(e){if(e.textureNeedsUpdate){e.textureNeedsUpdate=false;let t=xI.identity().translate(-e._textureBounds.x,-e._textureBounds.y);this._renderer.renderTarget.push(e.texture,true,null,e.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:t,worldColor:4294967295}),go(e,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop();}e._batchableRenderGroup._batcher.updateElement(e._batchableRenderGroup),e._batchableRenderGroup._batcher.geometry.buffers[0].update();}_executeDirect(e){this._renderer.globalUniforms.push({worldTransformMatrix:e.inverseParentTextureTransform,worldColor:e.worldColorAlpha}),go(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop();}};xo.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"renderGroup"};});function _o(r,e){e||(e=0);for(let t=e;t<r.length&&r[t];t++)r[t]=null;}var ig=f(()=>{});function vh(r,e=false){v2(r);let t=r.childrenToUpdate,i=r.updateTick++;for(let s in t){let n=Number(s),o=t[s],a=o.list,u=o.index;for(let l=0;l<u;l++){let c=a[l];c.parentRenderGroup===r&&c.relativeRenderGroupDepth===n&&sg(c,i,0);}_o(a,u),o.index=0;}if(e)for(let s=0;s<r.renderGroupChildren.length;s++)vh(r.renderGroupChildren[s],e);}function v2(r){let e=r.root,t;if(r.renderGroupParent){let i=r.renderGroupParent;r.worldTransform.appendFrom(e.relativeGroupTransform,i.worldTransform),r.worldColor=ns(e.groupColor,i.worldColor),t=e.groupAlpha*i.worldAlpha;}else r.worldTransform.copyFrom(e.localTransform),r.worldColor=e.localColor,t=e.localAlpha;t=t<0?0:t>1?1:t,r.worldAlpha=t,r.worldColorAlpha=r.worldColor+((t*255|0)<<24);}function sg(r,e,t){if(e===r.updateTick)return;r.updateTick=e,r.didChange=false;let i=r.localTransform;r.updateLocalTransform();let s=r.parent;if(s&&!s.renderGroup?(t|=r._updateFlags,r.relativeGroupTransform.appendFrom(i,s.relativeGroupTransform),t&FP&&OP(r,s,t)):(t=r._updateFlags,r.relativeGroupTransform.copyFrom(i),t&FP&&OP(r,_I,t)),!r.renderGroup){let n=r.children,o=n.length;for(let l=0;l<o;l++)sg(n[l],e,t);let a=r.parentRenderGroup,u=r;u.renderPipeId&&!a.structureDidChange&&a.updateRenderable(u);}}function OP(r,e,t){if(t&Pn){r.groupColor=ns(r.localColor,e.groupColor);let i=r.localAlpha*e.groupAlpha;i=i<0?0:i>1?1:i,r.groupAlpha=i,r.groupColorAlpha=r.groupColor+((i*255|0)<<24);}t&Ba&&(r.groupBlendMode=r.localBlendMode==="inherit"?e.groupBlendMode:r.localBlendMode),t&cs&&(r.globalDisplayStatus=r.localDisplayStatus&e.globalDisplayStatus),r._updateFlags=0;}var _I,FP,T2=f(()=>{qt();ig();hf();_I=new te,FP=cs|Pn|Ba;});function ng(r,e){let{list:t,index:i}=r.childrenRenderablesToUpdate,s=false;for(let n=0;n<i;n++){let o=t[n];if(s=e[o.renderPipeId].validateRenderable(o),s)break}return r.structureDidChange=s,s}var S2=f(()=>{});var bI,bo,E2=f(()=>{E();he();Fr();Et();ig();rg();T2();S2();bI=new D,bo=class{constructor(e){this._renderer=e;}render({container:e,transform:t}){let i=e.parent,s=e.renderGroup.renderGroupParent;e.parent=null,e.renderGroup.renderGroupParent=null;let n=this._renderer,o=bI;t&&(o=o.copyFrom(e.renderGroup.localTransform),e.renderGroup.localTransform.copyFrom(t));let a=n.renderPipes;this._updateCachedRenderGroups(e.renderGroup,null),this._updateRenderGroups(e.renderGroup),n.globalUniforms.start({worldTransformMatrix:t?e.renderGroup.localTransform:e.renderGroup.worldTransform,worldColor:e.renderGroup.worldColorAlpha}),go(e.renderGroup,a),a.uniformBatch&&a.uniformBatch.renderEnd(),t&&e.renderGroup.localTransform.copyFrom(o),e.parent=i,e.renderGroup.renderGroupParent=s;}destroy(){this._renderer=null;}_updateCachedRenderGroups(e,t){if(e.isCachedAsTexture){if(!e.updateCacheTexture)return;t=e;}e._parentCacheAsTextureRenderGroup=t;for(let i=e.renderGroupChildren.length-1;i>=0;i--)this._updateCachedRenderGroups(e.renderGroupChildren[i],t);if(e.invalidateMatrices(),e.isCachedAsTexture){if(e.textureNeedsUpdate){let i=e.root.getLocalBounds();i.ceil();let s=e.texture;e.texture&&be.returnTexture(e.texture);let n=this._renderer,o=e.textureOptions.resolution||n.view.resolution,a=e.textureOptions.antialias??n.view.antialias;e.texture=be.getOptimalTexture(i.width,i.height,o,a),e._textureBounds||(e._textureBounds=new me),e._textureBounds.copyFrom(i),s!==e.texture&&e.renderGroupParent&&(e.renderGroupParent.structureDidChange=true);}}else e.texture&&(be.returnTexture(e.texture),e.texture=null);}_updateRenderGroups(e){let t=this._renderer,i=t.renderPipes;if(e.runOnRender(t),e.instructionSet.renderPipes=i,e.structureDidChange?_o(e.childrenRenderablesToUpdate.list,0):ng(e,i),vh(e),e.structureDidChange?(e.structureDidChange=false,this._buildInstructions(e,t)):this._updateRenderables(e),e.childrenRenderablesToUpdate.index=0,t.renderPipes.batch.upload(e.instructionSet),!(e.isCachedAsTexture&&!e.textureNeedsUpdate))for(let s=0;s<e.renderGroupChildren.length;s++)this._updateRenderGroups(e.renderGroupChildren[s]);}_updateRenderables(e){let{list:t,index:i}=e.childrenRenderablesToUpdate;for(let s=0;s<i;s++){let n=t[s];n.didViewUpdate&&e.updateRenderable(n);}_o(t,i);}_buildInstructions(e,t){let i=e.root,s=e.instructionSet;s.reset();let n=t.renderPipes?t:t.batch.renderer,o=n.renderPipes;o.batch.buildStart(s),o.blendMode.buildStart(),o.colorMask.buildStart(),i.sortableChildren&&i.sortChildren(),i.collectRenderablesWithEffects(s,n,null),o.batch.buildEnd(s),o.blendMode.buildEnd(s);}};bo.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"renderGroup"};});var yo,A2=f(()=>{E();tu();yo=class{constructor(e){this._renderer=e;}addRenderable(e,t){let i=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,i),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t);}validateRenderable(e){let t=this._getGpuSprite(e);return !t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.bounds=e.visualBounds,t.texture=e._texture;}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){let t=new Pr;return t.renderable=e,t.transform=e.groupTransform,t.texture=e._texture,t.bounds=e.visualBounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};yo.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"sprite"};});var GP,js,og=f(()=>{St();GP=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,js="8.10.1";});var vo,To,ag=f(()=>{E();og();vo=class{static init(){globalThis.__PIXI_APP_INIT__?.(this,js);}static destroy(){}};vo.extension=m.Application;To=class{constructor(e){this._renderer=e;}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,js);}destroy(){this._renderer=null;}};To.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"initHook",priority:-10};});var C2,Th,P2=f(()=>{E();cr();Tp();C2=class UP{constructor(e,t){this.state=Ue.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init?.(this);}static getBatcher(e){return new this._availableBatchers[e]}buildStart(e){let t=this._batchersByInstructionSet[e.uid];t||(t=this._batchersByInstructionSet[e.uid]=Object.create(null),t.default||(t.default=new Ln({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=t,this._activeBatch=this._activeBatches.default;for(let i in this._activeBatches)this._activeBatches[i].begin();}addToBatch(e,t){if(this._activeBatch.name!==e.batcherName){this._activeBatch.break(t);let i=this._activeBatches[e.batcherName];i||(i=this._activeBatches[e.batcherName]=UP.getBatcher(e.batcherName),i.begin()),this._activeBatch=i;}this._activeBatch.add(e);}break(e){this._activeBatch.break(e);}buildEnd(e){this._activeBatch.break(e);let t=this._activeBatches;for(let i in t){let s=t[i],n=s.geometry;n.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,true),n.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,false);}}upload(e){let t=this._batchersByInstructionSet[e.uid];for(let i in t){let s=t[i],n=s.geometry;s.dirty&&(s.dirty=false,n.buffers[0].update(s.attributeSize*4));}}execute(e){if(e.action==="startBatch"){let t=e.batcher,i=t.geometry,s=t.shader;this._adaptor.start(this,i,s);}this._adaptor.execute(this,e);}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(let e in this._activeBatches)this._activeBatches[e].destroy();this._activeBatches=null;}};C2.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"batch"};C2._availableBatchers=Object.create(null);Th=C2;O.handleByMap(m.Batcher,Th._availableBatchers);O.add(Ln);});var ug,w2=f(()=>{ug=`in vec2 vMaskCoord;
|
|
1546
|
+
`}};});var fo,x2=f(()=>{E();he();Gi();no();Ui();eg();Ar();ce();_e();fo=class{init(){let e=vr({name:"mesh",bits:[Wi,Qm,Sr]});this._shader=new ze({gpuProgram:e,resources:{uTexture:C.EMPTY._source,uSampler:C.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new D}}}});}execute(e,t){let i=e.renderer,s=t._shader;if(!s)s=this._shader,s.groups[2]=i.texture.getTextureBindGroup(t.texture);else if(!s.gpuProgram){F("Mesh shader has no gpuProgram",t.shader);return}let n=s.gpuProgram;if(n.autoAssignGlobalUniforms&&(s.groups[0]=i.globalUniforms.bindGroup),n.autoAssignLocalUniforms){let o=e.localUniforms;s.groups[1]=i.renderPipes.uniformBatch.getUniformBindGroup(o,true);}i.encoder.draw({geometry:t._geometry,shader:s,state:t.state});}destroy(){this._shader.destroy(true),this._shader=null;}};fo.extension={type:[g.WebGPUPipesAdaptor],name:"mesh"};});var tg,po,_2=f(()=>{E();cr();pc();tg=Ue.for2d(),po=class{start(e,t,i){let s=e.renderer,n=s.encoder,o=i.gpuProgram;this._shader=i,this._geometry=t,n.setGeometry(t,o),tg.blendMode="normal",s.pipeline.getPipeline(t,o,tg);let a=s.globalUniforms.bindGroup;n.resetBindGroup(1),n.setBindGroup(0,a,o);}execute(e,t){let i=this._shader.gpuProgram,s=e.renderer,n=s.encoder;if(!t.bindGroup){let u=t.textures;t.bindGroup=bs(u.textures,u.count,s.limits.maxBatchableTextures);}tg.blendMode=t.blendMode;let o=s.bindGroup.getBindGroup(t.bindGroup,i,1),a=s.pipeline.getPipeline(this._geometry,i,tg,t.topology);t.bindGroup._touch(s.textureGC.count),n.setPipeline(a),n.renderPassEncoder.setBindGroup(1,o),n.renderPassEncoder.drawIndexed(t.size,1,t.start);}};po.extension={type:[g.WebGPUPipesAdaptor],name:"batch"};});var mo,b2=f(()=>{E();mo=class{constructor(e){this._renderer=e;}updateRenderable(){}destroyRenderable(){}validateRenderable(){return false}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e);}execute(e){e.isRenderable&&e.render(this._renderer);}destroy(){this._renderer=null;}};mo.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"customRender"};});function go(r,e){let t=r.instructionSet,i=t.instructions;for(let s=0;s<t.instructionSize;s++){let n=i[s];e[n.renderPipeId].execute(n);}}var rg=f(()=>{});var xI,xo,y2=f(()=>{E();he();ri();tu();rg();xI=new D,xo=class{constructor(e){this._renderer=e;}addRenderGroup(e,t){e.isCachedAsTexture?this._addRenderableCacheAsTexture(e,t):this._addRenderableDirect(e,t);}execute(e){e.isRenderable&&(e.isCachedAsTexture?this._executeCacheAsTexture(e):this._executeDirect(e));}destroy(){this._renderer=null;}_addRenderableDirect(e,t){this._renderer.renderPipes.batch.break(t),e._batchableRenderGroup&&(Re.return(e._batchableRenderGroup),e._batchableRenderGroup=null),t.add(e);}_addRenderableCacheAsTexture(e,t){let i=e._batchableRenderGroup??(e._batchableRenderGroup=Re.get(Pr));i.renderable=e.root,i.transform=e.root.relativeGroupTransform,i.texture=e.texture,i.bounds=e._textureBounds,t.add(e),this._renderer.renderPipes.batch.addToBatch(i,t);}_executeCacheAsTexture(e){if(e.textureNeedsUpdate){e.textureNeedsUpdate=false;let t=xI.identity().translate(-e._textureBounds.x,-e._textureBounds.y);this._renderer.renderTarget.push(e.texture,true,null,e.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:t,worldColor:4294967295}),go(e,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop();}e._batchableRenderGroup._batcher.updateElement(e._batchableRenderGroup),e._batchableRenderGroup._batcher.geometry.buffers[0].update();}_executeDirect(e){this._renderer.globalUniforms.push({worldTransformMatrix:e.inverseParentTextureTransform,worldColor:e.worldColorAlpha}),go(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop();}};xo.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"renderGroup"};});function _o(r,e){e||(e=0);for(let t=e;t<r.length&&r[t];t++)r[t]=null;}var ig=f(()=>{});function vh(r,e=false){v2(r);let t=r.childrenToUpdate,i=r.updateTick++;for(let s in t){let n=Number(s),o=t[s],a=o.list,u=o.index;for(let l=0;l<u;l++){let c=a[l];c.parentRenderGroup===r&&c.relativeRenderGroupDepth===n&&sg(c,i,0);}_o(a,u),o.index=0;}if(e)for(let s=0;s<r.renderGroupChildren.length;s++)vh(r.renderGroupChildren[s],e);}function v2(r){let e=r.root,t;if(r.renderGroupParent){let i=r.renderGroupParent;r.worldTransform.appendFrom(e.relativeGroupTransform,i.worldTransform),r.worldColor=ns(e.groupColor,i.worldColor),t=e.groupAlpha*i.worldAlpha;}else r.worldTransform.copyFrom(e.localTransform),r.worldColor=e.localColor,t=e.localAlpha;t=t<0?0:t>1?1:t,r.worldAlpha=t,r.worldColorAlpha=r.worldColor+((t*255|0)<<24);}function sg(r,e,t){if(e===r.updateTick)return;r.updateTick=e,r.didChange=false;let i=r.localTransform;r.updateLocalTransform();let s=r.parent;if(s&&!s.renderGroup?(t|=r._updateFlags,r.relativeGroupTransform.appendFrom(i,s.relativeGroupTransform),t&FP&&OP(r,s,t)):(t=r._updateFlags,r.relativeGroupTransform.copyFrom(i),t&FP&&OP(r,_I,t)),!r.renderGroup){let n=r.children,o=n.length;for(let l=0;l<o;l++)sg(n[l],e,t);let a=r.parentRenderGroup,u=r;u.renderPipeId&&!a.structureDidChange&&a.updateRenderable(u);}}function OP(r,e,t){if(t&Pn){r.groupColor=ns(r.localColor,e.groupColor);let i=r.localAlpha*e.groupAlpha;i=i<0?0:i>1?1:i,r.groupAlpha=i,r.groupColorAlpha=r.groupColor+((i*255|0)<<24);}t&Ba&&(r.groupBlendMode=r.localBlendMode==="inherit"?e.groupBlendMode:r.localBlendMode),t&cs&&(r.globalDisplayStatus=r.localDisplayStatus&e.globalDisplayStatus),r._updateFlags=0;}var _I,FP,T2=f(()=>{qt();ig();hf();_I=new te,FP=cs|Pn|Ba;});function ng(r,e){let{list:t,index:i}=r.childrenRenderablesToUpdate,s=false;for(let n=0;n<i;n++){let o=t[n];if(s=e[o.renderPipeId].validateRenderable(o),s)break}return r.structureDidChange=s,s}var S2=f(()=>{});var bI,bo,E2=f(()=>{E();he();Fr();Et();ig();rg();T2();S2();bI=new D,bo=class{constructor(e){this._renderer=e;}render({container:e,transform:t}){let i=e.parent,s=e.renderGroup.renderGroupParent;e.parent=null,e.renderGroup.renderGroupParent=null;let n=this._renderer,o=bI;t&&(o=o.copyFrom(e.renderGroup.localTransform),e.renderGroup.localTransform.copyFrom(t));let a=n.renderPipes;this._updateCachedRenderGroups(e.renderGroup,null),this._updateRenderGroups(e.renderGroup),n.globalUniforms.start({worldTransformMatrix:t?e.renderGroup.localTransform:e.renderGroup.worldTransform,worldColor:e.renderGroup.worldColorAlpha}),go(e.renderGroup,a),a.uniformBatch&&a.uniformBatch.renderEnd(),t&&e.renderGroup.localTransform.copyFrom(o),e.parent=i,e.renderGroup.renderGroupParent=s;}destroy(){this._renderer=null;}_updateCachedRenderGroups(e,t){if(e.isCachedAsTexture){if(!e.updateCacheTexture)return;t=e;}e._parentCacheAsTextureRenderGroup=t;for(let i=e.renderGroupChildren.length-1;i>=0;i--)this._updateCachedRenderGroups(e.renderGroupChildren[i],t);if(e.invalidateMatrices(),e.isCachedAsTexture){if(e.textureNeedsUpdate){let i=e.root.getLocalBounds();i.ceil();let s=e.texture;e.texture&&be.returnTexture(e.texture);let n=this._renderer,o=e.textureOptions.resolution||n.view.resolution,a=e.textureOptions.antialias??n.view.antialias;e.texture=be.getOptimalTexture(i.width,i.height,o,a),e._textureBounds||(e._textureBounds=new me),e._textureBounds.copyFrom(i),s!==e.texture&&e.renderGroupParent&&(e.renderGroupParent.structureDidChange=true);}}else e.texture&&(be.returnTexture(e.texture),e.texture=null);}_updateRenderGroups(e){let t=this._renderer,i=t.renderPipes;if(e.runOnRender(t),e.instructionSet.renderPipes=i,e.structureDidChange?_o(e.childrenRenderablesToUpdate.list,0):ng(e,i),vh(e),e.structureDidChange?(e.structureDidChange=false,this._buildInstructions(e,t)):this._updateRenderables(e),e.childrenRenderablesToUpdate.index=0,t.renderPipes.batch.upload(e.instructionSet),!(e.isCachedAsTexture&&!e.textureNeedsUpdate))for(let s=0;s<e.renderGroupChildren.length;s++)this._updateRenderGroups(e.renderGroupChildren[s]);}_updateRenderables(e){let{list:t,index:i}=e.childrenRenderablesToUpdate;for(let s=0;s<i;s++){let n=t[s];n.didViewUpdate&&e.updateRenderable(n);}_o(t,i);}_buildInstructions(e,t){let i=e.root,s=e.instructionSet;s.reset();let n=t.renderPipes?t:t.batch.renderer,o=n.renderPipes;o.batch.buildStart(s),o.blendMode.buildStart(),o.colorMask.buildStart(),i.sortableChildren&&i.sortChildren(),i.collectRenderablesWithEffects(s,n,null),o.batch.buildEnd(s),o.blendMode.buildEnd(s);}};bo.extension={type:[g.WebGLSystem,g.WebGPUSystem,g.CanvasSystem],name:"renderGroup"};});var yo,A2=f(()=>{E();tu();yo=class{constructor(e){this._renderer=e;}addRenderable(e,t){let i=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,i),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t);}validateRenderable(e){let t=this._getGpuSprite(e);return !t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.bounds=e.visualBounds,t.texture=e._texture;}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){let t=new Pr;return t.renderable=e,t.transform=e.groupTransform,t.texture=e._texture,t.bounds=e.visualBounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};yo.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"sprite"};});var GP,js,og=f(()=>{St();GP=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,js="8.10.2";});var vo,To,ag=f(()=>{E();og();vo=class{static init(){globalThis.__PIXI_APP_INIT__?.(this,js);}static destroy(){}};vo.extension=g.Application;To=class{constructor(e){this._renderer=e;}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,js);}destroy(){this._renderer=null;}};To.extension={type:[g.WebGLSystem,g.WebGPUSystem],name:"initHook",priority:-10};});var C2,Th,P2=f(()=>{E();cr();Tp();C2=class UP{constructor(e,t){this.state=Ue.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init?.(this);}static getBatcher(e){return new this._availableBatchers[e]}buildStart(e){let t=this._batchersByInstructionSet[e.uid];t||(t=this._batchersByInstructionSet[e.uid]=Object.create(null),t.default||(t.default=new Ln({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=t,this._activeBatch=this._activeBatches.default;for(let i in this._activeBatches)this._activeBatches[i].begin();}addToBatch(e,t){if(this._activeBatch.name!==e.batcherName){this._activeBatch.break(t);let i=this._activeBatches[e.batcherName];i||(i=this._activeBatches[e.batcherName]=UP.getBatcher(e.batcherName),i.begin()),this._activeBatch=i;}this._activeBatch.add(e);}break(e){this._activeBatch.break(e);}buildEnd(e){this._activeBatch.break(e);let t=this._activeBatches;for(let i in t){let s=t[i],n=s.geometry;n.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,true),n.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,false);}}upload(e){let t=this._batchersByInstructionSet[e.uid];for(let i in t){let s=t[i],n=s.geometry;s.dirty&&(s.dirty=false,n.buffers[0].update(s.attributeSize*4));}}execute(e){if(e.action==="startBatch"){let t=e.batcher,i=t.geometry,s=t.shader;this._adaptor.start(this,i,s);}this._adaptor.execute(this,e);}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(let e in this._activeBatches)this._activeBatches[e].destroy();this._activeBatches=null;}};C2.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"batch"};C2._availableBatchers=Object.create(null);Th=C2;O.handleByMap(g.Batcher,Th._availableBatchers);O.add(Ln);});var ug,w2=f(()=>{ug=`in vec2 vMaskCoord;
|
|
1547
1547
|
in vec2 vTextureCoord;
|
|
1548
1548
|
|
|
1549
1549
|
uniform sampler2D uTexture;
|
|
@@ -1712,9 +1712,9 @@ fn mainFragment(
|
|
|
1712
1712
|
|
|
1713
1713
|
return source * a;
|
|
1714
1714
|
}
|
|
1715
|
-
`;});var Su,M2=f(()=>{he();Kt();ur();Qe();Tf();hi();w2();B2();R2();Su=class extends _t{constructor(e){let{sprite:t,...i}=e,s=new ls(t.texture),n=new ae({uFilterMatrix:{value:new D,type:"mat3x3<f32>"},uMaskClamp:{value:s.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:e.inverse?1:0,type:"f32"}}),o=Fe.from({vertex:{source:Sh,entryPoint:"mainVertex"},fragment:{source:Sh,entryPoint:"mainFragment"}}),a=ke.from({vertex:lg,fragment:ug,name:"mask-filter"});super({...i,gpuProgram:o,glProgram:a,resources:{filterUniforms:n,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=s;}set inverse(e){this.resources.filterUniforms.uniforms.uInverse=e?1:0;}get inverse(){return this.resources.filterUniforms.uniforms.uInverse===1}apply(e,t,i,s){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,i,s);}};});var yI,D2,So,I2=f(()=>{E();Zl();M2();Et();vn();ms();ri();ce();Fr();lr();yI=new me,D2=class extends Ir{constructor(){super(),this.filters=[new Su({sprite:new Ee(C.EMPTY),inverse:false,resolution:"inherit",antialias:"inherit"})];}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e;}get inverse(){return this.filters[0].inverse}set inverse(e){this.filters[0].inverse=e;}},So=class{constructor(e){this._activeMaskStage=[],this._renderer=e;}push(e,t,i){let s=this._renderer;if(s.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:false,maskedContainer:t}),e.inverse=t._maskOptions.inverse,e.renderMaskToTexture){let n=e.mask;n.includeInBuild=true,n.collectRenderables(i,s,null),n.includeInBuild=false;}s.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,inverse:t._maskOptions.inverse,canBundle:false});}pop(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:false});}execute(e){let t=this._renderer,i=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){let s=Re.get(D2);if(s.inverse=e.inverse,i){e.mask.mask.measurable=true;let n=ii(e.mask.mask,true,yI);e.mask.mask.measurable=false,n.ceil();let o=t.renderTarget.renderTarget.colorTexture.source,a=be.getOptimalTexture(n.width,n.height,o._resolution,o.antialias);t.renderTarget.push(a,true),t.globalUniforms.push({offset:n,worldColor:4294967295});let u=s.sprite;u.texture=a,u.worldTransform.tx=n.minX,u.worldTransform.ty=n.minY,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer,filterTexture:a});}else s.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer});}else if(e.action==="pushMaskEnd"){let s=this._activeMaskStage[this._activeMaskStage.length-1];i&&(t.type===Oe.WEBGL&&t.renderTarget.finishRenderPass(),t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:s.maskedContainer,filterEffect:s.filterEffect,canBundle:false});}else if(e.action==="popMaskEnd"){t.filter.pop();let s=this._activeMaskStage.pop();i&&be.returnTexture(s.filterTexture),Re.return(s.filterEffect);}}destroy(){this._renderer=null,this._activeMaskStage=null;}};So.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"alphaMask"};});var Eo,k2=f(()=>{E();Eo=class{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e;}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15;}push(e,t,i){this._renderer.renderPipes.batch.break(i);let n=this._colorStack;n[this._colorStackIndex]=n[this._colorStackIndex-1]&e.mask;let o=this._colorStack[this._colorStackIndex];o!==this._currentColor&&(this._currentColor=o,i.add({renderPipeId:"colorMask",colorMask:o,canBundle:false})),this._colorStackIndex++;}pop(e,t,i){this._renderer.renderPipes.batch.break(i);let n=this._colorStack;this._colorStackIndex--;let o=n[this._colorStackIndex-1];o!==this._currentColor&&(this._currentColor=o,i.add({renderPipeId:"colorMask",colorMask:o,canBundle:false}));}execute(e){this._renderer.colorMask.setMask(e.colorMask);}destroy(){this._colorStack=null;}};Eo.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"colorMask"};});var Ao,F2=f(()=>{E();co();ys();Ao=class{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e;}push(e,t,i){var s;let n=e,o=this._renderer;o.renderPipes.batch.break(i),o.renderPipes.blendMode.setBlendMode(n.mask,"none",i),i.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:false});let a=n.mask;a.includeInBuild=true,this._maskHash.has(n)||this._maskHash.set(n,{instructionsStart:0,instructionsLength:0});let u=this._maskHash.get(n);u.instructionsStart=i.instructionSize,a.collectRenderables(i,o,null),a.includeInBuild=false,o.renderPipes.batch.break(i),i.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:false});let l=i.instructionSize-u.instructionsStart-1;u.instructionsLength=l;let c=o.renderTarget.renderTarget.uid;(s=this._maskStackHash)[c]??(s[c]=0);}pop(e,t,i){let s=e,n=this._renderer;n.renderPipes.batch.break(i),n.renderPipes.blendMode.setBlendMode(s.mask,"none",i),i.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:t._maskOptions.inverse,canBundle:false});let o=this._maskHash.get(e);for(let a=0;a<o.instructionsLength;a++)i.instructions[i.instructionSize++]=i.instructions[o.instructionsStart++];i.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:false});}execute(e){var t;let i=this._renderer,s=i.renderTarget.renderTarget.uid,n=(t=this._maskStackHash)[s]??(t[s]=0);e.action==="pushMaskBegin"?(i.renderTarget.ensureDepthStencil(),i.stencil.setStencilMode(Be.RENDERING_MASK_ADD,n),n++,i.colorMask.setMask(0)):e.action==="pushMaskEnd"?(e.inverse?i.stencil.setStencilMode(Be.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(Be.MASK_ACTIVE,n),i.colorMask.setMask(15)):e.action==="popMaskBegin"?(i.colorMask.setMask(0),n!==0?i.stencil.setStencilMode(Be.RENDERING_MASK_REMOVE,n):(i.renderTarget.clear(null,ot.STENCIL),i.stencil.setStencilMode(Be.DISABLED,n)),n--):e.action==="popMaskEnd"&&(e.inverse?i.stencil.setStencilMode(Be.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(Be.MASK_ACTIVE,n),i.colorMask.setMask(15)),this._maskStackHash[s]=n;}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null;}};Ao.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"stencilMask"};});var O2,cg,G2=f(()=>{it();E();O2=class LP{constructor(){this.clearBeforeRender=true,this._backgroundColor=new K(0),this.color=this._backgroundColor,this.alpha=1;}init(e){e={...LP.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha);}get color(){return this._backgroundColor}set color(e){this._backgroundColor.setValue(e);}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e);}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};O2.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"background",priority:0};O2.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:true};cg=O2;});var Eh,Co,U2=f(()=>{E();Zl();_e();Eh={};O.handle(m.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Eh[r.name]=r.ref;},r=>{delete Eh[r.name];});Co=class{constructor(e){this._isAdvanced=false,this._filterHash=Object.create(null),this._renderer=e,this._renderer.runners.prerender.add(this);}prerender(){this._activeBlendMode="normal",this._isAdvanced=false;}setBlendMode(e,t,i){if(this._activeBlendMode===t){this._isAdvanced&&this._renderableList.push(e);return}this._activeBlendMode=t,this._isAdvanced&&this._endAdvancedBlendMode(i),this._isAdvanced=!!Eh[t],this._isAdvanced&&(this._beginAdvancedBlendMode(i),this._renderableList.push(e));}_beginAdvancedBlendMode(e){this._renderer.renderPipes.batch.break(e);let t=this._activeBlendMode;if(!Eh[t]){F(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let i=this._filterHash[t];i||(i=this._filterHash[t]=new Ir,i.filters=[new Eh[t]]);let s={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:i,canBundle:false};this._renderableList=s.renderables,e.add(s);}_endAdvancedBlendMode(e){this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:false});}buildStart(){this._isAdvanced=false;}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e);}destroy(){this._renderer=null,this._renderableList=null;for(let e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null;}};Co.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"blendMode"};});var L2,N2,hg,H2=f(()=>{E();qt();ce();L2={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},N2=class NP{constructor(e){this._renderer=e;}_normalizeOptions(e,t={}){return e instanceof te||e instanceof C?{target:e,...t}:{...t,...e}}async image(e){let t=new Image;return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,NP.defaultImageOptions);let{format:t,quality:i}=e,s=this.canvas(e);if(s.toBlob!==void 0)return new Promise((n,o)=>{s.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}let u=new FileReader;u.onload=()=>n(u.result),u.onerror=o,u.readAsDataURL(a);},L2[t],i);});if(s.toDataURL!==void 0)return s.toDataURL(L2[t],i);if(s.convertToBlob!==void 0){let n=await s.convertToBlob({type:L2[t],quality:i});return new Promise((o,a)=>{let u=new FileReader;u.onload=()=>o(u.result),u.onerror=a,u.readAsDataURL(n);})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);let t=e.target,i=this._renderer;if(t instanceof C)return i.texture.generateCanvas(t);let s=i.textureGenerator.generateTexture(e),n=i.texture.generateCanvas(s);return s.destroy(true),n}pixels(e){e=this._normalizeOptions(e);let t=e.target,i=this._renderer,s=t instanceof C?t:i.textureGenerator.generateTexture(e),n=i.texture.getPixels(s);return t instanceof te&&s.destroy(true),n}texture(e){return e=this._normalizeOptions(e),e.target instanceof C?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);let t=this.canvas(e),i=document.createElement("a");i.download=e.filename??"image.png",i.href=t.toDataURL("image/png"),document.body.appendChild(i),i.click(),document.body.removeChild(i);}log(e){let t=e.width??200;e=this._normalizeOptions(e);let i=this.canvas(e),s=i.toDataURL();console.log(`[Pixi Texture] ${i.width}px ${i.height}px`);let n=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${s}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}destroy(){this._renderer=null;}};N2.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"extract"};N2.defaultImageOptions={format:"png",quality:1};hg=N2;});var Eu,V2=f(()=>{ct();ce();Eu=class r extends C{static create(e){return new r({source:new oe(e)})}resize(e,t,i){return this.source.resize(e,t,i),this}};});var vI,TI,SI,Po,z2=f(()=>{it();E();he();Ze();Et();Jl();qt();V2();vI=new Z,TI=new me,SI=[0,0,0,0],Po=class{constructor(e){this._renderer=e;}generateTexture(e){e instanceof te&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});let t=e.resolution||this._renderer.resolution,i=e.antialias||this._renderer.view.antialias,s=e.target,n=e.clearColor;n?n=Array.isArray(n)&&n.length===4?n:K.shared.setValue(n).toArray():n=SI;let o=e.frame?.copyTo(vI)||os(s,TI).rectangle;o.width=Math.max(o.width,1/t)|0,o.height=Math.max(o.height,1/t)|0;let a=Eu.create({...e.textureSourceOptions,width:o.width,height:o.height,resolution:t,antialias:i}),u=D.shared.translate(-o.x,-o.y);return this._renderer.render({container:s,transform:u,target:a,clearColor:n}),a.source.updateMipmaps(),a}destroy(){this._renderer=null;}};Po.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"textureGenerator"};});var wo,W2=f(()=>{E();he();jt();zn();Fi();lr();Qe();wo=class{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e;}reset(){this._stackIndex=0;for(let e=0;e<this._activeUniforms.length;e++)this._uniformsPool.push(this._activeUniforms[e]);for(let e=0;e<this._activeBindGroups.length;e++)this._bindGroupPool.push(this._activeBindGroups[e]);this._activeUniforms.length=0,this._activeBindGroups.length=0;}start(e){this.reset(),this.push(e);}bind({size:e,projectionMatrix:t,worldTransformMatrix:i,worldColor:s,offset:n}){let o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{worldTransformMatrix:new D,worldColor:4294967295,offset:new ne},u={projectionMatrix:t||this._renderer.renderTarget.projectionMatrix,resolution:e||o.size,worldTransformMatrix:i||a.worldTransformMatrix,worldColor:s||a.worldColor,offset:n||a.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);let c=l.uniforms;c.uProjectionMatrix=u.projectionMatrix,c.uResolution=u.resolution,c.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),c.uWorldTransformMatrix.tx-=u.offset.x,c.uWorldTransformMatrix.ty-=u.offset.y,Cr(u.worldColor,c.uWorldColorAlpha,0),l.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,false):(h=this._bindGroupPool.pop()||new nt,this._activeBindGroups.push(h),h.setResource(l,0)),u.bindGroup=h,this._currentGlobalUniformData=u;}push(e){this.bind(e),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData;}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Oe.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update();}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new ae({uProjectionMatrix:{value:new D,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new D,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:true})}destroy(){this._renderer=null;}};wo.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"globalUniforms"};});var EI,Bo,X2=f(()=>{E();ds();EI=1,Bo=class{constructor(){this._tasks=[],this._offset=0;}init(){ye.system.add(this._update,this);}repeat(e,t,i=true){let s=EI++,n=0;return i&&(this._offset+=1e3,n=this._offset),this._tasks.push({func:e,duration:t,start:performance.now(),offset:n,last:performance.now(),repeat:true,id:s}),s}cancel(e){for(let t=0;t<this._tasks.length;t++)if(this._tasks[t].id===e){this._tasks.splice(t,1);return}}_update(){let e=performance.now();for(let t=0;t<this._tasks.length;t++){let i=this._tasks[t];if(e-i.offset-i.last>=i.duration){let s=e-i.start;i.func(s),i.last=e;}}}destroy(){ye.system.remove(this._update,this),this._tasks.length=0;}};Bo.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"scheduler",priority:0};});function dg(r){if(!HP){if(V.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){let e=[`%c %c %c %c %c PixiJS %c v${js} (${r}) http://www.pixijs.com/
|
|
1715
|
+
`;});var Su,M2=f(()=>{he();Kt();ur();Qe();Tf();hi();w2();B2();R2();Su=class extends _t{constructor(e){let{sprite:t,...i}=e,s=new ls(t.texture),n=new ae({uFilterMatrix:{value:new D,type:"mat3x3<f32>"},uMaskClamp:{value:s.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:e.inverse?1:0,type:"f32"}}),o=Fe.from({vertex:{source:Sh,entryPoint:"mainVertex"},fragment:{source:Sh,entryPoint:"mainFragment"}}),a=ke.from({vertex:lg,fragment:ug,name:"mask-filter"});super({...i,gpuProgram:o,glProgram:a,resources:{filterUniforms:n,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=s;}set inverse(e){this.resources.filterUniforms.uniforms.uInverse=e?1:0;}get inverse(){return this.resources.filterUniforms.uniforms.uInverse===1}apply(e,t,i,s){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,i,s);}};});var yI,D2,So,I2=f(()=>{E();Zl();M2();Et();vn();ms();ri();ce();Fr();lr();yI=new me,D2=class extends Ir{constructor(){super(),this.filters=[new Su({sprite:new Ee(C.EMPTY),inverse:false,resolution:"inherit",antialias:"inherit"})];}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e;}get inverse(){return this.filters[0].inverse}set inverse(e){this.filters[0].inverse=e;}},So=class{constructor(e){this._activeMaskStage=[],this._renderer=e;}push(e,t,i){let s=this._renderer;if(s.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:false,maskedContainer:t}),e.inverse=t._maskOptions.inverse,e.renderMaskToTexture){let n=e.mask;n.includeInBuild=true,n.collectRenderables(i,s,null),n.includeInBuild=false;}s.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,inverse:t._maskOptions.inverse,canBundle:false});}pop(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:false});}execute(e){let t=this._renderer,i=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){let s=Re.get(D2);if(s.inverse=e.inverse,i){e.mask.mask.measurable=true;let n=ii(e.mask.mask,true,yI);e.mask.mask.measurable=false,n.ceil();let o=t.renderTarget.renderTarget.colorTexture.source,a=be.getOptimalTexture(n.width,n.height,o._resolution,o.antialias);t.renderTarget.push(a,true),t.globalUniforms.push({offset:n,worldColor:4294967295});let u=s.sprite;u.texture=a,u.worldTransform.tx=n.minX,u.worldTransform.ty=n.minY,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer,filterTexture:a});}else s.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer});}else if(e.action==="pushMaskEnd"){let s=this._activeMaskStage[this._activeMaskStage.length-1];i&&(t.type===Oe.WEBGL&&t.renderTarget.finishRenderPass(),t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:s.maskedContainer,filterEffect:s.filterEffect,canBundle:false});}else if(e.action==="popMaskEnd"){t.filter.pop();let s=this._activeMaskStage.pop();i&&be.returnTexture(s.filterTexture),Re.return(s.filterEffect);}}destroy(){this._renderer=null,this._activeMaskStage=null;}};So.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"alphaMask"};});var Eo,k2=f(()=>{E();Eo=class{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e;}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15;}push(e,t,i){this._renderer.renderPipes.batch.break(i);let n=this._colorStack;n[this._colorStackIndex]=n[this._colorStackIndex-1]&e.mask;let o=this._colorStack[this._colorStackIndex];o!==this._currentColor&&(this._currentColor=o,i.add({renderPipeId:"colorMask",colorMask:o,canBundle:false})),this._colorStackIndex++;}pop(e,t,i){this._renderer.renderPipes.batch.break(i);let n=this._colorStack;this._colorStackIndex--;let o=n[this._colorStackIndex-1];o!==this._currentColor&&(this._currentColor=o,i.add({renderPipeId:"colorMask",colorMask:o,canBundle:false}));}execute(e){this._renderer.colorMask.setMask(e.colorMask);}destroy(){this._colorStack=null;}};Eo.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"colorMask"};});var Ao,F2=f(()=>{E();co();ys();Ao=class{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e;}push(e,t,i){var s;let n=e,o=this._renderer;o.renderPipes.batch.break(i),o.renderPipes.blendMode.setBlendMode(n.mask,"none",i),i.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:false});let a=n.mask;a.includeInBuild=true,this._maskHash.has(n)||this._maskHash.set(n,{instructionsStart:0,instructionsLength:0});let u=this._maskHash.get(n);u.instructionsStart=i.instructionSize,a.collectRenderables(i,o,null),a.includeInBuild=false,o.renderPipes.batch.break(i),i.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:false});let l=i.instructionSize-u.instructionsStart-1;u.instructionsLength=l;let c=o.renderTarget.renderTarget.uid;(s=this._maskStackHash)[c]??(s[c]=0);}pop(e,t,i){let s=e,n=this._renderer;n.renderPipes.batch.break(i),n.renderPipes.blendMode.setBlendMode(s.mask,"none",i),i.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:t._maskOptions.inverse,canBundle:false});let o=this._maskHash.get(e);for(let a=0;a<o.instructionsLength;a++)i.instructions[i.instructionSize++]=i.instructions[o.instructionsStart++];i.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:false});}execute(e){var t;let i=this._renderer,s=i.renderTarget.renderTarget.uid,n=(t=this._maskStackHash)[s]??(t[s]=0);e.action==="pushMaskBegin"?(i.renderTarget.ensureDepthStencil(),i.stencil.setStencilMode(Be.RENDERING_MASK_ADD,n),n++,i.colorMask.setMask(0)):e.action==="pushMaskEnd"?(e.inverse?i.stencil.setStencilMode(Be.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(Be.MASK_ACTIVE,n),i.colorMask.setMask(15)):e.action==="popMaskBegin"?(i.colorMask.setMask(0),n!==0?i.stencil.setStencilMode(Be.RENDERING_MASK_REMOVE,n):(i.renderTarget.clear(null,ot.STENCIL),i.stencil.setStencilMode(Be.DISABLED,n)),n--):e.action==="popMaskEnd"&&(e.inverse?i.stencil.setStencilMode(Be.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(Be.MASK_ACTIVE,n),i.colorMask.setMask(15)),this._maskStackHash[s]=n;}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null;}};Ao.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"stencilMask"};});var O2,cg,G2=f(()=>{it();E();O2=class LP{constructor(){this.clearBeforeRender=true,this._backgroundColor=new K(0),this.color=this._backgroundColor,this.alpha=1;}init(e){e={...LP.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha);}get color(){return this._backgroundColor}set color(e){this._backgroundColor.setValue(e);}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e);}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};O2.extension={type:[g.WebGLSystem,g.WebGPUSystem,g.CanvasSystem],name:"background",priority:0};O2.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:true};cg=O2;});var Eh,Co,U2=f(()=>{E();Zl();_e();Eh={};O.handle(g.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Eh[r.name]=r.ref;},r=>{delete Eh[r.name];});Co=class{constructor(e){this._isAdvanced=false,this._filterHash=Object.create(null),this._renderer=e,this._renderer.runners.prerender.add(this);}prerender(){this._activeBlendMode="normal",this._isAdvanced=false;}setBlendMode(e,t,i){if(this._activeBlendMode===t){this._isAdvanced&&this._renderableList.push(e);return}this._activeBlendMode=t,this._isAdvanced&&this._endAdvancedBlendMode(i),this._isAdvanced=!!Eh[t],this._isAdvanced&&(this._beginAdvancedBlendMode(i),this._renderableList.push(e));}_beginAdvancedBlendMode(e){this._renderer.renderPipes.batch.break(e);let t=this._activeBlendMode;if(!Eh[t]){F(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let i=this._filterHash[t];i||(i=this._filterHash[t]=new Ir,i.filters=[new Eh[t]]);let s={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:i,canBundle:false};this._renderableList=s.renderables,e.add(s);}_endAdvancedBlendMode(e){this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:false});}buildStart(){this._isAdvanced=false;}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e);}destroy(){this._renderer=null,this._renderableList=null;for(let e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null;}};Co.extension={type:[g.WebGLPipes,g.WebGPUPipes,g.CanvasPipes],name:"blendMode"};});var L2,N2,hg,H2=f(()=>{E();qt();ce();L2={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},N2=class NP{constructor(e){this._renderer=e;}_normalizeOptions(e,t={}){return e instanceof te||e instanceof C?{target:e,...t}:{...t,...e}}async image(e){let t=new Image;return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,NP.defaultImageOptions);let{format:t,quality:i}=e,s=this.canvas(e);if(s.toBlob!==void 0)return new Promise((n,o)=>{s.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}let u=new FileReader;u.onload=()=>n(u.result),u.onerror=o,u.readAsDataURL(a);},L2[t],i);});if(s.toDataURL!==void 0)return s.toDataURL(L2[t],i);if(s.convertToBlob!==void 0){let n=await s.convertToBlob({type:L2[t],quality:i});return new Promise((o,a)=>{let u=new FileReader;u.onload=()=>o(u.result),u.onerror=a,u.readAsDataURL(n);})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);let t=e.target,i=this._renderer;if(t instanceof C)return i.texture.generateCanvas(t);let s=i.textureGenerator.generateTexture(e),n=i.texture.generateCanvas(s);return s.destroy(true),n}pixels(e){e=this._normalizeOptions(e);let t=e.target,i=this._renderer,s=t instanceof C?t:i.textureGenerator.generateTexture(e),n=i.texture.getPixels(s);return t instanceof te&&s.destroy(true),n}texture(e){return e=this._normalizeOptions(e),e.target instanceof C?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);let t=this.canvas(e),i=document.createElement("a");i.download=e.filename??"image.png",i.href=t.toDataURL("image/png"),document.body.appendChild(i),i.click(),document.body.removeChild(i);}log(e){let t=e.width??200;e=this._normalizeOptions(e);let i=this.canvas(e),s=i.toDataURL();console.log(`[Pixi Texture] ${i.width}px ${i.height}px`);let n=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${s}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}destroy(){this._renderer=null;}};N2.extension={type:[g.WebGLSystem,g.WebGPUSystem],name:"extract"};N2.defaultImageOptions={format:"png",quality:1};hg=N2;});var Eu,V2=f(()=>{ct();ce();Eu=class r extends C{static create(e){return new r({source:new oe(e)})}resize(e,t,i){return this.source.resize(e,t,i),this}};});var vI,TI,SI,Po,z2=f(()=>{it();E();he();Ze();Et();Jl();qt();V2();vI=new Z,TI=new me,SI=[0,0,0,0],Po=class{constructor(e){this._renderer=e;}generateTexture(e){e instanceof te&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});let t=e.resolution||this._renderer.resolution,i=e.antialias||this._renderer.view.antialias,s=e.target,n=e.clearColor;n?n=Array.isArray(n)&&n.length===4?n:K.shared.setValue(n).toArray():n=SI;let o=e.frame?.copyTo(vI)||os(s,TI).rectangle;o.width=Math.max(o.width,1/t)|0,o.height=Math.max(o.height,1/t)|0;let a=Eu.create({...e.textureSourceOptions,width:o.width,height:o.height,resolution:t,antialias:i}),u=D.shared.translate(-o.x,-o.y);return this._renderer.render({container:s,transform:u,target:a,clearColor:n}),a.source.updateMipmaps(),a}destroy(){this._renderer=null;}};Po.extension={type:[g.WebGLSystem,g.WebGPUSystem],name:"textureGenerator"};});var wo,W2=f(()=>{E();he();jt();zn();Fi();lr();Qe();wo=class{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e;}reset(){this._stackIndex=0;for(let e=0;e<this._activeUniforms.length;e++)this._uniformsPool.push(this._activeUniforms[e]);for(let e=0;e<this._activeBindGroups.length;e++)this._bindGroupPool.push(this._activeBindGroups[e]);this._activeUniforms.length=0,this._activeBindGroups.length=0;}start(e){this.reset(),this.push(e);}bind({size:e,projectionMatrix:t,worldTransformMatrix:i,worldColor:s,offset:n}){let o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{worldTransformMatrix:new D,worldColor:4294967295,offset:new ne},u={projectionMatrix:t||this._renderer.renderTarget.projectionMatrix,resolution:e||o.size,worldTransformMatrix:i||a.worldTransformMatrix,worldColor:s||a.worldColor,offset:n||a.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);let c=l.uniforms;c.uProjectionMatrix=u.projectionMatrix,c.uResolution=u.resolution,c.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),c.uWorldTransformMatrix.tx-=u.offset.x,c.uWorldTransformMatrix.ty-=u.offset.y,Cr(u.worldColor,c.uWorldColorAlpha,0),l.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,false):(h=this._bindGroupPool.pop()||new nt,this._activeBindGroups.push(h),h.setResource(l,0)),u.bindGroup=h,this._currentGlobalUniformData=u;}push(e){this.bind(e),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData;}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Oe.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update();}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new ae({uProjectionMatrix:{value:new D,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new D,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:true})}destroy(){this._renderer=null;}};wo.extension={type:[g.WebGLSystem,g.WebGPUSystem,g.CanvasSystem],name:"globalUniforms"};});var EI,Bo,X2=f(()=>{E();ds();EI=1,Bo=class{constructor(){this._tasks=[],this._offset=0;}init(){ye.system.add(this._update,this);}repeat(e,t,i=true){let s=EI++,n=0;return i&&(this._offset+=1e3,n=this._offset),this._tasks.push({func:e,duration:t,start:performance.now(),offset:n,last:performance.now(),repeat:true,id:s}),s}cancel(e){for(let t=0;t<this._tasks.length;t++)if(this._tasks[t].id===e){this._tasks.splice(t,1);return}}_update(){let e=performance.now();for(let t=0;t<this._tasks.length;t++){let i=this._tasks[t];if(e-i.offset-i.last>=i.duration){let s=e-i.start;i.func(s),i.last=e;}}}destroy(){ye.system.remove(this._update,this),this._tasks.length=0;}};Bo.extension={type:[g.WebGLSystem,g.WebGPUSystem,g.CanvasSystem],name:"scheduler",priority:0};});function dg(r){if(!HP){if(V.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){let e=[`%c %c %c %c %c PixiJS %c v${js} (${r}) http://www.pixijs.com/
|
|
1716
1716
|
|
|
1717
|
-
`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e);}else globalThis.console&&globalThis.console.log(`PixiJS ${js} - ${r} - http://www.pixijs.com/`);HP=true;}}var HP,Y2=f(()=>{Se();og();HP=false;});var qs,$2=f(()=>{E();Y2();lr();qs=class{constructor(e){this._renderer=e;}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===Oe.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),dg(t);}}};qs.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"hello",priority:-2};qs.defaultOptions={hello:false};});function fg(r){let e=false;for(let i in r)if(r[i]==null){e=true;break}if(!e)return r;let t=Object.create(null);for(let i in r){let s=r[i];s&&(t[i]=s);}return t}function pg(r){let e=0;for(let t=0;t<r.length;t++)r[t]==null?e++:r[t-e]=r[t];return r.length-=e,r}var j2=f(()=>{});var AI,q2,mg,K2=f(()=>{E();j2();AI=0,q2=class VP{constructor(e){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=e;}init(e){e={...VP.defaultOptions,...e},this.maxUnusedTime=e.renderableGCMaxUnusedTime,this._frequency=e.renderableGCFrequency,this.enabled=e.renderableGCActive;}get enabled(){return !!this._handler}set enabled(e){this.enabled!==e&&(e?(this._handler=this._renderer.scheduler.repeat(()=>this.run(),this._frequency,false),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(let t of this._managedHashes)t.context[t.hash]=fg(t.context[t.hash]);},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(let t of this._managedArrays)pg(t.context[t.hash]);},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)));}addManagedHash(e,t){this._managedHashes.push({context:e,hash:t});}addManagedArray(e,t){this._managedArrays.push({context:e,hash:t});}prerender({container:e}){this._now=performance.now(),e.renderGroup.gcTick=AI++,this._updateInstructionGCTick(e.renderGroup,e.renderGroup.gcTick);}addRenderable(e){this.enabled&&(e._lastUsed===-1&&(this._managedRenderables.push(e),e.once("destroyed",this._removeRenderable,this)),e._lastUsed=this._now);}run(){let e=this._now,t=this._managedRenderables,i=this._renderer.renderPipes,s=0;for(let n=0;n<t.length;n++){let o=t[n];if(o===null){s++;continue}let a=o.renderGroup??o.parentRenderGroup,u=a?.instructionSet?.gcTick??-1;if((a?.gcTick??0)===u&&(o._lastUsed=e),e-o._lastUsed>this.maxUnusedTime){if(!o.destroyed){let l=i;a&&(a.structureDidChange=true),l[o.renderPipeId].destroyRenderable(o);}o._lastUsed=-1,s++,o.off("destroyed",this._removeRenderable,this);}else t[n-s]=o;}t.length-=s;}destroy(){this.enabled=false,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0;}_removeRenderable(e){let t=this._managedRenderables.indexOf(e);t>=0&&(e.off("destroyed",this._removeRenderable,this),this._managedRenderables[t]=null);}_updateInstructionGCTick(e,t){e.instructionSet.gcTick=t;for(let i of e.renderGroupChildren)this._updateInstructionGCTick(i,t);}};q2.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"renderableGC",priority:0};q2.defaultOptions={renderableGCActive:true,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};mg=q2;});var Z2,gg,Q2=f(()=>{E();Z2=class zP{constructor(e){this._renderer=e,this.count=0,this.checkCount=0;}init(e){e={...zP.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle??e.textureGCMaxIdle,this.active=e.textureGCActive;}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())));}run(){let e=this._renderer.texture.managedTextures;for(let t=0;t<e.length;t++){let i=e[t];i.autoGarbageCollect&&i.resource&&i._touched>-1&&this.count-i._touched>this.maxIdle&&(i._touched=-1,i.unload());}}destroy(){this._renderer=null;}};Z2.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"textureGC"};Z2.defaultOptions={textureGCActive:true,textureGCAMaxIdle:null,textureGCMaxIdle:60*60,textureGCCheckCountMax:600};gg=Z2;});var WP,Ro,xg=f(()=>{lt();ct();ce();WP=class XP{constructor(e={}){if(this.uid=re("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=false,this._size=new Float32Array(2),this._managedColorTextures=false,e={...XP.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=true;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new oe({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}));}else {this.colorTextures=[...e.colorTextures.map(i=>i.source)];let t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution);}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof C||e.depthStencilTexture instanceof oe?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture());}get size(){let e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,true);}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new oe({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:false,antialias:false,mipLevelCount:1}));}resize(e,t,i=this.resolution,s=false){this.dirtyId++,this.colorTextures.forEach((n,o)=>{s&&o===0||n.source.resize(e,t,i);}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,i);}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy();}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture);}};WP.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:false,depth:false,antialias:false,isRoot:false};Ro=WP;});function Cu(r,e){if(!Au.has(r)){let t=new C({source:new ht({resource:r,...e})}),i=()=>{Au.get(r)===t&&Au.delete(r);};t.once("destroy",i),t.source.once("destroy",i),Au.set(r,t);}return Au.get(r)}function YP(r){return Au.has(r)}var Au,_g=f(()=>{On();ce();Au=new Map;});var J2,bg,eT=f(()=>{Se();E();Ze();xe();xg();_g();J2=class $P{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(e){this.texture.source.autoDensity=e;}get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e);}init(e){e={...$P.defaultOptions,...e},e.view&&(I(H,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new Z(0,0,e.width,e.height),this.canvas=e.canvas||V.get().createCanvas(),this.antialias=!!e.antialias,this.texture=Cu(this.canvas,e),this.renderTarget=new Ro({colorTextures:[this.texture],depth:!!e.depth,isRoot:true}),this.texture.source.transparent=e.backgroundAlpha<1,this.resolution=e.resolution;}resize(e,t,i){this.texture.source.resize(e,t,i),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height;}destroy(e=false){(typeof e=="boolean"?e:!!e?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);}};J2.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"view",priority:0};J2.defaultOptions={width:800,height:600,autoDensity:false,antialias:false};bg=J2;});var Pu,wu,yg=f(()=>{b2();y2();E2();A2();ag();P2();I2();k2();F2();G2();U2();H2();z2();W2();X2();$2();K2();Q2();eT();Pu=[cg,wo,qs,bg,bo,gg,Po,hg,To,mg,Bo],wu=[Co,Th,yo,xo,So,Ao,Eo,mo];});var Mo,tT=f(()=>{E();Mo=class{constructor(e){this._hash=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_hash");}contextChange(e){this._gpu=e;}getBindGroup(e,t,i){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,i)}_createBindGroup(e,t,i){let s=this._gpu.device,n=t.layout[i],o=[],a=this._renderer;for(let c in n){let h=e.resources[c]??e.resources[n[c]],d;if(h._resourceType==="uniformGroup"){let p=h;a.ubo.updateUniformGroup(p);let _=p.buffer;d={buffer:a.buffer.getGPUBuffer(_),offset:0,size:_.descriptor.size};}else if(h._resourceType==="buffer"){let p=h;d={buffer:a.buffer.getGPUBuffer(p),offset:0,size:p.descriptor.size};}else if(h._resourceType==="bufferResource"){let p=h;d={buffer:a.buffer.getGPUBuffer(p.buffer),offset:p.offset,size:p.size};}else if(h._resourceType==="textureSampler"){let p=h;d=a.texture.getGpuSampler(p);}else if(h._resourceType==="textureSource"){let p=h;d=a.texture.getGpuSource(p).createView({});}o.push({binding:n[c],resource:d});}let u=a.shader.getProgramData(t).bindGroups[i],l=s.createBindGroup({layout:u,entries:o});return this._hash[e._key]=l,l}destroy(){for(let e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null;}};Mo.extension={type:[m.WebGPUSystem],name:"bindGroup"};});var Do,rT=f(()=>{E();Yf();Do=class{constructor(e){this._gpuBuffers=Object.create(null),this._managedBuffers=[],e.renderableGC.addManagedHash(this,"_gpuBuffers");}contextChange(e){this._gpu=e;}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){let t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),i=e.data;return e._updateID&&i&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,i.buffer,0,(e._updateSize||i.byteLength)+3&-4)),t}destroyAll(){for(let e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={};}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(e));let t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(Un(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e);}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e);}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null;}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null;}};Do.extension={type:[m.WebGPUSystem],name:"buffer"};});var Io,iT=f(()=>{E();Io=class{constructor(e){this._colorMaskCache=15,this._renderer=e;}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e));}destroy(){this._renderer=null,this._colorMaskCache=null;}};Io.extension={type:[m.WebGPUSystem],name:"colorMask"};});var Ks,sT=f(()=>{Se();E();Ks=class{constructor(e){this._renderer=e;}async init(e){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(e).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu);}),this._initPromise)}contextChange(e){this._renderer.gpu=e;}async _createDeviceAndAdaptor(e){let t=await V.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),i=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(n=>t.features.has(n)),s=await t.requestDevice({requiredFeatures:i});return {adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null;}};Ks.extension={type:[m.WebGPUSystem],name:"device"};Ks.defaultOptions={powerPreference:void 0,forceFallbackAdapter:false};});var ko,nT=f(()=>{E();ko=class{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e;}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e;}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder();}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor);}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null;}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1);}setPipelineFromGeometryProgramAndState(e,t,i,s){let n=this._renderer.pipeline.getPipeline(e,t,i,s);this.setPipeline(n);}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e));}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)));}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;let t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t);}resetBindGroup(e){this._boundBindGroup[e]=null;}setBindGroup(e,t,i){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);let s=this._renderer.bindGroup.getBindGroup(t,i,e);this.renderPassEncoder.setBindGroup(e,s);}setGeometry(e,t){let i=this._renderer.pipeline.getBufferNamesToBind(e,t);for(let s in i)this._setVertexBuffer(s,e.attributes[i[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer);}_setShaderBindGroups(e,t){for(let i in e.groups){let s=e.groups[i];t||this._syncBindGroup(s),this.setBindGroup(i,s,e.gpuProgram);}}_syncBindGroup(e){for(let t in e.resources){let i=e.resources[t];i.isUniformGroup&&this._renderer.ubo.updateUniformGroup(i);}}draw(e){let{geometry:t,shader:i,state:s,topology:n,size:o,start:a,instanceCount:u,skipSync:l}=e;this.setPipelineFromGeometryProgramAndState(t,i.gpuProgram,s,n),this.setGeometry(t,i.gpuProgram),this._setShaderBindGroups(i,l),t.indexBuffer?this.renderPassEncoder.drawIndexed(o||t.indexBuffer.data.length,u??t.instanceCount,a||0):this.renderPassEncoder.draw(o||t.getSize(),u??t.instanceCount,a||0);}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null);}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null;}restoreRenderPass(){let e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,false,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);let t=this._boundPipeline,i={...this._boundVertexBuffer},s=this._boundIndexBuffer,n={...this._boundBindGroup};this._clearCache();let o=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(o.x,o.y,o.width,o.height,0,1),this.setPipeline(t);for(let a in i)this._setVertexBuffer(a,i[a]);for(let a in n)this.setBindGroup(a,n[a],null);this._setIndexBuffer(s);}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null;}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null;}contextChange(e){this._gpu=e;}};ko.extension={type:[m.WebGPUSystem],name:"encoder",priority:1};});var Fo,oT=f(()=>{E();Fo=class{constructor(e){this._renderer=e;}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures;}destroy(){}};Fo.extension={type:[m.WebGPUSystem],name:"limits"};});var Oo,aT=f(()=>{E();ys();Oo=class{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this);}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:Be.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference);}setStencilMode(e,t){let i=this._renderTargetStencilState[this._activeRenderTarget.uid];i.stencilMode=e,i.stencilReference=t;let s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t);}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null;}};Oo.extension={type:[m.WebGPUSystem],name:"stencil"};});var Zs,vg=f(()=>{jm();Oi();oi();Zs=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck();}_systemCheck(){if(!bu())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){let t=this.getUniformGroupData(e);e.buffer||(e.buffer=new Ve({data:new Float32Array(t.layout.size/4),usage:ie.UNIFORM|ie.COPY_DST}));}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){let t=e._signature,i=this._syncFunctionHash[t];if(!i){let s=Object.keys(e.uniformStructures).map(a=>e.uniformStructures[a]),n=this._adaptor.createUboElements(s),o=this._generateUboSync(n.uboElements);i=this._syncFunctionHash[t]={layout:n,syncFunction:o};}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,i){let s=this.getUniformGroupData(e);e.buffer||(e.buffer=new Ve({data:new Float32Array(s.layout.size/4),usage:ie.UNIFORM|ie.COPY_DST}));let n=null;return t||(t=e.buffer.data,n=e.buffer.dataInt32),i||(i=0),s.syncFunction(e.uniforms,t,n,i),true}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return false;e._dirtyId=0;let t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null;}};});function Tg(r){let e=r.map(i=>({data:i,offset:0,size:0})),t=0;for(let i=0;i<e.length;i++){let s=e[i],n=Go[s.data.type].size,o=Go[s.data.type].align;if(!Go[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(n=Math.max(n,o)*s.data.size),t=Math.ceil(t/o)*o,s.size=n,s.offset=t,t+=n;}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}var Go,Sg=f(()=>{Go={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};});var Wr,Eg=f(()=>{Wr=[{type:"mat3x3<f32>",test:r=>r.value.a!==void 0,ubo:`
|
|
1717
|
+
`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e);}else globalThis.console&&globalThis.console.log(`PixiJS ${js} - ${r} - http://www.pixijs.com/`);HP=true;}}var HP,Y2=f(()=>{Se();og();HP=false;});var qs,$2=f(()=>{E();Y2();lr();qs=class{constructor(e){this._renderer=e;}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===Oe.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),dg(t);}}};qs.extension={type:[g.WebGLSystem,g.WebGPUSystem,g.CanvasSystem],name:"hello",priority:-2};qs.defaultOptions={hello:false};});function fg(r){let e=false;for(let i in r)if(r[i]==null){e=true;break}if(!e)return r;let t=Object.create(null);for(let i in r){let s=r[i];s&&(t[i]=s);}return t}function pg(r){let e=0;for(let t=0;t<r.length;t++)r[t]==null?e++:r[t-e]=r[t];return r.length-=e,r}var j2=f(()=>{});var AI,q2,mg,K2=f(()=>{E();j2();AI=0,q2=class VP{constructor(e){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=e;}init(e){e={...VP.defaultOptions,...e},this.maxUnusedTime=e.renderableGCMaxUnusedTime,this._frequency=e.renderableGCFrequency,this.enabled=e.renderableGCActive;}get enabled(){return !!this._handler}set enabled(e){this.enabled!==e&&(e?(this._handler=this._renderer.scheduler.repeat(()=>this.run(),this._frequency,false),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(let t of this._managedHashes)t.context[t.hash]=fg(t.context[t.hash]);},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(let t of this._managedArrays)pg(t.context[t.hash]);},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)));}addManagedHash(e,t){this._managedHashes.push({context:e,hash:t});}addManagedArray(e,t){this._managedArrays.push({context:e,hash:t});}prerender({container:e}){this._now=performance.now(),e.renderGroup.gcTick=AI++,this._updateInstructionGCTick(e.renderGroup,e.renderGroup.gcTick);}addRenderable(e){this.enabled&&(e._lastUsed===-1&&(this._managedRenderables.push(e),e.once("destroyed",this._removeRenderable,this)),e._lastUsed=this._now);}run(){let e=this._now,t=this._managedRenderables,i=this._renderer.renderPipes,s=0;for(let n=0;n<t.length;n++){let o=t[n];if(o===null){s++;continue}let a=o.renderGroup??o.parentRenderGroup,u=a?.instructionSet?.gcTick??-1;if((a?.gcTick??0)===u&&(o._lastUsed=e),e-o._lastUsed>this.maxUnusedTime){if(!o.destroyed){let l=i;a&&(a.structureDidChange=true),l[o.renderPipeId].destroyRenderable(o);}o._lastUsed=-1,s++,o.off("destroyed",this._removeRenderable,this);}else t[n-s]=o;}t.length-=s;}destroy(){this.enabled=false,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0;}_removeRenderable(e){let t=this._managedRenderables.indexOf(e);t>=0&&(e.off("destroyed",this._removeRenderable,this),this._managedRenderables[t]=null);}_updateInstructionGCTick(e,t){e.instructionSet.gcTick=t;for(let i of e.renderGroupChildren)this._updateInstructionGCTick(i,t);}};q2.extension={type:[g.WebGLSystem,g.WebGPUSystem],name:"renderableGC",priority:0};q2.defaultOptions={renderableGCActive:true,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};mg=q2;});var Z2,gg,Q2=f(()=>{E();Z2=class zP{constructor(e){this._renderer=e,this.count=0,this.checkCount=0;}init(e){e={...zP.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle??e.textureGCMaxIdle,this.active=e.textureGCActive;}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())));}run(){let e=this._renderer.texture.managedTextures;for(let t=0;t<e.length;t++){let i=e[t];i.autoGarbageCollect&&i.resource&&i._touched>-1&&this.count-i._touched>this.maxIdle&&(i._touched=-1,i.unload());}}destroy(){this._renderer=null;}};Z2.extension={type:[g.WebGLSystem,g.WebGPUSystem],name:"textureGC"};Z2.defaultOptions={textureGCActive:true,textureGCAMaxIdle:null,textureGCMaxIdle:60*60,textureGCCheckCountMax:600};gg=Z2;});var WP,Ro,xg=f(()=>{lt();ct();ce();WP=class XP{constructor(e={}){if(this.uid=re("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=false,this._size=new Float32Array(2),this._managedColorTextures=false,e={...XP.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=true;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new oe({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}));}else {this.colorTextures=[...e.colorTextures.map(i=>i.source)];let t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution);}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof C||e.depthStencilTexture instanceof oe?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture());}get size(){let e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,true);}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new oe({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:false,antialias:false,mipLevelCount:1}));}resize(e,t,i=this.resolution,s=false){this.dirtyId++,this.colorTextures.forEach((n,o)=>{s&&o===0||n.source.resize(e,t,i);}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,i);}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy();}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture);}};WP.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:false,depth:false,antialias:false,isRoot:false};Ro=WP;});function Cu(r,e){if(!Au.has(r)){let t=new C({source:new ht({resource:r,...e})}),i=()=>{Au.get(r)===t&&Au.delete(r);};t.once("destroy",i),t.source.once("destroy",i),Au.set(r,t);}return Au.get(r)}function YP(r){return Au.has(r)}var Au,_g=f(()=>{On();ce();Au=new Map;});var J2,bg,eT=f(()=>{Se();E();Ze();xe();xg();_g();J2=class $P{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(e){this.texture.source.autoDensity=e;}get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e);}init(e){e={...$P.defaultOptions,...e},e.view&&(I(H,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new Z(0,0,e.width,e.height),this.canvas=e.canvas||V.get().createCanvas(),this.antialias=!!e.antialias,this.texture=Cu(this.canvas,e),this.renderTarget=new Ro({colorTextures:[this.texture],depth:!!e.depth,isRoot:true}),this.texture.source.transparent=e.backgroundAlpha<1,this.resolution=e.resolution;}resize(e,t,i){this.texture.source.resize(e,t,i),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height;}destroy(e=false){(typeof e=="boolean"?e:!!e?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);}};J2.extension={type:[g.WebGLSystem,g.WebGPUSystem,g.CanvasSystem],name:"view",priority:0};J2.defaultOptions={width:800,height:600,autoDensity:false,antialias:false};bg=J2;});var Pu,wu,yg=f(()=>{b2();y2();E2();A2();ag();P2();I2();k2();F2();G2();U2();H2();z2();W2();X2();$2();K2();Q2();eT();Pu=[cg,wo,qs,bg,bo,gg,Po,hg,To,mg,Bo],wu=[Co,Th,yo,xo,So,Ao,Eo,mo];});var Mo,tT=f(()=>{E();Mo=class{constructor(e){this._hash=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_hash");}contextChange(e){this._gpu=e;}getBindGroup(e,t,i){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,i)}_createBindGroup(e,t,i){let s=this._gpu.device,n=t.layout[i],o=[],a=this._renderer;for(let c in n){let h=e.resources[c]??e.resources[n[c]],d;if(h._resourceType==="uniformGroup"){let p=h;a.ubo.updateUniformGroup(p);let _=p.buffer;d={buffer:a.buffer.getGPUBuffer(_),offset:0,size:_.descriptor.size};}else if(h._resourceType==="buffer"){let p=h;d={buffer:a.buffer.getGPUBuffer(p),offset:0,size:p.descriptor.size};}else if(h._resourceType==="bufferResource"){let p=h;d={buffer:a.buffer.getGPUBuffer(p.buffer),offset:p.offset,size:p.size};}else if(h._resourceType==="textureSampler"){let p=h;d=a.texture.getGpuSampler(p);}else if(h._resourceType==="textureSource"){let p=h;d=a.texture.getGpuSource(p).createView({});}o.push({binding:n[c],resource:d});}let u=a.shader.getProgramData(t).bindGroups[i],l=s.createBindGroup({layout:u,entries:o});return this._hash[e._key]=l,l}destroy(){for(let e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null;}};Mo.extension={type:[g.WebGPUSystem],name:"bindGroup"};});var Do,rT=f(()=>{E();Yf();Do=class{constructor(e){this._gpuBuffers=Object.create(null),this._managedBuffers=[],e.renderableGC.addManagedHash(this,"_gpuBuffers");}contextChange(e){this._gpu=e;}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){let t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),i=e.data;return e._updateID&&i&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,i.buffer,0,(e._updateSize||i.byteLength)+3&-4)),t}destroyAll(){for(let e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={};}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(e));let t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(Un(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e);}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e);}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null;}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null;}};Do.extension={type:[g.WebGPUSystem],name:"buffer"};});var Io,iT=f(()=>{E();Io=class{constructor(e){this._colorMaskCache=15,this._renderer=e;}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e));}destroy(){this._renderer=null,this._colorMaskCache=null;}};Io.extension={type:[g.WebGPUSystem],name:"colorMask"};});var Ks,sT=f(()=>{Se();E();Ks=class{constructor(e){this._renderer=e;}async init(e){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(e).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu);}),this._initPromise)}contextChange(e){this._renderer.gpu=e;}async _createDeviceAndAdaptor(e){let t=await V.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),i=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(n=>t.features.has(n)),s=await t.requestDevice({requiredFeatures:i});return {adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null;}};Ks.extension={type:[g.WebGPUSystem],name:"device"};Ks.defaultOptions={powerPreference:void 0,forceFallbackAdapter:false};});var ko,nT=f(()=>{E();ko=class{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e;}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e;}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder();}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor);}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null;}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1);}setPipelineFromGeometryProgramAndState(e,t,i,s){let n=this._renderer.pipeline.getPipeline(e,t,i,s);this.setPipeline(n);}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e));}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)));}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;let t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t);}resetBindGroup(e){this._boundBindGroup[e]=null;}setBindGroup(e,t,i){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);let s=this._renderer.bindGroup.getBindGroup(t,i,e);this.renderPassEncoder.setBindGroup(e,s);}setGeometry(e,t){let i=this._renderer.pipeline.getBufferNamesToBind(e,t);for(let s in i)this._setVertexBuffer(s,e.attributes[i[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer);}_setShaderBindGroups(e,t){for(let i in e.groups){let s=e.groups[i];t||this._syncBindGroup(s),this.setBindGroup(i,s,e.gpuProgram);}}_syncBindGroup(e){for(let t in e.resources){let i=e.resources[t];i.isUniformGroup&&this._renderer.ubo.updateUniformGroup(i);}}draw(e){let{geometry:t,shader:i,state:s,topology:n,size:o,start:a,instanceCount:u,skipSync:l}=e;this.setPipelineFromGeometryProgramAndState(t,i.gpuProgram,s,n),this.setGeometry(t,i.gpuProgram),this._setShaderBindGroups(i,l),t.indexBuffer?this.renderPassEncoder.drawIndexed(o||t.indexBuffer.data.length,u??t.instanceCount,a||0):this.renderPassEncoder.draw(o||t.getSize(),u??t.instanceCount,a||0);}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null);}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null;}restoreRenderPass(){let e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,false,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);let t=this._boundPipeline,i={...this._boundVertexBuffer},s=this._boundIndexBuffer,n={...this._boundBindGroup};this._clearCache();let o=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(o.x,o.y,o.width,o.height,0,1),this.setPipeline(t);for(let a in i)this._setVertexBuffer(a,i[a]);for(let a in n)this.setBindGroup(a,n[a],null);this._setIndexBuffer(s);}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null;}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null;}contextChange(e){this._gpu=e;}};ko.extension={type:[g.WebGPUSystem],name:"encoder",priority:1};});var Fo,oT=f(()=>{E();Fo=class{constructor(e){this._renderer=e;}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures;}destroy(){}};Fo.extension={type:[g.WebGPUSystem],name:"limits"};});var Oo,aT=f(()=>{E();ys();Oo=class{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this);}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:Be.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference);}setStencilMode(e,t){let i=this._renderTargetStencilState[this._activeRenderTarget.uid];i.stencilMode=e,i.stencilReference=t;let s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t);}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null;}};Oo.extension={type:[g.WebGPUSystem],name:"stencil"};});var Zs,vg=f(()=>{jm();Oi();oi();Zs=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck();}_systemCheck(){if(!bu())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){let t=this.getUniformGroupData(e);e.buffer||(e.buffer=new Ve({data:new Float32Array(t.layout.size/4),usage:ie.UNIFORM|ie.COPY_DST}));}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){let t=e._signature,i=this._syncFunctionHash[t];if(!i){let s=Object.keys(e.uniformStructures).map(a=>e.uniformStructures[a]),n=this._adaptor.createUboElements(s),o=this._generateUboSync(n.uboElements);i=this._syncFunctionHash[t]={layout:n,syncFunction:o};}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,i){let s=this.getUniformGroupData(e);e.buffer||(e.buffer=new Ve({data:new Float32Array(s.layout.size/4),usage:ie.UNIFORM|ie.COPY_DST}));let n=null;return t||(t=e.buffer.data,n=e.buffer.dataInt32),i||(i=0),s.syncFunction(e.uniforms,t,n,i),true}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return false;e._dirtyId=0;let t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null;}};});function Tg(r){let e=r.map(i=>({data:i,offset:0,size:0})),t=0;for(let i=0;i<e.length;i++){let s=e[i],n=Go[s.data.type].size,o=Go[s.data.type].align;if(!Go[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(n=Math.max(n,o)*s.data.size),t=Math.ceil(t/o)*o,s.size=n,s.offset=t,t+=n;}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}var Go,Sg=f(()=>{Go={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};});var Wr,Eg=f(()=>{Wr=[{type:"mat3x3<f32>",test:r=>r.value.a!==void 0,ubo:`
|
|
1718
1718
|
var matrix = uv[name].toArray(true);
|
|
1719
1719
|
data[offset] = matrix[0];
|
|
1720
1720
|
data[offset + 1] = matrix[1];
|
|
@@ -1858,7 +1858,7 @@ fn mainFragment(
|
|
|
1858
1858
|
}
|
|
1859
1859
|
${s!==0?`arrayOffset += ${s};`:""}
|
|
1860
1860
|
}
|
|
1861
|
-
`}var uT=f(()=>{Sg();});function Bg(r){return Bu(r,"uboWgsl",wg,Cg)}var lT=f(()=>{Ag();Pg();uT();});var Uo,cT=f(()=>{E();vg();Sg();lT();Uo=class extends Zs{constructor(){super({createUboElements:Tg,generateUboSync:Bg});}};Uo.extension={type:[m.WebGPUSystem],name:"ubo"};});var mi,Ch=f(()=>{St();lt();mi=class extends ue{constructor({buffer:e,offset:t,size:i}){super(),this.uid=re("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=re("resource"),this._bufferResource=true,this.destroyed=false,this.buffer=e,this.offset=t|0,this.size=i,this.buffer.on("change",this.onBufferChange,this);}onBufferChange(){this._resourceId=re("resource"),this.emit("change",this);}destroy(e=false){this.destroyed=true,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null;}};});var Mu,hT=f(()=>{Mu=class{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535);}clear(){this.byteIndex=0;}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);let t=this.byteIndex,i=t+e*4;if(i=Math.ceil(i/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,i>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=i,t}addGroup(e){let t=this.addEmptyGroup(e.length);for(let i=0;i<e.length;i++)this.data[t/4+i]=e[i];return t}destroy(){this.data=null;}};});var Qs,Lo,dT=f(()=>{E();Oi();Ch();oi();hT();Fi();Qs=128,Lo=class{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_bindGroupHash"),this._batchBuffer=new Mu({minUniformOffsetAlignment:Qs});let t=256/Qs;for(let i=0;i<t;i++){let s=ie.UNIFORM|ie.COPY_DST;i===0&&(s|=ie.COPY_SRC),this._buffers.push(new Ve({data:this._batchBuffer.data,usage:s}));}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups();}_resetBindGroups(){for(let e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear();}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);let i=e.buffer.data,s=this._batchBuffer.addEmptyGroup(i.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,s/4),this._bindGroupHash[e.uid]=this._getBindGroup(s/Qs),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);let t=e.buffer.data,i=this._batchBuffer.addGroup(t);return this._getBufferResource(i/Qs)}getArrayBindGroup(e){let t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/Qs)}getArrayBufferResource(e){let i=this._batchBuffer.addGroup(e)/Qs;return this._getBufferResource(i)}_getBufferResource(e){if(!this._bufferResources[e]){let t=this._buffers[e%2];this._bufferResources[e]=new mi({buffer:t,offset:(e/2|0)*256,size:Qs});}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){let t=new nt({0:this._getBufferResource(e)});this._bindGroups[e]=t;}return this._bindGroups[e]}_uploadBindGroups(){let e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);let i=this._renderer.gpu.device.createCommandEncoder();for(let s=1;s<this._buffers.length;s++){let n=this._buffers[s];i.copyBufferToBuffer(e.getGPUBuffer(t),Qs,e.getGPUBuffer(n),0,this._batchBuffer.byteIndex);}this._renderer.gpu.device.queue.submit([i.finish()]);}destroy(){for(let e=0;e<this._bindGroups.length;e++)this._bindGroups[e].destroy();this._bindGroups=null,this._bindGroupHash=null;for(let e=0;e<this._buffers.length;e++)this._buffers[e].destroy();this._buffers=null;for(let e=0;e<this._bufferResources.length;e++)this._bufferResources[e].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null;}};Lo.extension={type:[m.WebGPUPipes],name:"uniformBatch"};});function Du(r,e){for(let t in r.attributes){let i=r.attributes[t],s=e[t];s?(i.format??(i.format=s.format),i.offset??(i.offset=s.offset),i.instance??(i.instance=s.instance)):F(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`);}CI(r);}function CI(r){let{buffers:e,attributes:t}=r,i={},s={};for(let n in e){let o=e[n];i[o.uid]=0,s[o.uid]=0;}for(let n in t){let o=t[n];i[o.buffer.uid]+=Dt(o.format).stride;}for(let n in t){let o=t[n];o.stride??(o.stride=i[o.buffer.uid]),o.start??(o.start=s[o.buffer.uid]),s[o.buffer.uid]+=Dt(o.format).stride;}}var Rg=f(()=>{_e();Ts();});var wr,Mg=f(()=>{ys();wr=[];wr[Be.NONE]=void 0;wr[Be.DISABLED]={stencilWriteMask:0,stencilReadMask:0};wr[Be.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};wr[Be.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};wr[Be.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};wr[Be.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}};});function wI(r,e,t,i,s){return r<<24|e<<16|t<<10|i<<5|s}function BI(r,e,t,i){return t<<6|r<<3|i<<1|e}var PI,No,fT=f(()=>{E();_e();Rg();ys();Va();Mg();PI={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};No=class{constructor(e){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=e;}contextChange(e){this._gpu=e,this.setStencilMode(Be.DISABLED),this._updatePipeHash();}setMultisampleCount(e){this._multisampleCount!==e&&(this._multisampleCount=e,this._updatePipeHash());}setRenderTarget(e){this._multisampleCount=e.msaaSamples,this._depthStencilAttachment=e.descriptor.depthStencilAttachment?1:0,this._updatePipeHash();}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash());}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=wr[e],this._updatePipeHash());}setPipeline(e,t,i,s){let n=this.getPipeline(e,t,i);s.setPipeline(n);}getPipeline(e,t,i,s){e._layoutKey||(Du(e,t.attributeData),this._generateBufferKey(e)),s||(s=e.topology);let n=wI(e._layoutKey,t._layoutKey,i.data,i._blendModeId,PI[s]);return this._pipeCache[n]?this._pipeCache[n]:(this._pipeCache[n]=this._createPipeline(e,t,i,s),this._pipeCache[n])}_createPipeline(e,t,i,s){let n=this._gpu.device,o=this._createVertexBufferLayouts(e,t),a=this._renderer.state.getColorTargets(i);a[0].writeMask=this._stencilMode===Be.RENDERING_MASK_ADD?0:this._colorMask;let u=this._renderer.shader.getProgramData(t).pipeline,l={vertex:{module:this._getModule(t.vertex.source),entryPoint:t.vertex.entryPoint,buffers:o},fragment:{module:this._getModule(t.fragment.source),entryPoint:t.fragment.entryPoint,targets:a},primitive:{topology:s,cullMode:i.cullMode},layout:u,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(l.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:i.depthTest,depthCompare:i.depthTest?"less":"always"}),n.createRenderPipeline(l)}_getModule(e){return this._moduleCache[e]||this._createModule(e)}_createModule(e){let t=this._gpu.device;return this._moduleCache[e]=t.createShaderModule({code:e}),this._moduleCache[e]}_generateBufferKey(e){let t=[],i=0,s=Object.keys(e.attributes).sort();for(let o=0;o<s.length;o++){let a=e.attributes[s[o]];t[i++]=a.offset,t[i++]=a.format,t[i++]=a.stride,t[i++]=a.instance;}let n=t.join("|");return e._layoutKey=Nr(n,"geometry"),e._layoutKey}_generateAttributeLocationsKey(e){let t=[],i=0,s=Object.keys(e.attributeData).sort();for(let o=0;o<s.length;o++){let a=e.attributeData[s[o]];t[i++]=a.location;}let n=t.join("|");return e._attributeLocationsKey=Nr(n,"programAttributes"),e._attributeLocationsKey}getBufferNamesToBind(e,t){let i=e._layoutKey<<16|t._attributeLocationsKey;if(this._bindingNamesCache[i])return this._bindingNamesCache[i];let s=this._createVertexBufferLayouts(e,t),n=Object.create(null),o=t.attributeData;for(let a=0;a<s.length;a++){let l=Object.values(s[a].attributes)[0].shaderLocation;for(let c in o)if(o[c].location===l){n[a]=c;break}}return this._bindingNamesCache[i]=n,n}_createVertexBufferLayouts(e,t){t._attributeLocationsKey||this._generateAttributeLocationsKey(t);let i=e._layoutKey<<16|t._attributeLocationsKey;if(this._bufferLayoutsCache[i])return this._bufferLayoutsCache[i];let s=[];return e.buffers.forEach(n=>{let o={arrayStride:0,stepMode:"vertex",attributes:[]},a=o.attributes;for(let u in t.attributeData){let l=e.attributes[u];(l.divisor??1)!==1&&F(`Attribute ${u} has an invalid divisor value of '${l.divisor}'. WebGPU only supports a divisor value of 1`),l.buffer===n&&(o.arrayStride=l.stride,o.stepMode=l.instance?"instance":"vertex",a.push({shaderLocation:t.attributeData[u].location,offset:l.offset,format:l.format}));}a.length&&s.push(o);}),this._bufferLayoutsCache[i]=s,s}_updatePipeHash(){let e=BI(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e];}destroy(){this._renderer=null,this._bufferLayoutsCache=null;}};No.extension={type:[m.WebGPUSystem],name:"pipeline"};});function Dg(r,e,t,i,s,n){let o=n?1:-1;return r.identity(),r.a=1/i*2,r.d=o*(1/s*2),r.tx=-1-e*r.a,r.ty=-o-t*r.d,r}var pT=f(()=>{});function Ig(r){let e=r.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}var mT=f(()=>{});var Js,kg=f(()=>{he();Ze();co();pT();qm();On();ct();ce();_g();mT();xg();Js=class{constructor(e){this.rootViewPort=new Z,this.viewport=new Z,this.onRenderTargetChange=new $s("onRenderTargetChange"),this.projectionMatrix=new D,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuRenderTargetHash");}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget);}renderStart({target:e,clear:t,clearColor:i,frame:s}){this._renderTargetStack.length=0,this.push(e,t,i,s),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=Ig(this.rootRenderTarget),this.adaptor.prerender?.(this.rootRenderTarget);}postrender(){this.adaptor.postrender?.(this.rootRenderTarget);}bind(e,t=true,i,s){let n=this.getRenderTarget(e),o=this.renderTarget!==n;this.renderTarget=n,this.renderSurface=e;let a=this.getGpuRenderTarget(n);(n.pixelWidth!==a.width||n.pixelHeight!==a.height)&&(this.adaptor.resizeGpuRenderTarget(n),a.width=n.pixelWidth,a.height=n.pixelHeight);let u=n.colorTexture,l=this.viewport,c=u.pixelWidth,h=u.pixelHeight;if(!s&&e instanceof C&&(s=e.frame),s){let d=u._resolution;l.x=s.x*d+.5|0,l.y=s.y*d+.5|0,l.width=s.width*d+.5|0,l.height=s.height*d+.5|0;}else l.x=0,l.y=0,l.width=c,l.height=h;return Dg(this.projectionMatrix,0,0,l.width/u.resolution,l.height/u.resolution,!n.isRoot),this.adaptor.startRenderPass(n,t,i,l),o&&this.onRenderTargetChange.emit(n),n}clear(e,t=ot.ALL,i){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,i,this.viewport));}contextChange(){this._gpuRenderTargetHash=Object.create(null);}push(e,t=ot.ALL,i,s){let n=this.bind(e,t,i,s);return this._renderTargetStack.push({renderTarget:n,frame:s}),n}pop(){this._renderTargetStack.pop();let e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,false,null,e.frame);}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,i,s,n){i.x<0&&(s.width+=i.x,n.x-=i.x,i.x=0),i.y<0&&(s.height+=i.y,n.y-=i.y,i.y=0);let{pixelWidth:o,pixelHeight:a}=e;return s.width=Math.min(s.width,o-i.x),s.height=Math.min(s.height,a-i.y),this.adaptor.copyToTexture(e,t,i,s,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=true,this.adaptor.startRenderPass(this.renderTarget,false,null,this.viewport));}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy();}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null);}_initRenderTarget(e){let t=null;return ht.test(e)&&(e=Cu(e).source),e instanceof Ro?t=e:e instanceof oe&&(t=new Ro({colorTextures:[e]}),e.source instanceof ht&&(t.isRoot=true),e.once("destroy",()=>{t.destroy(),this._renderSurfaceToRenderTargetHash.delete(e);let i=this._gpuRenderTargetHash[t.uid];i&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(i));})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}resetState(){this.renderTarget=null,this.renderSurface=null;}};});var Iu,gT=f(()=>{Iu=class{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1;}};});var ku,xT=f(()=>{co();On();ct();gT();ku=class{init(e,t){this._renderer=e,this._renderTargetSystem=t;}copyToTexture(e,t,i,s,n){let o=this._renderer,a=this._getGpuColorTexture(e),u=o.texture.getGpuSource(t.source);return o.encoder.commandEncoder.copyTextureToTexture({texture:a,origin:i},{texture:u,origin:n},s),t}startRenderPass(e,t=true,i,s){let o=this._renderTargetSystem.getGpuRenderTarget(e),a=this.getDescriptor(e,t,i);o.descriptor=a,this._renderer.pipeline.setRenderTarget(o),this._renderer.encoder.beginRenderPass(o),this._renderer.encoder.setViewport(s);}finishRenderPass(){this._renderer.encoder.endRenderPass();}_getGpuColorTexture(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,i){typeof t=="boolean"&&(t=t?ot.ALL:ot.NONE);let s=this._renderTargetSystem,n=s.getGpuRenderTarget(e),o=e.colorTextures.map((l,c)=>{let h=n.contexts[c],d,p;h?d=h.getCurrentTexture().createView():d=this._renderer.texture.getGpuSource(l).createView({mipLevelCount:1}),n.msaaTextures[c]&&(p=d,d=this._renderer.texture.getTextureView(n.msaaTextures[c]));let _=t&ot.COLOR?"clear":"load";return i??(i=s.defaultClearColor),{view:d,resolveTarget:p,clearValue:i,storeOp:"store",loadOp:_}}),a;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=n.msaa?4:1),e.depthStencilTexture){let l=t&ot.STENCIL?"clear":"load",c=t&ot.DEPTH?"clear":"load";a={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:l,depthClearValue:1,depthLoadOp:c,depthStoreOp:"store"};}return {colorAttachments:o,depthStencilAttachment:a}}clear(e,t=true,i,s){if(!t)return;let{gpu:n,encoder:o}=this._renderer,a=n.device;if(o.commandEncoder===null){let l=a.createCommandEncoder(),c=this.getDescriptor(e,t,i),h=l.beginRenderPass(c);h.setViewport(s.x,s.y,s.width,s.height,0,1),h.end();let d=l.finish();a.queue.submit([d]);}else this.startRenderPass(e,t,i,s);}initGpuRenderTarget(e){e.isRoot=true;let t=new Iu;return e.colorTextures.forEach((i,s)=>{if(i instanceof ht){let n=i.resource.getContext("webgpu"),o=i.transparent?"premultiplied":"opaque";try{n.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:o});}catch(a){console.error(a);}t.contexts[s]=n;}if(t.msaa=i.source.antialias,i.source.antialias){let n=new oe({width:0,height:0,sampleCount:4});t.msaaTextures[s]=n;}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure();}),e.msaaTextures.forEach(t=>{t.destroy();}),e.msaaTextures.length=0,e.contexts.length=0;}ensureDepthStencilTexture(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4);}resizeGpuRenderTarget(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((i,s)=>{t.msaaTextures[s]?.resize(i.source.width,i.source.height,i.source._resolution);});}};});var Ho,_T=f(()=>{E();kg();xT();Ho=class extends Js{constructor(e){super(e),this.adaptor=new ku,this.adaptor.init(e,this);}};Ho.extension={type:[m.WebGPUSystem],name:"renderTarget"};});var Vo,bT=f(()=>{E();Vo=class{constructor(){this._gpuProgramData=Object.create(null);}contextChange(e){this._gpu=e;}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){let t=this._gpu.device,i=e.gpuLayout.map(n=>t.createBindGroupLayout({entries:n})),s={bindGroupLayouts:i};return this._gpuProgramData[e._layoutKey]={bindGroups:i,pipeline:t.createPipelineLayout(s)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null;}};Vo.extension={type:[m.WebGPUSystem],name:"shader"};});var wt,yT=f(()=>{wt={};wt.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};wt.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};wt.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};wt.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};wt.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};wt.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};wt["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};wt["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};wt["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};wt.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};wt.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}};wt.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}};});var zo,vT=f(()=>{E();cr();yT();zo=class{constructor(){this.defaultState=new Ue,this.defaultState.blend=true;}contextChange(e){this.gpu=e;}getColorTargets(e){return [{format:"bgra8unorm",writeMask:0,blend:wt[e.blendMode]||wt.normal}]}destroy(){this.gpu=null;}};zo.extension={type:[m.WebGPUSystem],name:"state"};});var Fg,TT=f(()=>{Fg={type:"image",upload(r,e,t){let i=r.resource,s=(r.pixelWidth|0)*(r.pixelHeight|0),n=i.byteLength/s;t.device.queue.writeTexture({texture:e},i,{offset:0,rowsPerImage:r.pixelHeight,bytesPerRow:r.pixelHeight*n},{width:r.pixelWidth,height:r.pixelHeight,depthOrArrayLayers:1});}};});var Ph,RI,Og,ST=f(()=>{Ph={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},RI={blockBytes:4,blockWidth:1,blockHeight:1},Og={type:"compressed",upload(r,e,t){let i=r.pixelWidth,s=r.pixelHeight,n=Ph[r.format]||RI;for(let o=0;o<r.resource.length;o++){let a=r.resource[o],u=Math.ceil(i/n.blockWidth)*n.blockBytes;t.device.queue.writeTexture({texture:e,mipLevel:o},a,{offset:0,bytesPerRow:u},{width:Math.ceil(i/n.blockWidth)*n.blockWidth,height:Math.ceil(s/n.blockHeight)*n.blockHeight,depthOrArrayLayers:1}),i=Math.max(i>>1,1),s=Math.max(s>>1,1);}}};});var Fu,Gg=f(()=>{Se();_e();Fu={type:"image",upload(r,e,t){let i=r.resource;if(!i)return;if(globalThis.HTMLImageElement&&i instanceof HTMLImageElement){let a=V.get().createCanvas(i.width,i.height);a.getContext("2d").drawImage(i,0,0,i.width,i.height),r.resource=a,F("ImageSource: Image element passed, converting to canvas and replacing resource.");}let s=Math.min(e.width,r.resourceWidth||r.pixelWidth),n=Math.min(e.height,r.resourceHeight||r.pixelHeight),o=r.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:i},{texture:e,premultipliedAlpha:o},{width:s,height:n});}};});var Ug,ET=f(()=>{Gg();Ug={type:"video",upload(r,e,t){Fu.upload(r,e,t);}};});var Ou,AT=f(()=>{Ou=class{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={};}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
|
|
1861
|
+
`}var uT=f(()=>{Sg();});function Bg(r){return Bu(r,"uboWgsl",wg,Cg)}var lT=f(()=>{Ag();Pg();uT();});var Uo,cT=f(()=>{E();vg();Sg();lT();Uo=class extends Zs{constructor(){super({createUboElements:Tg,generateUboSync:Bg});}};Uo.extension={type:[g.WebGPUSystem],name:"ubo"};});var mi,Ch=f(()=>{St();lt();mi=class extends ue{constructor({buffer:e,offset:t,size:i}){super(),this.uid=re("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=re("resource"),this._bufferResource=true,this.destroyed=false,this.buffer=e,this.offset=t|0,this.size=i,this.buffer.on("change",this.onBufferChange,this);}onBufferChange(){this._resourceId=re("resource"),this.emit("change",this);}destroy(e=false){this.destroyed=true,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null;}};});var Mu,hT=f(()=>{Mu=class{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535);}clear(){this.byteIndex=0;}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);let t=this.byteIndex,i=t+e*4;if(i=Math.ceil(i/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,i>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=i,t}addGroup(e){let t=this.addEmptyGroup(e.length);for(let i=0;i<e.length;i++)this.data[t/4+i]=e[i];return t}destroy(){this.data=null;}};});var Qs,Lo,dT=f(()=>{E();Oi();Ch();oi();hT();Fi();Qs=128,Lo=class{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_bindGroupHash"),this._batchBuffer=new Mu({minUniformOffsetAlignment:Qs});let t=256/Qs;for(let i=0;i<t;i++){let s=ie.UNIFORM|ie.COPY_DST;i===0&&(s|=ie.COPY_SRC),this._buffers.push(new Ve({data:this._batchBuffer.data,usage:s}));}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups();}_resetBindGroups(){for(let e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear();}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);let i=e.buffer.data,s=this._batchBuffer.addEmptyGroup(i.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,s/4),this._bindGroupHash[e.uid]=this._getBindGroup(s/Qs),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);let t=e.buffer.data,i=this._batchBuffer.addGroup(t);return this._getBufferResource(i/Qs)}getArrayBindGroup(e){let t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/Qs)}getArrayBufferResource(e){let i=this._batchBuffer.addGroup(e)/Qs;return this._getBufferResource(i)}_getBufferResource(e){if(!this._bufferResources[e]){let t=this._buffers[e%2];this._bufferResources[e]=new mi({buffer:t,offset:(e/2|0)*256,size:Qs});}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){let t=new nt({0:this._getBufferResource(e)});this._bindGroups[e]=t;}return this._bindGroups[e]}_uploadBindGroups(){let e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);let i=this._renderer.gpu.device.createCommandEncoder();for(let s=1;s<this._buffers.length;s++){let n=this._buffers[s];i.copyBufferToBuffer(e.getGPUBuffer(t),Qs,e.getGPUBuffer(n),0,this._batchBuffer.byteIndex);}this._renderer.gpu.device.queue.submit([i.finish()]);}destroy(){for(let e=0;e<this._bindGroups.length;e++)this._bindGroups[e].destroy();this._bindGroups=null,this._bindGroupHash=null;for(let e=0;e<this._buffers.length;e++)this._buffers[e].destroy();this._buffers=null;for(let e=0;e<this._bufferResources.length;e++)this._bufferResources[e].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null;}};Lo.extension={type:[g.WebGPUPipes],name:"uniformBatch"};});function Du(r,e){for(let t in r.attributes){let i=r.attributes[t],s=e[t];s?(i.format??(i.format=s.format),i.offset??(i.offset=s.offset),i.instance??(i.instance=s.instance)):F(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`);}CI(r);}function CI(r){let{buffers:e,attributes:t}=r,i={},s={};for(let n in e){let o=e[n];i[o.uid]=0,s[o.uid]=0;}for(let n in t){let o=t[n];i[o.buffer.uid]+=Dt(o.format).stride;}for(let n in t){let o=t[n];o.stride??(o.stride=i[o.buffer.uid]),o.start??(o.start=s[o.buffer.uid]),s[o.buffer.uid]+=Dt(o.format).stride;}}var Rg=f(()=>{_e();Ts();});var wr,Mg=f(()=>{ys();wr=[];wr[Be.NONE]=void 0;wr[Be.DISABLED]={stencilWriteMask:0,stencilReadMask:0};wr[Be.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};wr[Be.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};wr[Be.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};wr[Be.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}};});function wI(r,e,t,i,s){return r<<24|e<<16|t<<10|i<<5|s}function BI(r,e,t,i){return t<<6|r<<3|i<<1|e}var PI,No,fT=f(()=>{E();_e();Rg();ys();Va();Mg();PI={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};No=class{constructor(e){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=e;}contextChange(e){this._gpu=e,this.setStencilMode(Be.DISABLED),this._updatePipeHash();}setMultisampleCount(e){this._multisampleCount!==e&&(this._multisampleCount=e,this._updatePipeHash());}setRenderTarget(e){this._multisampleCount=e.msaaSamples,this._depthStencilAttachment=e.descriptor.depthStencilAttachment?1:0,this._updatePipeHash();}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash());}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=wr[e],this._updatePipeHash());}setPipeline(e,t,i,s){let n=this.getPipeline(e,t,i);s.setPipeline(n);}getPipeline(e,t,i,s){e._layoutKey||(Du(e,t.attributeData),this._generateBufferKey(e)),s||(s=e.topology);let n=wI(e._layoutKey,t._layoutKey,i.data,i._blendModeId,PI[s]);return this._pipeCache[n]?this._pipeCache[n]:(this._pipeCache[n]=this._createPipeline(e,t,i,s),this._pipeCache[n])}_createPipeline(e,t,i,s){let n=this._gpu.device,o=this._createVertexBufferLayouts(e,t),a=this._renderer.state.getColorTargets(i);a[0].writeMask=this._stencilMode===Be.RENDERING_MASK_ADD?0:this._colorMask;let u=this._renderer.shader.getProgramData(t).pipeline,l={vertex:{module:this._getModule(t.vertex.source),entryPoint:t.vertex.entryPoint,buffers:o},fragment:{module:this._getModule(t.fragment.source),entryPoint:t.fragment.entryPoint,targets:a},primitive:{topology:s,cullMode:i.cullMode},layout:u,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(l.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:i.depthTest,depthCompare:i.depthTest?"less":"always"}),n.createRenderPipeline(l)}_getModule(e){return this._moduleCache[e]||this._createModule(e)}_createModule(e){let t=this._gpu.device;return this._moduleCache[e]=t.createShaderModule({code:e}),this._moduleCache[e]}_generateBufferKey(e){let t=[],i=0,s=Object.keys(e.attributes).sort();for(let o=0;o<s.length;o++){let a=e.attributes[s[o]];t[i++]=a.offset,t[i++]=a.format,t[i++]=a.stride,t[i++]=a.instance;}let n=t.join("|");return e._layoutKey=Nr(n,"geometry"),e._layoutKey}_generateAttributeLocationsKey(e){let t=[],i=0,s=Object.keys(e.attributeData).sort();for(let o=0;o<s.length;o++){let a=e.attributeData[s[o]];t[i++]=a.location;}let n=t.join("|");return e._attributeLocationsKey=Nr(n,"programAttributes"),e._attributeLocationsKey}getBufferNamesToBind(e,t){let i=e._layoutKey<<16|t._attributeLocationsKey;if(this._bindingNamesCache[i])return this._bindingNamesCache[i];let s=this._createVertexBufferLayouts(e,t),n=Object.create(null),o=t.attributeData;for(let a=0;a<s.length;a++){let l=Object.values(s[a].attributes)[0].shaderLocation;for(let c in o)if(o[c].location===l){n[a]=c;break}}return this._bindingNamesCache[i]=n,n}_createVertexBufferLayouts(e,t){t._attributeLocationsKey||this._generateAttributeLocationsKey(t);let i=e._layoutKey<<16|t._attributeLocationsKey;if(this._bufferLayoutsCache[i])return this._bufferLayoutsCache[i];let s=[];return e.buffers.forEach(n=>{let o={arrayStride:0,stepMode:"vertex",attributes:[]},a=o.attributes;for(let u in t.attributeData){let l=e.attributes[u];(l.divisor??1)!==1&&F(`Attribute ${u} has an invalid divisor value of '${l.divisor}'. WebGPU only supports a divisor value of 1`),l.buffer===n&&(o.arrayStride=l.stride,o.stepMode=l.instance?"instance":"vertex",a.push({shaderLocation:t.attributeData[u].location,offset:l.offset,format:l.format}));}a.length&&s.push(o);}),this._bufferLayoutsCache[i]=s,s}_updatePipeHash(){let e=BI(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e];}destroy(){this._renderer=null,this._bufferLayoutsCache=null;}};No.extension={type:[g.WebGPUSystem],name:"pipeline"};});function Dg(r,e,t,i,s,n){let o=n?1:-1;return r.identity(),r.a=1/i*2,r.d=o*(1/s*2),r.tx=-1-e*r.a,r.ty=-o-t*r.d,r}var pT=f(()=>{});function Ig(r){let e=r.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}var mT=f(()=>{});var Js,kg=f(()=>{he();Ze();co();pT();qm();On();ct();ce();_g();mT();xg();Js=class{constructor(e){this.rootViewPort=new Z,this.viewport=new Z,this.onRenderTargetChange=new $s("onRenderTargetChange"),this.projectionMatrix=new D,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuRenderTargetHash");}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget);}renderStart({target:e,clear:t,clearColor:i,frame:s}){this._renderTargetStack.length=0,this.push(e,t,i,s),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=Ig(this.rootRenderTarget),this.adaptor.prerender?.(this.rootRenderTarget);}postrender(){this.adaptor.postrender?.(this.rootRenderTarget);}bind(e,t=true,i,s){let n=this.getRenderTarget(e),o=this.renderTarget!==n;this.renderTarget=n,this.renderSurface=e;let a=this.getGpuRenderTarget(n);(n.pixelWidth!==a.width||n.pixelHeight!==a.height)&&(this.adaptor.resizeGpuRenderTarget(n),a.width=n.pixelWidth,a.height=n.pixelHeight);let u=n.colorTexture,l=this.viewport,c=u.pixelWidth,h=u.pixelHeight;if(!s&&e instanceof C&&(s=e.frame),s){let d=u._resolution;l.x=s.x*d+.5|0,l.y=s.y*d+.5|0,l.width=s.width*d+.5|0,l.height=s.height*d+.5|0;}else l.x=0,l.y=0,l.width=c,l.height=h;return Dg(this.projectionMatrix,0,0,l.width/u.resolution,l.height/u.resolution,!n.isRoot),this.adaptor.startRenderPass(n,t,i,l),o&&this.onRenderTargetChange.emit(n),n}clear(e,t=ot.ALL,i){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,i,this.viewport));}contextChange(){this._gpuRenderTargetHash=Object.create(null);}push(e,t=ot.ALL,i,s){let n=this.bind(e,t,i,s);return this._renderTargetStack.push({renderTarget:n,frame:s}),n}pop(){this._renderTargetStack.pop();let e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,false,null,e.frame);}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,i,s,n){i.x<0&&(s.width+=i.x,n.x-=i.x,i.x=0),i.y<0&&(s.height+=i.y,n.y-=i.y,i.y=0);let{pixelWidth:o,pixelHeight:a}=e;return s.width=Math.min(s.width,o-i.x),s.height=Math.min(s.height,a-i.y),this.adaptor.copyToTexture(e,t,i,s,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=true,this.adaptor.startRenderPass(this.renderTarget,false,null,this.viewport));}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy();}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null);}_initRenderTarget(e){let t=null;return ht.test(e)&&(e=Cu(e).source),e instanceof Ro?t=e:e instanceof oe&&(t=new Ro({colorTextures:[e]}),e.source instanceof ht&&(t.isRoot=true),e.once("destroy",()=>{t.destroy(),this._renderSurfaceToRenderTargetHash.delete(e);let i=this._gpuRenderTargetHash[t.uid];i&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(i));})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}resetState(){this.renderTarget=null,this.renderSurface=null;}};});var Iu,gT=f(()=>{Iu=class{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1;}};});var ku,xT=f(()=>{co();On();ct();gT();ku=class{init(e,t){this._renderer=e,this._renderTargetSystem=t;}copyToTexture(e,t,i,s,n){let o=this._renderer,a=this._getGpuColorTexture(e),u=o.texture.getGpuSource(t.source);return o.encoder.commandEncoder.copyTextureToTexture({texture:a,origin:i},{texture:u,origin:n},s),t}startRenderPass(e,t=true,i,s){let o=this._renderTargetSystem.getGpuRenderTarget(e),a=this.getDescriptor(e,t,i);o.descriptor=a,this._renderer.pipeline.setRenderTarget(o),this._renderer.encoder.beginRenderPass(o),this._renderer.encoder.setViewport(s);}finishRenderPass(){this._renderer.encoder.endRenderPass();}_getGpuColorTexture(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,i){typeof t=="boolean"&&(t=t?ot.ALL:ot.NONE);let s=this._renderTargetSystem,n=s.getGpuRenderTarget(e),o=e.colorTextures.map((l,c)=>{let h=n.contexts[c],d,p;h?d=h.getCurrentTexture().createView():d=this._renderer.texture.getGpuSource(l).createView({mipLevelCount:1}),n.msaaTextures[c]&&(p=d,d=this._renderer.texture.getTextureView(n.msaaTextures[c]));let _=t&ot.COLOR?"clear":"load";return i??(i=s.defaultClearColor),{view:d,resolveTarget:p,clearValue:i,storeOp:"store",loadOp:_}}),a;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=n.msaa?4:1),e.depthStencilTexture){let l=t&ot.STENCIL?"clear":"load",c=t&ot.DEPTH?"clear":"load";a={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:l,depthClearValue:1,depthLoadOp:c,depthStoreOp:"store"};}return {colorAttachments:o,depthStencilAttachment:a}}clear(e,t=true,i,s){if(!t)return;let{gpu:n,encoder:o}=this._renderer,a=n.device;if(o.commandEncoder===null){let l=a.createCommandEncoder(),c=this.getDescriptor(e,t,i),h=l.beginRenderPass(c);h.setViewport(s.x,s.y,s.width,s.height,0,1),h.end();let d=l.finish();a.queue.submit([d]);}else this.startRenderPass(e,t,i,s);}initGpuRenderTarget(e){e.isRoot=true;let t=new Iu;return e.colorTextures.forEach((i,s)=>{if(i instanceof ht){let n=i.resource.getContext("webgpu"),o=i.transparent?"premultiplied":"opaque";try{n.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:o});}catch(a){console.error(a);}t.contexts[s]=n;}if(t.msaa=i.source.antialias,i.source.antialias){let n=new oe({width:0,height:0,sampleCount:4});t.msaaTextures[s]=n;}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure();}),e.msaaTextures.forEach(t=>{t.destroy();}),e.msaaTextures.length=0,e.contexts.length=0;}ensureDepthStencilTexture(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4);}resizeGpuRenderTarget(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((i,s)=>{t.msaaTextures[s]?.resize(i.source.width,i.source.height,i.source._resolution);});}};});var Ho,_T=f(()=>{E();kg();xT();Ho=class extends Js{constructor(e){super(e),this.adaptor=new ku,this.adaptor.init(e,this);}};Ho.extension={type:[g.WebGPUSystem],name:"renderTarget"};});var Vo,bT=f(()=>{E();Vo=class{constructor(){this._gpuProgramData=Object.create(null);}contextChange(e){this._gpu=e;}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){let t=this._gpu.device,i=e.gpuLayout.map(n=>t.createBindGroupLayout({entries:n})),s={bindGroupLayouts:i};return this._gpuProgramData[e._layoutKey]={bindGroups:i,pipeline:t.createPipelineLayout(s)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null;}};Vo.extension={type:[g.WebGPUSystem],name:"shader"};});var wt,yT=f(()=>{wt={};wt.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};wt.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};wt.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};wt.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};wt.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};wt.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};wt["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};wt["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};wt["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};wt.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};wt.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}};wt.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}};});var zo,vT=f(()=>{E();cr();yT();zo=class{constructor(){this.defaultState=new Ue,this.defaultState.blend=true;}contextChange(e){this.gpu=e;}getColorTargets(e){return [{format:"bgra8unorm",writeMask:0,blend:wt[e.blendMode]||wt.normal}]}destroy(){this.gpu=null;}};zo.extension={type:[g.WebGPUSystem],name:"state"};});var Fg,TT=f(()=>{Fg={type:"image",upload(r,e,t){let i=r.resource,s=(r.pixelWidth|0)*(r.pixelHeight|0),n=i.byteLength/s;t.device.queue.writeTexture({texture:e},i,{offset:0,rowsPerImage:r.pixelHeight,bytesPerRow:r.pixelHeight*n},{width:r.pixelWidth,height:r.pixelHeight,depthOrArrayLayers:1});}};});var Ph,RI,Og,ST=f(()=>{Ph={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},RI={blockBytes:4,blockWidth:1,blockHeight:1},Og={type:"compressed",upload(r,e,t){let i=r.pixelWidth,s=r.pixelHeight,n=Ph[r.format]||RI;for(let o=0;o<r.resource.length;o++){let a=r.resource[o],u=Math.ceil(i/n.blockWidth)*n.blockBytes;t.device.queue.writeTexture({texture:e,mipLevel:o},a,{offset:0,bytesPerRow:u},{width:Math.ceil(i/n.blockWidth)*n.blockWidth,height:Math.ceil(s/n.blockHeight)*n.blockHeight,depthOrArrayLayers:1}),i=Math.max(i>>1,1),s=Math.max(s>>1,1);}}};});var Fu,Gg=f(()=>{Se();_e();Fu={type:"image",upload(r,e,t){let i=r.resource;if(!i)return;if(globalThis.HTMLImageElement&&i instanceof HTMLImageElement){let a=V.get().createCanvas(i.width,i.height);a.getContext("2d").drawImage(i,0,0,i.width,i.height),r.resource=a,F("ImageSource: Image element passed, converting to canvas and replacing resource.");}let s=Math.min(e.width,r.resourceWidth||r.pixelWidth),n=Math.min(e.height,r.resourceHeight||r.pixelHeight),o=r.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:i},{texture:e,premultipliedAlpha:o},{width:s,height:n});}};});var Ug,ET=f(()=>{Gg();Ug={type:"video",upload(r,e,t){Fu.upload(r,e,t);}};});var Ou,AT=f(()=>{Ou=class{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={};}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
|
|
1862
1862
|
var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
|
1863
1863
|
vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
|
|
1864
1864
|
|
|
@@ -1882,7 +1882,7 @@ fn mainFragment(
|
|
|
1882
1882
|
fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
|
|
1883
1883
|
return textureSample(img, imgSampler, texCoord);
|
|
1884
1884
|
}
|
|
1885
|
-
`})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){let t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let i=e,s=e.depthOrArrayLayers||1,n=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!n){let u={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};i=this.device.createTexture(u);}let o=this.device.createCommandEncoder({}),a=t.getBindGroupLayout(0);for(let u=0;u<s;++u){let l=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),c=n?1:0;for(let h=1;h<e.mipLevelCount;++h){let d=i.createView({baseMipLevel:c++,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),p=o.beginRenderPass({colorAttachments:[{view:d,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),_=this.device.createBindGroup({layout:a,entries:[{binding:0,resource:this.sampler},{binding:1,resource:l}]});p.setPipeline(t),p.setBindGroup(0,_),p.draw(3,1,0,0),p.end(),l=d;}}if(!n){let u={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s};for(let l=1;l<e.mipLevelCount;++l)o.copyTextureToTexture({texture:i,mipLevel:l-1},{texture:e,mipLevel:l},u),u.width=Math.ceil(u.width/2),u.height=Math.ceil(u.height/2);}return this.device.queue.submit([o.finish()]),n||i.destroy(),e}};});var Wo,CT=f(()=>{Se();E();Qe();Qn();Fi();TT();ST();Gg();ET();AT();Wo=class{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:Fu,buffer:Fg,video:Ug,compressed:Og},this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuSources"),e.renderableGC.addManagedHash(this,"_gpuSamplers"),e.renderableGC.addManagedHash(this,"_bindGroupHash"),e.renderableGC.addManagedHash(this,"_textureViewHash");}contextChange(e){this._gpu=e;}initSource(e){if(e.autoGenerateMipmaps){let u=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(u))+1;}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);let i=Ph[e.format]||{blockWidth:1,blockHeight:1},s=Math.ceil(e.pixelWidth/i.blockWidth)*i.blockWidth,n=Math.ceil(e.pixelHeight/i.blockHeight)*i.blockHeight,o={label:e.label,size:{width:s,height:n},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},a=this._gpu.device.createTexture(o);return this._gpuSources[e.uid]=a,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),a}onSourceUpdate(e){let t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e));}onSourceUnload(e){let t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy());}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new Ou(this._gpu.device));let t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t);}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e);}onSourceResize(e){let t=this._gpuSources[e.uid];t?(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e);}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){let t=e.source;return this._bindGroupHash[e.uid]=new nt({0:t,1:t.style,2:new ae({uTextureMatrix:{type:"mat3x3<f32>",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){let t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){let t=this._renderer,i=t.gpu.device.createCommandEncoder(),s=V.get().createCanvas();s.width=e.source.pixelWidth,s.height=e.source.pixelHeight;let n=s.getContext("webgpu");return n.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:V.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),i.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:n.getCurrentTexture()},{width:s.width,height:s.height}),t.gpu.device.queue.submit([i.finish()]),s}getPixels(e){let t=this.generateCanvas(e),i=Vt.getOptimalCanvasAndContext(t.width,t.height),s=i.context;s.drawImage(t,0,0);let{width:n,height:o}=t,a=s.getImageData(0,0,n,o),u=new Uint8ClampedArray(a.data.buffer);return Vt.returnCanvasAndContext(i),{pixels:u,width:n,height:o}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null;for(let e of Object.keys(this._bindGroupHash)){let t=Number(e);this._bindGroupHash[t]?.destroy(),this._bindGroupHash[t]=null;}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null;}};Wo.extension={type:[m.WebGPUSystem],name:"texture"};});var ZP={};zd(ZP,{WebGPURenderer:()=>wh});var MI,DI,II,jP,qP,KP,wh,PT=f(()=>{E();g2();x2();_2();yu();yg();lr();tT();rT();iT();sT();nT();oT();aT();cT();dT();fT();_T();bT();vT();CT();MI=[...Pu,Uo,ko,Ks,Fo,Do,Wo,Ho,Vo,zo,No,Io,Oo,Mo],DI=[...wu,Lo],II=[po,fo,ho],jP=[],qP=[],KP=[];O.handleByNamedList(m.WebGPUSystem,jP);O.handleByNamedList(m.WebGPUPipes,qP);O.handleByNamedList(m.WebGPUPipesAdaptor,KP);O.add(...MI,...DI,...II);wh=class extends di{constructor(){let e={name:"webgpu",type:Oe.WEBGPU,systems:jP,renderPipes:qP,renderPipeAdaptors:KP};super(e);}};});var Xo,wT=f(()=>{E();he();Gi();Wa();Xa();no();Ui();Sc();Ar();Qe();Xo=class{contextChange(e){let t=new ae({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),i=e.limits.maxBatchableTextures,s=Tr({name:"graphics",bits:[Cs,ws(i),zs,Er]});this.shader=new ze({glProgram:s,resources:{localUniforms:t,batchSamplers:Bs(i)}});}execute(e,t){let i=t.context,s=i.customShader||this.shader,n=e.renderer,o=n.graphicsContext,{batcher:a,instructions:u}=o.getContextRenderData(i);s.groups[0]=n.globalUniforms.bindGroup,n.state.set(e.state),n.shader.bind(s),n.geometry.bind(a.geometry,s.glProgram);let l=u.instructions;for(let c=0;c<u.instructionSize;c++){let h=l[c];if(h.size){for(let d=0;d<h.textures.count;d++)n.texture.bind(h.textures.textures[d],d);n.geometry.draw(h.topology,h.size,h.start);}}}destroy(){this.shader.destroy(true),this.shader=null;}};Xo.extension={type:[m.WebGLPipesAdaptor],name:"graphics"};});var Yo,BT=f(()=>{E();he();Gi();no();Ui();eg();Ar();ce();_e();Yo=class{init(){let e=Tr({name:"mesh",bits:[zs,Jm,Er]});this._shader=new ze({glProgram:e,resources:{uTexture:C.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new D}}}});}execute(e,t){let i=e.renderer,s=t._shader;if(s){if(!s.glProgram){F("Mesh shader has no glProgram",t.shader);return}}else {s=this._shader;let n=t.texture,o=n.source;s.resources.uTexture=o,s.resources.uSampler=o.style,s.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord;}s.groups[100]=i.globalUniforms.bindGroup,s.groups[101]=e.localUniformsBindGroup,i.encoder.draw({geometry:t._geometry,shader:s,state:t.state});}destroy(){this._shader.destroy(true),this._shader=null;}};Yo.extension={type:[m.WebGLPipesAdaptor],name:"mesh"};});var $o,RT=f(()=>{E();cr();$o=class{constructor(){this._tempState=Ue.for2d(),this._didUploadHash={};}init(e){e.renderer.runners.contextChange.add(this);}contextChange(){this._didUploadHash={};}start(e,t,i){let s=e.renderer,n=this._didUploadHash[i.uid];s.shader.bind(i,n),n||(this._didUploadHash[i.uid]=true),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(t,i.glProgram);}execute(e,t){let i=e.renderer;this._tempState.blendMode=t.blendMode,i.state.set(this._tempState);let s=t.textures.textures;for(let n=0;n<t.textures.count;n++)i.texture.bind(s[n],n);i.geometry.draw(t.topology,t.size,t.start);}};$o.extension={type:[m.WebGLPipesAdaptor],name:"batch"};});var jo,MT=f(()=>{jo=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(jo||{});});var Gu,DT=f(()=>{Gu=class{constructor(e,t){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=t;}};});var qo,IT=f(()=>{E();oi();MT();DT();qo=class{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers");}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null;}contextChange(){this._gl=this._renderer.gl,this._gpuBuffers=Object.create(null),this._maxBindings=this._renderer.limits.maxUniformBindings;}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){let{_gl:t}=this,i=this.getGlBuffer(e);t.bindBuffer(i.type,i.buffer);}bindBufferBase(e,t){let{_gl:i}=this;this._boundBufferBases[t]!==e&&(this._boundBufferBases[t]=e,e._lastBindBaseLocation=t,i.bindBufferBase(i.UNIFORM_BUFFER,t,e.buffer));}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1));}freeLocationForBufferBase(e){let t=this.getLastBindBaseLocation(e);if(t>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,t;let i=0,s=this._nextBindBaseIndex;for(;i<2;){s>=this._maxBindings&&(s=this._minBaseLocation,i++);let n=this._boundBufferBases[s];if(n&&n._lastBindCallId===this._bindCallId){s++;continue}break}return t=s,this._nextBindBaseIndex=s+1,i>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[t]=null,t)}getLastBindBaseLocation(e){let t=e._lastBindBaseLocation;return this._boundBufferBases[t]===e?t:-1}bindBufferRange(e,t,i,s){let{_gl:n}=this;i||(i=0),t||(t=0),this._boundBufferBases[t]=null,n.bindBufferRange(n.UNIFORM_BUFFER,t||0,e.buffer,i*256,s||256);}updateBuffer(e){let{_gl:t}=this,i=this.getGlBuffer(e);if(e._updateID===i.updateID)return i;i.updateID=e._updateID,t.bindBuffer(i.type,i.buffer);let s=e.data,n=e.descriptor.usage&ie.STATIC?t.STATIC_DRAW:t.DYNAMIC_DRAW;return s?i.byteLength>=s.byteLength?t.bufferSubData(i.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(i.byteLength=s.byteLength,t.bufferData(i.type,s,n)):(i.byteLength=e.descriptor.size,t.bufferData(i.type,i.byteLength,n)),i}destroyAll(){let e=this._gl;for(let t in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[t].buffer);this._gpuBuffers=Object.create(null);}onBufferDestroy(e,t){let i=this._gpuBuffers[e.uid],s=this._gl;t||s.deleteBuffer(i.buffer),this._gpuBuffers[e.uid]=null;}createGLBuffer(e){let{_gl:t}=this,i=jo.ARRAY_BUFFER;e.descriptor.usage&ie.INDEX?i=jo.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&ie.UNIFORM&&(i=jo.UNIFORM_BUFFER);let s=new Gu(t.createBuffer(),i);return this._gpuBuffers[e.uid]=s,e.on("destroy",this.onBufferDestroy,this),s}resetState(){this._boundBufferBases=Object.create(null);}};qo.extension={type:[m.WebGLSystem],name:"buffer"};});var kT,Lg,FT=f(()=>{Se();E();_e();kT=class QP{constructor(e){this.supports={uint32Indices:true,uniformBufferObject:true,vertexArrayObject:true,srgbTextures:true,nonPowOf2wrapping:true,msaa:true,nonPowOf2mipmaps:true},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this);}get isLost(){return !this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e;}init(e){e={...QP.defaultOptions,...e};let t=this.multiView=e.multiView;if(e.context&&t&&(F("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),t=false),t?this.canvas=V.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else {let i=this._renderer.background.alpha<1,s=e.premultipliedAlpha??true,n=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:i,premultipliedAlpha:s,antialias:n,stencil:true,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"});}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&F("multiView is disabled, but targetCanvas is not the main canvas");return}let{canvas:t}=this;(t.width<e.width||t.height<e.height)&&(t.width=Math.max(e.width,e.width),t.height=Math.max(e.height,e.height));}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof V.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);let t=this._renderer.view.canvas;t.addEventListener("webglcontextlost",this.handleContextLost,false),t.addEventListener("webglcontextrestored",this.handleContextRestored,false);}createContext(e,t){let i,s=this.canvas;if(e===2&&(i=s.getContext("webgl2",t)),!i&&(i=s.getContext("webgl",t),!i))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=i,this.initFromContext(this.gl);}getExtensions(){let{gl:e}=this,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...t,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else {this.extensions={...t,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};let i=e.getExtension("WEBGL_provoking_vertex");i&&i.provokingVertexWEBGL(i.FIRST_VERTEX_CONVENTION_WEBGL);}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=false,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext();},0));}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl);}destroy(){let e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext();}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=true;}validateContext(e){let t=e.getContextAttributes();t&&!t.stencil&&F("Provided WebGL context does not have a stencil buffer, masks may not render correctly");let i=this.supports,s=this.webGLVersion===2,n=this.extensions;i.uint32Indices=s||!!n.uint32ElementIndex,i.uniformBufferObject=s,i.vertexArrayObject=s||!!n.vertexArrayObject,i.srgbTextures=s||!!n.srgb,i.nonPowOf2wrapping=s,i.nonPowOf2mipmaps=s,i.msaa=s,i.uint32Indices||F("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly");}};kT.extension={type:[m.WebGLSystem],name:"context"};kT.defaultOptions={context:null,premultipliedAlpha:true,preserveDrawingBuffer:false,powerPreference:void 0,preferWebGLVersion:2,multiView:false};Lg=kT;});var Uu,Bh,OT,fe,Ng=f(()=>{Uu=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(Uu||{}),Bh=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(Bh||{}),OT=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(OT||{}),fe=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(fe||{});});function Hg(r){return JP[r]??JP.float32}var JP,GT=f(()=>{Ng();JP={uint8x2:fe.UNSIGNED_BYTE,uint8x4:fe.UNSIGNED_BYTE,sint8x2:fe.BYTE,sint8x4:fe.BYTE,unorm8x2:fe.UNSIGNED_BYTE,unorm8x4:fe.UNSIGNED_BYTE,snorm8x2:fe.BYTE,snorm8x4:fe.BYTE,uint16x2:fe.UNSIGNED_SHORT,uint16x4:fe.UNSIGNED_SHORT,sint16x2:fe.SHORT,sint16x4:fe.SHORT,unorm16x2:fe.UNSIGNED_SHORT,unorm16x4:fe.UNSIGNED_SHORT,snorm16x2:fe.SHORT,snorm16x4:fe.SHORT,float16x2:fe.HALF_FLOAT,float16x4:fe.HALF_FLOAT,float32:fe.FLOAT,float32x2:fe.FLOAT,float32x3:fe.FLOAT,float32x4:fe.FLOAT,uint32:fe.UNSIGNED_INT,uint32x2:fe.UNSIGNED_INT,uint32x3:fe.UNSIGNED_INT,uint32x4:fe.UNSIGNED_INT,sint32:fe.INT,sint32x2:fe.INT,sint32x3:fe.INT,sint32x4:fe.INT};});var kI,Ko,UT=f(()=>{E();Ts();Rg();GT();kI={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5},Ko=class{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=true,this.hasInstance=true,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash");}contextChange(){let e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");let t=this._renderer.context.extensions.vertexArrayObject;t&&(e.createVertexArray=()=>t.createVertexArrayOES(),e.bindVertexArray=s=>t.bindVertexArrayOES(s),e.deleteVertexArray=s=>t.deleteVertexArrayOES(s));let i=this._renderer.context.extensions.vertexAttribDivisorANGLE;i&&(e.drawArraysInstanced=(s,n,o,a)=>{i.drawArraysInstancedANGLE(s,n,o,a);},e.drawElementsInstanced=(s,n,o,a,u)=>{i.drawElementsInstancedANGLE(s,n,o,a,u);},e.vertexAttribDivisor=(s,n)=>i.vertexAttribDivisorANGLE(s,n)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null);}bind(e,t){let i=this.gl;this._activeGeometry=e;let s=this.getVao(e,t);this._activeVao!==s&&(this._activeVao=s,i.bindVertexArray(s)),this.updateBuffers();}resetState(){this.unbind();}updateBuffers(){let e=this._activeGeometry,t=this._renderer.buffer;for(let i=0;i<e.buffers.length;i++){let s=e.buffers[i];t.updateBuffer(s);}}checkCompatibility(e,t){let i=e.attributes,s=t._attributeData;for(let n in s)if(!i[n])throw new Error(`shader and geometry incompatible, geometry missing the "${n}" attribute`)}getSignature(e,t){let i=e.attributes,s=t._attributeData,n=["g",e.uid];for(let o in i)s[o]&&n.push(o,s[o].location);return n.join("-")}getVao(e,t){return this._geometryVaoHash[e.uid]?.[t._key]||this.initGeometryVao(e,t)}initGeometryVao(e,t,i=true){let s=this._renderer.gl,n=this._renderer.buffer;this._renderer.shader._getProgramData(t),this.checkCompatibility(e,t);let o=this.getSignature(e,t);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));let a=this._geometryVaoHash[e.uid],u=a[o];if(u)return a[t._key]=u,u;Du(e,t._attributeData);let l=e.buffers;u=s.createVertexArray(),s.bindVertexArray(u);for(let c=0;c<l.length;c++){let h=l[c];n.bind(h);}return this.activateVao(e,t),a[t._key]=u,a[o]=u,s.bindVertexArray(null),u}onGeometryDestroy(e,t){let i=this._geometryVaoHash[e.uid],s=this.gl;if(i){if(t)for(let n in i)this._activeVao!==i[n]&&this.unbind(),s.deleteVertexArray(i[n]);this._geometryVaoHash[e.uid]=null;}}destroyAll(e=false){let t=this.gl;for(let i in this._geometryVaoHash){if(e)for(let s in this._geometryVaoHash[i]){let n=this._geometryVaoHash[i];this._activeVao!==n&&this.unbind(),t.deleteVertexArray(n[s]);}this._geometryVaoHash[i]=null;}}activateVao(e,t){let i=this._renderer.gl,s=this._renderer.buffer,n=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let o=null;for(let a in n){let u=n[a],l=u.buffer,c=s.getGlBuffer(l),h=t._attributeData[a];if(h){o!==c&&(s.bind(l),o=c);let d=h.location;i.enableVertexAttribArray(d);let p=Dt(u.format),_=Hg(u.format);if(h.format?.substring(1,4)==="int"?i.vertexAttribIPointer(d,p.size,_,u.stride,u.offset):i.vertexAttribPointer(d,p.size,_,p.normalised,u.stride,u.offset),u.instance)if(this.hasInstance){let b=u.divisor??1;i.vertexAttribDivisor(d,b);}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,t,i,s){let{gl:n}=this._renderer,o=this._activeGeometry,a=kI[e||o.topology];if(s??(s=o.instanceCount),o.indexBuffer){let u=o.indexBuffer.data.BYTES_PER_ELEMENT,l=u===2?n.UNSIGNED_SHORT:n.UNSIGNED_INT;s>1?n.drawElementsInstanced(a,t||o.indexBuffer.data.length,l,(i||0)*u,s):n.drawElements(a,t||o.indexBuffer.data.length,l,(i||0)*u);}else s>1?n.drawArraysInstanced(a,i||0,t||o.getSize(),s):n.drawArrays(a,i||0,t||o.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null;}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null;}};Ko.extension={type:[m.WebGLSystem],name:"geometry"};});var FI,LT,Vg,NT=f(()=>{E();_e();vs();Ar();cr();ct();ce();Kt();FI=new Mt({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),LT=class ew{constructor(e){this.useBackBuffer=false,this._useBackBufferThisRender=false,this._renderer=e;}init(e={}){let{useBackBuffer:t,antialias:i}={...ew.defaultOptions,...e};this.useBackBuffer=t,this._antialias=i,this._renderer.context.supports.msaa||(F("antialiasing, is not supported on when using the back buffer"),this._antialias=false),this._state=Ue.for2d();let s=new ke({vertex:`
|
|
1885
|
+
`})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){let t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let i=e,s=e.depthOrArrayLayers||1,n=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!n){let u={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};i=this.device.createTexture(u);}let o=this.device.createCommandEncoder({}),a=t.getBindGroupLayout(0);for(let u=0;u<s;++u){let l=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),c=n?1:0;for(let h=1;h<e.mipLevelCount;++h){let d=i.createView({baseMipLevel:c++,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),p=o.beginRenderPass({colorAttachments:[{view:d,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),_=this.device.createBindGroup({layout:a,entries:[{binding:0,resource:this.sampler},{binding:1,resource:l}]});p.setPipeline(t),p.setBindGroup(0,_),p.draw(3,1,0,0),p.end(),l=d;}}if(!n){let u={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s};for(let l=1;l<e.mipLevelCount;++l)o.copyTextureToTexture({texture:i,mipLevel:l-1},{texture:e,mipLevel:l},u),u.width=Math.ceil(u.width/2),u.height=Math.ceil(u.height/2);}return this.device.queue.submit([o.finish()]),n||i.destroy(),e}};});var Wo,CT=f(()=>{Se();E();Qe();Qn();Fi();TT();ST();Gg();ET();AT();Wo=class{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:Fu,buffer:Fg,video:Ug,compressed:Og},this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuSources"),e.renderableGC.addManagedHash(this,"_gpuSamplers"),e.renderableGC.addManagedHash(this,"_bindGroupHash"),e.renderableGC.addManagedHash(this,"_textureViewHash");}contextChange(e){this._gpu=e;}initSource(e){if(e.autoGenerateMipmaps){let u=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(u))+1;}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);let i=Ph[e.format]||{blockWidth:1,blockHeight:1},s=Math.ceil(e.pixelWidth/i.blockWidth)*i.blockWidth,n=Math.ceil(e.pixelHeight/i.blockHeight)*i.blockHeight,o={label:e.label,size:{width:s,height:n},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},a=this._gpu.device.createTexture(o);return this._gpuSources[e.uid]=a,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),a}onSourceUpdate(e){let t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e));}onSourceUnload(e){let t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy());}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new Ou(this._gpu.device));let t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t);}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e);}onSourceResize(e){let t=this._gpuSources[e.uid];t?(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e);}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){let t=e.source;return this._bindGroupHash[e.uid]=new nt({0:t,1:t.style,2:new ae({uTextureMatrix:{type:"mat3x3<f32>",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){let t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){let t=this._renderer,i=t.gpu.device.createCommandEncoder(),s=V.get().createCanvas();s.width=e.source.pixelWidth,s.height=e.source.pixelHeight;let n=s.getContext("webgpu");return n.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:V.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),i.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:n.getCurrentTexture()},{width:s.width,height:s.height}),t.gpu.device.queue.submit([i.finish()]),s}getPixels(e){let t=this.generateCanvas(e),i=Vt.getOptimalCanvasAndContext(t.width,t.height),s=i.context;s.drawImage(t,0,0);let{width:n,height:o}=t,a=s.getImageData(0,0,n,o),u=new Uint8ClampedArray(a.data.buffer);return Vt.returnCanvasAndContext(i),{pixels:u,width:n,height:o}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null;for(let e of Object.keys(this._bindGroupHash)){let t=Number(e);this._bindGroupHash[t]?.destroy(),this._bindGroupHash[t]=null;}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null;}};Wo.extension={type:[g.WebGPUSystem],name:"texture"};});var ZP={};zd(ZP,{WebGPURenderer:()=>wh});var MI,DI,II,jP,qP,KP,wh,PT=f(()=>{E();g2();x2();_2();yu();yg();lr();tT();rT();iT();sT();nT();oT();aT();cT();dT();fT();_T();bT();vT();CT();MI=[...Pu,Uo,ko,Ks,Fo,Do,Wo,Ho,Vo,zo,No,Io,Oo,Mo],DI=[...wu,Lo],II=[po,fo,ho],jP=[],qP=[],KP=[];O.handleByNamedList(g.WebGPUSystem,jP);O.handleByNamedList(g.WebGPUPipes,qP);O.handleByNamedList(g.WebGPUPipesAdaptor,KP);O.add(...MI,...DI,...II);wh=class extends di{constructor(){let e={name:"webgpu",type:Oe.WEBGPU,systems:jP,renderPipes:qP,renderPipeAdaptors:KP};super(e);}};});var Xo,wT=f(()=>{E();he();Gi();Wa();Xa();no();Ui();Sc();Ar();Qe();Xo=class{contextChange(e){let t=new ae({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new D,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),i=e.limits.maxBatchableTextures,s=Tr({name:"graphics",bits:[Cs,ws(i),zs,Er]});this.shader=new ze({glProgram:s,resources:{localUniforms:t,batchSamplers:Bs(i)}});}execute(e,t){let i=t.context,s=i.customShader||this.shader,n=e.renderer,o=n.graphicsContext,{batcher:a,instructions:u}=o.getContextRenderData(i);s.groups[0]=n.globalUniforms.bindGroup,n.state.set(e.state),n.shader.bind(s),n.geometry.bind(a.geometry,s.glProgram);let l=u.instructions;for(let c=0;c<u.instructionSize;c++){let h=l[c];if(h.size){for(let d=0;d<h.textures.count;d++)n.texture.bind(h.textures.textures[d],d);n.geometry.draw(h.topology,h.size,h.start);}}}destroy(){this.shader.destroy(true),this.shader=null;}};Xo.extension={type:[g.WebGLPipesAdaptor],name:"graphics"};});var Yo,BT=f(()=>{E();he();Gi();no();Ui();eg();Ar();ce();_e();Yo=class{init(){let e=Tr({name:"mesh",bits:[zs,Jm,Er]});this._shader=new ze({glProgram:e,resources:{uTexture:C.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new D}}}});}execute(e,t){let i=e.renderer,s=t._shader;if(s){if(!s.glProgram){F("Mesh shader has no glProgram",t.shader);return}}else {s=this._shader;let n=t.texture,o=n.source;s.resources.uTexture=o,s.resources.uSampler=o.style,s.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord;}s.groups[100]=i.globalUniforms.bindGroup,s.groups[101]=e.localUniformsBindGroup,i.encoder.draw({geometry:t._geometry,shader:s,state:t.state});}destroy(){this._shader.destroy(true),this._shader=null;}};Yo.extension={type:[g.WebGLPipesAdaptor],name:"mesh"};});var $o,RT=f(()=>{E();cr();$o=class{constructor(){this._tempState=Ue.for2d(),this._didUploadHash={};}init(e){e.renderer.runners.contextChange.add(this);}contextChange(){this._didUploadHash={};}start(e,t,i){let s=e.renderer,n=this._didUploadHash[i.uid];s.shader.bind(i,n),n||(this._didUploadHash[i.uid]=true),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(t,i.glProgram);}execute(e,t){let i=e.renderer;this._tempState.blendMode=t.blendMode,i.state.set(this._tempState);let s=t.textures.textures;for(let n=0;n<t.textures.count;n++)i.texture.bind(s[n],n);i.geometry.draw(t.topology,t.size,t.start);}};$o.extension={type:[g.WebGLPipesAdaptor],name:"batch"};});var jo,MT=f(()=>{jo=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(jo||{});});var Gu,DT=f(()=>{Gu=class{constructor(e,t){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=t;}};});var qo,IT=f(()=>{E();oi();MT();DT();qo=class{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers");}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null;}contextChange(){this._gl=this._renderer.gl,this._gpuBuffers=Object.create(null),this._maxBindings=this._renderer.limits.maxUniformBindings;}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){let{_gl:t}=this,i=this.getGlBuffer(e);t.bindBuffer(i.type,i.buffer);}bindBufferBase(e,t){let{_gl:i}=this;this._boundBufferBases[t]!==e&&(this._boundBufferBases[t]=e,e._lastBindBaseLocation=t,i.bindBufferBase(i.UNIFORM_BUFFER,t,e.buffer));}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1));}freeLocationForBufferBase(e){let t=this.getLastBindBaseLocation(e);if(t>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,t;let i=0,s=this._nextBindBaseIndex;for(;i<2;){s>=this._maxBindings&&(s=this._minBaseLocation,i++);let n=this._boundBufferBases[s];if(n&&n._lastBindCallId===this._bindCallId){s++;continue}break}return t=s,this._nextBindBaseIndex=s+1,i>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[t]=null,t)}getLastBindBaseLocation(e){let t=e._lastBindBaseLocation;return this._boundBufferBases[t]===e?t:-1}bindBufferRange(e,t,i,s){let{_gl:n}=this;i||(i=0),t||(t=0),this._boundBufferBases[t]=null,n.bindBufferRange(n.UNIFORM_BUFFER,t||0,e.buffer,i*256,s||256);}updateBuffer(e){let{_gl:t}=this,i=this.getGlBuffer(e);if(e._updateID===i.updateID)return i;i.updateID=e._updateID,t.bindBuffer(i.type,i.buffer);let s=e.data,n=e.descriptor.usage&ie.STATIC?t.STATIC_DRAW:t.DYNAMIC_DRAW;return s?i.byteLength>=s.byteLength?t.bufferSubData(i.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(i.byteLength=s.byteLength,t.bufferData(i.type,s,n)):(i.byteLength=e.descriptor.size,t.bufferData(i.type,i.byteLength,n)),i}destroyAll(){let e=this._gl;for(let t in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[t].buffer);this._gpuBuffers=Object.create(null);}onBufferDestroy(e,t){let i=this._gpuBuffers[e.uid],s=this._gl;t||s.deleteBuffer(i.buffer),this._gpuBuffers[e.uid]=null;}createGLBuffer(e){let{_gl:t}=this,i=jo.ARRAY_BUFFER;e.descriptor.usage&ie.INDEX?i=jo.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&ie.UNIFORM&&(i=jo.UNIFORM_BUFFER);let s=new Gu(t.createBuffer(),i);return this._gpuBuffers[e.uid]=s,e.on("destroy",this.onBufferDestroy,this),s}resetState(){this._boundBufferBases=Object.create(null);}};qo.extension={type:[g.WebGLSystem],name:"buffer"};});var kT,Lg,FT=f(()=>{Se();E();_e();kT=class QP{constructor(e){this.supports={uint32Indices:true,uniformBufferObject:true,vertexArrayObject:true,srgbTextures:true,nonPowOf2wrapping:true,msaa:true,nonPowOf2mipmaps:true},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this);}get isLost(){return !this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e;}init(e){e={...QP.defaultOptions,...e};let t=this.multiView=e.multiView;if(e.context&&t&&(F("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),t=false),t?this.canvas=V.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else {let i=this._renderer.background.alpha<1,s=e.premultipliedAlpha??true,n=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:i,premultipliedAlpha:s,antialias:n,stencil:true,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"});}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&F("multiView is disabled, but targetCanvas is not the main canvas");return}let{canvas:t}=this;(t.width<e.width||t.height<e.height)&&(t.width=Math.max(e.width,e.width),t.height=Math.max(e.height,e.height));}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof V.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);let t=this._renderer.view.canvas;t.addEventListener("webglcontextlost",this.handleContextLost,false),t.addEventListener("webglcontextrestored",this.handleContextRestored,false);}createContext(e,t){let i,s=this.canvas;if(e===2&&(i=s.getContext("webgl2",t)),!i&&(i=s.getContext("webgl",t),!i))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=i,this.initFromContext(this.gl);}getExtensions(){let{gl:e}=this,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...t,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else {this.extensions={...t,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};let i=e.getExtension("WEBGL_provoking_vertex");i&&i.provokingVertexWEBGL(i.FIRST_VERTEX_CONVENTION_WEBGL);}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=false,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext();},0));}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl);}destroy(){let e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext();}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=true;}validateContext(e){let t=e.getContextAttributes();t&&!t.stencil&&F("Provided WebGL context does not have a stencil buffer, masks may not render correctly");let i=this.supports,s=this.webGLVersion===2,n=this.extensions;i.uint32Indices=s||!!n.uint32ElementIndex,i.uniformBufferObject=s,i.vertexArrayObject=s||!!n.vertexArrayObject,i.srgbTextures=s||!!n.srgb,i.nonPowOf2wrapping=s,i.nonPowOf2mipmaps=s,i.msaa=s,i.uint32Indices||F("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly");}};kT.extension={type:[g.WebGLSystem],name:"context"};kT.defaultOptions={context:null,premultipliedAlpha:true,preserveDrawingBuffer:false,powerPreference:void 0,preferWebGLVersion:2,multiView:false};Lg=kT;});var Uu,Bh,OT,fe,Ng=f(()=>{Uu=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(Uu||{}),Bh=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(Bh||{}),OT=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(OT||{}),fe=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(fe||{});});function Hg(r){return JP[r]??JP.float32}var JP,GT=f(()=>{Ng();JP={uint8x2:fe.UNSIGNED_BYTE,uint8x4:fe.UNSIGNED_BYTE,sint8x2:fe.BYTE,sint8x4:fe.BYTE,unorm8x2:fe.UNSIGNED_BYTE,unorm8x4:fe.UNSIGNED_BYTE,snorm8x2:fe.BYTE,snorm8x4:fe.BYTE,uint16x2:fe.UNSIGNED_SHORT,uint16x4:fe.UNSIGNED_SHORT,sint16x2:fe.SHORT,sint16x4:fe.SHORT,unorm16x2:fe.UNSIGNED_SHORT,unorm16x4:fe.UNSIGNED_SHORT,snorm16x2:fe.SHORT,snorm16x4:fe.SHORT,float16x2:fe.HALF_FLOAT,float16x4:fe.HALF_FLOAT,float32:fe.FLOAT,float32x2:fe.FLOAT,float32x3:fe.FLOAT,float32x4:fe.FLOAT,uint32:fe.UNSIGNED_INT,uint32x2:fe.UNSIGNED_INT,uint32x3:fe.UNSIGNED_INT,uint32x4:fe.UNSIGNED_INT,sint32:fe.INT,sint32x2:fe.INT,sint32x3:fe.INT,sint32x4:fe.INT};});var kI,Ko,UT=f(()=>{E();Ts();Rg();GT();kI={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5},Ko=class{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=true,this.hasInstance=true,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash");}contextChange(){let e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");let t=this._renderer.context.extensions.vertexArrayObject;t&&(e.createVertexArray=()=>t.createVertexArrayOES(),e.bindVertexArray=s=>t.bindVertexArrayOES(s),e.deleteVertexArray=s=>t.deleteVertexArrayOES(s));let i=this._renderer.context.extensions.vertexAttribDivisorANGLE;i&&(e.drawArraysInstanced=(s,n,o,a)=>{i.drawArraysInstancedANGLE(s,n,o,a);},e.drawElementsInstanced=(s,n,o,a,u)=>{i.drawElementsInstancedANGLE(s,n,o,a,u);},e.vertexAttribDivisor=(s,n)=>i.vertexAttribDivisorANGLE(s,n)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null);}bind(e,t){let i=this.gl;this._activeGeometry=e;let s=this.getVao(e,t);this._activeVao!==s&&(this._activeVao=s,i.bindVertexArray(s)),this.updateBuffers();}resetState(){this.unbind();}updateBuffers(){let e=this._activeGeometry,t=this._renderer.buffer;for(let i=0;i<e.buffers.length;i++){let s=e.buffers[i];t.updateBuffer(s);}}checkCompatibility(e,t){let i=e.attributes,s=t._attributeData;for(let n in s)if(!i[n])throw new Error(`shader and geometry incompatible, geometry missing the "${n}" attribute`)}getSignature(e,t){let i=e.attributes,s=t._attributeData,n=["g",e.uid];for(let o in i)s[o]&&n.push(o,s[o].location);return n.join("-")}getVao(e,t){return this._geometryVaoHash[e.uid]?.[t._key]||this.initGeometryVao(e,t)}initGeometryVao(e,t,i=true){let s=this._renderer.gl,n=this._renderer.buffer;this._renderer.shader._getProgramData(t),this.checkCompatibility(e,t);let o=this.getSignature(e,t);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));let a=this._geometryVaoHash[e.uid],u=a[o];if(u)return a[t._key]=u,u;Du(e,t._attributeData);let l=e.buffers;u=s.createVertexArray(),s.bindVertexArray(u);for(let c=0;c<l.length;c++){let h=l[c];n.bind(h);}return this.activateVao(e,t),a[t._key]=u,a[o]=u,s.bindVertexArray(null),u}onGeometryDestroy(e,t){let i=this._geometryVaoHash[e.uid],s=this.gl;if(i){if(t)for(let n in i)this._activeVao!==i[n]&&this.unbind(),s.deleteVertexArray(i[n]);this._geometryVaoHash[e.uid]=null;}}destroyAll(e=false){let t=this.gl;for(let i in this._geometryVaoHash){if(e)for(let s in this._geometryVaoHash[i]){let n=this._geometryVaoHash[i];this._activeVao!==n&&this.unbind(),t.deleteVertexArray(n[s]);}this._geometryVaoHash[i]=null;}}activateVao(e,t){let i=this._renderer.gl,s=this._renderer.buffer,n=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let o=null;for(let a in n){let u=n[a],l=u.buffer,c=s.getGlBuffer(l),h=t._attributeData[a];if(h){o!==c&&(s.bind(l),o=c);let d=h.location;i.enableVertexAttribArray(d);let p=Dt(u.format),_=Hg(u.format);if(h.format?.substring(1,4)==="int"?i.vertexAttribIPointer(d,p.size,_,u.stride,u.offset):i.vertexAttribPointer(d,p.size,_,p.normalised,u.stride,u.offset),u.instance)if(this.hasInstance){let b=u.divisor??1;i.vertexAttribDivisor(d,b);}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,t,i,s){let{gl:n}=this._renderer,o=this._activeGeometry,a=kI[e||o.topology];if(s??(s=o.instanceCount),o.indexBuffer){let u=o.indexBuffer.data.BYTES_PER_ELEMENT,l=u===2?n.UNSIGNED_SHORT:n.UNSIGNED_INT;s>1?n.drawElementsInstanced(a,t||o.indexBuffer.data.length,l,(i||0)*u,s):n.drawElements(a,t||o.indexBuffer.data.length,l,(i||0)*u);}else s>1?n.drawArraysInstanced(a,i||0,t||o.getSize(),s):n.drawArrays(a,i||0,t||o.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null;}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null;}};Ko.extension={type:[g.WebGLSystem],name:"geometry"};});var FI,LT,Vg,NT=f(()=>{E();_e();vs();Ar();cr();ct();ce();Kt();FI=new Mt({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),LT=class ew{constructor(e){this.useBackBuffer=false,this._useBackBufferThisRender=false,this._renderer=e;}init(e={}){let{useBackBuffer:t,antialias:i}={...ew.defaultOptions,...e};this.useBackBuffer=t,this._antialias=i,this._renderer.context.supports.msaa||(F("antialiasing, is not supported on when using the back buffer"),this._antialias=false),this._state=Ue.for2d();let s=new ke({vertex:`
|
|
1886
1886
|
attribute vec2 aPosition;
|
|
1887
1887
|
out vec2 vUv;
|
|
1888
1888
|
|
|
@@ -1901,7 +1901,7 @@ fn mainFragment(
|
|
|
1901
1901
|
|
|
1902
1902
|
void main() {
|
|
1903
1903
|
finalColor = texture(uTexture, vUv);
|
|
1904
|
-
}`,name:"big-triangle"});this._bigTriangleShader=new ze({glProgram:s,resources:{uTexture:C.WHITE.source}});}renderStart(e){let t=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!t.isRoot,this._useBackBufferThisRender){let i=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=i.colorTexture,e.target=this._getBackBufferTexture(i.colorTexture);}}renderEnd(){this._presentBackBuffer();}_presentBackBuffer(){let e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,false),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:FI,shader:this._bigTriangleShader,state:this._state}));}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new C({source:new oe({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null);}};LT.extension={type:[
|
|
1904
|
+
}`,name:"big-triangle"});this._bigTriangleShader=new ze({glProgram:s,resources:{uTexture:C.WHITE.source}});}renderStart(e){let t=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!t.isRoot,this._useBackBufferThisRender){let i=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=i.colorTexture,e.target=this._getBackBufferTexture(i.colorTexture);}}renderEnd(){this._presentBackBuffer();}_presentBackBuffer(){let e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,false),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:FI,shader:this._bigTriangleShader,state:this._state}));}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new C({source:new oe({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null);}};LT.extension={type:[g.WebGLSystem],name:"backBuffer",priority:1};LT.defaultOptions={useBackBuffer:false};Vg=LT;});var Zo,HT=f(()=>{E();Zo=class{constructor(e){this._colorMaskCache=15,this._renderer=e;}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.gl.colorMask(!!(e&8),!!(e&4),!!(e&2),!!(e&1)));}};Zo.extension={type:[g.WebGLSystem],name:"colorMask"};});var Qo,VT=f(()=>{E();Qo=class{constructor(e){this.commandFinished=Promise.resolve(),this._renderer=e;}setGeometry(e,t){this._renderer.geometry.bind(e,t.glProgram);}finishRenderPass(){}draw(e){let t=this._renderer,{geometry:i,shader:s,state:n,skipSync:o,topology:a,size:u,start:l,instanceCount:c}=e;t.shader.bind(s,o),t.geometry.bind(i,t.shader._activeProgram),n&&t.state.set(n),t.geometry.draw(a,u,l,c??i.instanceCount);}destroy(){this._renderer=null;}};Qo.extension={type:[g.WebGLSystem],name:"encoder"};});var Jo,zT=f(()=>{E();Kf();Jo=class{constructor(e){this._renderer=e;}contextChange(){let e=this._renderer.gl;this.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxBatchableTextures=Ua(this.maxTextures,e),this.maxUniformBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);}destroy(){}};Jo.extension={type:[g.WebGLSystem],name:"limits"};});var ea,WT=f(()=>{E();Mg();ys();ea=class{constructor(e){this._stencilCache={enabled:false,stencilReference:0,stencilMode:Be.NONE},this._renderTargetStencilState=Object.create(null),e.renderTarget.onRenderTargetChange.add(this);}contextChange(e){this._gl=e,this._comparisonFuncMapping={always:e.ALWAYS,never:e.NEVER,equal:e.EQUAL,"not-equal":e.NOTEQUAL,less:e.LESS,"less-equal":e.LEQUAL,greater:e.GREATER,"greater-equal":e.GEQUAL},this._stencilOpsMapping={keep:e.KEEP,zero:e.ZERO,replace:e.REPLACE,invert:e.INVERT,"increment-clamp":e.INCR,"decrement-clamp":e.DECR,"increment-wrap":e.INCR_WRAP,"decrement-wrap":e.DECR_WRAP},this.resetState();}onRenderTargetChange(e){if(this._activeRenderTarget===e)return;this._activeRenderTarget=e;let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:Be.DISABLED,stencilReference:0}),this.setStencilMode(t.stencilMode,t.stencilReference);}resetState(){this._stencilCache.enabled=false,this._stencilCache.stencilMode=Be.NONE,this._stencilCache.stencilReference=0;}setStencilMode(e,t){let i=this._renderTargetStencilState[this._activeRenderTarget.uid],s=this._gl,n=wr[e],o=this._stencilCache;if(i.stencilMode=e,i.stencilReference=t,e===Be.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=false,s.disable(s.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=true,s.enable(s.STENCIL_TEST)),(e!==o.stencilMode||o.stencilReference!==t)&&(o.stencilMode=e,o.stencilReference=t,s.stencilFunc(this._comparisonFuncMapping[n.stencilBack.compare],t,255),s.stencilOp(s.KEEP,s.KEEP,this._stencilOpsMapping[n.stencilBack.passOp]));}};ea.extension={type:[g.WebGLSystem],name:"stencil"};});function zg(r){let e=r.map(n=>({data:n,offset:0,size:0})),t=16,i=0,s=0;for(let n=0;n<e.length;n++){let o=e[n];if(i=Rh[o.data.type],!i)throw new Error(`Unknown type ${o.data.type}`);o.data.size>1&&(i=Math.max(i,t)*o.data.size);let a=i===12?16:i;o.size=i;let u=s%t;u>0&&t-u<a?s+=(t-u)%16:s+=(i-u%i)%i,o.offset=s,s+=i;}return s=Math.ceil(s/16)*16,{uboElements:e,size:s}}var Rh,Wg=f(()=>{Rh={f32:4,i32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"vec2<i32>":8,"vec3<i32>":12,"vec4<i32>":16,"mat2x2<f32>":32,"mat3x3<f32>":48,"mat4x4<f32>":64};});function Xg(r,e){let t=Math.max(Rh[r.data.type]/16,1),i=r.data.value.length/r.data.size,s=(4-i%4)%4,n=r.data.type.indexOf("i32")>=0?"dataInt32":"data";return `
|
|
1905
1905
|
v = uv.${r.data.name};
|
|
1906
1906
|
offset += ${e};
|
|
1907
1907
|
|
|
@@ -1917,7 +1917,7 @@ fn mainFragment(
|
|
|
1917
1917
|
}
|
|
1918
1918
|
${s!==0?`arrayOffset += ${s};`:""}
|
|
1919
1919
|
}
|
|
1920
|
-
`}var XT=f(()=>{Wg();});function Yg(r){return Bu(r,"uboStd40",Xg,Ah)}var YT=f(()=>{Ag();Pg();XT();});var ta,$T=f(()=>{E();vg();Wg();YT();ta=class extends Zs{constructor(){super({createUboElements:zg,generateUboSync:Yg});}};ta.extension={type:[
|
|
1920
|
+
`}var XT=f(()=>{Wg();});function Yg(r){return Bu(r,"uboStd40",Xg,Ah)}var YT=f(()=>{Ag();Pg();XT();});var ta,$T=f(()=>{E();vg();Wg();YT();ta=class extends Zs{constructor(){super({createUboElements:zg,generateUboSync:Yg});}};ta.extension={type:[g.WebGLSystem],name:"ubo"};});var Lu,jT=f(()=>{Lu=class{constructor(){this.width=-1,this.height=-1,this.msaa=false,this.msaaRenderBuffer=[];}};});var Nu,qT=f(()=>{Ze();_e();On();co();jT();Nu=class{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new Z;}init(e,t){this._renderer=e,this._renderTargetSystem=t,e.runners.contextChange.add(this);}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new Z;}copyToTexture(e,t,i,s,n){let o=this._renderTargetSystem,a=this._renderer,u=o.getGpuRenderTarget(e),l=a.gl;return this.finishRenderPass(e),l.bindFramebuffer(l.FRAMEBUFFER,u.resolveTargetFramebuffer),a.texture.bind(t,0),l.copyTexSubImage2D(l.TEXTURE_2D,0,n.x,n.y,i.x,i.y,s.width,s.height),t}startRenderPass(e,t=true,i,s){let n=this._renderTargetSystem,o=e.colorTexture,a=n.getGpuRenderTarget(e),u=s.y;e.isRoot&&(u=o.pixelHeight-s.height),e.colorTextures.forEach(h=>{this._renderer.texture.unbind(h);});let l=this._renderer.gl;l.bindFramebuffer(l.FRAMEBUFFER,a.framebuffer);let c=this._viewPortCache;(c.x!==s.x||c.y!==u||c.width!==s.width||c.height!==s.height)&&(c.x=s.x,c.y=u,c.width=s.width,c.height=s.height,l.viewport(s.x,u,s.width,s.height)),!a.depthStencilRenderBuffer&&(e.stencil||e.depth)&&this._initStencil(a),this.clear(e,t,i);}finishRenderPass(e){let i=this._renderTargetSystem.getGpuRenderTarget(e);if(!i.msaa)return;let s=this._renderer.gl;s.bindFramebuffer(s.FRAMEBUFFER,i.resolveTargetFramebuffer),s.bindFramebuffer(s.READ_FRAMEBUFFER,i.framebuffer),s.blitFramebuffer(0,0,i.width,i.height,0,0,i.width,i.height,s.COLOR_BUFFER_BIT,s.NEAREST),s.bindFramebuffer(s.FRAMEBUFFER,i.framebuffer);}initGpuRenderTarget(e){let i=this._renderer.gl,s=new Lu;return e.colorTexture instanceof ht?(this._renderer.context.ensureCanvasSize(e.colorTexture.resource),s.framebuffer=null,s):(this._initColor(e,s),i.bindFramebuffer(i.FRAMEBUFFER,null),s)}destroyGpuRenderTarget(e){let t=this._renderer.gl;e.framebuffer&&(t.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(t.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(t.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach(i=>{t.deleteRenderbuffer(i);}),e.msaaRenderBuffer=null;}clear(e,t,i){if(!t)return;let s=this._renderTargetSystem;typeof t=="boolean"&&(t=t?ot.ALL:ot.NONE);let n=this._renderer.gl;if(t&ot.COLOR){i??(i=s.defaultClearColor);let o=this._clearColorCache,a=i;(o[0]!==a[0]||o[1]!==a[1]||o[2]!==a[2]||o[3]!==a[3])&&(o[0]=a[0],o[1]=a[1],o[2]=a[2],o[3]=a[3],n.clearColor(a[0],a[1],a[2],a[3]));}n.clear(t);}resizeGpuRenderTarget(e){if(e.isRoot)return;let i=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,i),(e.stencil||e.depth)&&this._resizeStencil(i);}_initColor(e,t){let i=this._renderer,s=i.gl,n=s.createFramebuffer();if(t.resolveTargetFramebuffer=n,s.bindFramebuffer(s.FRAMEBUFFER,n),t.width=e.colorTexture.source.pixelWidth,t.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach((o,a)=>{let u=o.source;u.antialias&&(i.context.supports.msaa?t.msaa=true:F("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),i.texture.bindSource(u,0);let c=i.texture.getGlSource(u).texture;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+a,3553,c,0);}),t.msaa){let o=s.createFramebuffer();t.framebuffer=o,s.bindFramebuffer(s.FRAMEBUFFER,o),e.colorTextures.forEach((a,u)=>{let l=s.createRenderbuffer();t.msaaRenderBuffer[u]=l;});}else t.framebuffer=n;this._resizeColor(e,t);}_resizeColor(e,t){let i=e.colorTexture.source;if(t.width=i.pixelWidth,t.height=i.pixelHeight,e.colorTextures.forEach((s,n)=>{n!==0&&s.source.resize(i.width,i.height,i._resolution);}),t.msaa){let s=this._renderer,n=s.gl,o=t.framebuffer;n.bindFramebuffer(n.FRAMEBUFFER,o),e.colorTextures.forEach((a,u)=>{let l=a.source;s.texture.bindSource(l,0);let h=s.texture.getGlSource(l).internalFormat,d=t.msaaRenderBuffer[u];n.bindRenderbuffer(n.RENDERBUFFER,d),n.renderbufferStorageMultisample(n.RENDERBUFFER,4,h,l.pixelWidth,l.pixelHeight),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+u,n.RENDERBUFFER,d);});}}_initStencil(e){if(e.framebuffer===null)return;let t=this._renderer.gl,i=t.createRenderbuffer();e.depthStencilRenderBuffer=i,t.bindRenderbuffer(t.RENDERBUFFER,i),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,i),this._resizeStencil(e);}_resizeStencil(e){let t=this._renderer.gl;t.bindRenderbuffer(t.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?t.renderbufferStorageMultisample(t.RENDERBUFFER,4,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,this._renderer.context.webGLVersion===2?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL,e.width,e.height);}prerender(e){let t=e.colorTexture.resource;this._renderer.context.multiView&&ht.test(t)&&this._renderer.context.ensureCanvasSize(t);}postrender(e){if(this._renderer.context.multiView&&ht.test(e.colorTexture.resource)){let t=this._renderer.context.canvas,i=e.colorTexture;i.context2D.drawImage(t,0,i.pixelHeight-t.height);}}};});var ra,KT=f(()=>{E();kg();qT();ra=class extends Js{constructor(e){super(e),this.adaptor=new Nu,this.adaptor.init(e,this);}};ra.extension={type:[g.WebGLSystem],name:"renderTarget"};});function $g(r,e){let t=[],i=[`
|
|
1921
1921
|
var g = s.groups;
|
|
1922
1922
|
var sS = r.shader;
|
|
1923
1923
|
var p = s.glProgram;
|
|
@@ -1947,7 +1947,7 @@ fn mainFragment(
|
|
|
1947
1947
|
`);return new Function("r","s","sD",a)}var ZT=f(()=>{Ch();Qe();ct();});var jg,Hu,QT=f(()=>{jg=class{},Hu=class{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={};}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null;}};});function Mh(r,e,t){let i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),i}var JT=f(()=>{});function eS(r){let e=new Array(r);for(let t=0;t<e.length;t++)e[t]=false;return e}function Vu(r,e){switch(r){case "float":return 0;case "vec2":return new Float32Array(2*e);case "vec3":return new Float32Array(3*e);case "vec4":return new Float32Array(4*e);case "int":case "uint":case "sampler2D":case "sampler2DArray":return 0;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 false;case "bvec2":return eS(2*e);case "bvec3":return eS(3*e);case "bvec4":return eS(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}var qg=f(()=>{});function Dh(r,e){if(!Kg){let t=Object.keys(tw);Kg={};for(let i=0;i<t.length;++i){let s=t[i];Kg[r[s]]=tw[s];}}return Kg[e]}function Zg(r,e){let t=Dh(r,e);return OI[t]||"float32"}var Kg,tw,OI,Qg=f(()=>{Kg=null,tw={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"},OI={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};});function Jg(r,e,t=false){let i={},s=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES);for(let o=0;o<s;o++){let a=e.getActiveAttrib(r,o);if(a.name.startsWith("gl_"))continue;let u=Zg(e,a.type);i[a.name]={location:0,format:u,stride:Dt(u).stride,offset:0,instance:false,start:0};}let n=Object.keys(i);if(t){n.sort((o,a)=>o>a?1:-1);for(let o=0;o<n.length;o++)i[n[o]].location=o,e.bindAttribLocation(r,o,n[o]);e.linkProgram(r);}else for(let o=0;o<n.length;o++)i[n[o]].location=e.getAttribLocation(r,n[o]);return i}var tS=f(()=>{Ts();Qg();});function ex(r,e){if(!e.ACTIVE_UNIFORM_BLOCKS)return {};let t={},i=e.getProgramParameter(r,e.ACTIVE_UNIFORM_BLOCKS);for(let s=0;s<i;s++){let n=e.getActiveUniformBlockName(r,s),o=e.getUniformBlockIndex(r,n),a=e.getActiveUniformBlockParameter(r,s,e.UNIFORM_BLOCK_DATA_SIZE);t[n]={name:n,index:o,size:a};}return t}var rS=f(()=>{});function tx(r,e){let t={},i=e.getProgramParameter(r,e.ACTIVE_UNIFORMS);for(let s=0;s<i;s++){let n=e.getActiveUniform(r,s),o=n.name.replace(/\[.*?\]$/,""),a=!!n.name.match(/\[.*?\]$/),u=Dh(e,n.type);t[o]={name:o,index:s,type:u,size:n.size,isArray:a,value:Vu(u,n.size)};}return t}var iS=f(()=>{qg();Qg();});function rw(r,e){let t=r.getShaderSource(e).split(`
|
|
1948
1948
|
`).map((l,c)=>`${c}: ${l}`),i=r.getShaderInfoLog(e),s=i.split(`
|
|
1949
1949
|
`),n={},o=s.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!n[l]?(n[l]=true,true):false),a=[""];o.forEach(l=>{t[l-1]=`%c${t[l-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px");});let u=t.join(`
|
|
1950
|
-
`);a[0]=u,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd();}function rx(r,e,t,i){r.getProgramParameter(e,r.LINK_STATUS)||(r.getShaderParameter(t,r.COMPILE_STATUS)||rw(r,t),r.getShaderParameter(i,r.COMPILE_STATUS)||rw(r,i),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(e)));}var sS=f(()=>{});function ix(r,e){let t=Mh(r,r.VERTEX_SHADER,e.vertex),i=Mh(r,r.FRAGMENT_SHADER,e.fragment),s=r.createProgram();r.attachShader(s,t),r.attachShader(s,i);let n=e.transformFeedbackVaryings;n&&(typeof r.transformFeedbackVaryings!="function"?F("TransformFeedback is not supported but TransformFeedbackVaryings are given."):r.transformFeedbackVaryings(s,n.names,n.bufferMode==="separate"?r.SEPARATE_ATTRIBS:r.INTERLEAVED_ATTRIBS)),r.linkProgram(s),r.getProgramParameter(s,r.LINK_STATUS)||rx(r,s,t,i),e._attributeData=Jg(s,r,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=tx(s,r),e._uniformBlockData=ex(s,r),r.deleteShader(t),r.deleteShader(i);let o={};for(let u in e._uniformData){let l=e._uniformData[u];o[u]={location:r.getUniformLocation(s,u),value:Vu(l.type,l.size)};}return new Hu(s,o)}var nS=f(()=>{_e();QT();JT();qg();tS();rS();iS();sS();});var sx,ia,oS=f(()=>{E();ZT();nS();sx={textureCount:0,blockIndex:0},ia=class{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_programDataHash");}contextChange(e){this._gl=e,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null;}bind(e,t){if(this._setProgram(e.glProgram),t)return;sx.textureCount=0,sx.blockIndex=0;let i=this._shaderSyncFunctions[e.glProgram._key];i||(i=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),this._renderer.buffer.nextBindBase(!!e.glProgram.transformFeedbackVaryings),i(this._renderer,e,sx);}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,sx);}bindUniformBlock(e,t,i=0){let s=this._renderer.buffer,n=this._getProgramData(this._activeProgram),o=e._bufferResource;o||this._renderer.ubo.updateUniformGroup(e);let a=e.buffer,u=s.updateBuffer(a),l=s.freeLocationForBufferBase(u);if(o){let{offset:h,size:d}=e;h===0&&d===a.data.byteLength?s.bindBufferBase(u,l):s.bindBufferRange(u,l,h);}else s.getLastBindBaseLocation(u)!==l&&s.bindBufferBase(u,l);let c=this._activeProgram._uniformBlockData[t].index;n.uniformBlockBindings[i]!==l&&(n.uniformBlockBindings[i]=l,this._renderer.gl.uniformBlockBinding(n.program,c,l));}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;let t=this._getProgramData(e);this._gl.useProgram(t.program);}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){let t=e._key;return this._programDataHash[t]=ix(this._gl,e),this._programDataHash[t]}destroy(){for(let e of Object.keys(this._programDataHash))this._programDataHash[e].destroy(),this._programDataHash[e]=null;this._programDataHash=null;}_generateShaderSync(e,t){return $g(e,t)}resetState(){this._activeProgram=null;}};ia.extension={type:[
|
|
1950
|
+
`);a[0]=u,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd();}function rx(r,e,t,i){r.getProgramParameter(e,r.LINK_STATUS)||(r.getShaderParameter(t,r.COMPILE_STATUS)||rw(r,t),r.getShaderParameter(i,r.COMPILE_STATUS)||rw(r,i),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(e)));}var sS=f(()=>{});function ix(r,e){let t=Mh(r,r.VERTEX_SHADER,e.vertex),i=Mh(r,r.FRAGMENT_SHADER,e.fragment),s=r.createProgram();r.attachShader(s,t),r.attachShader(s,i);let n=e.transformFeedbackVaryings;n&&(typeof r.transformFeedbackVaryings!="function"?F("TransformFeedback is not supported but TransformFeedbackVaryings are given."):r.transformFeedbackVaryings(s,n.names,n.bufferMode==="separate"?r.SEPARATE_ATTRIBS:r.INTERLEAVED_ATTRIBS)),r.linkProgram(s),r.getProgramParameter(s,r.LINK_STATUS)||rx(r,s,t,i),e._attributeData=Jg(s,r,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=tx(s,r),e._uniformBlockData=ex(s,r),r.deleteShader(t),r.deleteShader(i);let o={};for(let u in e._uniformData){let l=e._uniformData[u];o[u]={location:r.getUniformLocation(s,u),value:Vu(l.type,l.size)};}return new Hu(s,o)}var nS=f(()=>{_e();QT();JT();qg();tS();rS();iS();sS();});var sx,ia,oS=f(()=>{E();ZT();nS();sx={textureCount:0,blockIndex:0},ia=class{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_programDataHash");}contextChange(e){this._gl=e,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null;}bind(e,t){if(this._setProgram(e.glProgram),t)return;sx.textureCount=0,sx.blockIndex=0;let i=this._shaderSyncFunctions[e.glProgram._key];i||(i=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),this._renderer.buffer.nextBindBase(!!e.glProgram.transformFeedbackVaryings),i(this._renderer,e,sx);}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,sx);}bindUniformBlock(e,t,i=0){let s=this._renderer.buffer,n=this._getProgramData(this._activeProgram),o=e._bufferResource;o||this._renderer.ubo.updateUniformGroup(e);let a=e.buffer,u=s.updateBuffer(a),l=s.freeLocationForBufferBase(u);if(o){let{offset:h,size:d}=e;h===0&&d===a.data.byteLength?s.bindBufferBase(u,l):s.bindBufferRange(u,l,h);}else s.getLastBindBaseLocation(u)!==l&&s.bindBufferBase(u,l);let c=this._activeProgram._uniformBlockData[t].index;n.uniformBlockBindings[i]!==l&&(n.uniformBlockBindings[i]=l,this._renderer.gl.uniformBlockBinding(n.program,c,l));}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;let t=this._getProgramData(e);this._gl.useProgram(t.program);}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){let t=e._key;return this._programDataHash[t]=ix(this._gl,e),this._programDataHash[t]}destroy(){for(let e of Object.keys(this._programDataHash))this._programDataHash[e].destroy(),this._programDataHash[e]=null;this._programDataHash=null;}_generateShaderSync(e,t){return $g(e,t)}resetState(){this._activeProgram=null;}};ia.extension={type:[g.WebGLSystem],name:"shader"};});var nx,ox,aS=f(()=>{nx={f32:`if (cv !== v) {
|
|
1951
1951
|
cu.value = v;
|
|
1952
1952
|
gl.uniform1f(location, v);
|
|
1953
1953
|
}`,"vec2<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
@@ -2037,8 +2037,8 @@ fn mainFragment(
|
|
|
2037
2037
|
cv = cu.value;
|
|
2038
2038
|
v = uv["${i}"];
|
|
2039
2039
|
${a};`);}}return new Function("ud","uv","renderer","syncData",t.join(`
|
|
2040
|
-
`))}var uS=f(()=>{Ch();Qe();Eg();aS();});var sa,lS=f(()=>{E();uS();sa=class{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={};}contextChange(e){this.gl=e;}updateUniformGroup(e,t,i){let s=this._renderer.shader._getProgramData(t);(!e.isStatic||e._dirtyId!==s.uniformDirtyGroups[e.uid])&&(s.uniformDirtyGroups[e.uid]=e._dirtyId,this._getUniformSyncFunction(e,t)(s.uniformData,e.uniforms,this._renderer,i));}_getUniformSyncFunction(e,t){return this._uniformGroupSyncHash[e._signature]?.[t._key]||this._createUniformSyncFunction(e,t)}_createUniformSyncFunction(e,t){let i=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),s=this._getSignature(e,t._uniformData,"u");return this._cache[s]||(this._cache[s]=this._generateUniformsSync(e,t._uniformData)),i[t._key]=this._cache[s],i[t._key]}_generateUniformsSync(e,t){return ax(e,t)}_getSignature(e,t,i){let s=e.uniforms,n=[`${i}-`];for(let o in s)n.push(o),t[o]&&n.push(t[o].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null;}};sa.extension={type:[m.WebGLSystem],name:"uniformGroup"};});function ux(r){let e={};if(e.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e.add=[r.ONE,r.ONE],e.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],e["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],!(r instanceof V.get().getWebGLRenderingContext()))e.min=[r.ONE,r.ONE,r.ONE,r.ONE,r.MIN,r.MIN],e.max=[r.ONE,r.ONE,r.ONE,r.ONE,r.MAX,r.MAX];else {let i=r.getExtension("EXT_blend_minmax");i&&(e.min=[r.ONE,r.ONE,r.ONE,r.ONE,i.MIN_EXT,i.MIN_EXT],e.max=[r.ONE,r.ONE,r.ONE,r.ONE,i.MAX_EXT,i.MAX_EXT]);}return e}var cS=f(()=>{Se();});var GI,UI,LI,NI,HI,VI,iw,lx,dS=f(()=>{E();cr();cS();GI=0,UI=1,LI=2,NI=3,HI=4,VI=5,iw=class hS{constructor(e){this._invertFrontFace=false,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=false,this.map=[],this.map[GI]=this.setBlend,this.map[UI]=this.setOffset,this.map[LI]=this.setCullFace,this.map[NI]=this.setDepthTest,this.map[HI]=this.setFrontFace,this.map[VI]=this.setDepthMask,this.checks=[],this.defaultState=Ue.for2d(),e.renderTarget.onRenderTargetChange.add(this);}onRenderTargetChange(e){this._invertFrontFace=!e.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=true;}contextChange(e){this.gl=e,this.blendModesMap=ux(e),this.resetState();}set(e){if(e||(e=this.defaultState),this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<<i)),t>>=1,i++;this.stateId=e.data;}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);}forceState(e){e||(e=this.defaultState);for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data;}setBlend(e){this._updateCheck(hS._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND);}setOffset(e){this._updateCheck(hS._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL);}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST);}setDepthMask(e){this.gl.depthMask(e);}setCullFace(e){this._cullFace=e,this.gl[e?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace);}setFrontFace(e){this._frontFace=e,this._frontFaceDirty=false;let t=this._invertFrontFace?!e:e;this._glFrontFace!==t&&(this._glFrontFace=t,this.gl.frontFace(this.gl[t?"CW":"CCW"]));}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;let t=this.blendModesMap[e],i=this.gl;t.length===2?i.blendFunc(t[0],t[1]):i.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=true,i.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=false,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD));}setPolygonOffset(e,t){this.gl.polygonOffset(e,t);}resetState(){this._glFrontFace=false,this._frontFace=false,this._cullFace=false,this._frontFaceDirty=false,this._invertFrontFace=false,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,false),this.forceState(this.defaultState),this._blendEq=true,this.blendMode="",this.setBlendMode("normal");}_updateCheck(e,t){let i=this.checks.indexOf(e);t&&i===-1?this.checks.push(e):!t&&i!==-1&&this.checks.splice(i,1);}static _checkBlendMode(e,t){e.setBlendMode(t.blendMode);}static _checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset);}destroy(){this.gl=null,this.checks.length=0;}};iw.extension={type:[m.WebGLSystem],name:"state"};lx=iw;});var zu,fS=f(()=>{Ng();zu=class{constructor(e){this.target=Bh.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=fe.UNSIGNED_BYTE,this.internalFormat=Uu.RGBA,this.format=Uu.RGBA,this.samplerType=0;}};});var cx,pS=f(()=>{cx={id:"buffer",upload(r,e,t){e.width===r.width||e.height===r.height?t.texSubImage2D(t.TEXTURE_2D,0,0,0,r.width,r.height,e.format,e.type,r.resource):t.texImage2D(e.target,0,e.internalFormat,r.width,r.height,0,e.format,e.type,r.resource),e.width=r.width,e.height=r.height;}};});var zI,hx,mS=f(()=>{zI={"bc1-rgba-unorm":true,"bc1-rgba-unorm-srgb":true,"bc2-rgba-unorm":true,"bc2-rgba-unorm-srgb":true,"bc3-rgba-unorm":true,"bc3-rgba-unorm-srgb":true,"bc4-r-unorm":true,"bc4-r-snorm":true,"bc5-rg-unorm":true,"bc5-rg-snorm":true,"bc6h-rgb-ufloat":true,"bc6h-rgb-float":true,"bc7-rgba-unorm":true,"bc7-rgba-unorm-srgb":true,"etc2-rgb8unorm":true,"etc2-rgb8unorm-srgb":true,"etc2-rgb8a1unorm":true,"etc2-rgb8a1unorm-srgb":true,"etc2-rgba8unorm":true,"etc2-rgba8unorm-srgb":true,"eac-r11unorm":true,"eac-r11snorm":true,"eac-rg11unorm":true,"eac-rg11snorm":true,"astc-4x4-unorm":true,"astc-4x4-unorm-srgb":true,"astc-5x4-unorm":true,"astc-5x4-unorm-srgb":true,"astc-5x5-unorm":true,"astc-5x5-unorm-srgb":true,"astc-6x5-unorm":true,"astc-6x5-unorm-srgb":true,"astc-6x6-unorm":true,"astc-6x6-unorm-srgb":true,"astc-8x5-unorm":true,"astc-8x5-unorm-srgb":true,"astc-8x6-unorm":true,"astc-8x6-unorm-srgb":true,"astc-8x8-unorm":true,"astc-8x8-unorm-srgb":true,"astc-10x5-unorm":true,"astc-10x5-unorm-srgb":true,"astc-10x6-unorm":true,"astc-10x6-unorm-srgb":true,"astc-10x8-unorm":true,"astc-10x8-unorm-srgb":true,"astc-10x10-unorm":true,"astc-10x10-unorm-srgb":true,"astc-12x10-unorm":true,"astc-12x10-unorm-srgb":true,"astc-12x12-unorm":true,"astc-12x12-unorm-srgb":true},hx={id:"compressed",upload(r,e,t){t.pixelStorei(t.UNPACK_ALIGNMENT,4);let i=r.pixelWidth,s=r.pixelHeight,n=!!zI[r.format];for(let o=0;o<r.resource.length;o++){let a=r.resource[o];n?t.compressedTexImage2D(t.TEXTURE_2D,o,e.internalFormat,i,s,0,a):t.texImage2D(t.TEXTURE_2D,o,e.internalFormat,i,s,0,e.format,e.type,a),i=Math.max(i>>1,1),s=Math.max(s>>1,1);}}};});var Wu,dx=f(()=>{Wu={id:"image",upload(r,e,t,i){let s=e.width,n=e.height,o=r.pixelWidth,a=r.pixelHeight,u=r.resourceWidth,l=r.resourceHeight;u<o||l<a?((s!==o||n!==a)&&t.texImage2D(e.target,0,e.internalFormat,o,a,0,e.format,e.type,null),i===2?t.texSubImage2D(t.TEXTURE_2D,0,0,0,u,l,e.format,e.type,r.resource):t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,r.resource)):s===o&&n===a?t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,r.resource):i===2?t.texImage2D(e.target,0,e.internalFormat,o,a,0,e.format,e.type,r.resource):t.texImage2D(e.target,0,e.internalFormat,e.format,e.type,r.resource),e.width=o,e.height=a;}};});var fx,gS=f(()=>{dx();fx={id:"video",upload(r,e,t,i){if(!r.isValid){t.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null);return}Wu.upload(r,e,t,i);}};});var Ih,px,Xu,mx,xS=f(()=>{Ih={linear:9729,nearest:9728},px={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Xu={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},mx={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};});function kh(r,e,t,i,s,n,o,a){let u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){let l=Xu[o?"clamp-to-edge":r.addressModeU],c=Xu[o?"clamp-to-edge":r.addressModeV],h=Xu[o?"clamp-to-edge":r.addressModeW];e[s](u,e.TEXTURE_WRAP_S,l),e[s](u,e.TEXTURE_WRAP_T,c),e.TEXTURE_WRAP_R&&e[s](u,e.TEXTURE_WRAP_R,h);}if((!a||r.magFilter!=="linear")&&e[s](u,e.TEXTURE_MAG_FILTER,Ih[r.magFilter]),t){if(!a||r.mipmapFilter!=="linear"){let l=px[r.minFilter][r.mipmapFilter];e[s](u,e.TEXTURE_MIN_FILTER,l);}}else e[s](u,e.TEXTURE_MIN_FILTER,Ih[r.minFilter]);if(i&&r.maxAnisotropy>1){let l=Math.min(r.maxAnisotropy,e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[s](u,i.TEXTURE_MAX_ANISOTROPY_EXT,l);}r.compare&&e[s](u,e.TEXTURE_COMPARE_FUNC,mx[r.compare]);}var _S=f(()=>{xS();});function gx(r){return {r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var bS=f(()=>{});function xx(r,e){let t={},i=r.RGBA;return r instanceof V.get().getWebGLRenderingContext()?e.srgb&&(t={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(t={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},i=r.RGBA8),{r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA,...t,rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:i,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}var yS=f(()=>{Se();});function _x(r){return {r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}var vS=f(()=>{});function sw(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));let e=r.length;for(let t=0;t<e;t+=4){let i=r[t+3];if(i!==0){let s=255.001/i;r[t]=r[t]*s+.5,r[t+1]=r[t+1]*s+.5,r[t+2]=r[t+2]*s+.5;}}}var nw=f(()=>{});var WI,na,TS=f(()=>{Se();E();ce();fS();pS();mS();dx();gS();_S();bS();yS();vS();WI=4,na=class{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Wu,buffer:cx,video:fx,compressed:hx},this._premultiplyAlpha=false,this._useSeparateSamplers=false,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_glTextures"),this._renderer.renderableGC.addManagedHash(this,"_glSamplers");}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=xx(e,this._renderer.context.extensions),this._mapFormatToType=_x(e),this._mapFormatToFormat=gx(e)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=false;for(let t=0;t<16;t++)this.bind(C.EMPTY,t);}initSource(e){this.bind(e);}bind(e,t=0){let i=e.source;e?(this.bindSource(i,t),this._useSeparateSamplers&&this._bindSampler(i.style,t)):(this.bindSource(null,t),this._useSeparateSamplers&&this._bindSampler(null,t));}bindSource(e,t=0){let i=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[t]!==e){this._boundTextures[t]=e,this._activateLocation(t),e||(e=C.EMPTY.source);let s=this.getGlSource(e);i.bindTexture(s.target,s.texture);}}_bindSampler(e,t=0){let i=this._gl;if(!e){this._boundSamplers[t]=null,i.bindSampler(t,null);return}let s=this._getGlSampler(e);this._boundSamplers[t]!==s&&(this._boundSamplers[t]=s,i.bindSampler(t,s));}unbind(e){let t=e.source,i=this._boundTextures,s=this._gl;for(let n=0;n<i.length;n++)if(i[n]===t){this._activateLocation(n);let o=this.getGlSource(t);s.bindTexture(o.target,null),i[n]=null;}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e));}_initSource(e){let t=this._gl,i=new zu(t.createTexture());if(i.type=this._mapFormatToType[e.format],i.internalFormat=this._mapFormatToInternalFormat[e.format],i.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){let s=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(s))+1;}return this._glTextures[e.uid]=i,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,false),i}onStyleChange(e){this.updateStyle(e,false);}updateStyle(e,t){let i=this._gl,s=this.getGlSource(e);i.bindTexture(i.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=e,kh(e.style,i,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",i.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,t);}onSourceUnload(e){let t=this._glTextures[e.uid];t&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(t.texture));}onSourceUpdate(e){let t=this._gl,i=this.getGlSource(e);t.bindTexture(t.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=e;let s=e.alphaMode==="premultiply-alpha-on-upload";this._premultiplyAlpha!==s&&(this._premultiplyAlpha=s,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s)),this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,i,t,this._renderer.context.webGLVersion):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e.pixelWidth,e.pixelHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,false);}onUpdateMipmaps(e,t=true){t&&this.bindSource(e,0);let i=this.getGlSource(e);this._gl.generateMipmap(i.target);}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e);}_initSampler(e){let t=this._gl,i=this._gl.createSampler();return this._glSamplers[e._resourceId]=i,kh(e,t,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",i,false,true),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){let{pixels:t,width:i,height:s}=this.getPixels(e),n=V.get().createCanvas();n.width=i,n.height=s;let o=n.getContext("2d");if(o){let a=o.createImageData(i,s);a.data.set(t),o.putImageData(a,0,0);}return n}getPixels(e){let t=e.source.resolution,i=e.frame,s=Math.max(Math.round(i.width*t),1),n=Math.max(Math.round(i.height*t),1),o=new Uint8Array(WI*s*n),a=this._renderer,u=a.renderTarget.getRenderTarget(e),l=a.renderTarget.getGpuRenderTarget(u),c=a.gl;return c.bindFramebuffer(c.FRAMEBUFFER,l.resolveTargetFramebuffer),c.readPixels(Math.round(i.x*t),Math.round(i.y*t),s,n,c.RGBA,c.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:s,height:n}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._renderer=null;}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(C.EMPTY.source),this._boundSamplers=Object.create(null);let e=this._gl;this._premultiplyAlpha=false,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha);}};na.extension={type:[m.WebGLSystem],name:"texture"};});var lw={};zd(lw,{WebGLRenderer:()=>Fh});var XI,YI,$I,ow,aw,uw,Fh,SS=f(()=>{E();wT();BT();RT();yu();yg();lr();IT();FT();UT();NT();HT();VT();zT();WT();$T();KT();oS();lS();dS();TS();XI=[...Pu,ta,Vg,Lg,Jo,qo,na,ra,Ko,sa,ia,Qo,lx,ea,Zo],YI=[...wu],$I=[$o,Yo,Xo],ow=[],aw=[],uw=[];O.handleByNamedList(m.WebGLSystem,ow);O.handleByNamedList(m.WebGLPipes,aw);O.handleByNamedList(m.WebGLPipesAdaptor,uw);O.add(...XI,...YI,...$I);Fh=class extends di{constructor(){let e={name:"webgl",type:Oe.WEBGL,systems:ow,renderPipes:aw,renderPipeAdaptors:uw};super(e);}};});async function bx(r){let e=[];r.preference?(e.push(r.preference),cw.forEach(n=>{n!==r.preference&&e.push(n);})):e=cw.slice();let t,i={};for(let n=0;n<e.length;n++){let o=e[n];if(o==="webgpu"&&await pi()){let{WebGPURenderer:a}=await Promise.resolve().then(()=>(PT(),ZP));t=a,i={...r,...r.webgpu};break}else if(o==="webgl"&&fi(r.failIfMajorPerformanceCaveat??di.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:a}=await Promise.resolve().then(()=>(SS(),lw));t=a,i={...r,...r.webgl};break}else if(o==="canvas")throw i={...r},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!t)throw new Error("No available renderer for the current environment");let s=new t;return await s.init(i),s}var cw,ES=f(()=>{vu();Tu();yu();cw=["webgl","webgpu","canvas"];});var hw,Oh,dw=f(()=>{E();ES();qt();ag();xe();hw=class AS{constructor(...e){this.stage=new te,e[0]!==void 0&&I(H,"Application constructor options are deprecated, please use Application.init() instead.");}async init(e){e={...e},this.renderer=await bx(e),AS._plugins.forEach(t=>{t.init.call(this,e);});}render(){this.renderer.render({container:this.stage});}get canvas(){return this.renderer.canvas}get view(){return I(H,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=false,t=false){let i=AS._plugins.slice(0);i.reverse(),i.forEach(s=>{s.destroy.call(this);}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null;}};hw._plugins=[];Oh=hw;O.handleByList(m.Application,Oh._plugins);O.add(vo);});var oa,CS=f(()=>{Ze();ce();vm();Wc();oa=class extends Ls{constructor(e,t){super();let{textures:i,data:s}=e;Object.keys(s.pages).forEach(n=>{let o=s.pages[parseInt(n,10)],a=i[o.id];this.pages.push({texture:a});}),Object.keys(s.chars).forEach(n=>{let o=s.chars[n],{frame:a,source:u}=i[o.page],l=new Z(o.x+a.x,o.y+a.y,o.width,o.height),c=new C({source:u,frame:l});this.chars[n]={id:n.codePointAt(0),xOffset:o.xOffset,yOffset:o.yOffset,xAdvance:o.xAdvance,kerning:o.kerning??{},texture:c};}),this.baseRenderedFontSize=s.fontSize,this.baseMeasurementFontSize=s.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:s.fontSize},this.baseLineOffset=s.baseLineOffset,this.lineHeight=s.lineHeight,this.fontFamily=s.fontFamily,this.distanceField=s.distanceField??{type:"none",range:0},this.url=t;}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){let{texture:t}=this.pages[e];t.destroy(true);}this.pages=null;}static install(e){zi.install(e);}static uninstall(e){zi.uninstall(e);}};});var Yu,PS=f(()=>{Yu={test(r){return typeof r=="string"&&r.startsWith("info face=")},parse(r){let e=r.match(/^[a-z]+\s+.+$/gm),t={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(let h in e){let d=e[h].match(/^[a-z]+/gm)[0],p=e[h].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),_={};for(let b in p){let x=p[b].split("="),g=x[0],v=x[1].replace(/"/gm,""),T=parseFloat(v),S=isNaN(T)?v:T;_[g]=S;}t[d].push(_);}let i={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},[s]=t.info,[n]=t.common,[o]=t.distanceField??[];o&&(i.distanceField={range:parseInt(o.distanceRange,10),type:o.fieldType}),i.fontSize=parseInt(s.size,10),i.fontFamily=s.face,i.lineHeight=parseInt(n.lineHeight,10);let a=t.page;for(let h=0;h<a.length;h++)i.pages.push({id:parseInt(a[h].id,10)||0,file:a[h].file});let u={};i.baseLineOffset=i.lineHeight-parseInt(n.base,10);let l=t.char;for(let h=0;h<l.length;h++){let d=l[h],p=parseInt(d.id,10),_=d.letter??d.char??String.fromCharCode(p);_==="space"&&(_=" "),u[p]=_,i.chars[_]={id:p,page:parseInt(d.page,10)||0,x:parseInt(d.x,10),y:parseInt(d.y,10),width:parseInt(d.width,10),height:parseInt(d.height,10),xOffset:parseInt(d.xoffset,10),yOffset:parseInt(d.yoffset,10),xAdvance:parseInt(d.xadvance,10),kerning:{}};}let c=t.kerning||[];for(let h=0;h<c.length;h++){let d=parseInt(c[h].first,10),p=parseInt(c[h].second,10),_=parseInt(c[h].amount,10);i.chars[u[p]].kerning[u[d]]=_;}return i}};});var Gh,wS=f(()=>{Gh={test(r){let e=r;return typeof e!="string"&&"getElementsByTagName"in e&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},parse(r){let e={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},t=r.getElementsByTagName("info")[0],i=r.getElementsByTagName("common")[0],s=r.getElementsByTagName("distanceField")[0];s&&(e.distanceField={type:s.getAttribute("fieldType"),range:parseInt(s.getAttribute("distanceRange"),10)});let n=r.getElementsByTagName("page"),o=r.getElementsByTagName("char"),a=r.getElementsByTagName("kerning");e.fontSize=parseInt(t.getAttribute("size"),10),e.fontFamily=t.getAttribute("face"),e.lineHeight=parseInt(i.getAttribute("lineHeight"),10);for(let l=0;l<n.length;l++)e.pages.push({id:parseInt(n[l].getAttribute("id"),10)||0,file:n[l].getAttribute("file")});let u={};e.baseLineOffset=e.lineHeight-parseInt(i.getAttribute("base"),10);for(let l=0;l<o.length;l++){let c=o[l],h=parseInt(c.getAttribute("id"),10),d=c.getAttribute("letter")??c.getAttribute("char")??String.fromCharCode(h);d==="space"&&(d=" "),u[h]=d,e.chars[d]={id:h,page:parseInt(c.getAttribute("page"),10)||0,x:parseInt(c.getAttribute("x"),10),y:parseInt(c.getAttribute("y"),10),width:parseInt(c.getAttribute("width"),10),height:parseInt(c.getAttribute("height"),10),xOffset:parseInt(c.getAttribute("xoffset"),10),yOffset:parseInt(c.getAttribute("yoffset"),10),xAdvance:parseInt(c.getAttribute("xadvance"),10),kerning:{}};}for(let l=0;l<a.length;l++){let c=parseInt(a[l].getAttribute("first"),10),h=parseInt(a[l].getAttribute("second"),10),d=parseInt(a[l].getAttribute("amount"),10);e.chars[u[h]].kerning[u[c]]=d;}return e}};});var Uh,BS=f(()=>{Se();wS();Uh={test(r){return typeof r=="string"&&r.includes("<font>")?Gh.test(V.get().parseXML(r)):false},parse(r){return Gh.parse(V.get().parseXML(r))}};});var jI,yx,vx,RS=f(()=>{ar();Gf();Se();E();fs();CS();PS();BS();jI=[".xml",".fnt"],yx={extension:{type:m.CacheParser,name:"cacheBitmapFont"},test:r=>r instanceof oa,getCacheableAssets(r,e){let t={};return r.forEach(i=>{t[i]=e,t[`${i}-bitmap`]=e;}),t[`${e.fontFamily}-bitmap`]=e,t}},vx={extension:{type:m.LoadParser,priority:Me.Normal},name:"loadBitmapFont",test(r){return jI.includes(De.extname(r).toLowerCase())},async testParse(r){return Yu.test(r)||Uh.test(r)},async parse(r,e,t){let i=Yu.test(r)?Yu.parse(r):Uh.parse(r),{src:s}=e,{pages:n}=i,o=[],a=i.distanceField?{scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:false,resolution:1}:{};for(let h=0;h<n.length;++h){let d=n[h].file,p=De.join(De.dirname(s),d);p=Dn(p,s),o.push({src:p,data:a});}let u=await t.load(o),l=o.map(h=>u[h.src]);return new oa({data:i,textures:l},s)},async load(r,e){return await(await V.get().fetch(r)).text()},async unload(r,e,t){await Promise.all(r.pages.map(i=>t.unload(i.texture.source._sourceOrigin))),r.destroy();}};});var $u,MS=f(()=>{$u=class{constructor(e,t=false){this._loader=e,this._assetList=[],this._isLoading=false,this._maxConcurrent=1,this.verbose=t;}add(e){e.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=true;let e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i<t;i++)e.push(this._assetList.pop());await this._loader.load(e),this._isLoading=false,this._next();}}get active(){return this._isActive}set active(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next());}};});var Tx,DS=f(()=>{E();ce();Tx={extension:{type:m.CacheParser,name:"cacheTextureArray"},test:r=>Array.isArray(r)&&r.every(e=>e instanceof C),getCacheableAssets:(r,e)=>{let t={};return r.forEach(i=>{e.forEach((s,n)=>{t[i+(n===0?"":n+1)]=s;});}),t}};});async function ju(r){if("Image"in globalThis)return new Promise(e=>{let t=new Image;t.onload=()=>{e(true);},t.onerror=()=>{e(false);},t.src=r;});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{let e=await(await fetch(r)).blob();await createImageBitmap(e);}catch{return false}return true}return false}var Sx=f(()=>{});var Ex,IS=f(()=>{E();Sx();Ex={extension:{type:m.DetectionParser,priority:1},test:async()=>ju("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(e=>e!=="avif")};});var fw,Ax,kS=f(()=>{E();fw=["png","jpg","jpeg"],Ax={extension:{type:m.DetectionParser,priority:-1},test:()=>Promise.resolve(true),add:async r=>[...r,...fw],remove:async r=>r.filter(e=>!fw.includes(e))};});function en(r){return qI?false:document.createElement("video").canPlayType(r)!==""}var qI,Lh=f(()=>{qI="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;});var Cx,FS=f(()=>{E();Lh();Cx={extension:{type:m.DetectionParser,priority:0},test:async()=>en("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(e=>e!=="mp4"&&e!=="m4v")};});var Px,OS=f(()=>{E();Lh();Px={extension:{type:m.DetectionParser,priority:0},test:async()=>en("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(e=>e!=="ogv")};});var wx,GS=f(()=>{E();Lh();wx={extension:{type:m.DetectionParser,priority:0},test:async()=>en("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(e=>e!=="webm")};});var Bx,US=f(()=>{E();Sx();Bx={extension:{type:m.DetectionParser,priority:0},test:async()=>ju("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(e=>e!=="webp")};});var qu,LS=f(()=>{_e();fs();Ia();lc();qu=class{constructor(){this._parsers=[],this._parsersValidated=false,this.parsers=new Proxy(this._parsers,{set:(e,t,i)=>(this._parsersValidated=false,e[t]=i,true)}),this.promiseCache={};}reset(){this._parsersValidated=false,this.promiseCache={};}_getLoadPromiseAndParser(e,t){let i={promise:null,parser:null};return i.promise=(async()=>{let s=null,n=null;if(t.loadParser&&(n=this._parserHash[t.loadParser],n||F(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!n){for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];if(a.load&&a.test?.(e,t,this)){n=a;break}}if(!n)return F(`[Assets] ${e} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}s=await n.load(e,t,this),i.parser=n;for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];a.parse&&a.parse&&await a.testParse?.(s,t,this)&&(s=await a.parse(s,t,this)||s,i.parser=a);}return s})(),i}async load(e,t){this._parsersValidated||this._validateParsers();let i=0,s={},n=ki(e),o=Ct(e,l=>({alias:[l],src:l,data:{}})),a=o.length,u=o.map(async l=>{let c=De.toAbsolute(l.src);if(!s[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),s[l.src]=await this.promiseCache[c].promise,t&&t(++i/a);}catch(h){throw delete this.promiseCache[c],delete s[l.src],new Error(`[Loader.load] Failed to load ${c}.
|
|
2041
|
-
${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=Ct(e,s=>({alias:[s],src:s})).map(async s=>{let n=De.toAbsolute(s.src),o=this.promiseCache[n];if(o){let a=await o.promise;delete this.promiseCache[n],await o.parser?.unload?.(a,s,this);}});await Promise.all(i);}_validateParsers(){this._parsersValidated=true,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,t)=>(t.name?e[t.name]&&F(`[Assets] loadParser name conflict "${t.name}"`):F("[Assets] loadParser should have a name"),{...e,[t.name]:t}),{});}};});function Qt(r,e){if(Array.isArray(e)){for(let t of e)if(r.startsWith(`data:${t}`))return true;return false}return r.startsWith(`data:${e}`)}var tn=f(()=>{});function We(r,e){let t=r.split("?")[0],i=De.extname(t).toLowerCase();return Array.isArray(e)?e.includes(i):i===e}var hr=f(()=>{fs();});var KI,ZI,Rx,NS=f(()=>{Se();E();tn();hr();ar();KI=".json",ZI="application/json",Rx={extension:{type:
|
|
2040
|
+
`))}var uS=f(()=>{Ch();Qe();Eg();aS();});var sa,lS=f(()=>{E();uS();sa=class{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={};}contextChange(e){this.gl=e;}updateUniformGroup(e,t,i){let s=this._renderer.shader._getProgramData(t);(!e.isStatic||e._dirtyId!==s.uniformDirtyGroups[e.uid])&&(s.uniformDirtyGroups[e.uid]=e._dirtyId,this._getUniformSyncFunction(e,t)(s.uniformData,e.uniforms,this._renderer,i));}_getUniformSyncFunction(e,t){return this._uniformGroupSyncHash[e._signature]?.[t._key]||this._createUniformSyncFunction(e,t)}_createUniformSyncFunction(e,t){let i=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),s=this._getSignature(e,t._uniformData,"u");return this._cache[s]||(this._cache[s]=this._generateUniformsSync(e,t._uniformData)),i[t._key]=this._cache[s],i[t._key]}_generateUniformsSync(e,t){return ax(e,t)}_getSignature(e,t,i){let s=e.uniforms,n=[`${i}-`];for(let o in s)n.push(o),t[o]&&n.push(t[o].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null;}};sa.extension={type:[g.WebGLSystem],name:"uniformGroup"};});function ux(r){let e={};if(e.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e.add=[r.ONE,r.ONE],e.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],e["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],!(r instanceof V.get().getWebGLRenderingContext()))e.min=[r.ONE,r.ONE,r.ONE,r.ONE,r.MIN,r.MIN],e.max=[r.ONE,r.ONE,r.ONE,r.ONE,r.MAX,r.MAX];else {let i=r.getExtension("EXT_blend_minmax");i&&(e.min=[r.ONE,r.ONE,r.ONE,r.ONE,i.MIN_EXT,i.MIN_EXT],e.max=[r.ONE,r.ONE,r.ONE,r.ONE,i.MAX_EXT,i.MAX_EXT]);}return e}var cS=f(()=>{Se();});var GI,UI,LI,NI,HI,VI,iw,lx,dS=f(()=>{E();cr();cS();GI=0,UI=1,LI=2,NI=3,HI=4,VI=5,iw=class hS{constructor(e){this._invertFrontFace=false,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=false,this.map=[],this.map[GI]=this.setBlend,this.map[UI]=this.setOffset,this.map[LI]=this.setCullFace,this.map[NI]=this.setDepthTest,this.map[HI]=this.setFrontFace,this.map[VI]=this.setDepthMask,this.checks=[],this.defaultState=Ue.for2d(),e.renderTarget.onRenderTargetChange.add(this);}onRenderTargetChange(e){this._invertFrontFace=!e.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=true;}contextChange(e){this.gl=e,this.blendModesMap=ux(e),this.resetState();}set(e){if(e||(e=this.defaultState),this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<<i)),t>>=1,i++;this.stateId=e.data;}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);}forceState(e){e||(e=this.defaultState);for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data;}setBlend(e){this._updateCheck(hS._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND);}setOffset(e){this._updateCheck(hS._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL);}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST);}setDepthMask(e){this.gl.depthMask(e);}setCullFace(e){this._cullFace=e,this.gl[e?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace);}setFrontFace(e){this._frontFace=e,this._frontFaceDirty=false;let t=this._invertFrontFace?!e:e;this._glFrontFace!==t&&(this._glFrontFace=t,this.gl.frontFace(this.gl[t?"CW":"CCW"]));}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;let t=this.blendModesMap[e],i=this.gl;t.length===2?i.blendFunc(t[0],t[1]):i.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=true,i.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=false,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD));}setPolygonOffset(e,t){this.gl.polygonOffset(e,t);}resetState(){this._glFrontFace=false,this._frontFace=false,this._cullFace=false,this._frontFaceDirty=false,this._invertFrontFace=false,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,false),this.forceState(this.defaultState),this._blendEq=true,this.blendMode="",this.setBlendMode("normal");}_updateCheck(e,t){let i=this.checks.indexOf(e);t&&i===-1?this.checks.push(e):!t&&i!==-1&&this.checks.splice(i,1);}static _checkBlendMode(e,t){e.setBlendMode(t.blendMode);}static _checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset);}destroy(){this.gl=null,this.checks.length=0;}};iw.extension={type:[g.WebGLSystem],name:"state"};lx=iw;});var zu,fS=f(()=>{Ng();zu=class{constructor(e){this.target=Bh.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=fe.UNSIGNED_BYTE,this.internalFormat=Uu.RGBA,this.format=Uu.RGBA,this.samplerType=0;}};});var cx,pS=f(()=>{cx={id:"buffer",upload(r,e,t){e.width===r.width||e.height===r.height?t.texSubImage2D(t.TEXTURE_2D,0,0,0,r.width,r.height,e.format,e.type,r.resource):t.texImage2D(e.target,0,e.internalFormat,r.width,r.height,0,e.format,e.type,r.resource),e.width=r.width,e.height=r.height;}};});var zI,hx,mS=f(()=>{zI={"bc1-rgba-unorm":true,"bc1-rgba-unorm-srgb":true,"bc2-rgba-unorm":true,"bc2-rgba-unorm-srgb":true,"bc3-rgba-unorm":true,"bc3-rgba-unorm-srgb":true,"bc4-r-unorm":true,"bc4-r-snorm":true,"bc5-rg-unorm":true,"bc5-rg-snorm":true,"bc6h-rgb-ufloat":true,"bc6h-rgb-float":true,"bc7-rgba-unorm":true,"bc7-rgba-unorm-srgb":true,"etc2-rgb8unorm":true,"etc2-rgb8unorm-srgb":true,"etc2-rgb8a1unorm":true,"etc2-rgb8a1unorm-srgb":true,"etc2-rgba8unorm":true,"etc2-rgba8unorm-srgb":true,"eac-r11unorm":true,"eac-r11snorm":true,"eac-rg11unorm":true,"eac-rg11snorm":true,"astc-4x4-unorm":true,"astc-4x4-unorm-srgb":true,"astc-5x4-unorm":true,"astc-5x4-unorm-srgb":true,"astc-5x5-unorm":true,"astc-5x5-unorm-srgb":true,"astc-6x5-unorm":true,"astc-6x5-unorm-srgb":true,"astc-6x6-unorm":true,"astc-6x6-unorm-srgb":true,"astc-8x5-unorm":true,"astc-8x5-unorm-srgb":true,"astc-8x6-unorm":true,"astc-8x6-unorm-srgb":true,"astc-8x8-unorm":true,"astc-8x8-unorm-srgb":true,"astc-10x5-unorm":true,"astc-10x5-unorm-srgb":true,"astc-10x6-unorm":true,"astc-10x6-unorm-srgb":true,"astc-10x8-unorm":true,"astc-10x8-unorm-srgb":true,"astc-10x10-unorm":true,"astc-10x10-unorm-srgb":true,"astc-12x10-unorm":true,"astc-12x10-unorm-srgb":true,"astc-12x12-unorm":true,"astc-12x12-unorm-srgb":true},hx={id:"compressed",upload(r,e,t){t.pixelStorei(t.UNPACK_ALIGNMENT,4);let i=r.pixelWidth,s=r.pixelHeight,n=!!zI[r.format];for(let o=0;o<r.resource.length;o++){let a=r.resource[o];n?t.compressedTexImage2D(t.TEXTURE_2D,o,e.internalFormat,i,s,0,a):t.texImage2D(t.TEXTURE_2D,o,e.internalFormat,i,s,0,e.format,e.type,a),i=Math.max(i>>1,1),s=Math.max(s>>1,1);}}};});var Wu,dx=f(()=>{Wu={id:"image",upload(r,e,t,i){let s=e.width,n=e.height,o=r.pixelWidth,a=r.pixelHeight,u=r.resourceWidth,l=r.resourceHeight;u<o||l<a?((s!==o||n!==a)&&t.texImage2D(e.target,0,e.internalFormat,o,a,0,e.format,e.type,null),i===2?t.texSubImage2D(t.TEXTURE_2D,0,0,0,u,l,e.format,e.type,r.resource):t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,r.resource)):s===o&&n===a?t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,r.resource):i===2?t.texImage2D(e.target,0,e.internalFormat,o,a,0,e.format,e.type,r.resource):t.texImage2D(e.target,0,e.internalFormat,e.format,e.type,r.resource),e.width=o,e.height=a;}};});var fx,gS=f(()=>{dx();fx={id:"video",upload(r,e,t,i){if(!r.isValid){t.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null);return}Wu.upload(r,e,t,i);}};});var Ih,px,Xu,mx,xS=f(()=>{Ih={linear:9729,nearest:9728},px={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Xu={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},mx={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};});function kh(r,e,t,i,s,n,o,a){let u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){let l=Xu[o?"clamp-to-edge":r.addressModeU],c=Xu[o?"clamp-to-edge":r.addressModeV],h=Xu[o?"clamp-to-edge":r.addressModeW];e[s](u,e.TEXTURE_WRAP_S,l),e[s](u,e.TEXTURE_WRAP_T,c),e.TEXTURE_WRAP_R&&e[s](u,e.TEXTURE_WRAP_R,h);}if((!a||r.magFilter!=="linear")&&e[s](u,e.TEXTURE_MAG_FILTER,Ih[r.magFilter]),t){if(!a||r.mipmapFilter!=="linear"){let l=px[r.minFilter][r.mipmapFilter];e[s](u,e.TEXTURE_MIN_FILTER,l);}}else e[s](u,e.TEXTURE_MIN_FILTER,Ih[r.minFilter]);if(i&&r.maxAnisotropy>1){let l=Math.min(r.maxAnisotropy,e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[s](u,i.TEXTURE_MAX_ANISOTROPY_EXT,l);}r.compare&&e[s](u,e.TEXTURE_COMPARE_FUNC,mx[r.compare]);}var _S=f(()=>{xS();});function gx(r){return {r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var bS=f(()=>{});function xx(r,e){let t={},i=r.RGBA;return r instanceof V.get().getWebGLRenderingContext()?e.srgb&&(t={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(t={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},i=r.RGBA8),{r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA,...t,rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:i,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}var yS=f(()=>{Se();});function _x(r){return {r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}var vS=f(()=>{});function sw(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));let e=r.length;for(let t=0;t<e;t+=4){let i=r[t+3];if(i!==0){let s=255.001/i;r[t]=r[t]*s+.5,r[t+1]=r[t+1]*s+.5,r[t+2]=r[t+2]*s+.5;}}}var nw=f(()=>{});var WI,na,TS=f(()=>{Se();E();ce();fS();pS();mS();dx();gS();_S();bS();yS();vS();WI=4,na=class{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Wu,buffer:cx,video:fx,compressed:hx},this._premultiplyAlpha=false,this._useSeparateSamplers=false,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_glTextures"),this._renderer.renderableGC.addManagedHash(this,"_glSamplers");}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=xx(e,this._renderer.context.extensions),this._mapFormatToType=_x(e),this._mapFormatToFormat=gx(e)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=false;for(let t=0;t<16;t++)this.bind(C.EMPTY,t);}initSource(e){this.bind(e);}bind(e,t=0){let i=e.source;e?(this.bindSource(i,t),this._useSeparateSamplers&&this._bindSampler(i.style,t)):(this.bindSource(null,t),this._useSeparateSamplers&&this._bindSampler(null,t));}bindSource(e,t=0){let i=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[t]!==e){this._boundTextures[t]=e,this._activateLocation(t),e||(e=C.EMPTY.source);let s=this.getGlSource(e);i.bindTexture(s.target,s.texture);}}_bindSampler(e,t=0){let i=this._gl;if(!e){this._boundSamplers[t]=null,i.bindSampler(t,null);return}let s=this._getGlSampler(e);this._boundSamplers[t]!==s&&(this._boundSamplers[t]=s,i.bindSampler(t,s));}unbind(e){let t=e.source,i=this._boundTextures,s=this._gl;for(let n=0;n<i.length;n++)if(i[n]===t){this._activateLocation(n);let o=this.getGlSource(t);s.bindTexture(o.target,null),i[n]=null;}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e));}_initSource(e){let t=this._gl,i=new zu(t.createTexture());if(i.type=this._mapFormatToType[e.format],i.internalFormat=this._mapFormatToInternalFormat[e.format],i.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){let s=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(s))+1;}return this._glTextures[e.uid]=i,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,false),i}onStyleChange(e){this.updateStyle(e,false);}updateStyle(e,t){let i=this._gl,s=this.getGlSource(e);i.bindTexture(i.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=e,kh(e.style,i,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",i.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,t);}onSourceUnload(e){let t=this._glTextures[e.uid];t&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(t.texture));}onSourceUpdate(e){let t=this._gl,i=this.getGlSource(e);t.bindTexture(t.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=e;let s=e.alphaMode==="premultiply-alpha-on-upload";this._premultiplyAlpha!==s&&(this._premultiplyAlpha=s,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s)),this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,i,t,this._renderer.context.webGLVersion):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e.pixelWidth,e.pixelHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,false);}onUpdateMipmaps(e,t=true){t&&this.bindSource(e,0);let i=this.getGlSource(e);this._gl.generateMipmap(i.target);}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e);}_initSampler(e){let t=this._gl,i=this._gl.createSampler();return this._glSamplers[e._resourceId]=i,kh(e,t,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",i,false,true),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){let{pixels:t,width:i,height:s}=this.getPixels(e),n=V.get().createCanvas();n.width=i,n.height=s;let o=n.getContext("2d");if(o){let a=o.createImageData(i,s);a.data.set(t),o.putImageData(a,0,0);}return n}getPixels(e){let t=e.source.resolution,i=e.frame,s=Math.max(Math.round(i.width*t),1),n=Math.max(Math.round(i.height*t),1),o=new Uint8Array(WI*s*n),a=this._renderer,u=a.renderTarget.getRenderTarget(e),l=a.renderTarget.getGpuRenderTarget(u),c=a.gl;return c.bindFramebuffer(c.FRAMEBUFFER,l.resolveTargetFramebuffer),c.readPixels(Math.round(i.x*t),Math.round(i.y*t),s,n,c.RGBA,c.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:s,height:n}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._renderer=null;}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(C.EMPTY.source),this._boundSamplers=Object.create(null);let e=this._gl;this._premultiplyAlpha=false,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha);}};na.extension={type:[g.WebGLSystem],name:"texture"};});var lw={};zd(lw,{WebGLRenderer:()=>Fh});var XI,YI,$I,ow,aw,uw,Fh,SS=f(()=>{E();wT();BT();RT();yu();yg();lr();IT();FT();UT();NT();HT();VT();zT();WT();$T();KT();oS();lS();dS();TS();XI=[...Pu,ta,Vg,Lg,Jo,qo,na,ra,Ko,sa,ia,Qo,lx,ea,Zo],YI=[...wu],$I=[$o,Yo,Xo],ow=[],aw=[],uw=[];O.handleByNamedList(g.WebGLSystem,ow);O.handleByNamedList(g.WebGLPipes,aw);O.handleByNamedList(g.WebGLPipesAdaptor,uw);O.add(...XI,...YI,...$I);Fh=class extends di{constructor(){let e={name:"webgl",type:Oe.WEBGL,systems:ow,renderPipes:aw,renderPipeAdaptors:uw};super(e);}};});async function bx(r){let e=[];r.preference?(e.push(r.preference),cw.forEach(n=>{n!==r.preference&&e.push(n);})):e=cw.slice();let t,i={};for(let n=0;n<e.length;n++){let o=e[n];if(o==="webgpu"&&await pi()){let{WebGPURenderer:a}=await Promise.resolve().then(()=>(PT(),ZP));t=a,i={...r,...r.webgpu};break}else if(o==="webgl"&&fi(r.failIfMajorPerformanceCaveat??di.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:a}=await Promise.resolve().then(()=>(SS(),lw));t=a,i={...r,...r.webgl};break}else if(o==="canvas")throw i={...r},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!t)throw new Error("No available renderer for the current environment");let s=new t;return await s.init(i),s}var cw,ES=f(()=>{vu();Tu();yu();cw=["webgl","webgpu","canvas"];});var hw,Oh,dw=f(()=>{E();ES();qt();ag();xe();hw=class AS{constructor(...e){this.stage=new te,e[0]!==void 0&&I(H,"Application constructor options are deprecated, please use Application.init() instead.");}async init(e){e={...e},this.renderer=await bx(e),AS._plugins.forEach(t=>{t.init.call(this,e);});}render(){this.renderer.render({container:this.stage});}get canvas(){return this.renderer.canvas}get view(){return I(H,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=false,t=false){let i=AS._plugins.slice(0);i.reverse(),i.forEach(s=>{s.destroy.call(this);}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null;}};hw._plugins=[];Oh=hw;O.handleByList(g.Application,Oh._plugins);O.add(vo);});var oa,CS=f(()=>{Ze();ce();vm();Wc();oa=class extends Ls{constructor(e,t){super();let{textures:i,data:s}=e;Object.keys(s.pages).forEach(n=>{let o=s.pages[parseInt(n,10)],a=i[o.id];this.pages.push({texture:a});}),Object.keys(s.chars).forEach(n=>{let o=s.chars[n],{frame:a,source:u}=i[o.page],l=new Z(o.x+a.x,o.y+a.y,o.width,o.height),c=new C({source:u,frame:l});this.chars[n]={id:n.codePointAt(0),xOffset:o.xOffset,yOffset:o.yOffset,xAdvance:o.xAdvance,kerning:o.kerning??{},texture:c};}),this.baseRenderedFontSize=s.fontSize,this.baseMeasurementFontSize=s.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:s.fontSize},this.baseLineOffset=s.baseLineOffset,this.lineHeight=s.lineHeight,this.fontFamily=s.fontFamily,this.distanceField=s.distanceField??{type:"none",range:0},this.url=t;}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){let{texture:t}=this.pages[e];t.destroy(true);}this.pages=null;}static install(e){zi.install(e);}static uninstall(e){zi.uninstall(e);}};});var Yu,PS=f(()=>{Yu={test(r){return typeof r=="string"&&r.startsWith("info face=")},parse(r){let e=r.match(/^[a-z]+\s+.+$/gm),t={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(let h in e){let d=e[h].match(/^[a-z]+/gm)[0],p=e[h].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),_={};for(let b in p){let x=p[b].split("="),m=x[0],v=x[1].replace(/"/gm,""),T=parseFloat(v),S=isNaN(T)?v:T;_[m]=S;}t[d].push(_);}let i={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},[s]=t.info,[n]=t.common,[o]=t.distanceField??[];o&&(i.distanceField={range:parseInt(o.distanceRange,10),type:o.fieldType}),i.fontSize=parseInt(s.size,10),i.fontFamily=s.face,i.lineHeight=parseInt(n.lineHeight,10);let a=t.page;for(let h=0;h<a.length;h++)i.pages.push({id:parseInt(a[h].id,10)||0,file:a[h].file});let u={};i.baseLineOffset=i.lineHeight-parseInt(n.base,10);let l=t.char;for(let h=0;h<l.length;h++){let d=l[h],p=parseInt(d.id,10),_=d.letter??d.char??String.fromCharCode(p);_==="space"&&(_=" "),u[p]=_,i.chars[_]={id:p,page:parseInt(d.page,10)||0,x:parseInt(d.x,10),y:parseInt(d.y,10),width:parseInt(d.width,10),height:parseInt(d.height,10),xOffset:parseInt(d.xoffset,10),yOffset:parseInt(d.yoffset,10),xAdvance:parseInt(d.xadvance,10),kerning:{}};}let c=t.kerning||[];for(let h=0;h<c.length;h++){let d=parseInt(c[h].first,10),p=parseInt(c[h].second,10),_=parseInt(c[h].amount,10);i.chars[u[p]].kerning[u[d]]=_;}return i}};});var Gh,wS=f(()=>{Gh={test(r){let e=r;return typeof e!="string"&&"getElementsByTagName"in e&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},parse(r){let e={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},t=r.getElementsByTagName("info")[0],i=r.getElementsByTagName("common")[0],s=r.getElementsByTagName("distanceField")[0];s&&(e.distanceField={type:s.getAttribute("fieldType"),range:parseInt(s.getAttribute("distanceRange"),10)});let n=r.getElementsByTagName("page"),o=r.getElementsByTagName("char"),a=r.getElementsByTagName("kerning");e.fontSize=parseInt(t.getAttribute("size"),10),e.fontFamily=t.getAttribute("face"),e.lineHeight=parseInt(i.getAttribute("lineHeight"),10);for(let l=0;l<n.length;l++)e.pages.push({id:parseInt(n[l].getAttribute("id"),10)||0,file:n[l].getAttribute("file")});let u={};e.baseLineOffset=e.lineHeight-parseInt(i.getAttribute("base"),10);for(let l=0;l<o.length;l++){let c=o[l],h=parseInt(c.getAttribute("id"),10),d=c.getAttribute("letter")??c.getAttribute("char")??String.fromCharCode(h);d==="space"&&(d=" "),u[h]=d,e.chars[d]={id:h,page:parseInt(c.getAttribute("page"),10)||0,x:parseInt(c.getAttribute("x"),10),y:parseInt(c.getAttribute("y"),10),width:parseInt(c.getAttribute("width"),10),height:parseInt(c.getAttribute("height"),10),xOffset:parseInt(c.getAttribute("xoffset"),10),yOffset:parseInt(c.getAttribute("yoffset"),10),xAdvance:parseInt(c.getAttribute("xadvance"),10),kerning:{}};}for(let l=0;l<a.length;l++){let c=parseInt(a[l].getAttribute("first"),10),h=parseInt(a[l].getAttribute("second"),10),d=parseInt(a[l].getAttribute("amount"),10);e.chars[u[h]].kerning[u[c]]=d;}return e}};});var Uh,BS=f(()=>{Se();wS();Uh={test(r){return typeof r=="string"&&r.includes("<font>")?Gh.test(V.get().parseXML(r)):false},parse(r){return Gh.parse(V.get().parseXML(r))}};});var jI,yx,vx,RS=f(()=>{ar();Gf();Se();E();fs();CS();PS();BS();jI=[".xml",".fnt"],yx={extension:{type:g.CacheParser,name:"cacheBitmapFont"},test:r=>r instanceof oa,getCacheableAssets(r,e){let t={};return r.forEach(i=>{t[i]=e,t[`${i}-bitmap`]=e;}),t[`${e.fontFamily}-bitmap`]=e,t}},vx={extension:{type:g.LoadParser,priority:Me.Normal},name:"loadBitmapFont",test(r){return jI.includes(De.extname(r).toLowerCase())},async testParse(r){return Yu.test(r)||Uh.test(r)},async parse(r,e,t){let i=Yu.test(r)?Yu.parse(r):Uh.parse(r),{src:s}=e,{pages:n}=i,o=[],a=i.distanceField?{scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:false,resolution:1}:{};for(let h=0;h<n.length;++h){let d=n[h].file,p=De.join(De.dirname(s),d);p=Dn(p,s),o.push({src:p,data:a});}let u=await t.load(o),l=o.map(h=>u[h.src]);return new oa({data:i,textures:l},s)},async load(r,e){return await(await V.get().fetch(r)).text()},async unload(r,e,t){await Promise.all(r.pages.map(i=>t.unload(i.texture.source._sourceOrigin))),r.destroy();}};});var $u,MS=f(()=>{$u=class{constructor(e,t=false){this._loader=e,this._assetList=[],this._isLoading=false,this._maxConcurrent=1,this.verbose=t;}add(e){e.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=true;let e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i<t;i++)e.push(this._assetList.pop());await this._loader.load(e),this._isLoading=false,this._next();}}get active(){return this._isActive}set active(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next());}};});var Tx,DS=f(()=>{E();ce();Tx={extension:{type:g.CacheParser,name:"cacheTextureArray"},test:r=>Array.isArray(r)&&r.every(e=>e instanceof C),getCacheableAssets:(r,e)=>{let t={};return r.forEach(i=>{e.forEach((s,n)=>{t[i+(n===0?"":n+1)]=s;});}),t}};});async function ju(r){if("Image"in globalThis)return new Promise(e=>{let t=new Image;t.onload=()=>{e(true);},t.onerror=()=>{e(false);},t.src=r;});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{let e=await(await fetch(r)).blob();await createImageBitmap(e);}catch{return false}return true}return false}var Sx=f(()=>{});var Ex,IS=f(()=>{E();Sx();Ex={extension:{type:g.DetectionParser,priority:1},test:async()=>ju("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(e=>e!=="avif")};});var fw,Ax,kS=f(()=>{E();fw=["png","jpg","jpeg"],Ax={extension:{type:g.DetectionParser,priority:-1},test:()=>Promise.resolve(true),add:async r=>[...r,...fw],remove:async r=>r.filter(e=>!fw.includes(e))};});function en(r){return qI?false:document.createElement("video").canPlayType(r)!==""}var qI,Lh=f(()=>{qI="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;});var Cx,FS=f(()=>{E();Lh();Cx={extension:{type:g.DetectionParser,priority:0},test:async()=>en("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(e=>e!=="mp4"&&e!=="m4v")};});var Px,OS=f(()=>{E();Lh();Px={extension:{type:g.DetectionParser,priority:0},test:async()=>en("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(e=>e!=="ogv")};});var wx,GS=f(()=>{E();Lh();wx={extension:{type:g.DetectionParser,priority:0},test:async()=>en("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(e=>e!=="webm")};});var Bx,US=f(()=>{E();Sx();Bx={extension:{type:g.DetectionParser,priority:0},test:async()=>ju("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(e=>e!=="webp")};});var qu,LS=f(()=>{_e();fs();Ia();lc();qu=class{constructor(){this._parsers=[],this._parsersValidated=false,this.parsers=new Proxy(this._parsers,{set:(e,t,i)=>(this._parsersValidated=false,e[t]=i,true)}),this.promiseCache={};}reset(){this._parsersValidated=false,this.promiseCache={};}_getLoadPromiseAndParser(e,t){let i={promise:null,parser:null};return i.promise=(async()=>{let s=null,n=null;if(t.loadParser&&(n=this._parserHash[t.loadParser],n||F(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!n){for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];if(a.load&&a.test?.(e,t,this)){n=a;break}}if(!n)return F(`[Assets] ${e} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}s=await n.load(e,t,this),i.parser=n;for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];a.parse&&a.parse&&await a.testParse?.(s,t,this)&&(s=await a.parse(s,t,this)||s,i.parser=a);}return s})(),i}async load(e,t){this._parsersValidated||this._validateParsers();let i=0,s={},n=ki(e),o=Ct(e,l=>({alias:[l],src:l,data:{}})),a=o.length,u=o.map(async l=>{let c=De.toAbsolute(l.src);if(!s[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),s[l.src]=await this.promiseCache[c].promise,t&&t(++i/a);}catch(h){throw delete this.promiseCache[c],delete s[l.src],new Error(`[Loader.load] Failed to load ${c}.
|
|
2041
|
+
${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=Ct(e,s=>({alias:[s],src:s})).map(async s=>{let n=De.toAbsolute(s.src),o=this.promiseCache[n];if(o){let a=await o.promise;delete this.promiseCache[n],await o.parser?.unload?.(a,s,this);}});await Promise.all(i);}_validateParsers(){this._parsersValidated=true,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,t)=>(t.name?e[t.name]&&F(`[Assets] loadParser name conflict "${t.name}"`):F("[Assets] loadParser should have a name"),{...e,[t.name]:t}),{});}};});function Qt(r,e){if(Array.isArray(e)){for(let t of e)if(r.startsWith(`data:${t}`))return true;return false}return r.startsWith(`data:${e}`)}var tn=f(()=>{});function We(r,e){let t=r.split("?")[0],i=De.extname(t).toLowerCase();return Array.isArray(e)?e.includes(i):i===e}var hr=f(()=>{fs();});var KI,ZI,Rx,NS=f(()=>{Se();E();tn();hr();ar();KI=".json",ZI="application/json",Rx={extension:{type:g.LoadParser,priority:Me.Low},name:"loadJson",test(r){return Qt(r,ZI)||We(r,KI)},async load(r){return await(await V.get().fetch(r)).json()}};});var QI,JI,Mx,HS=f(()=>{Se();E();tn();hr();ar();QI=".txt",JI="text/plain",Mx={name:"loadTxt",extension:{type:g.LoadParser,priority:Me.Low,name:"loadTxt"},test(r){return Qt(r,JI)||We(r,QI)},async load(r){return await(await V.get().fetch(r)).text()}};});function VS(r){let e=De.extname(r),s=De.basename(r,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)),n=s.length>0;for(let a of s)if(!a.match(ik)){n=false;break}let o=s.join(" ");return n||(o=`"${o.replace(/[\\"]/g,"\\$&")}"`),o}function nk(r){return sk.test(r)?r:encodeURI(r)}var ek,tk,rk,ik,sk,Dx,zS=f(()=>{Se();E();_e();fs();ni();tn();hr();ar();ek=["normal","bold","100","200","300","400","500","600","700","800","900"],tk=[".ttf",".otf",".woff",".woff2"],rk=["font/ttf","font/otf","font/woff","font/woff2"],ik=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;sk=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;Dx={extension:{type:g.LoadParser,priority:Me.Low},name:"loadWebFont",test(r){return Qt(r,rk)||We(r,tk)},async load(r,e){let t=V.get().getFontFaceSet();if(t){let i=[],s=e.data?.family??VS(r),n=e.data?.weights?.filter(a=>ek.includes(a))??["normal"],o=e.data??{};for(let a=0;a<n.length;a++){let u=n[a],l=new FontFace(s,`url(${nk(r)})`,{...o,weight:u});await l.load(),t.add(l),i.push(l);}return de.set(`${s}-and-url`,{url:r,fontFaces:i}),i.length===1?i[0]:i}return F("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(r){(Array.isArray(r)?r:[r]).forEach(e=>{de.remove(`${e.family}-and-url`),V.get().getFontFaceSet().delete(e);});}};});function rn(r,e=1){let t=Pt.RETINA_PREFIX?.exec(r);return t?parseFloat(t[1]):e}var Nh=f(()=>{ps();});function kt(r,e,t){r.label=t,r._sourceOrigin=t;let i=new C({source:r,label:t}),s=()=>{delete e.promiseCache[t],de.has(t)&&de.remove(t);};return i.source.once("destroy",()=>{e.promiseCache[t]&&(F("[Assets] A TextureSource managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the TextureSource."),s());}),i.once("destroy",()=>{r.destroyed||(F("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),s());}),i}var Xi=f(()=>{ce();_e();ni();});async function uk(r,e,t,i){let n=await(await V.get().fetch(r)).blob(),o=URL.createObjectURL(n),a=new Image;a.src=o,a.crossOrigin=i,await a.decode(),URL.revokeObjectURL(o);let u=document.createElement("canvas"),l=u.getContext("2d"),c=e.data?.resolution||rn(r),h=e.data?.width??a.width,d=e.data?.height??a.height;u.width=h*c,u.height=d*c,l.drawImage(a,0,0,h*c,d*c);let{parseAsGraphicsContext:p,..._}=e.data??{},b=new Rt({resource:u,alphaMode:"premultiply-alpha-on-upload",resolution:c,..._});return kt(b,t,r)}async function lk(r){let t=await(await V.get().fetch(r)).text(),i=new Je;return i.svg(t),i}var ok,ak,Ix,WS=f(()=>{Se();E();Gn();Zn();Nh();tn();hr();ar();Xi();ok=".svg",ak="image/svg+xml",Ix={extension:{type:g.LoadParser,priority:Me.Low,name:"loadSVG"},name:"loadSVG",config:{crossOrigin:"anonymous",parseAsGraphicsContext:false},test(r){return Qt(r,ak)||We(r,ok)},async load(r,e,t){return e.data?.parseAsGraphicsContext??this.config.parseAsGraphicsContext?lk(r):uk(r,e,t,this.config.crossOrigin)},unload(r){r.destroy(true);}};});var ck,Ku,Zu,pw=f(()=>{ck=`(function () {
|
|
2042
2042
|
'use strict';
|
|
2043
2043
|
|
|
2044
2044
|
const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
|
|
@@ -2088,7 +2088,7 @@ ${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=Ct(e
|
|
|
2088
2088
|
};
|
|
2089
2089
|
|
|
2090
2090
|
})();
|
|
2091
|
-
`,Qu=null,Hh=class{constructor(){Qu||(Qu=URL.createObjectURL(new Blob([hk],{type:"application/javascript"}))),this.worker=new Worker(Qu);}};Hh.revokeObjectURL=function(){Qu&&(URL.revokeObjectURL(Qu),Qu=null);};});var gw,XS,YS,Vh,$S=f(()=>{pw();mw();gw=0,YS=class{constructor(){this._initialized=false,this._createdWorkers=0,this._workerPool=[],this._queue=[],this._resolveHash={};}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{let{worker:t}=new Zu;t.addEventListener("message",i=>{t.terminate(),Zu.revokeObjectURL(),e(i.data);});}),this._isImageBitmapSupported)}loadImageBitmap(e,t){return this._run("loadImageBitmap",[e,t?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=true);}_getWorker(){XS===void 0&&(XS=navigator.hardwareConcurrency||4);let e=this._workerPool.pop();return !e&&this._createdWorkers<XS&&(this._createdWorkers++,e=new Hh().worker,e.addEventListener("message",t=>{this._complete(t.data),this._returnWorker(t.target),this._next();})),e}_returnWorker(e){this._workerPool.push(e);}_complete(e){e.error!==void 0?this._resolveHash[e.uuid].reject(e.error):this._resolveHash[e.uuid].resolve(e.data),this._resolveHash[e.uuid]=null;}async _run(e,t){await this._initWorkers();let i=new Promise((s,n)=>{this._queue.push({id:e,arguments:t,resolve:s,reject:n});});return this._next(),i}_next(){if(!this._queue.length)return;let e=this._getWorker();if(!e)return;let t=this._queue.pop(),i=t.id;this._resolveHash[gw]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:gw++,id:i});}},Vh=new YS;});async function jS(r,e){let t=await V.get().fetch(r);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${t.status} ${t.statusText}`);let i=await t.blob();return e?.data?.alphaMode==="premultiplied-alpha"?createImageBitmap(i,{premultiplyAlpha:"none"}):createImageBitmap(i)}var dk,fk,Ju,kx=f(()=>{Se();E();Gn();Nh();tn();hr();$S();ar();Xi();dk=[".jpeg",".jpg",".png",".webp",".avif"],fk=["image/jpeg","image/png","image/webp","image/avif"];Ju={name:"loadTextures",extension:{type:m.LoadParser,priority:Me.High,name:"loadTextures"},config:{preferWorkers:true,preferCreateImageBitmap:true,crossOrigin:"anonymous"},test(r){return Qt(r,fk)||We(r,dk)},async load(r,e,t){let i=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await Vh.isImageBitmapSupported()?i=await Vh.loadImageBitmap(r,e):i=await jS(r,e):i=await new Promise((n,o)=>{i=new Image,i.crossOrigin=this.config.crossOrigin,i.src=r,i.complete?n(i):(i.onload=()=>{n(i);},i.onerror=o);});let s=new Rt({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:e.data?.resolution||rn(r),...e.data});return kt(s,t,r)},unload(r){r.destroy(true);}};});function qS(r,e,t){t===void 0&&!e.startsWith("data:")?r.crossOrigin=ZS(e):t!==false&&(r.crossOrigin=typeof t=="string"?t:"anonymous");}function KS(r){return new Promise((e,t)=>{r.addEventListener("canplaythrough",i),r.addEventListener("error",s),r.load();function i(){n(),e();}function s(o){n(),t(o);}function n(){r.removeEventListener("canplaythrough",i),r.removeEventListener("error",s);}})}function ZS(r,e=globalThis.location){if(r.startsWith("data:"))return "";e||(e=globalThis.location);let t=new URL(r,document.baseURI);return t.hostname!==e.hostname||t.port!==e.port||t.protocol!==e.protocol?"anonymous":""}var xw,pk,Fx,QS=f(()=>{E();zf();Hf();Nh();tn();hr();Xi();xw=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],pk=xw.map(r=>`video/${r.substring(1)}`);Fx={name:"loadVideo",extension:{type:m.LoadParser,name:"loadVideo"},test(r){let e=Qt(r,pk),t=We(r,xw);return e||t},async load(r,e,t){let i={..._s.defaultOptions,resolution:e.data?.resolution||rn(r),alphaMode:e.data?.alphaMode||await Fa(),...e.data},s=document.createElement("video"),n={preload:i.autoLoad!==false?"auto":void 0,"webkit-playsinline":i.playsinline!==false?"":void 0,playsinline:i.playsinline!==false?"":void 0,muted:i.muted===true?"":void 0,loop:i.loop===true?"":void 0,autoplay:i.autoPlay!==false?"":void 0};Object.keys(n).forEach(u=>{let l=n[u];l!==void 0&&s.setAttribute(u,l);}),i.muted===true&&(s.muted=true),qS(s,r,i.crossorigin);let o=document.createElement("source"),a;if(r.startsWith("data:"))a=r.slice(5,r.indexOf(";"));else if(!r.startsWith("blob:")){let u=r.split("?")[0].slice(r.lastIndexOf(".")+1).toLowerCase();a=_s.MIME_TYPES[u]||`video/${u}`;}return o.src=r,a&&(o.type=a),new Promise(u=>{let l=async()=>{let c=new _s({...i,resource:s});s.removeEventListener("canplay",l),e.data.preload&&await KS(s),u(kt(c,t,r));};i.preload&&!i.autoPlay&&s.load(),s.addEventListener("canplay",l),s.appendChild(o);})},unload(r){r.destroy(true);}};});var el,Ox=f(()=>{E();kx();ps();el={extension:{type:m.ResolveParser,name:"resolveTexture"},test:Ju.test,parse:r=>({resolution:parseFloat(Pt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})};});var Gx,JS=f(()=>{E();ps();Ox();Gx={extension:{type:m.ResolveParser,priority:-2,name:"resolveJson"},test:r=>Pt.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:el.parse};});var zh,et,_w,bw=f(()=>{E();RS();_e();MS();ni();DS();IS();kS();FS();OS();GS();US();LS();NS();HS();zS();WS();kx();QS();JS();Ox();ps();Ia();lc();zh=class{constructor(){this._detections=[],this._initialized=false,this.resolver=new Pt,this.loader=new qu,this.cache=de,this._backgroundLoader=new $u(this.loader),this._backgroundLoader.active=true,this.reset();}async init(e={}){if(this._initialized){F("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=true,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let n=e.manifest;typeof n=="string"&&(n=await this.load(n)),this.resolver.addManifest(n);}let t=e.texturePreference?.resolution??1,i=typeof t=="number"?[t]:t,s=await this._detectFormats({preferredFormats:e.texturePreference?.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:i}}),e.preferences&&this.setPreferences(e.preferences);}add(e){this.resolver.add(e);}async load(e,t){this._initialized||await this.init();let i=ki(e),s=Ct(e).map(a=>{if(typeof a!="string"){let u=this.resolver.getAlias(a);return u.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(u)?u[0]:u}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),n=this.resolver.resolve(s),o=await this._mapLoadToResolve(n,t);return i?o[s[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t);}async loadBundle(e,t){this._initialized||await this.init();let i=false;typeof e=="string"&&(i=true,e=[e]);let s=this.resolver.resolveBundle(e),n={},o=Object.keys(s),a=0,u=0,l=()=>{t?.(++a/u);},c=o.map(h=>{let d=s[h];return u+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(p=>{n[h]=p;})});return await Promise.all(c),i?n[e[0]]:n}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);let t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t));}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);let t=this.resolver.resolveBundle(e);Object.values(t).forEach(i=>{this._backgroundLoader.add(Object.values(i));});}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=false;}get(e){if(typeof e=="string")return de.get(e);let t={};for(let i=0;i<e.length;i++)t[i]=de.get(e[i]);return t}async _mapLoadToResolve(e,t){let i=[...new Set(Object.values(e))];this._backgroundLoader.active=false;let s=await this.loader.load(i,t);this._backgroundLoader.active=true;let n={};return i.forEach(o=>{let a=s[o.src],u=[o.src];o.alias&&u.push(...o.alias),u.forEach(l=>{n[l]=a;}),de.set(u,a);}),n}async unload(e){this._initialized||await this.init();let t=Ct(e).map(s=>typeof s!="string"?s.src:s),i=this.resolver.resolve(t);await this._unloadFromResolved(i);}async unloadBundle(e){this._initialized||await this.init(),e=Ct(e);let t=this.resolver.resolveBundle(e),i=Object.keys(t).map(s=>this._unloadFromResolved(t[s]));await Promise.all(i);}async _unloadFromResolved(e){let t=Object.values(e);t.forEach(i=>{de.remove(i.src);}),await this.loader.unload(t);}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(let i of e.detections)e.skipDetections||await i.test()?t=await i.add(t):e.skipDetections||(t=await i.remove(t));return t=t.filter((i,s)=>t.indexOf(i)===s),t}get detections(){return this._detections}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(i=>i in e).forEach(i=>{t.config[i]=e[i];});});}},et=new zh;O.handleByList(m.LoadParser,et.loader.parsers).handleByList(m.ResolveParser,et.resolver.parsers).handleByList(m.CacheParser,et.cache.parsers).handleByList(m.DetectionParser,et.detections);O.add(Tx,Ax,Ex,Bx,Cx,Px,wx,Rx,Mx,Dx,Ix,Ju,Fx,vx,yx,el,Gx);_w={loader:m.LoadParser,resolver:m.ResolveParser,cache:m.CacheParser,detection:m.DetectionParser};O.handle(m.Asset,r=>{let e=r.ref;Object.entries(_w).filter(([t])=>!!e[t]).forEach(([t,i])=>O.add(Object.assign(e[t],{extension:e[t].extension??i})));},r=>{let e=r.ref;Object.keys(_w).filter(t=>!!e[t]).forEach(t=>O.remove(e[t]));});});var yw,vw=f(()=>{E();vu();Tu();yw={extension:{type:m.DetectionParser,priority:3},test:async()=>!!(await pi()||fi()),add:async r=>[...r,"basis"],remove:async r=>r.filter(e=>e!=="basis")};});var Br,tl=f(()=>{ct();Br=class extends oe{constructor(e){super(e),this.uploadMethodId="compressed",this.resource=e.resource,this.mipLevelCount=this.resource.length;}};});function Wh(){if(Ux)return Ux;let e=document.createElement("canvas").getContext("webgl");return e?(Ux=[...e.getExtension("EXT_texture_compression_bptc")?["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...e.getExtension("WEBGL_compressed_texture_s3tc")?["bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"]:[],...e.getExtension("WEBGL_compressed_texture_s3tc_srgb")?["bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"]:[],...e.getExtension("EXT_texture_compression_rgtc")?["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"]:[],...e.getExtension("WEBGL_compressed_texture_etc")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","eac-r11unorm","eac-rg11unorm"]:[],...e.getExtension("WEBGL_compressed_texture_astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],Ux):[]}var Ux,e1=f(()=>{});async function Xh(){if(Lx)return Lx;let r=await V.get().getNavigator().gpu.requestAdapter();return Lx=[...r.features.has("texture-compression-bc")?["bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...r.features.has("texture-compression-etc2")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"]:[],...r.features.has("texture-compression-astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],Lx}var Lx,t1=f(()=>{Se();});async function rl(){return Nx!==void 0||(Nx=await(async()=>{let r=await pi(),e=fi();if(r&&e){let t=await Xh(),i=Wh();return t.filter(s=>i.includes(s))}else {if(r)return await Xh();if(e)return Wh()}return []})()),Nx}var Nx,Hx=f(()=>{vu();Tu();e1();t1();});async function gi(){if(Vx!==void 0)return Vx;let r=await rl();return Vx=[...r1,...r],Vx}var r1,Vx,il=f(()=>{Hx();r1=["r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb9e5ufloat","rgb10a2unorm","rg11b10ufloat","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8"];});var mk,sl,Yh,Tw=f(()=>{mk=`(function () {
|
|
2091
|
+
`,Qu=null,Hh=class{constructor(){Qu||(Qu=URL.createObjectURL(new Blob([hk],{type:"application/javascript"}))),this.worker=new Worker(Qu);}};Hh.revokeObjectURL=function(){Qu&&(URL.revokeObjectURL(Qu),Qu=null);};});var gw,XS,YS,Vh,$S=f(()=>{pw();mw();gw=0,YS=class{constructor(){this._initialized=false,this._createdWorkers=0,this._workerPool=[],this._queue=[],this._resolveHash={};}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{let{worker:t}=new Zu;t.addEventListener("message",i=>{t.terminate(),Zu.revokeObjectURL(),e(i.data);});}),this._isImageBitmapSupported)}loadImageBitmap(e,t){return this._run("loadImageBitmap",[e,t?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=true);}_getWorker(){XS===void 0&&(XS=navigator.hardwareConcurrency||4);let e=this._workerPool.pop();return !e&&this._createdWorkers<XS&&(this._createdWorkers++,e=new Hh().worker,e.addEventListener("message",t=>{this._complete(t.data),this._returnWorker(t.target),this._next();})),e}_returnWorker(e){this._workerPool.push(e);}_complete(e){e.error!==void 0?this._resolveHash[e.uuid].reject(e.error):this._resolveHash[e.uuid].resolve(e.data),this._resolveHash[e.uuid]=null;}async _run(e,t){await this._initWorkers();let i=new Promise((s,n)=>{this._queue.push({id:e,arguments:t,resolve:s,reject:n});});return this._next(),i}_next(){if(!this._queue.length)return;let e=this._getWorker();if(!e)return;let t=this._queue.pop(),i=t.id;this._resolveHash[gw]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:gw++,id:i});}},Vh=new YS;});async function jS(r,e){let t=await V.get().fetch(r);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${t.status} ${t.statusText}`);let i=await t.blob();return e?.data?.alphaMode==="premultiplied-alpha"?createImageBitmap(i,{premultiplyAlpha:"none"}):createImageBitmap(i)}var dk,fk,Ju,kx=f(()=>{Se();E();Gn();Nh();tn();hr();$S();ar();Xi();dk=[".jpeg",".jpg",".png",".webp",".avif"],fk=["image/jpeg","image/png","image/webp","image/avif"];Ju={name:"loadTextures",extension:{type:g.LoadParser,priority:Me.High,name:"loadTextures"},config:{preferWorkers:true,preferCreateImageBitmap:true,crossOrigin:"anonymous"},test(r){return Qt(r,fk)||We(r,dk)},async load(r,e,t){let i=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await Vh.isImageBitmapSupported()?i=await Vh.loadImageBitmap(r,e):i=await jS(r,e):i=await new Promise((n,o)=>{i=new Image,i.crossOrigin=this.config.crossOrigin,i.src=r,i.complete?n(i):(i.onload=()=>{n(i);},i.onerror=o);});let s=new Rt({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:e.data?.resolution||rn(r),...e.data});return kt(s,t,r)},unload(r){r.destroy(true);}};});function qS(r,e,t){t===void 0&&!e.startsWith("data:")?r.crossOrigin=ZS(e):t!==false&&(r.crossOrigin=typeof t=="string"?t:"anonymous");}function KS(r){return new Promise((e,t)=>{r.addEventListener("canplaythrough",i),r.addEventListener("error",s),r.load();function i(){n(),e();}function s(o){n(),t(o);}function n(){r.removeEventListener("canplaythrough",i),r.removeEventListener("error",s);}})}function ZS(r,e=globalThis.location){if(r.startsWith("data:"))return "";e||(e=globalThis.location);let t=new URL(r,document.baseURI);return t.hostname!==e.hostname||t.port!==e.port||t.protocol!==e.protocol?"anonymous":""}var xw,pk,Fx,QS=f(()=>{E();zf();Hf();Nh();tn();hr();Xi();xw=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],pk=xw.map(r=>`video/${r.substring(1)}`);Fx={name:"loadVideo",extension:{type:g.LoadParser,name:"loadVideo"},test(r){let e=Qt(r,pk),t=We(r,xw);return e||t},async load(r,e,t){let i={..._s.defaultOptions,resolution:e.data?.resolution||rn(r),alphaMode:e.data?.alphaMode||await Fa(),...e.data},s=document.createElement("video"),n={preload:i.autoLoad!==false?"auto":void 0,"webkit-playsinline":i.playsinline!==false?"":void 0,playsinline:i.playsinline!==false?"":void 0,muted:i.muted===true?"":void 0,loop:i.loop===true?"":void 0,autoplay:i.autoPlay!==false?"":void 0};Object.keys(n).forEach(u=>{let l=n[u];l!==void 0&&s.setAttribute(u,l);}),i.muted===true&&(s.muted=true),qS(s,r,i.crossorigin);let o=document.createElement("source"),a;if(r.startsWith("data:"))a=r.slice(5,r.indexOf(";"));else if(!r.startsWith("blob:")){let u=r.split("?")[0].slice(r.lastIndexOf(".")+1).toLowerCase();a=_s.MIME_TYPES[u]||`video/${u}`;}return o.src=r,a&&(o.type=a),new Promise(u=>{let l=async()=>{let c=new _s({...i,resource:s});s.removeEventListener("canplay",l),e.data.preload&&await KS(s),u(kt(c,t,r));};i.preload&&!i.autoPlay&&s.load(),s.addEventListener("canplay",l),s.appendChild(o);})},unload(r){r.destroy(true);}};});var el,Ox=f(()=>{E();kx();ps();el={extension:{type:g.ResolveParser,name:"resolveTexture"},test:Ju.test,parse:r=>({resolution:parseFloat(Pt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})};});var Gx,JS=f(()=>{E();ps();Ox();Gx={extension:{type:g.ResolveParser,priority:-2,name:"resolveJson"},test:r=>Pt.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:el.parse};});var zh,et,_w,bw=f(()=>{E();RS();_e();MS();ni();DS();IS();kS();FS();OS();GS();US();LS();NS();HS();zS();WS();kx();QS();JS();Ox();ps();Ia();lc();zh=class{constructor(){this._detections=[],this._initialized=false,this.resolver=new Pt,this.loader=new qu,this.cache=de,this._backgroundLoader=new $u(this.loader),this._backgroundLoader.active=true,this.reset();}async init(e={}){if(this._initialized){F("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=true,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let n=e.manifest;typeof n=="string"&&(n=await this.load(n)),this.resolver.addManifest(n);}let t=e.texturePreference?.resolution??1,i=typeof t=="number"?[t]:t,s=await this._detectFormats({preferredFormats:e.texturePreference?.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:i}}),e.preferences&&this.setPreferences(e.preferences);}add(e){this.resolver.add(e);}async load(e,t){this._initialized||await this.init();let i=ki(e),s=Ct(e).map(a=>{if(typeof a!="string"){let u=this.resolver.getAlias(a);return u.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(u)?u[0]:u}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),n=this.resolver.resolve(s),o=await this._mapLoadToResolve(n,t);return i?o[s[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t);}async loadBundle(e,t){this._initialized||await this.init();let i=false;typeof e=="string"&&(i=true,e=[e]);let s=this.resolver.resolveBundle(e),n={},o=Object.keys(s),a=0,u=0,l=()=>{t?.(++a/u);},c=o.map(h=>{let d=s[h];return u+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(p=>{n[h]=p;})});return await Promise.all(c),i?n[e[0]]:n}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);let t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t));}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);let t=this.resolver.resolveBundle(e);Object.values(t).forEach(i=>{this._backgroundLoader.add(Object.values(i));});}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=false;}get(e){if(typeof e=="string")return de.get(e);let t={};for(let i=0;i<e.length;i++)t[i]=de.get(e[i]);return t}async _mapLoadToResolve(e,t){let i=[...new Set(Object.values(e))];this._backgroundLoader.active=false;let s=await this.loader.load(i,t);this._backgroundLoader.active=true;let n={};return i.forEach(o=>{let a=s[o.src],u=[o.src];o.alias&&u.push(...o.alias),u.forEach(l=>{n[l]=a;}),de.set(u,a);}),n}async unload(e){this._initialized||await this.init();let t=Ct(e).map(s=>typeof s!="string"?s.src:s),i=this.resolver.resolve(t);await this._unloadFromResolved(i);}async unloadBundle(e){this._initialized||await this.init(),e=Ct(e);let t=this.resolver.resolveBundle(e),i=Object.keys(t).map(s=>this._unloadFromResolved(t[s]));await Promise.all(i);}async _unloadFromResolved(e){let t=Object.values(e);t.forEach(i=>{de.remove(i.src);}),await this.loader.unload(t);}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(let i of e.detections)e.skipDetections||await i.test()?t=await i.add(t):e.skipDetections||(t=await i.remove(t));return t=t.filter((i,s)=>t.indexOf(i)===s),t}get detections(){return this._detections}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(i=>i in e).forEach(i=>{t.config[i]=e[i];});});}},et=new zh;O.handleByList(g.LoadParser,et.loader.parsers).handleByList(g.ResolveParser,et.resolver.parsers).handleByList(g.CacheParser,et.cache.parsers).handleByList(g.DetectionParser,et.detections);O.add(Tx,Ax,Ex,Bx,Cx,Px,wx,Rx,Mx,Dx,Ix,Ju,Fx,vx,yx,el,Gx);_w={loader:g.LoadParser,resolver:g.ResolveParser,cache:g.CacheParser,detection:g.DetectionParser};O.handle(g.Asset,r=>{let e=r.ref;Object.entries(_w).filter(([t])=>!!e[t]).forEach(([t,i])=>O.add(Object.assign(e[t],{extension:e[t].extension??i})));},r=>{let e=r.ref;Object.keys(_w).filter(t=>!!e[t]).forEach(t=>O.remove(e[t]));});});var yw,vw=f(()=>{E();vu();Tu();yw={extension:{type:g.DetectionParser,priority:3},test:async()=>!!(await pi()||fi()),add:async r=>[...r,"basis"],remove:async r=>r.filter(e=>e!=="basis")};});var Br,tl=f(()=>{ct();Br=class extends oe{constructor(e){super(e),this.uploadMethodId="compressed",this.resource=e.resource,this.mipLevelCount=this.resource.length;}};});function Wh(){if(Ux)return Ux;let e=document.createElement("canvas").getContext("webgl");return e?(Ux=[...e.getExtension("EXT_texture_compression_bptc")?["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...e.getExtension("WEBGL_compressed_texture_s3tc")?["bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"]:[],...e.getExtension("WEBGL_compressed_texture_s3tc_srgb")?["bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"]:[],...e.getExtension("EXT_texture_compression_rgtc")?["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"]:[],...e.getExtension("WEBGL_compressed_texture_etc")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","eac-r11unorm","eac-rg11unorm"]:[],...e.getExtension("WEBGL_compressed_texture_astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],Ux):[]}var Ux,e1=f(()=>{});async function Xh(){if(Lx)return Lx;let r=await V.get().getNavigator().gpu.requestAdapter();return Lx=[...r.features.has("texture-compression-bc")?["bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...r.features.has("texture-compression-etc2")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"]:[],...r.features.has("texture-compression-astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],Lx}var Lx,t1=f(()=>{Se();});async function rl(){return Nx!==void 0||(Nx=await(async()=>{let r=await pi(),e=fi();if(r&&e){let t=await Xh(),i=Wh();return t.filter(s=>i.includes(s))}else {if(r)return await Xh();if(e)return Wh()}return []})()),Nx}var Nx,Hx=f(()=>{vu();Tu();e1();t1();});async function gi(){if(Vx!==void 0)return Vx;let r=await rl();return Vx=[...r1,...r],Vx}var r1,Vx,il=f(()=>{Hx();r1=["r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb9e5ufloat","rgb10a2unorm","rg11b10ufloat","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8"];});var mk,sl,Yh,Tw=f(()=>{mk=`(function () {
|
|
2092
2092
|
'use strict';
|
|
2093
2093
|
|
|
2094
2094
|
function createLevelBuffers(basisTexture, basisTranscoderFormat) {
|
|
@@ -2224,8 +2224,8 @@ ${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=Ct(e
|
|
|
2224
2224
|
};
|
|
2225
2225
|
|
|
2226
2226
|
})();
|
|
2227
|
-
`,sl=null,Yh=class{constructor(){sl||(sl=URL.createObjectURL(new Blob([mk],{type:"application/javascript"}))),this.worker=new Worker(sl);}};Yh.revokeObjectURL=function(){sl&&(URL.revokeObjectURL(sl),sl=null);};});function Sw(r){Object.assign(nl,r);}var nl,i1=f(()=>{nl={jsUrl:"https://files.pixijs.download/transcoders/basis/basis_transcoder.js",wasmUrl:"https://files.pixijs.download/transcoders/basis/basis_transcoder.wasm"};});function gk(r){return $h||($h=new Yh().worker,$h.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load Basis texture",i),Ew[i](s);},$h.postMessage({type:"init",jsUrl:nl.jsUrl,wasmUrl:nl.wasmUrl,supportedTextures:r})),$h}function zx(r,e){let t=gk(e);return new Promise(i=>{Ew[r]=i,t.postMessage({type:"load",url:r});})}var $h,Ew,s1=f(()=>{Tw();i1();Ew={};});var Aw,Cw=f(()=>{ar();Xi();hr();E();tl();il();s1();Aw={extension:{type:m.LoadParser,priority:Me.High,name:"loadBasis"},name:"loadBasis",test(r){return We(r,[".basis"])},async load(r,e,t){let i=await gi(),s=await zx(r,i),n=new Br(s);return kt(n,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});function Pw(r,e){let t=r.getNumImages(),i=r.getNumLevels(0);if(!r.startTranscoding())throw new Error("startTranscoding failed");let n=[];for(let o=0;o<i;++o)for(let a=0;a<t;++a){let u=r.getImageTranscodedSizeInBytes(a,o,e),l=new Uint8Array(u);if(!r.transcodeImage(l,a,o,e,1,0))throw new Error("transcodeImage failed");n.push(l);}return n}var ww=f(()=>{});function Bw(r){let e=xk[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var xk,Rw=f(()=>{xk={"bc3-rgba-unorm":3,"bc7-rgba-unorm":6,"etc2-rgba8unorm":1,"astc-4x4-unorm":10,rgba8unorm:13,rgba4unorm:16};});function bt(r){return r.charCodeAt(0)+(r.charCodeAt(1)<<8)+(r.charCodeAt(2)<<16)+(r.charCodeAt(3)<<24)}var _k,bk,Wx,Xx,zt,jh,Ft,Q,Yx,n1=f(()=>{_k={MAGIC:0,SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19,PF_FLAGS:20,FOURCC:21,RGB_BITCOUNT:22,R_BIT_MASK:23,G_BIT_MASK:24,B_BIT_MASK:25,A_BIT_MASK:26},bk={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},Wx=(r=>(r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT",r))(Wx||{}),Xx=(r=>(r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D",r))(Xx||{});zt=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.R8G8B8=20]="R8G8B8",r[r.A8R8G8B8=21]="A8R8G8B8",r[r.X8R8G8B8=22]="X8R8G8B8",r[r.R5G6B5=23]="R5G6B5",r[r.X1R5G5B5=24]="X1R5G5B5",r[r.A1R5G5B5=25]="A1R5G5B5",r[r.A4R4G4B4=26]="A4R4G4B4",r[r.R3G3B2=27]="R3G3B2",r[r.A8=28]="A8",r[r.A8R3G3B2=29]="A8R3G3B2",r[r.X4R4G4B4=30]="X4R4G4B4",r[r.A2B10G10R10=31]="A2B10G10R10",r[r.A8B8G8R8=32]="A8B8G8R8",r[r.X8B8G8R8=33]="X8B8G8R8",r[r.G16R16=34]="G16R16",r[r.A2R10G10B10=35]="A2R10G10B10",r[r.A16B16G16R16=36]="A16B16G16R16",r[r.A8P8=40]="A8P8",r[r.P8=41]="P8",r[r.L8=50]="L8",r[r.A8L8=51]="A8L8",r[r.A4L4=52]="A4L4",r[r.V8U8=60]="V8U8",r[r.L6V5U5=61]="L6V5U5",r[r.X8L8V8U8=62]="X8L8V8U8",r[r.Q8W8V8U8=63]="Q8W8V8U8",r[r.V16U16=64]="V16U16",r[r.A2W10V10U10=67]="A2W10V10U10",r[r.Q16W16V16U16=110]="Q16W16V16U16",r[r.R16F=111]="R16F",r[r.G16R16F=112]="G16R16F",r[r.A16B16G16R16F=113]="A16B16G16R16F",r[r.R32F=114]="R32F",r[r.G32R32F=115]="G32R32F",r[r.A32B32G32R32F=116]="A32B32G32R32F",r[r.UYVY=bt("UYVY")]="UYVY",r[r.R8G8_B8G8=bt("RGBG")]="R8G8_B8G8",r[r.YUY2=bt("YUY2")]="YUY2",r[r.D3DFMT_G8R8_G8B8=bt("GRGB")]="D3DFMT_G8R8_G8B8",r[r.DXT1=bt("DXT1")]="DXT1",r[r.DXT2=bt("DXT2")]="DXT2",r[r.DXT3=bt("DXT3")]="DXT3",r[r.DXT4=bt("DXT4")]="DXT4",r[r.DXT5=bt("DXT5")]="DXT5",r[r.ATI1=bt("ATI1")]="ATI1",r[r.AT1N=bt("AT1N")]="AT1N",r[r.ATI2=bt("ATI2")]="ATI2",r[r.AT2N=bt("AT2N")]="AT2N",r[r.BC4U=bt("BC4U")]="BC4U",r[r.BC4S=bt("BC4S")]="BC4S",r[r.BC5U=bt("BC5U")]="BC5U",r[r.BC5S=bt("BC5S")]="BC5S",r[r.DX10=bt("DX10")]="DX10",r))(zt||{}),jh={[zt.DXT1]:"bc1-rgba-unorm",[zt.DXT2]:"bc2-rgba-unorm",[zt.DXT3]:"bc2-rgba-unorm",[zt.DXT4]:"bc3-rgba-unorm",[zt.DXT5]:"bc3-rgba-unorm",[zt.ATI1]:"bc4-r-unorm",[zt.BC4U]:"bc4-r-unorm",[zt.BC4S]:"bc4-r-snorm",[zt.ATI2]:"bc5-rg-unorm",[zt.BC5U]:"bc5-rg-unorm",[zt.BC5S]:"bc5-rg-snorm",36:"rgba16uint",110:"rgba16sint",111:"r16float",112:"rg16float",113:"rgba16float",114:"r32float",115:"rg32float",116:"rgba32float"},Ft={70:"bc1-rgba-unorm",71:"bc1-rgba-unorm",72:"bc1-rgba-unorm-srgb",73:"bc2-rgba-unorm",74:"bc2-rgba-unorm",75:"bc2-rgba-unorm-srgb",76:"bc3-rgba-unorm",77:"bc3-rgba-unorm",78:"bc3-rgba-unorm-srgb",79:"bc4-r-unorm",80:"bc4-r-unorm",81:"bc4-r-snorm",82:"bc5-rg-unorm",83:"bc5-rg-unorm",84:"bc5-rg-snorm",94:"bc6h-rgb-ufloat",95:"bc6h-rgb-ufloat",96:"bc6h-rgb-float",97:"bc7-rgba-unorm",98:"bc7-rgba-unorm",99:"bc7-rgba-unorm-srgb",28:"rgba8unorm",29:"rgba8unorm-srgb",87:"bgra8unorm",91:"bgra8unorm-srgb",41:"r32float",49:"rg8unorm",56:"r16uint",61:"r8unorm",24:"rgb10a2unorm",11:"rgba16uint",13:"rgba16sint",10:"rgba16float",54:"r16float",34:"rg16float",16:"rg32float",2:"rgba32float"},Q={MAGIC_VALUE:542327876,MAGIC_SIZE:4,HEADER_SIZE:124,HEADER_DX10_SIZE:20,PIXEL_FORMAT_FLAGS:{ALPHAPIXELS:1,ALPHA:2,FOURCC:4,RGB:64,RGBA:65,YUV:512,LUMINANCE:131072,LUMINANCEA:131073},RESOURCE_MISC_TEXTURECUBE:4,HEADER_FIELDS:_k,HEADER_DX10_FIELDS:bk,DXGI_FORMAT:Wx,D3D10_RESOURCE_DIMENSION:Xx,D3DFMT:zt},Yx={"bc1-rgba-unorm":8,"bc1-rgba-unorm-srgb":8,"bc2-rgba-unorm":16,"bc2-rgba-unorm-srgb":16,"bc3-rgba-unorm":16,"bc3-rgba-unorm-srgb":16,"bc4-r-unorm":8,"bc4-r-snorm":8,"bc5-rg-unorm":16,"bc5-rg-snorm":16,"bc6h-rgb-ufloat":16,"bc6h-rgb-float":16,"bc7-rgba-unorm":16,"bc7-rgba-unorm-srgb":16};});function $x(r,e){let{format:t,fourCC:i,width:s,height:n,dataOffset:o,mipmapCount:a}=vk(r);if(!e.includes(t))throw new Error(`Unsupported texture format: ${i} ${t}, supported: ${e}`);if(a<=1)return {format:t,width:s,height:n,resource:[new Uint8Array(r,o)],alphaMode:"no-premultiply-alpha"};let u=yk(t,s,n,o,a,r);return {format:t,width:s,height:n,resource:u,alphaMode:"no-premultiply-alpha"}}function yk(r,e,t,i,s,n){let o=[],a=Yx[r],u=e,l=t,c=i;for(let h=0;h<s;++h){let d=Math.ceil(Math.max(4,u)/4)*4,p=Math.ceil(Math.max(4,l)/4)*4,_=a?d/4*p/4*a:u*l*4,b=new Uint8Array(n,c,_);o.push(b),c+=_,u=Math.max(u>>1,1),l=Math.max(l>>1,1);}return o}function vk(r){let e=new Uint32Array(r,0,Q.HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(e[Q.HEADER_FIELDS.MAGIC]!==Q.MAGIC_VALUE)throw new Error("Invalid magic number in DDS header");let t=e[Q.HEADER_FIELDS.HEIGHT],i=e[Q.HEADER_FIELDS.WIDTH],s=Math.max(1,e[Q.HEADER_FIELDS.MIPMAP_COUNT]),n=e[Q.HEADER_FIELDS.PF_FLAGS],o=e[Q.HEADER_FIELDS.FOURCC],a=Tk(e,n,o,r),u=Q.MAGIC_SIZE+Q.HEADER_SIZE+(o===Q.D3DFMT.DX10?Q.HEADER_DX10_SIZE:0);return {format:a,fourCC:o,width:i,height:t,dataOffset:u,mipmapCount:s}}function Tk(r,e,t,i){if(e&Q.PIXEL_FORMAT_FLAGS.FOURCC){if(t===Q.D3DFMT.DX10){let s=new Uint32Array(i,Q.MAGIC_SIZE+Q.HEADER_SIZE,Q.HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(s[Q.HEADER_DX10_FIELDS.MISC_FLAG]===Q.RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(s[Q.HEADER_DX10_FIELDS.RESOURCE_DIMENSION]===Q.D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");let a=s[Q.HEADER_DX10_FIELDS.DXGI_FORMAT];if(a in Ft)return Ft[a];throw new Error(`DDSParser cannot parse texture data with DXGI format ${a}`)}if(t in jh)return jh[t];throw new Error(`DDSParser cannot parse texture data with fourCC format ${t}`)}if(e&Q.PIXEL_FORMAT_FLAGS.RGB||e&Q.PIXEL_FORMAT_FLAGS.RGBA)return Sk(r);throw e&Q.PIXEL_FORMAT_FLAGS.YUV?new Error("DDSParser does not supported YUV uncompressed texture data."):e&Q.PIXEL_FORMAT_FLAGS.LUMINANCE||e&Q.PIXEL_FORMAT_FLAGS.LUMINANCEA?new Error("DDSParser does not support single-channel (lumninance) texture data!"):e&Q.PIXEL_FORMAT_FLAGS.ALPHA||e&Q.PIXEL_FORMAT_FLAGS.ALPHAPIXELS?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!")}function Sk(r){let e=r[Q.HEADER_FIELDS.RGB_BITCOUNT],t=r[Q.HEADER_FIELDS.R_BIT_MASK],i=r[Q.HEADER_FIELDS.G_BIT_MASK],s=r[Q.HEADER_FIELDS.B_BIT_MASK],n=r[Q.HEADER_FIELDS.A_BIT_MASK];switch(e){case 32:if(t===255&&i===65280&&s===16711680&&n===4278190080)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM];if(t===16711680&&i===65280&&s===255&&n===4278190080)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM];if(t===1072693248&&i===1047552&&s===1023&&n===3221225472)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM];if(t===65535&&i===4294901760&&s===0&&n===0)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R16G16_UNORM];if(t===4294967295&&i===0&&s===0&&n===0)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT];break;case 24:break;case 16:if(t===31744&&i===992&&s===31&&n===32768)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM];if(t===63488&&i===2016&&s===31&&n===0)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM];if(t===3840&&i===240&&s===15&&n===61440)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM];if(t===255&&i===0&&s===0&&n===65280)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM];if(t===65535&&i===0&&s===0&&n===0)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM];break;case 8:if(t===255&&i===0&&s===0&&n===0)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM];break}throw new Error(`DDSParser does not support uncompressed texture with configuration:
|
|
2228
|
-
bitCount = ${e}, rBitMask = ${t}, gBitMask = ${i}, aBitMask = ${n}`)}var o1=f(()=>{n1();});var Mw,Dw=f(()=>{ar();Xi();hr();E();tl();il();o1();Mw={extension:{type:m.LoadParser,priority:Me.High,name:"loadDDS"},name:"loadDDS",test(r){return We(r,[".dds"])},async load(r,e,t){let i=await gi(),n=await(await fetch(r)).arrayBuffer(),o=$x(n,i),a=new Br(o);return kt(a,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});var a1,Ek,Ak,Ck,Pk,wk,Bk,Rk,Mk,Dk,Xe,u1=f(()=>{a1=(r=>(r[r.RGBA8_SNORM=36759]="RGBA8_SNORM",r[r.RGBA=6408]="RGBA",r[r.RGBA8UI=36220]="RGBA8UI",r[r.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",r[r.RGBA8I=36238]="RGBA8I",r[r.RGBA8=32856]="RGBA8",r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",r[r.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",r[r.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",r[r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",r[r.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",r[r.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",r[r.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",r[r.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",r[r.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",r[r.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",r[r.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",r[r.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",r[r.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",r[r.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",r[r.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",r[r.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",r[r.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",r[r.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",r[r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",r[r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",r[r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",r))(a1||{}),Ek={33776:"bc1-rgba-unorm",33777:"bc1-rgba-unorm",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",35916:"bc1-rgba-unorm-srgb",35917:"bc1-rgba-unorm-srgb",35918:"bc2-rgba-unorm-srgb",35919:"bc3-rgba-unorm-srgb",36283:"bc4-r-unorm",36284:"bc4-r-snorm",36285:"bc5-rg-unorm",36286:"bc5-rg-snorm",37488:"eac-r11unorm",37490:"eac-rg11snorm",37492:"etc2-rgb8unorm",37496:"etc2-rgba8unorm",37493:"etc2-rgb8unorm-srgb",37497:"etc2-rgba8unorm-srgb",37494:"etc2-rgb8a1unorm",37495:"etc2-rgb8a1unorm-srgb",37808:"astc-4x4-unorm",37840:"astc-4x4-unorm-srgb",37809:"astc-5x4-unorm",37841:"astc-5x4-unorm-srgb",37810:"astc-5x5-unorm",37842:"astc-5x5-unorm-srgb",37811:"astc-6x5-unorm",37843:"astc-6x5-unorm-srgb",37812:"astc-6x6-unorm",37844:"astc-6x6-unorm-srgb",37813:"astc-8x5-unorm",37845:"astc-8x5-unorm-srgb",37814:"astc-8x6-unorm",37846:"astc-8x6-unorm-srgb",37815:"astc-8x8-unorm",37847:"astc-8x8-unorm-srgb",37816:"astc-10x5-unorm",37848:"astc-10x5-unorm-srgb",37817:"astc-10x6-unorm",37849:"astc-10x6-unorm-srgb",37818:"astc-10x8-unorm",37850:"astc-10x8-unorm-srgb",37819:"astc-10x10-unorm",37851:"astc-10x10-unorm-srgb",37820:"astc-12x10-unorm",37852:"astc-12x10-unorm-srgb",37821:"astc-12x12-unorm",37853:"astc-12x12-unorm-srgb",36492:"bc7-rgba-unorm",36493:"bc7-rgba-unorm-srgb",36494:"bc6h-rgb-float",36495:"bc6h-rgb-ufloat",35907:"rgba8unorm-srgb",36759:"rgba8snorm",36220:"rgba8uint",36238:"rgba8sint",6408:"rgba8unorm"},Ak=[171,75,84,88,32,49,49,187,13,10,26,10],Ck={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},Pk=64,wk=67305985,Bk={5121:1,5123:2,5124:4,5125:4,5126:4,36193:8},Rk={6408:4,6407:3,33319:2,6403:1,6409:1,6410:2,6406:1},Mk={32819:2,32820:2,33635:2},Dk={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,36283:.5,36284:.5,36285:1,36286:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,37808:1,37840:1,37809:.8,37841:.8,37810:.64,37842:.64,37811:.53375,37843:.53375,37812:.445,37844:.445,37813:.4,37845:.4,37814:.33375,37846:.33375,37815:.25,37847:.25,37816:.32,37848:.32,37817:.26625,37849:.26625,37818:.2,37850:.2,37819:.16,37851:.16,37820:.13375,37852:.13375,37821:.11125,37853:.11125,36492:1,36493:1,36494:1,36495:1},Xe={FILE_HEADER_SIZE:Pk,FILE_IDENTIFIER:Ak,FORMATS_TO_COMPONENTS:Rk,INTERNAL_FORMAT_TO_BYTES_PER_PIXEL:Dk,INTERNAL_FORMAT_TO_TEXTURE_FORMATS:Ek,FIELDS:Ck,TYPES_TO_BYTES_PER_COMPONENT:Bk,TYPES_TO_BYTES_PER_PIXEL:Mk,ENDIANNESS:wk};});function jx(r,e){let t=new DataView(r);if(!Ok(t))throw new Error("Invalid KTX identifier in header");let{littleEndian:i,glType:s,glFormat:n,glInternalFormat:o,pixelWidth:a,pixelHeight:u,numberOfMipmapLevels:l,offset:c}=Fk(t),h=Xe.INTERNAL_FORMAT_TO_TEXTURE_FORMATS[o];if(!h)throw new Error(`Unknown texture format ${o}`);if(!e.includes(h))throw new Error(`Unsupported texture format: ${h}, supportedFormats: ${e}`);let d=kk(s,n,o),p=Ik(t,s,d,a,u,c,l,i);return {format:h,width:a,height:u,resource:p,alphaMode:"no-premultiply-alpha"}}function Ik(r,e,t,i,s,n,o,a){let u=i+3&-4,l=s+3&-4,c=i*s;e===0&&(c=u*l);let h=c*t,d=i,p=s,_=u,b=l,x=n,g=new Array(o);for(let v=0;v<o;v++){let T=r.getUint32(x,a),S=x+4;g[v]=new Uint8Array(r.buffer,S,h),S+=h,x+=T+4,x=x%4!==0?x+4-x%4:x,d=d>>1||1,p=p>>1||1,_=d+4-1&-4,b=p+4-1&-4,h=_*b*t;}return g}function kk(r,e,t){let i=Xe.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[t];if(r!==0&&(Xe.TYPES_TO_BYTES_PER_COMPONENT[r]?i=Xe.TYPES_TO_BYTES_PER_COMPONENT[r]*Xe.FORMATS_TO_COMPONENTS[e]:i=Xe.TYPES_TO_BYTES_PER_PIXEL[r]),i===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");return i}function Fk(r){let e=r.getUint32(Xe.FIELDS.ENDIANNESS,true)===Xe.ENDIANNESS,t=r.getUint32(Xe.FIELDS.GL_TYPE,e),i=r.getUint32(Xe.FIELDS.GL_FORMAT,e),s=r.getUint32(Xe.FIELDS.GL_INTERNAL_FORMAT,e),n=r.getUint32(Xe.FIELDS.PIXEL_WIDTH,e),o=r.getUint32(Xe.FIELDS.PIXEL_HEIGHT,e)||1,a=r.getUint32(Xe.FIELDS.PIXEL_DEPTH,e)||1,u=r.getUint32(Xe.FIELDS.NUMBER_OF_ARRAY_ELEMENTS,e)||1,l=r.getUint32(Xe.FIELDS.NUMBER_OF_FACES,e),c=r.getUint32(Xe.FIELDS.NUMBER_OF_MIPMAP_LEVELS,e),h=r.getUint32(Xe.FIELDS.BYTES_OF_KEY_VALUE_DATA,e);if(o===0||a!==1)throw new Error("Only 2D textures are supported");if(l!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");return {littleEndian:e,glType:t,glFormat:i,glInternalFormat:s,pixelWidth:n,pixelHeight:o,numberOfMipmapLevels:c,offset:Xe.FILE_HEADER_SIZE+h}}function Ok(r){for(let e=0;e<Xe.FILE_IDENTIFIER.length;e++)if(r.getUint8(e)!==Xe.FILE_IDENTIFIER[e])return false;return true}var l1=f(()=>{u1();});var Iw,kw=f(()=>{ar();Xi();hr();E();tl();il();l1();Iw={extension:{type:m.LoadParser,priority:Me.High,name:"loadKTX"},name:"loadKTX",test(r){return We(r,".ktx")},async load(r,e,t){let i=await gi(),n=await(await fetch(r)).arrayBuffer(),o=jx(n,i),a=new Br(o);return kt(a,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});var Gk,ol,qh,Fw=f(()=>{Gk=`(function () {
|
|
2227
|
+
`,sl=null,Yh=class{constructor(){sl||(sl=URL.createObjectURL(new Blob([mk],{type:"application/javascript"}))),this.worker=new Worker(sl);}};Yh.revokeObjectURL=function(){sl&&(URL.revokeObjectURL(sl),sl=null);};});function Sw(r){Object.assign(nl,r);}var nl,i1=f(()=>{nl={jsUrl:"https://files.pixijs.download/transcoders/basis/basis_transcoder.js",wasmUrl:"https://files.pixijs.download/transcoders/basis/basis_transcoder.wasm"};});function gk(r){return $h||($h=new Yh().worker,$h.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load Basis texture",i),Ew[i](s);},$h.postMessage({type:"init",jsUrl:nl.jsUrl,wasmUrl:nl.wasmUrl,supportedTextures:r})),$h}function zx(r,e){let t=gk(e);return new Promise(i=>{Ew[r]=i,t.postMessage({type:"load",url:r});})}var $h,Ew,s1=f(()=>{Tw();i1();Ew={};});var Aw,Cw=f(()=>{ar();Xi();hr();E();tl();il();s1();Aw={extension:{type:g.LoadParser,priority:Me.High,name:"loadBasis"},name:"loadBasis",test(r){return We(r,[".basis"])},async load(r,e,t){let i=await gi(),s=await zx(r,i),n=new Br(s);return kt(n,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});function Pw(r,e){let t=r.getNumImages(),i=r.getNumLevels(0);if(!r.startTranscoding())throw new Error("startTranscoding failed");let n=[];for(let o=0;o<i;++o)for(let a=0;a<t;++a){let u=r.getImageTranscodedSizeInBytes(a,o,e),l=new Uint8Array(u);if(!r.transcodeImage(l,a,o,e,1,0))throw new Error("transcodeImage failed");n.push(l);}return n}var ww=f(()=>{});function Bw(r){let e=xk[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var xk,Rw=f(()=>{xk={"bc3-rgba-unorm":3,"bc7-rgba-unorm":6,"etc2-rgba8unorm":1,"astc-4x4-unorm":10,rgba8unorm:13,rgba4unorm:16};});function bt(r){return r.charCodeAt(0)+(r.charCodeAt(1)<<8)+(r.charCodeAt(2)<<16)+(r.charCodeAt(3)<<24)}var _k,bk,Wx,Xx,zt,jh,Ft,Q,Yx,n1=f(()=>{_k={MAGIC:0,SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19,PF_FLAGS:20,FOURCC:21,RGB_BITCOUNT:22,R_BIT_MASK:23,G_BIT_MASK:24,B_BIT_MASK:25,A_BIT_MASK:26},bk={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},Wx=(r=>(r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT",r))(Wx||{}),Xx=(r=>(r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D",r))(Xx||{});zt=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.R8G8B8=20]="R8G8B8",r[r.A8R8G8B8=21]="A8R8G8B8",r[r.X8R8G8B8=22]="X8R8G8B8",r[r.R5G6B5=23]="R5G6B5",r[r.X1R5G5B5=24]="X1R5G5B5",r[r.A1R5G5B5=25]="A1R5G5B5",r[r.A4R4G4B4=26]="A4R4G4B4",r[r.R3G3B2=27]="R3G3B2",r[r.A8=28]="A8",r[r.A8R3G3B2=29]="A8R3G3B2",r[r.X4R4G4B4=30]="X4R4G4B4",r[r.A2B10G10R10=31]="A2B10G10R10",r[r.A8B8G8R8=32]="A8B8G8R8",r[r.X8B8G8R8=33]="X8B8G8R8",r[r.G16R16=34]="G16R16",r[r.A2R10G10B10=35]="A2R10G10B10",r[r.A16B16G16R16=36]="A16B16G16R16",r[r.A8P8=40]="A8P8",r[r.P8=41]="P8",r[r.L8=50]="L8",r[r.A8L8=51]="A8L8",r[r.A4L4=52]="A4L4",r[r.V8U8=60]="V8U8",r[r.L6V5U5=61]="L6V5U5",r[r.X8L8V8U8=62]="X8L8V8U8",r[r.Q8W8V8U8=63]="Q8W8V8U8",r[r.V16U16=64]="V16U16",r[r.A2W10V10U10=67]="A2W10V10U10",r[r.Q16W16V16U16=110]="Q16W16V16U16",r[r.R16F=111]="R16F",r[r.G16R16F=112]="G16R16F",r[r.A16B16G16R16F=113]="A16B16G16R16F",r[r.R32F=114]="R32F",r[r.G32R32F=115]="G32R32F",r[r.A32B32G32R32F=116]="A32B32G32R32F",r[r.UYVY=bt("UYVY")]="UYVY",r[r.R8G8_B8G8=bt("RGBG")]="R8G8_B8G8",r[r.YUY2=bt("YUY2")]="YUY2",r[r.D3DFMT_G8R8_G8B8=bt("GRGB")]="D3DFMT_G8R8_G8B8",r[r.DXT1=bt("DXT1")]="DXT1",r[r.DXT2=bt("DXT2")]="DXT2",r[r.DXT3=bt("DXT3")]="DXT3",r[r.DXT4=bt("DXT4")]="DXT4",r[r.DXT5=bt("DXT5")]="DXT5",r[r.ATI1=bt("ATI1")]="ATI1",r[r.AT1N=bt("AT1N")]="AT1N",r[r.ATI2=bt("ATI2")]="ATI2",r[r.AT2N=bt("AT2N")]="AT2N",r[r.BC4U=bt("BC4U")]="BC4U",r[r.BC4S=bt("BC4S")]="BC4S",r[r.BC5U=bt("BC5U")]="BC5U",r[r.BC5S=bt("BC5S")]="BC5S",r[r.DX10=bt("DX10")]="DX10",r))(zt||{}),jh={[zt.DXT1]:"bc1-rgba-unorm",[zt.DXT2]:"bc2-rgba-unorm",[zt.DXT3]:"bc2-rgba-unorm",[zt.DXT4]:"bc3-rgba-unorm",[zt.DXT5]:"bc3-rgba-unorm",[zt.ATI1]:"bc4-r-unorm",[zt.BC4U]:"bc4-r-unorm",[zt.BC4S]:"bc4-r-snorm",[zt.ATI2]:"bc5-rg-unorm",[zt.BC5U]:"bc5-rg-unorm",[zt.BC5S]:"bc5-rg-snorm",36:"rgba16uint",110:"rgba16sint",111:"r16float",112:"rg16float",113:"rgba16float",114:"r32float",115:"rg32float",116:"rgba32float"},Ft={70:"bc1-rgba-unorm",71:"bc1-rgba-unorm",72:"bc1-rgba-unorm-srgb",73:"bc2-rgba-unorm",74:"bc2-rgba-unorm",75:"bc2-rgba-unorm-srgb",76:"bc3-rgba-unorm",77:"bc3-rgba-unorm",78:"bc3-rgba-unorm-srgb",79:"bc4-r-unorm",80:"bc4-r-unorm",81:"bc4-r-snorm",82:"bc5-rg-unorm",83:"bc5-rg-unorm",84:"bc5-rg-snorm",94:"bc6h-rgb-ufloat",95:"bc6h-rgb-ufloat",96:"bc6h-rgb-float",97:"bc7-rgba-unorm",98:"bc7-rgba-unorm",99:"bc7-rgba-unorm-srgb",28:"rgba8unorm",29:"rgba8unorm-srgb",87:"bgra8unorm",91:"bgra8unorm-srgb",41:"r32float",49:"rg8unorm",56:"r16uint",61:"r8unorm",24:"rgb10a2unorm",11:"rgba16uint",13:"rgba16sint",10:"rgba16float",54:"r16float",34:"rg16float",16:"rg32float",2:"rgba32float"},Q={MAGIC_VALUE:542327876,MAGIC_SIZE:4,HEADER_SIZE:124,HEADER_DX10_SIZE:20,PIXEL_FORMAT_FLAGS:{ALPHAPIXELS:1,ALPHA:2,FOURCC:4,RGB:64,RGBA:65,YUV:512,LUMINANCE:131072,LUMINANCEA:131073},RESOURCE_MISC_TEXTURECUBE:4,HEADER_FIELDS:_k,HEADER_DX10_FIELDS:bk,DXGI_FORMAT:Wx,D3D10_RESOURCE_DIMENSION:Xx,D3DFMT:zt},Yx={"bc1-rgba-unorm":8,"bc1-rgba-unorm-srgb":8,"bc2-rgba-unorm":16,"bc2-rgba-unorm-srgb":16,"bc3-rgba-unorm":16,"bc3-rgba-unorm-srgb":16,"bc4-r-unorm":8,"bc4-r-snorm":8,"bc5-rg-unorm":16,"bc5-rg-snorm":16,"bc6h-rgb-ufloat":16,"bc6h-rgb-float":16,"bc7-rgba-unorm":16,"bc7-rgba-unorm-srgb":16};});function $x(r,e){let{format:t,fourCC:i,width:s,height:n,dataOffset:o,mipmapCount:a}=vk(r);if(!e.includes(t))throw new Error(`Unsupported texture format: ${i} ${t}, supported: ${e}`);if(a<=1)return {format:t,width:s,height:n,resource:[new Uint8Array(r,o)],alphaMode:"no-premultiply-alpha"};let u=yk(t,s,n,o,a,r);return {format:t,width:s,height:n,resource:u,alphaMode:"no-premultiply-alpha"}}function yk(r,e,t,i,s,n){let o=[],a=Yx[r],u=e,l=t,c=i;for(let h=0;h<s;++h){let d=Math.ceil(Math.max(4,u)/4)*4,p=Math.ceil(Math.max(4,l)/4)*4,_=a?d/4*p/4*a:u*l*4,b=new Uint8Array(n,c,_);o.push(b),c+=_,u=Math.max(u>>1,1),l=Math.max(l>>1,1);}return o}function vk(r){let e=new Uint32Array(r,0,Q.HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(e[Q.HEADER_FIELDS.MAGIC]!==Q.MAGIC_VALUE)throw new Error("Invalid magic number in DDS header");let t=e[Q.HEADER_FIELDS.HEIGHT],i=e[Q.HEADER_FIELDS.WIDTH],s=Math.max(1,e[Q.HEADER_FIELDS.MIPMAP_COUNT]),n=e[Q.HEADER_FIELDS.PF_FLAGS],o=e[Q.HEADER_FIELDS.FOURCC],a=Tk(e,n,o,r),u=Q.MAGIC_SIZE+Q.HEADER_SIZE+(o===Q.D3DFMT.DX10?Q.HEADER_DX10_SIZE:0);return {format:a,fourCC:o,width:i,height:t,dataOffset:u,mipmapCount:s}}function Tk(r,e,t,i){if(e&Q.PIXEL_FORMAT_FLAGS.FOURCC){if(t===Q.D3DFMT.DX10){let s=new Uint32Array(i,Q.MAGIC_SIZE+Q.HEADER_SIZE,Q.HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(s[Q.HEADER_DX10_FIELDS.MISC_FLAG]===Q.RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(s[Q.HEADER_DX10_FIELDS.RESOURCE_DIMENSION]===Q.D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");let a=s[Q.HEADER_DX10_FIELDS.DXGI_FORMAT];if(a in Ft)return Ft[a];throw new Error(`DDSParser cannot parse texture data with DXGI format ${a}`)}if(t in jh)return jh[t];throw new Error(`DDSParser cannot parse texture data with fourCC format ${t}`)}if(e&Q.PIXEL_FORMAT_FLAGS.RGB||e&Q.PIXEL_FORMAT_FLAGS.RGBA)return Sk(r);throw e&Q.PIXEL_FORMAT_FLAGS.YUV?new Error("DDSParser does not supported YUV uncompressed texture data."):e&Q.PIXEL_FORMAT_FLAGS.LUMINANCE||e&Q.PIXEL_FORMAT_FLAGS.LUMINANCEA?new Error("DDSParser does not support single-channel (lumninance) texture data!"):e&Q.PIXEL_FORMAT_FLAGS.ALPHA||e&Q.PIXEL_FORMAT_FLAGS.ALPHAPIXELS?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!")}function Sk(r){let e=r[Q.HEADER_FIELDS.RGB_BITCOUNT],t=r[Q.HEADER_FIELDS.R_BIT_MASK],i=r[Q.HEADER_FIELDS.G_BIT_MASK],s=r[Q.HEADER_FIELDS.B_BIT_MASK],n=r[Q.HEADER_FIELDS.A_BIT_MASK];switch(e){case 32:if(t===255&&i===65280&&s===16711680&&n===4278190080)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM];if(t===16711680&&i===65280&&s===255&&n===4278190080)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM];if(t===1072693248&&i===1047552&&s===1023&&n===3221225472)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM];if(t===65535&&i===4294901760&&s===0&&n===0)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R16G16_UNORM];if(t===4294967295&&i===0&&s===0&&n===0)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT];break;case 24:break;case 16:if(t===31744&&i===992&&s===31&&n===32768)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM];if(t===63488&&i===2016&&s===31&&n===0)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM];if(t===3840&&i===240&&s===15&&n===61440)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM];if(t===255&&i===0&&s===0&&n===65280)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM];if(t===65535&&i===0&&s===0&&n===0)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM];break;case 8:if(t===255&&i===0&&s===0&&n===0)return Ft[Q.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM];break}throw new Error(`DDSParser does not support uncompressed texture with configuration:
|
|
2228
|
+
bitCount = ${e}, rBitMask = ${t}, gBitMask = ${i}, aBitMask = ${n}`)}var o1=f(()=>{n1();});var Mw,Dw=f(()=>{ar();Xi();hr();E();tl();il();o1();Mw={extension:{type:g.LoadParser,priority:Me.High,name:"loadDDS"},name:"loadDDS",test(r){return We(r,[".dds"])},async load(r,e,t){let i=await gi(),n=await(await fetch(r)).arrayBuffer(),o=$x(n,i),a=new Br(o);return kt(a,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});var a1,Ek,Ak,Ck,Pk,wk,Bk,Rk,Mk,Dk,Xe,u1=f(()=>{a1=(r=>(r[r.RGBA8_SNORM=36759]="RGBA8_SNORM",r[r.RGBA=6408]="RGBA",r[r.RGBA8UI=36220]="RGBA8UI",r[r.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",r[r.RGBA8I=36238]="RGBA8I",r[r.RGBA8=32856]="RGBA8",r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",r[r.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",r[r.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",r[r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",r[r.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",r[r.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",r[r.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",r[r.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",r[r.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",r[r.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",r[r.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",r[r.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",r[r.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",r[r.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",r[r.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",r[r.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",r[r.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",r[r.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",r[r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",r[r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",r[r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",r))(a1||{}),Ek={33776:"bc1-rgba-unorm",33777:"bc1-rgba-unorm",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",35916:"bc1-rgba-unorm-srgb",35917:"bc1-rgba-unorm-srgb",35918:"bc2-rgba-unorm-srgb",35919:"bc3-rgba-unorm-srgb",36283:"bc4-r-unorm",36284:"bc4-r-snorm",36285:"bc5-rg-unorm",36286:"bc5-rg-snorm",37488:"eac-r11unorm",37490:"eac-rg11snorm",37492:"etc2-rgb8unorm",37496:"etc2-rgba8unorm",37493:"etc2-rgb8unorm-srgb",37497:"etc2-rgba8unorm-srgb",37494:"etc2-rgb8a1unorm",37495:"etc2-rgb8a1unorm-srgb",37808:"astc-4x4-unorm",37840:"astc-4x4-unorm-srgb",37809:"astc-5x4-unorm",37841:"astc-5x4-unorm-srgb",37810:"astc-5x5-unorm",37842:"astc-5x5-unorm-srgb",37811:"astc-6x5-unorm",37843:"astc-6x5-unorm-srgb",37812:"astc-6x6-unorm",37844:"astc-6x6-unorm-srgb",37813:"astc-8x5-unorm",37845:"astc-8x5-unorm-srgb",37814:"astc-8x6-unorm",37846:"astc-8x6-unorm-srgb",37815:"astc-8x8-unorm",37847:"astc-8x8-unorm-srgb",37816:"astc-10x5-unorm",37848:"astc-10x5-unorm-srgb",37817:"astc-10x6-unorm",37849:"astc-10x6-unorm-srgb",37818:"astc-10x8-unorm",37850:"astc-10x8-unorm-srgb",37819:"astc-10x10-unorm",37851:"astc-10x10-unorm-srgb",37820:"astc-12x10-unorm",37852:"astc-12x10-unorm-srgb",37821:"astc-12x12-unorm",37853:"astc-12x12-unorm-srgb",36492:"bc7-rgba-unorm",36493:"bc7-rgba-unorm-srgb",36494:"bc6h-rgb-float",36495:"bc6h-rgb-ufloat",35907:"rgba8unorm-srgb",36759:"rgba8snorm",36220:"rgba8uint",36238:"rgba8sint",6408:"rgba8unorm"},Ak=[171,75,84,88,32,49,49,187,13,10,26,10],Ck={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},Pk=64,wk=67305985,Bk={5121:1,5123:2,5124:4,5125:4,5126:4,36193:8},Rk={6408:4,6407:3,33319:2,6403:1,6409:1,6410:2,6406:1},Mk={32819:2,32820:2,33635:2},Dk={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,36283:.5,36284:.5,36285:1,36286:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,37808:1,37840:1,37809:.8,37841:.8,37810:.64,37842:.64,37811:.53375,37843:.53375,37812:.445,37844:.445,37813:.4,37845:.4,37814:.33375,37846:.33375,37815:.25,37847:.25,37816:.32,37848:.32,37817:.26625,37849:.26625,37818:.2,37850:.2,37819:.16,37851:.16,37820:.13375,37852:.13375,37821:.11125,37853:.11125,36492:1,36493:1,36494:1,36495:1},Xe={FILE_HEADER_SIZE:Pk,FILE_IDENTIFIER:Ak,FORMATS_TO_COMPONENTS:Rk,INTERNAL_FORMAT_TO_BYTES_PER_PIXEL:Dk,INTERNAL_FORMAT_TO_TEXTURE_FORMATS:Ek,FIELDS:Ck,TYPES_TO_BYTES_PER_COMPONENT:Bk,TYPES_TO_BYTES_PER_PIXEL:Mk,ENDIANNESS:wk};});function jx(r,e){let t=new DataView(r);if(!Ok(t))throw new Error("Invalid KTX identifier in header");let{littleEndian:i,glType:s,glFormat:n,glInternalFormat:o,pixelWidth:a,pixelHeight:u,numberOfMipmapLevels:l,offset:c}=Fk(t),h=Xe.INTERNAL_FORMAT_TO_TEXTURE_FORMATS[o];if(!h)throw new Error(`Unknown texture format ${o}`);if(!e.includes(h))throw new Error(`Unsupported texture format: ${h}, supportedFormats: ${e}`);let d=kk(s,n,o),p=Ik(t,s,d,a,u,c,l,i);return {format:h,width:a,height:u,resource:p,alphaMode:"no-premultiply-alpha"}}function Ik(r,e,t,i,s,n,o,a){let u=i+3&-4,l=s+3&-4,c=i*s;e===0&&(c=u*l);let h=c*t,d=i,p=s,_=u,b=l,x=n,m=new Array(o);for(let v=0;v<o;v++){let T=r.getUint32(x,a),S=x+4;m[v]=new Uint8Array(r.buffer,S,h),S+=h,x+=T+4,x=x%4!==0?x+4-x%4:x,d=d>>1||1,p=p>>1||1,_=d+4-1&-4,b=p+4-1&-4,h=_*b*t;}return m}function kk(r,e,t){let i=Xe.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[t];if(r!==0&&(Xe.TYPES_TO_BYTES_PER_COMPONENT[r]?i=Xe.TYPES_TO_BYTES_PER_COMPONENT[r]*Xe.FORMATS_TO_COMPONENTS[e]:i=Xe.TYPES_TO_BYTES_PER_PIXEL[r]),i===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");return i}function Fk(r){let e=r.getUint32(Xe.FIELDS.ENDIANNESS,true)===Xe.ENDIANNESS,t=r.getUint32(Xe.FIELDS.GL_TYPE,e),i=r.getUint32(Xe.FIELDS.GL_FORMAT,e),s=r.getUint32(Xe.FIELDS.GL_INTERNAL_FORMAT,e),n=r.getUint32(Xe.FIELDS.PIXEL_WIDTH,e),o=r.getUint32(Xe.FIELDS.PIXEL_HEIGHT,e)||1,a=r.getUint32(Xe.FIELDS.PIXEL_DEPTH,e)||1,u=r.getUint32(Xe.FIELDS.NUMBER_OF_ARRAY_ELEMENTS,e)||1,l=r.getUint32(Xe.FIELDS.NUMBER_OF_FACES,e),c=r.getUint32(Xe.FIELDS.NUMBER_OF_MIPMAP_LEVELS,e),h=r.getUint32(Xe.FIELDS.BYTES_OF_KEY_VALUE_DATA,e);if(o===0||a!==1)throw new Error("Only 2D textures are supported");if(l!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");return {littleEndian:e,glType:t,glFormat:i,glInternalFormat:s,pixelWidth:n,pixelHeight:o,numberOfMipmapLevels:c,offset:Xe.FILE_HEADER_SIZE+h}}function Ok(r){for(let e=0;e<Xe.FILE_IDENTIFIER.length;e++)if(r.getUint8(e)!==Xe.FILE_IDENTIFIER[e])return false;return true}var l1=f(()=>{u1();});var Iw,kw=f(()=>{ar();Xi();hr();E();tl();il();l1();Iw={extension:{type:g.LoadParser,priority:Me.High,name:"loadKTX"},name:"loadKTX",test(r){return We(r,".ktx")},async load(r,e,t){let i=await gi(),n=await(await fetch(r)).arrayBuffer(),o=jx(n,i),a=new Br(o);return kt(a,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});var Gk,ol,qh,Fw=f(()=>{Gk=`(function () {
|
|
2229
2229
|
'use strict';
|
|
2230
2230
|
|
|
2231
2231
|
const converters = {
|
|
@@ -2469,8 +2469,8 @@ ${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=Ct(e
|
|
|
2469
2469
|
};
|
|
2470
2470
|
|
|
2471
2471
|
})();
|
|
2472
|
-
`,ol=null,qh=class{constructor(){ol||(ol=URL.createObjectURL(new Blob([Gk],{type:"application/javascript"}))),this.worker=new Worker(ol);}};qh.revokeObjectURL=function(){ol&&(URL.revokeObjectURL(ol),ol=null);};});function Ow(r){Object.assign(al,r);}var al,c1=f(()=>{al={jsUrl:"https://files.pixijs.download/transcoders/ktx/libktx.js",wasmUrl:"https://files.pixijs.download/transcoders/ktx/libktx.wasm"};});function Uk(r){return Kh||(Kh=new qh().worker,Kh.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load KTX texture",i),Gw[i](s);},Kh.postMessage({type:"init",jsUrl:al.jsUrl,wasmUrl:al.wasmUrl,supportedTextures:r})),Kh}function qx(r,e){let t=Uk(e);return new Promise(i=>{Gw[r]=i,t.postMessage({type:"load",url:r});})}var Kh,Gw,h1=f(()=>{Fw();c1();Gw={};});var Uw,Lw=f(()=>{ar();Xi();hr();E();tl();il();h1();Uw={extension:{type:m.LoadParser,priority:Me.High,name:"loadKTX2"},name:"loadKTX2",test(r){return We(r,".ktx2")},async load(r,e,t){let i=await gi(),s=await qx(r,i),n=new Br(s);return kt(n,t,r)},async unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});function Hw(r){let e=r.format;if(d1[e]){let t=d1[e].convertFunction,i=r.resource;for(let s=0;s<i.length;s++)i[s]=t(i[s]);r.format=d1[e].convertedFormat;}}function Nw(r){let e=r.byteLength/3,t=new Uint32Array(e);for(let i=0;i<e;++i)t[i]=r[i*3]+(r[i*3+1]<<8)+(r[i*3+2]<<16)+4278190080;return new Uint8Array(t.buffer)}var d1,Vw=f(()=>{d1={rgb8unorm:{convertedFormat:"rgba8unorm",convertFunction:Nw},"rgb8unorm-srgb":{convertedFormat:"rgba8unorm-srgb",convertFunction:Nw}};});function zw(r){let e=[];for(let t=0;t<r.numLevels;t++){let i=r.getImageData(t,0,0),s=new Uint8Array(i.byteLength);s.set(i),e.push(s);}return e}var Ww=f(()=>{});function Kx(r){let e=Lk[r];if(e)return e;throw new Error(`Unsupported glInternalFormat: ${r}`)}var Lk,f1=f(()=>{Lk={6408:"rgba8unorm",32856:"bgra8unorm",32857:"rgb10a2unorm",33189:"depth16unorm",33190:"depth24plus",33321:"r8unorm",33323:"rg8unorm",33325:"r16float",33326:"r32float",33327:"rg16float",33328:"rg32float",33329:"r8sint",33330:"r8uint",33331:"r16sint",33332:"r16uint",33333:"r32sint",33334:"r32uint",33335:"rg8sint",33336:"rg8uint",33337:"rg16sint",33338:"rg16uint",33339:"rg32sint",33340:"rg32uint",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",34836:"rgba32float",34842:"rgba16float",35056:"depth24plus-stencil8",35898:"rg11b10ufloat",35901:"rgb9e5ufloat",35907:"rgba8unorm-srgb",36012:"depth32float",36013:"depth32float-stencil8",36168:"stencil8",36208:"rgba32uint",36214:"rgba16uint",36220:"rgba8uint",36226:"rgba32sint",36232:"rgba16sint",36238:"rgba8sint",36492:"bc7-rgba-unorm",36756:"r8snorm",36757:"rg8snorm",36759:"rgba8snorm",37496:"etc2-rgba8unorm",37808:"astc-4x4-unorm"};});function Zx(r){let e=Nk[r];if(e)return e;throw new Error(`Unsupported VkFormat: ${r}`)}var Nk,p1=f(()=>{Nk={23:"rgb8unorm",37:"rgba8unorm",43:"rgba8unorm-srgb"};});function Xw(r){return r.classId===2?Zx(r.vkFormat):Kx(r.glInternalformat)}var Yw=f(()=>{f1();p1();});function $w(r){let e=Hk[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var Hk,jw=f(()=>{Hk={"bc3-rgba-unorm":"BC3_RGBA","bc7-rgba-unorm":"BC7_M5_RGBA","etc2-rgba8unorm":"ETC2_RGBA","astc-4x4-unorm":"ASTC_4x4_RGBA",rgba8unorm:"RGBA32",rg11b10ufloat:"R11F_G11F_B10F"};});var ul,qw,m1=f(()=>{ps();hr();E();ul=["basis","bc7","bc6h","astc","etc2","bc5","bc4","bc3","bc2","bc1","eac"],qw={extension:m.ResolveParser,test:r=>We(r,[".ktx",".ktx2",".dds"]),parse:r=>{let e,t=r.split(".");if(t.length>2){let i=t[t.length-2];ul.includes(i)&&(e=i);}else e=t[t.length-1];return {resolution:parseFloat(Pt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e,src:r}}};});function Vk(r){let e=["basis"],t={};return r.forEach(i=>{let s=i.split("-")[0];s&&!t[s]&&(t[s]=true,e.push(s));}),e.sort((i,s)=>{let n=ul.indexOf(i),o=ul.indexOf(s);return n===-1?1:o===-1?-1:n-o}),e}var Qx,Kw,Zw=f(()=>{E();Hx();vu();Tu();m1();Kw={extension:{type:m.DetectionParser,priority:2},test:async()=>!!(await pi()||fi()),add:async r=>{let e=await rl();return Qx=Vk(e),[...Qx,...r]},remove:async r=>Qx?r.filter(e=>!(e in Qx)):r};});var zk,g1,Jx,x1=f(()=>{Et();vn();zk=new me,g1=class{cull(e,t,i=true){this._cullRecursive(e,t,i);}_cullRecursive(e,t,i=true){if(e.cullable&&e.measurable&&e.includeInBuild){let s=e.cullArea??ii(e,i,zk);e.culled=s.x>=t.x+t.width||s.y>=t.y+t.height||s.x+s.width<=t.x||s.y+s.height<=t.y;}else e.culled=false;if(!(!e.cullableChildren||e.culled||!e.renderable||!e.measurable||!e.includeInBuild))for(let s=0;s<e.children.length;s++)this._cullRecursive(e.children[s],t,i);}};g1.shared=new g1;Jx=g1;});var Zh,Qw=f(()=>{E();x1();Zh=class{static init(){this._renderRef=this.render.bind(this),this.render=()=>{Jx.shared.cull(this.stage,this.renderer.screen),this.renderer.render({container:this.stage});};}static destroy(){this.render=this._renderRef;}};Zh.extension={priority:10,type:m.Application,name:"culler"};});var Qh=ti(ll=>{function Wk(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var i=0;i<r.length;i++)if(Object.prototype.hasOwnProperty.call(r,i)){var s=r[i];if(e.call(void 0,s,i,r))return s}}function _1(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}function Xk(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}var Jw=_1({HTML:"text/html",isHTML:function(r){return r===Jw.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),e3=_1({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===e3.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});ll.assign=Xk;ll.find=Wk;ll.freeze=_1;ll.MIME_TYPE=Jw;ll.NAMESPACE=e3;});var B1=ti(sn=>{var u3=Qh(),xi=u3.find,Jh=u3.NAMESPACE;function Yk(r){return r!==""}function $k(r){return r?r.split(/[\t\n\f\r ]+/).filter(Yk):[]}function jk(r,e){return r.hasOwnProperty(e)||(r[e]=true),r}function t3(r){if(!r)return [];var e=$k(r);return Object.keys(e.reduce(jk,{}))}function qk(r){return function(e){return r&&r.indexOf(e)!==-1}}function td(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function er(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,td(t,s),r.prototype=t=s;}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r);}var tr={},Xr=tr.ELEMENT_NODE=1,hl=tr.ATTRIBUTE_NODE=2,e_=tr.TEXT_NODE=3,l3=tr.CDATA_SECTION_NODE=4,c3=tr.ENTITY_REFERENCE_NODE=5,Kk=tr.ENTITY_NODE=6,h3=tr.PROCESSING_INSTRUCTION_NODE=7,d3=tr.COMMENT_NODE=8,f3=tr.DOCUMENT_NODE=9,p3=tr.DOCUMENT_TYPE_NODE=10,$i=tr.DOCUMENT_FRAGMENT_NODE=11,Zk=tr.NOTATION_NODE=12,Ot={},yt={};Ot.INDEX_SIZE_ERR=(yt[1]="Index size error",1);Ot.DOMSTRING_SIZE_ERR=(yt[2]="DOMString size error",2);var Jt=Ot.HIERARCHY_REQUEST_ERR=(yt[3]="Hierarchy request error",3);Ot.WRONG_DOCUMENT_ERR=(yt[4]="Wrong document",4);Ot.INVALID_CHARACTER_ERR=(yt[5]="Invalid character",5);Ot.NO_DATA_ALLOWED_ERR=(yt[6]="No data allowed",6);Ot.NO_MODIFICATION_ALLOWED_ERR=(yt[7]="No modification allowed",7);var m3=Ot.NOT_FOUND_ERR=(yt[8]="Not found",8);Ot.NOT_SUPPORTED_ERR=(yt[9]="Not supported",9);var r3=Ot.INUSE_ATTRIBUTE_ERR=(yt[10]="Attribute in use",10);Ot.INVALID_STATE_ERR=(yt[11]="Invalid state",11);Ot.SYNTAX_ERR=(yt[12]="Syntax error",12);Ot.INVALID_MODIFICATION_ERR=(yt[13]="Invalid modification",13);Ot.NAMESPACE_ERR=(yt[14]="Invalid namespace",14);Ot.INVALID_ACCESS_ERR=(yt[15]="Invalid access",15);function tt(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,yt[r]),this.message=yt[r],Error.captureStackTrace&&Error.captureStackTrace(this,tt);return t.code=r,e&&(this.message=this.message+": "+e),t}tt.prototype=Error.prototype;td(Ot,tt);function Yi(){}Yi.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r,e){for(var t=[],i=0;i<this.length;i++)cl(this[i],t,r,e);return t.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};function dl(r,e){this._node=r,this._refresh=e,v1(this);}function v1(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(P3(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var i=t.length;i in r;i++)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i];td(t,r),r._inc=e;}}dl.prototype.item=function(r){return v1(this),this[r]||null};er(dl,Yi);function t_(){}function g3(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function i3(r,e,t,i){if(i?e[g3(e,i)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(i&&b3(s,r,i),Qk(s,r,t));}}function s3(r,e,t){var i=g3(e,t);if(i>=0){for(var s=e.length-1;i<s;)e[i]=e[++i];if(e.length=s,r){var n=r.ownerDocument;n&&(b3(n,r,t),t.ownerElement=null);}}else throw new tt(m3,new Error(r.tagName+"@"+t))}t_.prototype={length:0,item:Yi.prototype.item,getNamedItem:function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},setNamedItem:function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new tt(r3);var t=this.getNamedItem(r.nodeName);return i3(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new tt(r3);return t=this.getNamedItemNS(r.namespaceURI,r.localName),i3(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return s3(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return s3(this._ownerElement,this,t),t},getNamedItemNS:function(r,e){for(var t=this.length;t--;){var i=this[t];if(i.localName==e&&i.namespaceURI==r)return i}return null}};function x3(){}x3.prototype={hasFeature:function(r,e){return true},createDocument:function(r,e,t){var i=new rd;if(i.implementation=this,i.childNodes=new Yi,i.doctype=t||null,t&&i.appendChild(t),e){var s=i.createElementNS(r,e);i.appendChild(s);}return i},createDocumentType:function(r,e,t){var i=new s_;return i.name=r,i.nodeName=r,i.publicId=e||"",i.systemId=t||"",i}};function Ae(){}Ae.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(r,e){return r_(this,r,e)},replaceChild:function(r,e){r_(this,r,e,v3),e&&this.removeChild(e);},removeChild:function(r){return y3(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return y1(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==e_&&r.nodeType==e_?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e);}},isSupported:function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&t[i]===r)return i}e=e.nodeType==hl?e.ownerDocument:e.parentNode;}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r];e=e.nodeType==hl?e.ownerDocument:e.parentNode;}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function _3(r){return r=="<"&&"<"||r==">"&&">"||r=="&"&&"&"||r=='"'&&"""||"&#"+r.charCodeAt()+";"}td(tr,Ae);td(tr,Ae.prototype);function ed(r,e){if(e(r))return true;if(r=r.firstChild)do if(ed(r,e))return true;while(r=r.nextSibling)}function rd(){this.ownerDocument=this;}function Qk(r,e,t){r&&r._inc++;var i=t.namespaceURI;i===Jh.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value);}function b3(r,e,t,i){r&&r._inc++;var s=t.namespaceURI;s===Jh.XMLNS&&delete e._nsMap[t.prefix?t.localName:""];}function T1(r,e,t){if(r&&r._inc){r._inc++;var i=e.childNodes;if(t)i[i.length++]=t;else {for(var s=e.firstChild,n=0;s;)i[n++]=s,s=s.nextSibling;i.length=n,delete i[i.length];}}}function y3(r,e){var t=e.previousSibling,i=e.nextSibling;return t?t.nextSibling=i:r.firstChild=i,i?i.previousSibling=t:r.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,T1(r.ownerDocument,r),e}function Jk(r){return r&&(r.nodeType===Ae.DOCUMENT_NODE||r.nodeType===Ae.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ae.ELEMENT_NODE)}function eF(r){return r&&(_i(r)||S1(r)||ji(r)||r.nodeType===Ae.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ae.COMMENT_NODE||r.nodeType===Ae.PROCESSING_INSTRUCTION_NODE)}function ji(r){return r&&r.nodeType===Ae.DOCUMENT_TYPE_NODE}function _i(r){return r&&r.nodeType===Ae.ELEMENT_NODE}function S1(r){return r&&r.nodeType===Ae.TEXT_NODE}function n3(r,e){var t=r.childNodes||[];if(xi(t,_i)||ji(e))return false;var i=xi(t,ji);return !(e&&i&&t.indexOf(i)>t.indexOf(e))}function o3(r,e){var t=r.childNodes||[];function i(n){return _i(n)&&n!==e}if(xi(t,i))return false;var s=xi(t,ji);return !(e&&s&&t.indexOf(s)>t.indexOf(e))}function tF(r,e,t){if(!Jk(r))throw new tt(Jt,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new tt(m3,"child not in parent");if(!eF(e)||ji(e)&&r.nodeType!==Ae.DOCUMENT_NODE)throw new tt(Jt,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function rF(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ae.DOCUMENT_FRAGMENT_NODE){var n=s.filter(_i);if(n.length>1||xi(s,S1))throw new tt(Jt,"More than one element or text in fragment");if(n.length===1&&!n3(r,t))throw new tt(Jt,"Element in fragment can not be inserted before doctype")}if(_i(e)&&!n3(r,t))throw new tt(Jt,"Only one element can be added and only after doctype");if(ji(e)){if(xi(i,ji))throw new tt(Jt,"Only one doctype is allowed");var o=xi(i,_i);if(t&&i.indexOf(o)<i.indexOf(t))throw new tt(Jt,"Doctype can only be inserted before an element");if(!t&&o)throw new tt(Jt,"Doctype can not be appended since element is present")}}function v3(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ae.DOCUMENT_FRAGMENT_NODE){var n=s.filter(_i);if(n.length>1||xi(s,S1))throw new tt(Jt,"More than one element or text in fragment");if(n.length===1&&!o3(r,t))throw new tt(Jt,"Element in fragment can not be inserted before doctype")}if(_i(e)&&!o3(r,t))throw new tt(Jt,"Only one element can be added and only after doctype");if(ji(e)){let u=function(l){return ji(l)&&l!==t};if(xi(i,u))throw new tt(Jt,"Only one doctype is allowed");var o=xi(i,_i);if(t&&i.indexOf(o)<i.indexOf(t))throw new tt(Jt,"Doctype can only be inserted before an element")}}function r_(r,e,t,i){tF(r,e,t),r.nodeType===Ae.DOCUMENT_NODE&&(i||rF)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===$i){var n=e.firstChild;if(n==null)return e;var o=e.lastChild;}else n=o=e;var a=t?t.previousSibling:r.lastChild;n.previousSibling=a,o.nextSibling=t,a?a.nextSibling=n:r.firstChild=n,t==null?r.lastChild=o:t.previousSibling=o;do n.parentNode=r;while(n!==o&&(n=n.nextSibling));return T1(r.ownerDocument||r,r),e.nodeType==$i&&(e.firstChild=e.lastChild=null),e}function iF(r,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=r,e.previousSibling=r.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,r.lastChild=e,T1(r.ownerDocument,r,e),e}rd.prototype={nodeName:"#document",nodeType:f3,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==$i){for(var t=r.firstChild;t;){var i=t.nextSibling;this.insertBefore(t,e),t=i;}return r}return r_(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===Xr&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),y3(this,r)},replaceChild:function(r,e){r_(this,r,e,v3),r.ownerDocument=this,e&&this.removeChild(e),_i(r)&&(this.documentElement=r);},importNode:function(r,e){return C3(this,r,e)},getElementById:function(r){var e=null;return ed(this.documentElement,function(t){if(t.nodeType==Xr&&t.getAttribute("id")==r)return e=t,true}),e},getElementsByClassName:function(r){var e=t3(r);return new dl(this,function(t){var i=[];return e.length>0&&ed(t.documentElement,function(s){if(s!==t&&s.nodeType===Xr){var n=s.getAttribute("class");if(n){var o=r===n;if(!o){var a=t3(n);o=e.every(qk(a));}o&&i.push(s);}}}),i})},createElement:function(r){var e=new aa;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new Yi;var t=e.attributes=new t_;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new n_;return r.ownerDocument=this,r.childNodes=new Yi,r},createTextNode:function(r){var e=new E1;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new A1;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new C1;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new w1;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new i_;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=true,e},createEntityReference:function(r){var e=new P1;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new aa,i=e.split(":"),s=t.attributes=new t_;return t.childNodes=new Yi,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,s._ownerElement=t,t},createAttributeNS:function(r,e){var t=new i_,i=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=true,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,t}};er(rd,Ae);function aa(){this._nsMap={};}aa.prototype={nodeType:Xr,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var e=this.getAttributeNode(r);return e&&e.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t);},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e);},appendChild:function(r){return r.nodeType===$i?this.insertBefore(r,null):iF(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t);},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},setAttributeNS:function(r,e,t){var i=this.ownerDocument.createAttributeNS(r,e);i.value=i.nodeValue=""+t,this.setAttributeNode(i);},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByTagName:function(r){return new dl(this,function(e){var t=[];return ed(e,function(i){i!==e&&i.nodeType==Xr&&(r==="*"||i.tagName==r)&&t.push(i);}),t})},getElementsByTagNameNS:function(r,e){return new dl(this,function(t){var i=[];return ed(t,function(s){s!==t&&s.nodeType===Xr&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&i.push(s);}),i})}};rd.prototype.getElementsByTagName=aa.prototype.getElementsByTagName;rd.prototype.getElementsByTagNameNS=aa.prototype.getElementsByTagNameNS;er(aa,Ae);function i_(){}i_.prototype.nodeType=hl;er(i_,Ae);function id(){}id.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length;},insertData:function(r,e){this.replaceData(r,0,e);},appendChild:function(r){throw new Error(yt[Jt])},deleteData:function(r,e){this.replaceData(r,e,"");},replaceData:function(r,e,t){var i=this.data.substring(0,r),s=this.data.substring(r+e);t=i+t+s,this.nodeValue=this.data=t,this.length=t.length;}};er(id,Ae);function E1(){}E1.prototype={nodeName:"#text",nodeType:e_,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}};er(E1,id);function A1(){}A1.prototype={nodeName:"#comment",nodeType:d3};er(A1,id);function C1(){}C1.prototype={nodeName:"#cdata-section",nodeType:l3};er(C1,id);function s_(){}s_.prototype.nodeType=p3;er(s_,Ae);function T3(){}T3.prototype.nodeType=Zk;er(T3,Ae);function S3(){}S3.prototype.nodeType=Kk;er(S3,Ae);function P1(){}P1.prototype.nodeType=c3;er(P1,Ae);function n_(){}n_.prototype.nodeName="#document-fragment";n_.prototype.nodeType=$i;er(n_,Ae);function w1(){}w1.prototype.nodeType=h3;er(w1,Ae);function E3(){}E3.prototype.serializeToString=function(r,e,t){return A3.call(r,e,t)};Ae.prototype.toString=A3;function A3(r,e){var t=[],i=this.nodeType==9&&this.documentElement||this,s=i.prefix,n=i.namespaceURI;if(n&&s==null){var s=i.lookupPrefix(n);if(s==null)var o=[{namespace:n,prefix:null}];}return cl(this,t,r,e,o),t.join("")}function a3(r,e,t){var i=r.prefix||"",s=r.namespaceURI;if(!s||i==="xml"&&s===Jh.XML||s===Jh.XMLNS)return false;for(var n=t.length;n--;){var o=t[n];if(o.prefix===i)return o.namespace!==s}return true}function b1(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,_3),'"');}function cl(r,e,t,i,s){if(s||(s=[]),i)if(r=i(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case Xr:var n=r.attributes,o=n.length,g=r.firstChild,a=r.tagName;t=Jh.isHTML(r.namespaceURI)||t;var u=a;if(!t&&!r.prefix&&r.namespaceURI){for(var l,c=0;c<n.length;c++)if(n.item(c).name==="xmlns"){l=n.item(c).value;break}if(!l)for(var h=s.length-1;h>=0;h--){var d=s[h];if(d.prefix===""&&d.namespace===r.namespaceURI){l=d.namespace;break}}if(l!==r.namespaceURI)for(var h=s.length-1;h>=0;h--){var d=s[h];if(d.namespace===r.namespaceURI){d.prefix&&(u=d.prefix+":"+a);break}}}e.push("<",u);for(var p=0;p<o;p++){var _=n.item(p);_.prefix=="xmlns"?s.push({prefix:_.localName,namespace:_.value}):_.nodeName=="xmlns"&&s.push({prefix:"",namespace:_.value});}for(var p=0;p<o;p++){var _=n.item(p);if(a3(_,t,s)){var b=_.prefix||"",x=_.namespaceURI;b1(e,b?"xmlns:"+b:"xmlns",x),s.push({prefix:b,namespace:x});}cl(_,e,t,i,s);}if(a===u&&a3(r,t,s)){var b=r.prefix||"",x=r.namespaceURI;b1(e,b?"xmlns:"+b:"xmlns",x),s.push({prefix:b,namespace:x});}if(g||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(a)){if(e.push(">"),t&&/^script$/i.test(a))for(;g;)g.data?e.push(g.data):cl(g,e,t,i,s.slice()),g=g.nextSibling;else for(;g;)cl(g,e,t,i,s.slice()),g=g.nextSibling;e.push("</",u,">");}else e.push("/>");return;case f3:case $i:for(var g=r.firstChild;g;)cl(g,e,t,i,s.slice()),g=g.nextSibling;return;case hl:return b1(e,r.name,r.value);case e_:return e.push(r.data.replace(/[<&>]/g,_3));case l3:return e.push("<![CDATA[",r.data,"]]>");case d3:return e.push("<!--",r.data,"-->");case p3:var v=r.publicId,T=r.systemId;if(e.push("<!DOCTYPE ",r.name),v)e.push(" PUBLIC ",v),T&&T!="."&&e.push(" ",T),e.push(">");else if(T&&T!=".")e.push(" SYSTEM ",T,">");else {var S=r.internalSubset;S&&e.push(" [",S,"]"),e.push(">");}return;case h3:return e.push("<?",r.target," ",r.data,"?>");case c3:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName);}}function C3(r,e,t){var i;switch(e.nodeType){case Xr:i=e.cloneNode(false),i.ownerDocument=r;case $i:break;case hl:t=true;break}if(i||(i=e.cloneNode(false)),i.ownerDocument=r,i.parentNode=null,t)for(var s=e.firstChild;s;)i.appendChild(C3(r,s,t)),s=s.nextSibling;return i}function y1(r,e,t){var i=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];typeof n!="object"&&n!=i[s]&&(i[s]=n);}switch(e.childNodes&&(i.childNodes=new Yi),i.ownerDocument=r,i.nodeType){case Xr:var o=e.attributes,a=i.attributes=new t_,u=o.length;a._ownerElement=i;for(var l=0;l<u;l++)i.setAttributeNode(y1(r,o.item(l),true));break;case hl:t=true;}if(t)for(var c=e.firstChild;c;)i.appendChild(y1(r,c,t)),c=c.nextSibling;return i}function P3(r,e,t){r[e]=t;}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case Xr:case $i:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};sF=r,Object.defineProperty(dl.prototype,"length",{get:function(){return v1(this),this.$$length}}),Object.defineProperty(Ae.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case Xr:case $i:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e;}}}),P3=function(e,t,i){e["$$"+t]=i;};}}catch{}var sF;sn.DocumentType=s_;sn.DOMException=tt;sn.DOMImplementation=x3;sn.Element=aa;sn.Node=Ae;sn.NodeList=Yi;sn.XMLSerializer=E3;});var B3=ti(sd=>{var w3=Qh().freeze;sd.XML_ENTITIES=w3({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});sd.HTML_ENTITIES=w3({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
2473
|
-
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});sd.entityMap=sd.HTML_ENTITIES;});var G3=ti(M1=>{var ud=Qh().NAMESPACE,R1=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,R3=new RegExp("[\\-\\.0-9"+R1.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),M3=new RegExp("^"+R1.source+R3.source+"*(?::"+R1.source+R3.source+"*)?$"),nd=0,nn=1,fl=2,od=3,pl=4,ml=5,ad=6,o_=7;function gl(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,gl);}gl.prototype=new Error;gl.prototype.name=gl.name;function k3(){}k3.prototype={parse:function(r,e,t){var i=this.domBuilder;i.startDocument(),F3(e,e={}),nF(r,e,t,i,this.errorHandler),i.endDocument();}};function nF(r,e,t,i,s){function n(z){if(z>65535){z-=65536;var j=55296+(z>>10),cb=56320+(z&1023);return String.fromCharCode(j,cb)}else return String.fromCharCode(z)}function o(z){var j=z.slice(1,-1);return Object.hasOwnProperty.call(t,j)?t[j]:j.charAt(0)==="#"?n(parseInt(j.substr(1).replace("x","0x"))):(s.error("entity not found:"+z),z)}function a(z){if(z>b){var j=r.substring(b,z).replace(/&#?\w+;/g,o);d&&u(b),i.characters(j,0,z-b),b=z;}}function u(z,j){for(;z>=c&&(j=h.exec(r));)l=j.index,c=l+j[0].length,d.lineNumber++;d.columnNumber=z-l+1;}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,p=[{currentNSMap:e}],_={},b=0;;){try{var x=r.indexOf("<",b);if(x<0){if(!r.substr(b).match(/^\s*$/)){var g=i.doc,v=g.createTextNode(r.substr(b));g.appendChild(v),i.currentElement=v;}return}switch(x>b&&a(x),r.charAt(x+1)){case "/":var k=r.indexOf(">",x+3),T=r.substring(x+2,k).replace(/[ \t\n\r]+$/g,""),S=p.pop();k<0?(T=r.substring(x+2).replace(/[\s<].*/,""),s.error("end tag name: "+T+" is not complete:"+S.tagName),k=x+1+T.length):T.match(/\s</)&&(T=T.replace(/[\s<].*/,""),s.error("end tag name: "+T+" maybe not complete"),k=x+1+T.length);var B=S.localNSMap,A=S.tagName==T,R=A||S.tagName&&S.tagName.toLowerCase()==T.toLowerCase();if(R){if(i.endElement(S.uri,S.localName,T),B)for(var Y in B)Object.prototype.hasOwnProperty.call(B,Y)&&i.endPrefixMapping(Y);A||s.fatalError("end tag name: "+T+" is not match the current start tagName:"+S.tagName);}else p.push(S);k++;break;case "?":d&&u(x),k=cF(r,x,i);break;case "!":d&&u(x),k=lF(r,x,i,s);break;default:d&&u(x);var M=new O3,U=p[p.length-1].currentNSMap,k=oF(r,x,M,U,o,s),J=M.length;if(!M.closed&&uF(r,k,M.tagName,_)&&(M.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),d&&J){for(var ge=D3(d,{}),Ke=0;Ke<J;Ke++){var ts=M[Ke];u(ts.offset),ts.locator=D3(d,{});}i.locator=ge,I3(M,i,U)&&p.push(M),i.locator=d;}else I3(M,i,U)&&p.push(M);ud.isHTML(M.uri)&&!M.closed?k=aF(r,k,M.tagName,o,i):k++;}}catch(z){if(z instanceof gl)throw z;s.error("element parse error: "+z),k=-1;}k>b?b=k:a(Math.max(x,b)+1);}}function D3(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function oF(r,e,t,i,s,n){function o(p,_,b){t.attributeNames.hasOwnProperty(p)&&n.fatalError("Attribute "+p+" redefined"),t.addValue(p,_.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),b);}for(var a,u,l=++e,c=nd;;){var h=r.charAt(l);switch(h){case "=":if(c===nn)a=r.slice(e,l),c=od;else if(c===fl)c=od;else throw new Error("attribute equal must after attrName");break;case "'":case '"':if(c===od||c===nn)if(c===nn&&(n.warning('attribute value must after "="'),a=r.slice(e,l)),e=l+1,l=r.indexOf(h,e),l>0)u=r.slice(e,l),o(a,u,e-1),c=ml;else throw new Error("attribute value no end '"+h+"' match");else if(c==pl)u=r.slice(e,l),o(a,u,e),n.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=l+1,c=ml;else throw new Error('attribute value must after "="');break;case "/":switch(c){case nd:t.setTagName(r.slice(e,l));case ml:case ad:case o_:c=o_,t.closed=true;case pl:case nn:break;case fl:t.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case "":return n.error("unexpected end of input"),c==nd&&t.setTagName(r.slice(e,l)),l;case ">":switch(c){case nd:t.setTagName(r.slice(e,l));case ml:case ad:case o_:break;case pl:case nn:u=r.slice(e,l),u.slice(-1)==="/"&&(t.closed=true,u=u.slice(0,-1));case fl:c===fl&&(u=a),c==pl?(n.warning('attribute "'+u+'" missed quot(")!'),o(a,u,e)):((!ud.isHTML(i[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case od:throw new Error("attribute value missed!!")}return l;case "\x80":h=" ";default:if(h<=" ")switch(c){case nd:t.setTagName(r.slice(e,l)),c=ad;break;case nn:a=r.slice(e,l),c=fl;break;case pl:var u=r.slice(e,l);n.warning('attribute "'+u+'" missed quot(")!!'),o(a,u,e);case ml:c=ad;break}else switch(c){case fl:t.tagName;(!ud.isHTML(i[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,e),e=l,c=nn;break;case ml:n.warning('attribute space is required"'+a+'"!!');case ad:c=nn,e=l;break;case od:c=pl,e=l;break;case o_:throw new Error("elements closed character '/' and '>' must be connected to")}}l++;}}function I3(r,e,t){for(var i=r.tagName,s=null,h=r.length;h--;){var n=r[h],o=n.qName,a=n.value,d=o.indexOf(":");if(d>0)var u=n.prefix=o.slice(0,d),l=o.slice(d+1),c=u==="xmlns"&&l;else l=o,u=null,c=o==="xmlns"&&"";n.localName=l,c!==false&&(s==null&&(s={},F3(t,t={})),t[c]=s[c]=a,n.uri=ud.XMLNS,e.startPrefixMapping(c,a));}for(var h=r.length;h--;){n=r[h];var u=n.prefix;u&&(u==="xml"&&(n.uri=ud.XML),u!=="xmlns"&&(n.uri=t[u||""]));}var d=i.indexOf(":");d>0?(u=r.prefix=i.slice(0,d),l=r.localName=i.slice(d+1)):(u=null,l=r.localName=i);var p=r.uri=t[u||""];if(e.startElement(p,l,i,r),r.closed){if(e.endElement(p,l,i),s)for(u in s)Object.prototype.hasOwnProperty.call(s,u)&&e.endPrefixMapping(u);}else return r.currentNSMap=t,r.localNSMap=s,true}function aF(r,e,t,i,s){if(/^(?:script|textarea)$/i.test(t)){var n=r.indexOf("</"+t+">",e),o=r.substring(e+1,n);if(/[&<]/.test(o))return /^script$/i.test(t)?(s.characters(o,0,o.length),n):(o=o.replace(/&#?\w+;/g,i),s.characters(o,0,o.length),n)}return e+1}function uF(r,e,t,i){var s=i[t];return s==null&&(s=r.lastIndexOf("</"+t+">"),s<e&&(s=r.lastIndexOf("</"+t)),i[t]=s),s<e}function F3(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function lF(r,e,t,i){var s=r.charAt(e+2);switch(s){case "-":if(r.charAt(e+3)==="-"){var n=r.indexOf("-->",e+4);return n>e?(t.comment(r,e+4,n-e-4),n+3):(i.error("Unclosed comment"),-1)}else return -1;default:if(r.substr(e+3,6)=="CDATA["){var n=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,n-e-9),t.endCDATA(),n+3}var o=hF(r,e),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var u=o[1][0],l=false,c=false;a>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],c=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var h=o[a-1];return t.startDTD(u,l,c),t.endDTD(),h.index+h[0].length}}return -1}function cF(r,e,t){var i=r.indexOf("?>",e);if(i){var s=r.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s){s[0].length;return t.processingInstruction(s[1],s[2]),i+2}else return -1}return -1}function O3(){this.attributeNames={};}O3.prototype={setTagName:function(r){if(!M3.test(r))throw new Error("invalid tagName:"+r);this.tagName=r;},addValue:function(r,e,t){if(!M3.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t};},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function hF(r,e){var t,i=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(r);t=s.exec(r);)if(i.push(t),t[1])return i}M1.XMLReader=k3;M1.ParseError=gl;});var W3=ti(u_=>{var dF=Qh(),fF=B1(),U3=B3(),H3=G3(),pF=fF.DOMImplementation,L3=dF.NAMESPACE,mF=H3.ParseError,gF=H3.XMLReader;function V3(r){return r.replace(/\r[\n\u0085]/g,`
|
|
2472
|
+
`,ol=null,qh=class{constructor(){ol||(ol=URL.createObjectURL(new Blob([Gk],{type:"application/javascript"}))),this.worker=new Worker(ol);}};qh.revokeObjectURL=function(){ol&&(URL.revokeObjectURL(ol),ol=null);};});function Ow(r){Object.assign(al,r);}var al,c1=f(()=>{al={jsUrl:"https://files.pixijs.download/transcoders/ktx/libktx.js",wasmUrl:"https://files.pixijs.download/transcoders/ktx/libktx.wasm"};});function Uk(r){return Kh||(Kh=new qh().worker,Kh.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load KTX texture",i),Gw[i](s);},Kh.postMessage({type:"init",jsUrl:al.jsUrl,wasmUrl:al.wasmUrl,supportedTextures:r})),Kh}function qx(r,e){let t=Uk(e);return new Promise(i=>{Gw[r]=i,t.postMessage({type:"load",url:r});})}var Kh,Gw,h1=f(()=>{Fw();c1();Gw={};});var Uw,Lw=f(()=>{ar();Xi();hr();E();tl();il();h1();Uw={extension:{type:g.LoadParser,priority:Me.High,name:"loadKTX2"},name:"loadKTX2",test(r){return We(r,".ktx2")},async load(r,e,t){let i=await gi(),s=await qx(r,i),n=new Br(s);return kt(n,t,r)},async unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});function Hw(r){let e=r.format;if(d1[e]){let t=d1[e].convertFunction,i=r.resource;for(let s=0;s<i.length;s++)i[s]=t(i[s]);r.format=d1[e].convertedFormat;}}function Nw(r){let e=r.byteLength/3,t=new Uint32Array(e);for(let i=0;i<e;++i)t[i]=r[i*3]+(r[i*3+1]<<8)+(r[i*3+2]<<16)+4278190080;return new Uint8Array(t.buffer)}var d1,Vw=f(()=>{d1={rgb8unorm:{convertedFormat:"rgba8unorm",convertFunction:Nw},"rgb8unorm-srgb":{convertedFormat:"rgba8unorm-srgb",convertFunction:Nw}};});function zw(r){let e=[];for(let t=0;t<r.numLevels;t++){let i=r.getImageData(t,0,0),s=new Uint8Array(i.byteLength);s.set(i),e.push(s);}return e}var Ww=f(()=>{});function Kx(r){let e=Lk[r];if(e)return e;throw new Error(`Unsupported glInternalFormat: ${r}`)}var Lk,f1=f(()=>{Lk={6408:"rgba8unorm",32856:"bgra8unorm",32857:"rgb10a2unorm",33189:"depth16unorm",33190:"depth24plus",33321:"r8unorm",33323:"rg8unorm",33325:"r16float",33326:"r32float",33327:"rg16float",33328:"rg32float",33329:"r8sint",33330:"r8uint",33331:"r16sint",33332:"r16uint",33333:"r32sint",33334:"r32uint",33335:"rg8sint",33336:"rg8uint",33337:"rg16sint",33338:"rg16uint",33339:"rg32sint",33340:"rg32uint",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",34836:"rgba32float",34842:"rgba16float",35056:"depth24plus-stencil8",35898:"rg11b10ufloat",35901:"rgb9e5ufloat",35907:"rgba8unorm-srgb",36012:"depth32float",36013:"depth32float-stencil8",36168:"stencil8",36208:"rgba32uint",36214:"rgba16uint",36220:"rgba8uint",36226:"rgba32sint",36232:"rgba16sint",36238:"rgba8sint",36492:"bc7-rgba-unorm",36756:"r8snorm",36757:"rg8snorm",36759:"rgba8snorm",37496:"etc2-rgba8unorm",37808:"astc-4x4-unorm"};});function Zx(r){let e=Nk[r];if(e)return e;throw new Error(`Unsupported VkFormat: ${r}`)}var Nk,p1=f(()=>{Nk={23:"rgb8unorm",37:"rgba8unorm",43:"rgba8unorm-srgb"};});function Xw(r){return r.classId===2?Zx(r.vkFormat):Kx(r.glInternalformat)}var Yw=f(()=>{f1();p1();});function $w(r){let e=Hk[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var Hk,jw=f(()=>{Hk={"bc3-rgba-unorm":"BC3_RGBA","bc7-rgba-unorm":"BC7_M5_RGBA","etc2-rgba8unorm":"ETC2_RGBA","astc-4x4-unorm":"ASTC_4x4_RGBA",rgba8unorm:"RGBA32",rg11b10ufloat:"R11F_G11F_B10F"};});var ul,qw,m1=f(()=>{ps();hr();E();ul=["basis","bc7","bc6h","astc","etc2","bc5","bc4","bc3","bc2","bc1","eac"],qw={extension:g.ResolveParser,test:r=>We(r,[".ktx",".ktx2",".dds"]),parse:r=>{let e,t=r.split(".");if(t.length>2){let i=t[t.length-2];ul.includes(i)&&(e=i);}else e=t[t.length-1];return {resolution:parseFloat(Pt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e,src:r}}};});function Vk(r){let e=["basis"],t={};return r.forEach(i=>{let s=i.split("-")[0];s&&!t[s]&&(t[s]=true,e.push(s));}),e.sort((i,s)=>{let n=ul.indexOf(i),o=ul.indexOf(s);return n===-1?1:o===-1?-1:n-o}),e}var Qx,Kw,Zw=f(()=>{E();Hx();vu();Tu();m1();Kw={extension:{type:g.DetectionParser,priority:2},test:async()=>!!(await pi()||fi()),add:async r=>{let e=await rl();return Qx=Vk(e),[...Qx,...r]},remove:async r=>Qx?r.filter(e=>!(e in Qx)):r};});var zk,g1,Jx,x1=f(()=>{Et();vn();zk=new me,g1=class{cull(e,t,i=true){this._cullRecursive(e,t,i);}_cullRecursive(e,t,i=true){if(e.cullable&&e.measurable&&e.includeInBuild){let s=e.cullArea??ii(e,i,zk);e.culled=s.x>=t.x+t.width||s.y>=t.y+t.height||s.x+s.width<=t.x||s.y+s.height<=t.y;}else e.culled=false;if(!(!e.cullableChildren||e.culled||!e.renderable||!e.measurable||!e.includeInBuild))for(let s=0;s<e.children.length;s++)this._cullRecursive(e.children[s],t,i);}};g1.shared=new g1;Jx=g1;});var Zh,Qw=f(()=>{E();x1();Zh=class{static init(){this._renderRef=this.render.bind(this),this.render=()=>{Jx.shared.cull(this.stage,this.renderer.screen),this.renderer.render({container:this.stage});};}static destroy(){this.render=this._renderRef;}};Zh.extension={priority:10,type:g.Application,name:"culler"};});var Qh=ti(ll=>{function Wk(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var i=0;i<r.length;i++)if(Object.prototype.hasOwnProperty.call(r,i)){var s=r[i];if(e.call(void 0,s,i,r))return s}}function _1(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}function Xk(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}var Jw=_1({HTML:"text/html",isHTML:function(r){return r===Jw.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),e3=_1({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===e3.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});ll.assign=Xk;ll.find=Wk;ll.freeze=_1;ll.MIME_TYPE=Jw;ll.NAMESPACE=e3;});var B1=ti(sn=>{var u3=Qh(),xi=u3.find,Jh=u3.NAMESPACE;function Yk(r){return r!==""}function $k(r){return r?r.split(/[\t\n\f\r ]+/).filter(Yk):[]}function jk(r,e){return r.hasOwnProperty(e)||(r[e]=true),r}function t3(r){if(!r)return [];var e=$k(r);return Object.keys(e.reduce(jk,{}))}function qk(r){return function(e){return r&&r.indexOf(e)!==-1}}function td(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function er(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,td(t,s),r.prototype=t=s;}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r);}var tr={},Xr=tr.ELEMENT_NODE=1,hl=tr.ATTRIBUTE_NODE=2,e_=tr.TEXT_NODE=3,l3=tr.CDATA_SECTION_NODE=4,c3=tr.ENTITY_REFERENCE_NODE=5,Kk=tr.ENTITY_NODE=6,h3=tr.PROCESSING_INSTRUCTION_NODE=7,d3=tr.COMMENT_NODE=8,f3=tr.DOCUMENT_NODE=9,p3=tr.DOCUMENT_TYPE_NODE=10,$i=tr.DOCUMENT_FRAGMENT_NODE=11,Zk=tr.NOTATION_NODE=12,Ot={},yt={};Ot.INDEX_SIZE_ERR=(yt[1]="Index size error",1);Ot.DOMSTRING_SIZE_ERR=(yt[2]="DOMString size error",2);var Jt=Ot.HIERARCHY_REQUEST_ERR=(yt[3]="Hierarchy request error",3);Ot.WRONG_DOCUMENT_ERR=(yt[4]="Wrong document",4);Ot.INVALID_CHARACTER_ERR=(yt[5]="Invalid character",5);Ot.NO_DATA_ALLOWED_ERR=(yt[6]="No data allowed",6);Ot.NO_MODIFICATION_ALLOWED_ERR=(yt[7]="No modification allowed",7);var m3=Ot.NOT_FOUND_ERR=(yt[8]="Not found",8);Ot.NOT_SUPPORTED_ERR=(yt[9]="Not supported",9);var r3=Ot.INUSE_ATTRIBUTE_ERR=(yt[10]="Attribute in use",10);Ot.INVALID_STATE_ERR=(yt[11]="Invalid state",11);Ot.SYNTAX_ERR=(yt[12]="Syntax error",12);Ot.INVALID_MODIFICATION_ERR=(yt[13]="Invalid modification",13);Ot.NAMESPACE_ERR=(yt[14]="Invalid namespace",14);Ot.INVALID_ACCESS_ERR=(yt[15]="Invalid access",15);function tt(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,yt[r]),this.message=yt[r],Error.captureStackTrace&&Error.captureStackTrace(this,tt);return t.code=r,e&&(this.message=this.message+": "+e),t}tt.prototype=Error.prototype;td(Ot,tt);function Yi(){}Yi.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r,e){for(var t=[],i=0;i<this.length;i++)cl(this[i],t,r,e);return t.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};function dl(r,e){this._node=r,this._refresh=e,v1(this);}function v1(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(P3(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var i=t.length;i in r;i++)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i];td(t,r),r._inc=e;}}dl.prototype.item=function(r){return v1(this),this[r]||null};er(dl,Yi);function t_(){}function g3(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function i3(r,e,t,i){if(i?e[g3(e,i)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(i&&b3(s,r,i),Qk(s,r,t));}}function s3(r,e,t){var i=g3(e,t);if(i>=0){for(var s=e.length-1;i<s;)e[i]=e[++i];if(e.length=s,r){var n=r.ownerDocument;n&&(b3(n,r,t),t.ownerElement=null);}}else throw new tt(m3,new Error(r.tagName+"@"+t))}t_.prototype={length:0,item:Yi.prototype.item,getNamedItem:function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},setNamedItem:function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new tt(r3);var t=this.getNamedItem(r.nodeName);return i3(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new tt(r3);return t=this.getNamedItemNS(r.namespaceURI,r.localName),i3(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return s3(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return s3(this._ownerElement,this,t),t},getNamedItemNS:function(r,e){for(var t=this.length;t--;){var i=this[t];if(i.localName==e&&i.namespaceURI==r)return i}return null}};function x3(){}x3.prototype={hasFeature:function(r,e){return true},createDocument:function(r,e,t){var i=new rd;if(i.implementation=this,i.childNodes=new Yi,i.doctype=t||null,t&&i.appendChild(t),e){var s=i.createElementNS(r,e);i.appendChild(s);}return i},createDocumentType:function(r,e,t){var i=new s_;return i.name=r,i.nodeName=r,i.publicId=e||"",i.systemId=t||"",i}};function Ae(){}Ae.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(r,e){return r_(this,r,e)},replaceChild:function(r,e){r_(this,r,e,v3),e&&this.removeChild(e);},removeChild:function(r){return y3(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return y1(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==e_&&r.nodeType==e_?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e);}},isSupported:function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&t[i]===r)return i}e=e.nodeType==hl?e.ownerDocument:e.parentNode;}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r];e=e.nodeType==hl?e.ownerDocument:e.parentNode;}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function _3(r){return r=="<"&&"<"||r==">"&&">"||r=="&"&&"&"||r=='"'&&"""||"&#"+r.charCodeAt()+";"}td(tr,Ae);td(tr,Ae.prototype);function ed(r,e){if(e(r))return true;if(r=r.firstChild)do if(ed(r,e))return true;while(r=r.nextSibling)}function rd(){this.ownerDocument=this;}function Qk(r,e,t){r&&r._inc++;var i=t.namespaceURI;i===Jh.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value);}function b3(r,e,t,i){r&&r._inc++;var s=t.namespaceURI;s===Jh.XMLNS&&delete e._nsMap[t.prefix?t.localName:""];}function T1(r,e,t){if(r&&r._inc){r._inc++;var i=e.childNodes;if(t)i[i.length++]=t;else {for(var s=e.firstChild,n=0;s;)i[n++]=s,s=s.nextSibling;i.length=n,delete i[i.length];}}}function y3(r,e){var t=e.previousSibling,i=e.nextSibling;return t?t.nextSibling=i:r.firstChild=i,i?i.previousSibling=t:r.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,T1(r.ownerDocument,r),e}function Jk(r){return r&&(r.nodeType===Ae.DOCUMENT_NODE||r.nodeType===Ae.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ae.ELEMENT_NODE)}function eF(r){return r&&(_i(r)||S1(r)||ji(r)||r.nodeType===Ae.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ae.COMMENT_NODE||r.nodeType===Ae.PROCESSING_INSTRUCTION_NODE)}function ji(r){return r&&r.nodeType===Ae.DOCUMENT_TYPE_NODE}function _i(r){return r&&r.nodeType===Ae.ELEMENT_NODE}function S1(r){return r&&r.nodeType===Ae.TEXT_NODE}function n3(r,e){var t=r.childNodes||[];if(xi(t,_i)||ji(e))return false;var i=xi(t,ji);return !(e&&i&&t.indexOf(i)>t.indexOf(e))}function o3(r,e){var t=r.childNodes||[];function i(n){return _i(n)&&n!==e}if(xi(t,i))return false;var s=xi(t,ji);return !(e&&s&&t.indexOf(s)>t.indexOf(e))}function tF(r,e,t){if(!Jk(r))throw new tt(Jt,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new tt(m3,"child not in parent");if(!eF(e)||ji(e)&&r.nodeType!==Ae.DOCUMENT_NODE)throw new tt(Jt,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function rF(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ae.DOCUMENT_FRAGMENT_NODE){var n=s.filter(_i);if(n.length>1||xi(s,S1))throw new tt(Jt,"More than one element or text in fragment");if(n.length===1&&!n3(r,t))throw new tt(Jt,"Element in fragment can not be inserted before doctype")}if(_i(e)&&!n3(r,t))throw new tt(Jt,"Only one element can be added and only after doctype");if(ji(e)){if(xi(i,ji))throw new tt(Jt,"Only one doctype is allowed");var o=xi(i,_i);if(t&&i.indexOf(o)<i.indexOf(t))throw new tt(Jt,"Doctype can only be inserted before an element");if(!t&&o)throw new tt(Jt,"Doctype can not be appended since element is present")}}function v3(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ae.DOCUMENT_FRAGMENT_NODE){var n=s.filter(_i);if(n.length>1||xi(s,S1))throw new tt(Jt,"More than one element or text in fragment");if(n.length===1&&!o3(r,t))throw new tt(Jt,"Element in fragment can not be inserted before doctype")}if(_i(e)&&!o3(r,t))throw new tt(Jt,"Only one element can be added and only after doctype");if(ji(e)){let u=function(l){return ji(l)&&l!==t};if(xi(i,u))throw new tt(Jt,"Only one doctype is allowed");var o=xi(i,_i);if(t&&i.indexOf(o)<i.indexOf(t))throw new tt(Jt,"Doctype can only be inserted before an element")}}function r_(r,e,t,i){tF(r,e,t),r.nodeType===Ae.DOCUMENT_NODE&&(i||rF)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===$i){var n=e.firstChild;if(n==null)return e;var o=e.lastChild;}else n=o=e;var a=t?t.previousSibling:r.lastChild;n.previousSibling=a,o.nextSibling=t,a?a.nextSibling=n:r.firstChild=n,t==null?r.lastChild=o:t.previousSibling=o;do n.parentNode=r;while(n!==o&&(n=n.nextSibling));return T1(r.ownerDocument||r,r),e.nodeType==$i&&(e.firstChild=e.lastChild=null),e}function iF(r,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=r,e.previousSibling=r.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,r.lastChild=e,T1(r.ownerDocument,r,e),e}rd.prototype={nodeName:"#document",nodeType:f3,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==$i){for(var t=r.firstChild;t;){var i=t.nextSibling;this.insertBefore(t,e),t=i;}return r}return r_(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===Xr&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),y3(this,r)},replaceChild:function(r,e){r_(this,r,e,v3),r.ownerDocument=this,e&&this.removeChild(e),_i(r)&&(this.documentElement=r);},importNode:function(r,e){return C3(this,r,e)},getElementById:function(r){var e=null;return ed(this.documentElement,function(t){if(t.nodeType==Xr&&t.getAttribute("id")==r)return e=t,true}),e},getElementsByClassName:function(r){var e=t3(r);return new dl(this,function(t){var i=[];return e.length>0&&ed(t.documentElement,function(s){if(s!==t&&s.nodeType===Xr){var n=s.getAttribute("class");if(n){var o=r===n;if(!o){var a=t3(n);o=e.every(qk(a));}o&&i.push(s);}}}),i})},createElement:function(r){var e=new aa;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new Yi;var t=e.attributes=new t_;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new n_;return r.ownerDocument=this,r.childNodes=new Yi,r},createTextNode:function(r){var e=new E1;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new A1;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new C1;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new w1;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new i_;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=true,e},createEntityReference:function(r){var e=new P1;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new aa,i=e.split(":"),s=t.attributes=new t_;return t.childNodes=new Yi,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,s._ownerElement=t,t},createAttributeNS:function(r,e){var t=new i_,i=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=true,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,t}};er(rd,Ae);function aa(){this._nsMap={};}aa.prototype={nodeType:Xr,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var e=this.getAttributeNode(r);return e&&e.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t);},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e);},appendChild:function(r){return r.nodeType===$i?this.insertBefore(r,null):iF(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t);},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},setAttributeNS:function(r,e,t){var i=this.ownerDocument.createAttributeNS(r,e);i.value=i.nodeValue=""+t,this.setAttributeNode(i);},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByTagName:function(r){return new dl(this,function(e){var t=[];return ed(e,function(i){i!==e&&i.nodeType==Xr&&(r==="*"||i.tagName==r)&&t.push(i);}),t})},getElementsByTagNameNS:function(r,e){return new dl(this,function(t){var i=[];return ed(t,function(s){s!==t&&s.nodeType===Xr&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&i.push(s);}),i})}};rd.prototype.getElementsByTagName=aa.prototype.getElementsByTagName;rd.prototype.getElementsByTagNameNS=aa.prototype.getElementsByTagNameNS;er(aa,Ae);function i_(){}i_.prototype.nodeType=hl;er(i_,Ae);function id(){}id.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length;},insertData:function(r,e){this.replaceData(r,0,e);},appendChild:function(r){throw new Error(yt[Jt])},deleteData:function(r,e){this.replaceData(r,e,"");},replaceData:function(r,e,t){var i=this.data.substring(0,r),s=this.data.substring(r+e);t=i+t+s,this.nodeValue=this.data=t,this.length=t.length;}};er(id,Ae);function E1(){}E1.prototype={nodeName:"#text",nodeType:e_,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}};er(E1,id);function A1(){}A1.prototype={nodeName:"#comment",nodeType:d3};er(A1,id);function C1(){}C1.prototype={nodeName:"#cdata-section",nodeType:l3};er(C1,id);function s_(){}s_.prototype.nodeType=p3;er(s_,Ae);function T3(){}T3.prototype.nodeType=Zk;er(T3,Ae);function S3(){}S3.prototype.nodeType=Kk;er(S3,Ae);function P1(){}P1.prototype.nodeType=c3;er(P1,Ae);function n_(){}n_.prototype.nodeName="#document-fragment";n_.prototype.nodeType=$i;er(n_,Ae);function w1(){}w1.prototype.nodeType=h3;er(w1,Ae);function E3(){}E3.prototype.serializeToString=function(r,e,t){return A3.call(r,e,t)};Ae.prototype.toString=A3;function A3(r,e){var t=[],i=this.nodeType==9&&this.documentElement||this,s=i.prefix,n=i.namespaceURI;if(n&&s==null){var s=i.lookupPrefix(n);if(s==null)var o=[{namespace:n,prefix:null}];}return cl(this,t,r,e,o),t.join("")}function a3(r,e,t){var i=r.prefix||"",s=r.namespaceURI;if(!s||i==="xml"&&s===Jh.XML||s===Jh.XMLNS)return false;for(var n=t.length;n--;){var o=t[n];if(o.prefix===i)return o.namespace!==s}return true}function b1(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,_3),'"');}function cl(r,e,t,i,s){if(s||(s=[]),i)if(r=i(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case Xr:var n=r.attributes,o=n.length,m=r.firstChild,a=r.tagName;t=Jh.isHTML(r.namespaceURI)||t;var u=a;if(!t&&!r.prefix&&r.namespaceURI){for(var l,c=0;c<n.length;c++)if(n.item(c).name==="xmlns"){l=n.item(c).value;break}if(!l)for(var h=s.length-1;h>=0;h--){var d=s[h];if(d.prefix===""&&d.namespace===r.namespaceURI){l=d.namespace;break}}if(l!==r.namespaceURI)for(var h=s.length-1;h>=0;h--){var d=s[h];if(d.namespace===r.namespaceURI){d.prefix&&(u=d.prefix+":"+a);break}}}e.push("<",u);for(var p=0;p<o;p++){var _=n.item(p);_.prefix=="xmlns"?s.push({prefix:_.localName,namespace:_.value}):_.nodeName=="xmlns"&&s.push({prefix:"",namespace:_.value});}for(var p=0;p<o;p++){var _=n.item(p);if(a3(_,t,s)){var b=_.prefix||"",x=_.namespaceURI;b1(e,b?"xmlns:"+b:"xmlns",x),s.push({prefix:b,namespace:x});}cl(_,e,t,i,s);}if(a===u&&a3(r,t,s)){var b=r.prefix||"",x=r.namespaceURI;b1(e,b?"xmlns:"+b:"xmlns",x),s.push({prefix:b,namespace:x});}if(m||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(a)){if(e.push(">"),t&&/^script$/i.test(a))for(;m;)m.data?e.push(m.data):cl(m,e,t,i,s.slice()),m=m.nextSibling;else for(;m;)cl(m,e,t,i,s.slice()),m=m.nextSibling;e.push("</",u,">");}else e.push("/>");return;case f3:case $i:for(var m=r.firstChild;m;)cl(m,e,t,i,s.slice()),m=m.nextSibling;return;case hl:return b1(e,r.name,r.value);case e_:return e.push(r.data.replace(/[<&>]/g,_3));case l3:return e.push("<![CDATA[",r.data,"]]>");case d3:return e.push("<!--",r.data,"-->");case p3:var v=r.publicId,T=r.systemId;if(e.push("<!DOCTYPE ",r.name),v)e.push(" PUBLIC ",v),T&&T!="."&&e.push(" ",T),e.push(">");else if(T&&T!=".")e.push(" SYSTEM ",T,">");else {var S=r.internalSubset;S&&e.push(" [",S,"]"),e.push(">");}return;case h3:return e.push("<?",r.target," ",r.data,"?>");case c3:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName);}}function C3(r,e,t){var i;switch(e.nodeType){case Xr:i=e.cloneNode(false),i.ownerDocument=r;case $i:break;case hl:t=true;break}if(i||(i=e.cloneNode(false)),i.ownerDocument=r,i.parentNode=null,t)for(var s=e.firstChild;s;)i.appendChild(C3(r,s,t)),s=s.nextSibling;return i}function y1(r,e,t){var i=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];typeof n!="object"&&n!=i[s]&&(i[s]=n);}switch(e.childNodes&&(i.childNodes=new Yi),i.ownerDocument=r,i.nodeType){case Xr:var o=e.attributes,a=i.attributes=new t_,u=o.length;a._ownerElement=i;for(var l=0;l<u;l++)i.setAttributeNode(y1(r,o.item(l),true));break;case hl:t=true;}if(t)for(var c=e.firstChild;c;)i.appendChild(y1(r,c,t)),c=c.nextSibling;return i}function P3(r,e,t){r[e]=t;}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case Xr:case $i:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};sF=r,Object.defineProperty(dl.prototype,"length",{get:function(){return v1(this),this.$$length}}),Object.defineProperty(Ae.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case Xr:case $i:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e;}}}),P3=function(e,t,i){e["$$"+t]=i;};}}catch{}var sF;sn.DocumentType=s_;sn.DOMException=tt;sn.DOMImplementation=x3;sn.Element=aa;sn.Node=Ae;sn.NodeList=Yi;sn.XMLSerializer=E3;});var B3=ti(sd=>{var w3=Qh().freeze;sd.XML_ENTITIES=w3({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});sd.HTML_ENTITIES=w3({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
2473
|
+
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});sd.entityMap=sd.HTML_ENTITIES;});var G3=ti(M1=>{var ud=Qh().NAMESPACE,R1=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,R3=new RegExp("[\\-\\.0-9"+R1.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),M3=new RegExp("^"+R1.source+R3.source+"*(?::"+R1.source+R3.source+"*)?$"),nd=0,nn=1,fl=2,od=3,pl=4,ml=5,ad=6,o_=7;function gl(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,gl);}gl.prototype=new Error;gl.prototype.name=gl.name;function k3(){}k3.prototype={parse:function(r,e,t){var i=this.domBuilder;i.startDocument(),F3(e,e={}),nF(r,e,t,i,this.errorHandler),i.endDocument();}};function nF(r,e,t,i,s){function n(z){if(z>65535){z-=65536;var j=55296+(z>>10),cb=56320+(z&1023);return String.fromCharCode(j,cb)}else return String.fromCharCode(z)}function o(z){var j=z.slice(1,-1);return Object.hasOwnProperty.call(t,j)?t[j]:j.charAt(0)==="#"?n(parseInt(j.substr(1).replace("x","0x"))):(s.error("entity not found:"+z),z)}function a(z){if(z>b){var j=r.substring(b,z).replace(/&#?\w+;/g,o);d&&u(b),i.characters(j,0,z-b),b=z;}}function u(z,j){for(;z>=c&&(j=h.exec(r));)l=j.index,c=l+j[0].length,d.lineNumber++;d.columnNumber=z-l+1;}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,p=[{currentNSMap:e}],_={},b=0;;){try{var x=r.indexOf("<",b);if(x<0){if(!r.substr(b).match(/^\s*$/)){var m=i.doc,v=m.createTextNode(r.substr(b));m.appendChild(v),i.currentElement=v;}return}switch(x>b&&a(x),r.charAt(x+1)){case "/":var k=r.indexOf(">",x+3),T=r.substring(x+2,k).replace(/[ \t\n\r]+$/g,""),S=p.pop();k<0?(T=r.substring(x+2).replace(/[\s<].*/,""),s.error("end tag name: "+T+" is not complete:"+S.tagName),k=x+1+T.length):T.match(/\s</)&&(T=T.replace(/[\s<].*/,""),s.error("end tag name: "+T+" maybe not complete"),k=x+1+T.length);var B=S.localNSMap,A=S.tagName==T,R=A||S.tagName&&S.tagName.toLowerCase()==T.toLowerCase();if(R){if(i.endElement(S.uri,S.localName,T),B)for(var Y in B)Object.prototype.hasOwnProperty.call(B,Y)&&i.endPrefixMapping(Y);A||s.fatalError("end tag name: "+T+" is not match the current start tagName:"+S.tagName);}else p.push(S);k++;break;case "?":d&&u(x),k=cF(r,x,i);break;case "!":d&&u(x),k=lF(r,x,i,s);break;default:d&&u(x);var M=new O3,U=p[p.length-1].currentNSMap,k=oF(r,x,M,U,o,s),J=M.length;if(!M.closed&&uF(r,k,M.tagName,_)&&(M.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),d&&J){for(var ge=D3(d,{}),Ke=0;Ke<J;Ke++){var ts=M[Ke];u(ts.offset),ts.locator=D3(d,{});}i.locator=ge,I3(M,i,U)&&p.push(M),i.locator=d;}else I3(M,i,U)&&p.push(M);ud.isHTML(M.uri)&&!M.closed?k=aF(r,k,M.tagName,o,i):k++;}}catch(z){if(z instanceof gl)throw z;s.error("element parse error: "+z),k=-1;}k>b?b=k:a(Math.max(x,b)+1);}}function D3(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function oF(r,e,t,i,s,n){function o(p,_,b){t.attributeNames.hasOwnProperty(p)&&n.fatalError("Attribute "+p+" redefined"),t.addValue(p,_.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),b);}for(var a,u,l=++e,c=nd;;){var h=r.charAt(l);switch(h){case "=":if(c===nn)a=r.slice(e,l),c=od;else if(c===fl)c=od;else throw new Error("attribute equal must after attrName");break;case "'":case '"':if(c===od||c===nn)if(c===nn&&(n.warning('attribute value must after "="'),a=r.slice(e,l)),e=l+1,l=r.indexOf(h,e),l>0)u=r.slice(e,l),o(a,u,e-1),c=ml;else throw new Error("attribute value no end '"+h+"' match");else if(c==pl)u=r.slice(e,l),o(a,u,e),n.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=l+1,c=ml;else throw new Error('attribute value must after "="');break;case "/":switch(c){case nd:t.setTagName(r.slice(e,l));case ml:case ad:case o_:c=o_,t.closed=true;case pl:case nn:break;case fl:t.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case "":return n.error("unexpected end of input"),c==nd&&t.setTagName(r.slice(e,l)),l;case ">":switch(c){case nd:t.setTagName(r.slice(e,l));case ml:case ad:case o_:break;case pl:case nn:u=r.slice(e,l),u.slice(-1)==="/"&&(t.closed=true,u=u.slice(0,-1));case fl:c===fl&&(u=a),c==pl?(n.warning('attribute "'+u+'" missed quot(")!'),o(a,u,e)):((!ud.isHTML(i[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case od:throw new Error("attribute value missed!!")}return l;case "\x80":h=" ";default:if(h<=" ")switch(c){case nd:t.setTagName(r.slice(e,l)),c=ad;break;case nn:a=r.slice(e,l),c=fl;break;case pl:var u=r.slice(e,l);n.warning('attribute "'+u+'" missed quot(")!!'),o(a,u,e);case ml:c=ad;break}else switch(c){case fl:t.tagName;(!ud.isHTML(i[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,e),e=l,c=nn;break;case ml:n.warning('attribute space is required"'+a+'"!!');case ad:c=nn,e=l;break;case od:c=pl,e=l;break;case o_:throw new Error("elements closed character '/' and '>' must be connected to")}}l++;}}function I3(r,e,t){for(var i=r.tagName,s=null,h=r.length;h--;){var n=r[h],o=n.qName,a=n.value,d=o.indexOf(":");if(d>0)var u=n.prefix=o.slice(0,d),l=o.slice(d+1),c=u==="xmlns"&&l;else l=o,u=null,c=o==="xmlns"&&"";n.localName=l,c!==false&&(s==null&&(s={},F3(t,t={})),t[c]=s[c]=a,n.uri=ud.XMLNS,e.startPrefixMapping(c,a));}for(var h=r.length;h--;){n=r[h];var u=n.prefix;u&&(u==="xml"&&(n.uri=ud.XML),u!=="xmlns"&&(n.uri=t[u||""]));}var d=i.indexOf(":");d>0?(u=r.prefix=i.slice(0,d),l=r.localName=i.slice(d+1)):(u=null,l=r.localName=i);var p=r.uri=t[u||""];if(e.startElement(p,l,i,r),r.closed){if(e.endElement(p,l,i),s)for(u in s)Object.prototype.hasOwnProperty.call(s,u)&&e.endPrefixMapping(u);}else return r.currentNSMap=t,r.localNSMap=s,true}function aF(r,e,t,i,s){if(/^(?:script|textarea)$/i.test(t)){var n=r.indexOf("</"+t+">",e),o=r.substring(e+1,n);if(/[&<]/.test(o))return /^script$/i.test(t)?(s.characters(o,0,o.length),n):(o=o.replace(/&#?\w+;/g,i),s.characters(o,0,o.length),n)}return e+1}function uF(r,e,t,i){var s=i[t];return s==null&&(s=r.lastIndexOf("</"+t+">"),s<e&&(s=r.lastIndexOf("</"+t)),i[t]=s),s<e}function F3(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function lF(r,e,t,i){var s=r.charAt(e+2);switch(s){case "-":if(r.charAt(e+3)==="-"){var n=r.indexOf("-->",e+4);return n>e?(t.comment(r,e+4,n-e-4),n+3):(i.error("Unclosed comment"),-1)}else return -1;default:if(r.substr(e+3,6)=="CDATA["){var n=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,n-e-9),t.endCDATA(),n+3}var o=hF(r,e),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var u=o[1][0],l=false,c=false;a>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],c=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var h=o[a-1];return t.startDTD(u,l,c),t.endDTD(),h.index+h[0].length}}return -1}function cF(r,e,t){var i=r.indexOf("?>",e);if(i){var s=r.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s){s[0].length;return t.processingInstruction(s[1],s[2]),i+2}else return -1}return -1}function O3(){this.attributeNames={};}O3.prototype={setTagName:function(r){if(!M3.test(r))throw new Error("invalid tagName:"+r);this.tagName=r;},addValue:function(r,e,t){if(!M3.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t};},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function hF(r,e){var t,i=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(r);t=s.exec(r);)if(i.push(t),t[1])return i}M1.XMLReader=k3;M1.ParseError=gl;});var W3=ti(u_=>{var dF=Qh(),fF=B1(),U3=B3(),H3=G3(),pF=fF.DOMImplementation,L3=dF.NAMESPACE,mF=H3.ParseError,gF=H3.XMLReader;function V3(r){return r.replace(/\r[\n\u0085]/g,`
|
|
2474
2474
|
`).replace(/[\r\u0085\u2028]/g,`
|
|
2475
2475
|
`)}function z3(r){this.options=r||{locator:{}};}z3.prototype.parseFromString=function(r,e){var t=this.options,i=new gF,s=t.domBuilder||new ld,n=t.errorHandler,o=t.locator,a=t.xmlns||{},u=/\/x?html?$/.test(e),l=u?U3.HTML_ENTITIES:U3.XML_ENTITIES;o&&s.setDocumentLocator(o),i.errorHandler=xF(n,s,o),i.domBuilder=t.domBuilder||s,u&&(a[""]=L3.HTML),a.xml=a.xml||L3.XML;var c=t.normalizeLineEndings||V3;return r&&typeof r=="string"?i.parse(c(r),a,l):i.errorHandler.error("invalid doc source"),s.doc};function xF(r,e,t){if(!r){if(e instanceof ld)return e;r=e;}var i={},s=r instanceof Function;t=t||{};function n(o){var a=r[o];!a&&s&&(a=r.length==2?function(u){r(o,u);}:r),i[o]=a&&function(u){a("[xmldom "+o+"] "+u+D1(t));}||function(){};}return n("warning"),n("error"),n("fatalError"),i}function ld(){this.cdata=false;}function xl(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber;}ld.prototype={startDocument:function(){this.doc=new pF().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId);},startElement:function(r,e,t,i){var s=this.doc,n=s.createElementNS(r,t||e),o=i.length;a_(this,n),this.currentElement=n,this.locator&&xl(this.locator,n);for(var a=0;a<o;a++){var r=i.getURI(a),u=i.getValue(a),t=i.getQName(a),l=s.createAttributeNS(r,t);this.locator&&xl(i.getLocator(a),l),l.value=l.nodeValue=u,n.setAttributeNode(l);}},endElement:function(r,e,t){var i=this.currentElement;i.tagName;this.currentElement=i.parentNode;},startPrefixMapping:function(r,e){},endPrefixMapping:function(r){},processingInstruction:function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&xl(this.locator,t),a_(this,t);},ignorableWhitespace:function(r,e,t){},characters:function(r,e,t){if(r=N3.apply(this,arguments),r){if(this.cdata)var i=this.doc.createCDATASection(r);else var i=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(r)&&this.doc.appendChild(i),this.locator&&xl(this.locator,i);}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize();},setDocumentLocator:function(r){(this.locator=r)&&(r.lineNumber=0);},comment:function(r,e,t){r=N3.apply(this,arguments);var i=this.doc.createComment(r);this.locator&&xl(this.locator,i),a_(this,i);},startCDATA:function(){this.cdata=true;},endCDATA:function(){this.cdata=false;},startDTD:function(r,e,t){var i=this.doc.implementation;if(i&&i.createDocumentType){var s=i.createDocumentType(r,e,t);this.locator&&xl(this.locator,s),a_(this,s),this.doc.doctype=s;}},warning:function(r){console.warn("[xmldom warning] "+r,D1(this.locator));},error:function(r){console.error("[xmldom error] "+r,D1(this.locator));},fatalError:function(r){throw new mF(r,this.locator)}};function D1(r){if(r)return `
|
|
2476
2476
|
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function N3(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){ld.prototype[r]=function(){return null};});function a_(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e);}u_.__DOMHandler=ld;u_.normalizeLineEndings=V3;u_.DOMParser=z3;});var Y3=ti(l_=>{var X3=B1();l_.DOMImplementation=X3.DOMImplementation;l_.XMLSerializer=X3.XMLSerializer;l_.DOMParser=W3().DOMParser;});var $3,j3,q3=f(()=>{$3=Wd(Y3()),j3={createCanvas:(r,e)=>new OffscreenCanvas(r??0,e??0),getCanvasRenderingContext2D:()=>OffscreenCanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>globalThis.location.href,getFontFaceSet:()=>globalThis.fonts,fetch:(r,e)=>fetch(r,e),parseXML:r=>new $3.DOMParser().parseFromString(r,"text/xml")};});var on,cd=f(()=>{on=`in vec2 aPosition;
|
|
@@ -2871,7 +2871,7 @@ fn mainFragment(
|
|
|
2871
2871
|
rgb.b *= result.a;
|
|
2872
2872
|
|
|
2873
2873
|
return vec4(rgb, result.a);
|
|
2874
|
-
}`;});var __,iB=f(()=>{it();Kt();ur();Qe();hi();cd();H1();V1();__=class extends _t{constructor(e={}){let t=new ae({uColorMatrix:{value:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],type:"f32",size:20},uAlpha:{value:1,type:"f32"}}),i=Fe.from({vertex:{source:fd,entryPoint:"mainVertex"},fragment:{source:fd,entryPoint:"mainFragment"}}),s=ke.from({vertex:on,fragment:x_,name:"color-matrix-filter"});super({...e,gpuProgram:i,glProgram:s,resources:{colorMatrixUniforms:t}}),this.alpha=1;}_loadMatrix(e,t=false){let i=e;t&&(this._multiply(i,this.matrix,e),i=this._colorMatrix(i)),this.resources.colorMatrixUniforms.uniforms.uColorMatrix=i,this.resources.colorMatrixUniforms.update();}_multiply(e,t,i){return e[0]=t[0]*i[0]+t[1]*i[5]+t[2]*i[10]+t[3]*i[15],e[1]=t[0]*i[1]+t[1]*i[6]+t[2]*i[11]+t[3]*i[16],e[2]=t[0]*i[2]+t[1]*i[7]+t[2]*i[12]+t[3]*i[17],e[3]=t[0]*i[3]+t[1]*i[8]+t[2]*i[13]+t[3]*i[18],e[4]=t[0]*i[4]+t[1]*i[9]+t[2]*i[14]+t[3]*i[19]+t[4],e[5]=t[5]*i[0]+t[6]*i[5]+t[7]*i[10]+t[8]*i[15],e[6]=t[5]*i[1]+t[6]*i[6]+t[7]*i[11]+t[8]*i[16],e[7]=t[5]*i[2]+t[6]*i[7]+t[7]*i[12]+t[8]*i[17],e[8]=t[5]*i[3]+t[6]*i[8]+t[7]*i[13]+t[8]*i[18],e[9]=t[5]*i[4]+t[6]*i[9]+t[7]*i[14]+t[8]*i[19]+t[9],e[10]=t[10]*i[0]+t[11]*i[5]+t[12]*i[10]+t[13]*i[15],e[11]=t[10]*i[1]+t[11]*i[6]+t[12]*i[11]+t[13]*i[16],e[12]=t[10]*i[2]+t[11]*i[7]+t[12]*i[12]+t[13]*i[17],e[13]=t[10]*i[3]+t[11]*i[8]+t[12]*i[13]+t[13]*i[18],e[14]=t[10]*i[4]+t[11]*i[9]+t[12]*i[14]+t[13]*i[19]+t[14],e[15]=t[15]*i[0]+t[16]*i[5]+t[17]*i[10]+t[18]*i[15],e[16]=t[15]*i[1]+t[16]*i[6]+t[17]*i[11]+t[18]*i[16],e[17]=t[15]*i[2]+t[16]*i[7]+t[17]*i[12]+t[18]*i[17],e[18]=t[15]*i[3]+t[16]*i[8]+t[17]*i[13]+t[18]*i[18],e[19]=t[15]*i[4]+t[16]*i[9]+t[17]*i[14]+t[18]*i[19]+t[19],e}_colorMatrix(e){let t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t}brightness(e,t){let i=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(i,t);}tint(e,t){let[i,s,n]=K.shared.setValue(e).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,t);}greyscale(e,t){let i=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(i,t);}grayscale(e,t){this.greyscale(e,t);}blackAndWhite(e){let t=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(t,e);}hue(e,t){e=(e||0)/180*Math.PI;let i=Math.cos(e),s=Math.sin(e),n=Math.sqrt,o=1/3,a=n(o),u=i+(1-i)*o,l=o*(1-i)-a*s,c=o*(1-i)+a*s,h=o*(1-i)+a*s,d=i+o*(1-i),p=o*(1-i)-a*s,_=o*(1-i)-a*s,b=o*(1-i)+a*s,x=i+o*(1-i),
|
|
2874
|
+
}`;});var __,iB=f(()=>{it();Kt();ur();Qe();hi();cd();H1();V1();__=class extends _t{constructor(e={}){let t=new ae({uColorMatrix:{value:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],type:"f32",size:20},uAlpha:{value:1,type:"f32"}}),i=Fe.from({vertex:{source:fd,entryPoint:"mainVertex"},fragment:{source:fd,entryPoint:"mainFragment"}}),s=ke.from({vertex:on,fragment:x_,name:"color-matrix-filter"});super({...e,gpuProgram:i,glProgram:s,resources:{colorMatrixUniforms:t}}),this.alpha=1;}_loadMatrix(e,t=false){let i=e;t&&(this._multiply(i,this.matrix,e),i=this._colorMatrix(i)),this.resources.colorMatrixUniforms.uniforms.uColorMatrix=i,this.resources.colorMatrixUniforms.update();}_multiply(e,t,i){return e[0]=t[0]*i[0]+t[1]*i[5]+t[2]*i[10]+t[3]*i[15],e[1]=t[0]*i[1]+t[1]*i[6]+t[2]*i[11]+t[3]*i[16],e[2]=t[0]*i[2]+t[1]*i[7]+t[2]*i[12]+t[3]*i[17],e[3]=t[0]*i[3]+t[1]*i[8]+t[2]*i[13]+t[3]*i[18],e[4]=t[0]*i[4]+t[1]*i[9]+t[2]*i[14]+t[3]*i[19]+t[4],e[5]=t[5]*i[0]+t[6]*i[5]+t[7]*i[10]+t[8]*i[15],e[6]=t[5]*i[1]+t[6]*i[6]+t[7]*i[11]+t[8]*i[16],e[7]=t[5]*i[2]+t[6]*i[7]+t[7]*i[12]+t[8]*i[17],e[8]=t[5]*i[3]+t[6]*i[8]+t[7]*i[13]+t[8]*i[18],e[9]=t[5]*i[4]+t[6]*i[9]+t[7]*i[14]+t[8]*i[19]+t[9],e[10]=t[10]*i[0]+t[11]*i[5]+t[12]*i[10]+t[13]*i[15],e[11]=t[10]*i[1]+t[11]*i[6]+t[12]*i[11]+t[13]*i[16],e[12]=t[10]*i[2]+t[11]*i[7]+t[12]*i[12]+t[13]*i[17],e[13]=t[10]*i[3]+t[11]*i[8]+t[12]*i[13]+t[13]*i[18],e[14]=t[10]*i[4]+t[11]*i[9]+t[12]*i[14]+t[13]*i[19]+t[14],e[15]=t[15]*i[0]+t[16]*i[5]+t[17]*i[10]+t[18]*i[15],e[16]=t[15]*i[1]+t[16]*i[6]+t[17]*i[11]+t[18]*i[16],e[17]=t[15]*i[2]+t[16]*i[7]+t[17]*i[12]+t[18]*i[17],e[18]=t[15]*i[3]+t[16]*i[8]+t[17]*i[13]+t[18]*i[18],e[19]=t[15]*i[4]+t[16]*i[9]+t[17]*i[14]+t[18]*i[19]+t[19],e}_colorMatrix(e){let t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t}brightness(e,t){let i=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(i,t);}tint(e,t){let[i,s,n]=K.shared.setValue(e).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,t);}greyscale(e,t){let i=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(i,t);}grayscale(e,t){this.greyscale(e,t);}blackAndWhite(e){let t=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(t,e);}hue(e,t){e=(e||0)/180*Math.PI;let i=Math.cos(e),s=Math.sin(e),n=Math.sqrt,o=1/3,a=n(o),u=i+(1-i)*o,l=o*(1-i)-a*s,c=o*(1-i)+a*s,h=o*(1-i)+a*s,d=i+o*(1-i),p=o*(1-i)-a*s,_=o*(1-i)-a*s,b=o*(1-i)+a*s,x=i+o*(1-i),m=[u,l,c,0,0,h,d,p,0,0,_,b,x,0,0,0,0,0,1,0];this._loadMatrix(m,t);}contrast(e,t){let i=(e||0)+1,s=-0.5*(i-1),n=[i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0];this._loadMatrix(n,t);}saturate(e=0,t){let i=e*2/3+1,s=(i-1)*-0.5,n=[i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0];this._loadMatrix(n,t);}desaturate(){this.saturate(-1);}negative(e){let t=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(t,e);}sepia(e){let t=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(t,e);}technicolor(e){let t=[1.9125277891456083,-0.8545344976951645,-0.09155508482755585,0,11.793603434377337,-0.3087833385928097,1.7658908555458428,-0.10601743074722245,0,-70.35205161461398,-0.231103377548616,-0.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(t,e);}polaroid(e){let t=[1.438,-0.062,-0.062,0,0,-0.122,1.378,-0.122,0,0,-0.016,-0.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(t,e);}toBGR(e){let t=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(t,e);}kodachrome(e){let t=[1.1285582396593525,-0.3967382283601348,-0.03992559172921793,0,63.72958762196502,-0.16404339962244616,1.0835251566291304,-0.05498805115633132,0,24.732407896706203,-0.16786010706155763,-0.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(t,e);}browni(e){let t=[.5997023498159715,.34553243048391263,-0.2708298674538042,0,47.43192855600873,-0.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-0.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(t,e);}vintage(e){let t=[.6279345635605994,.3202183420819367,-0.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-0.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(t,e);}colorTone(e,t,i,s,n){e||(e=.2),t||(t=.15),i||(i=16770432),s||(s=3375104);let o=K.shared,[a,u,l]=o.setValue(i).toArray(),[c,h,d]=o.setValue(s).toArray(),p=[.3,.59,.11,0,0,a,u,l,e,0,c,h,d,t,0,a-c,u-h,l-d,0,0];this._loadMatrix(p,n);}night(e,t){e||(e=.1);let i=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(i,t);}predator(e,t){let i=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(i,t);}lsd(e){let t=[2,-0.4,.5,0,0,-0.5,2,-0.4,0,0,-0.4,-0.5,3,0,0,0,0,0,1,0];this._loadMatrix(t,e);}reset(){let e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,false);}get matrix(){return this.resources.colorMatrixUniforms.uniforms.uColorMatrix}set matrix(e){this.resources.colorMatrixUniforms.uniforms.uColorMatrix=e;}get alpha(){return this.resources.colorMatrixUniforms.uniforms.uAlpha}set alpha(e){this.resources.colorMatrixUniforms.uniforms.uAlpha=e;}};});var b_,z1=f(()=>{b_=`
|
|
2875
2875
|
in vec2 vTextureCoord;
|
|
2876
2876
|
in vec2 vFilterUv;
|
|
2877
2877
|
|
|
@@ -3223,11 +3223,11 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3223
3223
|
}
|
|
3224
3224
|
|
|
3225
3225
|
return result;
|
|
3226
|
-
}`;});function gd(r,e,t,i,s,n,o,a){let u=o-t,l=a-i,c=s-t,h=n-i,d=r-t,p=e-i,_=u*u+l*l,b=u*c+l*h,x=u*d+l*p,g=c*c+h*h,v=c*d+h*p,T=1/(_*g-b*b),S=(g*x-b*v)*T,B=(_*v-b*x)*T;return S>=0&&B>=0&&S+B<1}var j1=f(()=>{});var S_,hB=f(()=>{qp();Ze();S_=class r{constructor(e=0,t=0,i=0,s=0,n=0,o=0){this.type="triangle",this.x=e,this.y=t,this.x2=i,this.y2=s,this.x3=n,this.y3=o;}contains(e,t){let i=(this.x-this.x3)*(t-this.y3)-(this.y-this.y3)*(e-this.x3),s=(this.x2-this.x)*(t-this.y)-(this.y2-this.y)*(e-this.x);if(i<0!=s<0&&i!==0&&s!==0)return false;let n=(this.x3-this.x2)*(t-this.y2)-(this.y3-this.y2)*(e-this.x2);return n===0||n<0==i+s<=0}strokeContains(e,t,i,s=.5){let n=i/2,o=n*n,{x:a,x2:u,x3:l,y:c,y2:h,y3:d}=this;return Is(e,t,a,c,u,d)<=o||Is(e,t,u,h,l,d)<=o||Is(e,t,l,d,a,c)<=o}clone(){return new r(this.x,this.y,this.x2,this.y2,this.x3,this.y3)}copyFrom(e){return this.x=e.x,this.y=e.y,this.x2=e.x2,this.y2=e.y2,this.x3=e.x3,this.y3=e.y3,this}copyTo(e){return e.copyFrom(this),e}getBounds(e){e||(e=new Z);let t=Math.min(this.x,this.x2,this.x3),i=Math.max(this.x,this.x2,this.x3),s=Math.min(this.y,this.y2,this.y3),n=Math.max(this.y,this.y2,this.y3);return e.x=t,e.y=s,e.width=i-t,e.height=n-s,e}};});var dB,E_,q1=f(()=>{qt();Bn();ds();dB=class fB{constructor(e){this._tick=()=>{this.timeout=setTimeout(this._processQueue,0);},this._processQueue=()=>{let{queue:t}=this,i=0;for(;t.length&&i<fB.uploadsPerFrame;){let s=t.shift();this.uploadQueueItem(s),i++;}t.length?ye.system.addOnce(this._tick,this,Ht.UTILITY):this._resolve();},this.renderer=e,this.queue=[],this.resolves=[];}getQueue(){return [...this.queue]}add(e){let t=Array.isArray(e)?e:[e];for(let i of t)i instanceof te?this._addContainer(i):this.resolveQueueItem(i,this.queue);return this}_addContainer(e){this.resolveQueueItem(e,this.queue);for(let t of e.children)this._addContainer(t);}upload(e){return e&&this.add(e),new Promise(t=>{this.queue.length?(this.resolves.push(t),this.dedupeQueue(),ye.system.addOnce(this._tick,this,Ht.UTILITY)):t();})}dedupeQueue(){let e=Object.create(null),t=0;for(let i=0;i<this.queue.length;i++){let s=this.queue[i];e[s.uid]||(e[s.uid]=true,this.queue[t++]=s);}this.queue.length=t;}_resolve(){let{resolves:e}=this,t=e.slice(0);e.length=0;for(let i of t)i();}};dB.uploadsPerFrame=4;E_=dB;});var rr,ua=f(()=>{j1();vs();cr();ce();xe();Gr();Vs();rr=class extends qe{constructor(...e){let t=e[0];t instanceof Mt&&(I(H,"Mesh: use new Mesh({ geometry, shader }) instead"),t={geometry:t,shader:e[1]},e[3]&&(I(H,"Mesh: drawMode argument has been removed, use geometry.topology instead"),t.geometry.topology=e[3]));let{geometry:i,shader:s,texture:n,roundPixels:o,state:a,...u}=t;super({label:"Mesh",...u}),this.renderPipeId="mesh",this._shader=null,this.allowChildren=false,this.shader=s??null,this.texture=n??s?.texture??C.WHITE,this.state=a??Ue.for2d(),this._geometry=i,this._geometry.on("update",this.onViewUpdate,this),this.roundPixels=o??false;}get material(){return I(H,"mesh.material property has been removed, use mesh.shader instead"),this._shader}set shader(e){this._shader!==e&&(this._shader=e,this.onViewUpdate());}get shader(){return this._shader}set geometry(e){this._geometry!==e&&(this._geometry?.off("update",this.onViewUpdate,this),e.on("update",this.onViewUpdate,this),this._geometry=e,this.onViewUpdate());}get geometry(){return this._geometry}set texture(e){e||(e=C.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this.shader&&(this.shader.texture=e),this._texture=e,this.onViewUpdate());}get texture(){return this._texture}get batched(){return this._shader||(this.state.data&12)!==0?false:this._geometry instanceof Zt?this._geometry.batchMode==="auto"?this._geometry.positions.length/2<=100:this._geometry.batchMode==="batch":false}get bounds(){return this._geometry.bounds}updateBounds(){this._bounds=this._geometry.bounds;}containsPoint(e){let{x:t,y:i}=e;if(!this.bounds.containsPoint(t,i))return false;let s=this.geometry.getBuffer("aPosition").data,n=this.geometry.topology==="triangle-strip"?3:1;if(this.geometry.getIndex()){let o=this.geometry.getIndex().data,a=o.length;for(let u=0;u+2<a;u+=n){let l=o[u]*2,c=o[u+1]*2,h=o[u+2]*2;if(gd(t,i,s[l],s[l+1],s[c],s[c+1],s[h],s[h+1]))return true}}else {let o=s.length/2;for(let a=0;a+2<o;a+=n){let u=a*2,l=(a+1)*2,c=(a+2)*2;if(gd(t,i,s[u],s[u+1],s[l],s[l+1],s[c],s[c+1]))return true}}return false}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._geometry?.off("update",this.onViewUpdate,this),this._texture=null,this._geometry=null,this._shader=null,this._gpuData=null;}};});var yl,K1=f(()=>{ce();Bn();ds();ms();yl=class r extends Ee{constructor(...e){let t=e[0];Array.isArray(e[0])&&(t={textures:e[0],autoUpdate:e[1]});let{animationSpeed:i=1,autoPlay:s=false,autoUpdate:n=true,loop:o=true,onComplete:a=null,onFrameChange:u=null,onLoop:l=null,textures:c,updateAnchor:h=false,...d}=t,[p]=c;super({...d,texture:p instanceof C?p:p.texture}),this._textures=null,this._durations=null,this._autoUpdate=n,this._isConnectedToTicker=false,this.animationSpeed=i,this.loop=o,this.updateAnchor=h,this.onComplete=a,this.onFrameChange=u,this.onLoop=l,this._currentTime=0,this._playing=false,this._previousFrame=null,this.textures=c,s&&this.play();}stop(){this._playing&&(this._playing=false,this._autoUpdate&&this._isConnectedToTicker&&(ye.shared.remove(this.update,this),this._isConnectedToTicker=false));}play(){this._playing||(this._playing=true,this._autoUpdate&&!this._isConnectedToTicker&&(ye.shared.add(this.update,this,Ht.HIGH),this._isConnectedToTicker=true));}gotoAndStop(e){this.stop(),this.currentFrame=e;}gotoAndPlay(e){this.currentFrame=e,this.play();}update(e){if(!this._playing)return;let t=e.deltaTime,i=this.animationSpeed*t,s=this.currentFrame;if(this._durations!==null){let n=this._currentTime%1*this._durations[this.currentFrame];for(n+=i/60*1e3;n<0;)this._currentTime--,n+=this._durations[this.currentFrame];let o=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);n>=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*o,this._currentTime+=o;this._currentTime+=n/this._durations[this.currentFrame];}else this._currentTime+=i;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()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<s||this.animationSpeed<0&&this.currentFrame>s)&&this.onLoop(),this._updateTexture());}_updateTexture(){let e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this.texture=this._textures[e],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame));}destroy(){this.stop(),super.destroy(),this.onComplete=null,this.onFrameChange=null,this.onLoop=null;}static fromFrames(e){let t=[];for(let i=0;i<e.length;++i)t.push(C.from(e[i]));return new r(t)}static fromImages(e){let t=[];for(let i=0;i<e.length;++i)t.push(C.from(e[i]));return new r(t)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(e){if(e[0]instanceof C)this._textures=e,this._durations=null;else {this._textures=[],this._durations=[];for(let t=0;t<e.length;t++)this._textures.push(e[t].texture),this._durations.push(e[t].time);}this._previousFrame=null,this.gotoAndStop(0),this._updateTexture();}get currentFrame(){let e=Math.floor(this._currentTime)%this._textures.length;return e<0&&(e+=this._textures.length),e}set currentFrame(e){if(e<0||e>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${e}, expected to be between 0 and totalFrames ${this.totalFrames}.`);let t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this._updateTexture();}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(ye.shared.remove(this.update,this),this._isConnectedToTicker=false):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(ye.shared.add(this.update,this),this._isConnectedToTicker=true));}};});var vl,Z1=f(()=>{he();is();vl=class{constructor({matrix:e,observer:t}={}){this.dirty=true,this._matrix=e??new D,this.observer=t,this.position=new we(this,0,0),this.scale=new we(this,1,1),this.pivot=new we(this,0,0),this.skew=new we(this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1;}get matrix(){let e=this._matrix;return this.dirty&&(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.dirty=false),e}_onUpdate(e){this.dirty=true,e===this.skew&&this.updateSkew(),this.observer?._onUpdate(this);}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.dirty=true;}toString(){return `[pixi.js/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}) ]`}setFromMatrix(e){e.decompose(this),this.dirty=true;}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this.skew));}};});var pB,C_,Q1=f(()=>{ni();is();ce();xe();_e();Z1();Gr();pB=class A_ extends qe{constructor(...e){let t=e[0]||{};t instanceof C&&(t={texture:t}),e.length>1&&(I(H,"use new TilingSprite({ texture, width:100, height:100 }) instead"),t.width=e[1],t.height=e[2]),t={...A_.defaultOptions,...t};let{texture:i,anchor:s,tilePosition:n,tileScale:o,tileRotation:a,width:u,height:l,applyAnchorToTexture:c,roundPixels:h,...d}=t??{};super({label:"TilingSprite",...d}),this.renderPipeId="tilingSprite",this.batched=true,this.allowChildren=false,this._anchor=new we({_onUpdate:()=>{this.onViewUpdate();}}),this.applyAnchorToTexture=c,this.texture=i,this._width=u??i.width,this._height=l??i.height,this._tileTransform=new vl({observer:{_onUpdate:()=>this.onViewUpdate()}}),s&&(this.anchor=s),this.tilePosition=n,this.tileScale=o,this.tileRotation=a,this.roundPixels=h??false;}static from(e,t={}){return typeof e=="string"?new A_({texture:de.get(e),...t}):new A_({texture:e,...t})}get uvRespectAnchor(){return F("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture}set uvRespectAnchor(e){F("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture=e;}get clampMargin(){return this._texture.textureMatrix.clampMargin}set clampMargin(e){this._texture.textureMatrix.clampMargin=e;}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get tilePosition(){return this._tileTransform.position}set tilePosition(e){this._tileTransform.position.copyFrom(e);}get tileScale(){return this._tileTransform.scale}set tileScale(e){typeof e=="number"?this._tileTransform.scale.set(e):this._tileTransform.scale.copyFrom(e);}set tileRotation(e){this._tileTransform.rotation=e;}get tileRotation(){return this._tileTransform.rotation}get tileTransform(){return this._tileTransform}set texture(e){e||(e=C.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get texture(){return this._texture}set width(e){this._width=e,this.onViewUpdate();}get width(){return this._width}set height(e){this._height=e,this.onViewUpdate();}get height(){return this._height}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}containsPoint(e){let t=this._width,i=this._height,s=-t*this._anchor._x,n=0;return e.x>=s&&e.x<=s+t&&(n=-i*this._anchor._y,e.y>=n&&e.y<=n+i)}destroy(e=false){if(super.destroy(e),this._anchor=null,this._tileTransform=null,this._bounds=null,typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}};pB.defaultOptions={texture:C.EMPTY,anchor:{x:0,y:0},tilePosition:{x:0,y:0},tileScale:{x:1,y:1},tileRotation:0,applyAnchorToTexture:false};C_=pB;});function an(r,e){let t=r[0]??{};return (typeof t=="string"||r[1])&&(I(H,`use new ${e}({ text: "hi!", style }) instead`),t={text:t,style:r[1]}),t}var bi,xd=f(()=>{is();xe();Gr();bi=class extends qe{constructor(e,t){let{text:i,resolution:s,style:n,anchor:o,width:a,height:u,roundPixels:l,...c}=e;super({...c}),this.batched=true,this._resolution=null,this._autoResolution=true,this._didTextUpdate=true,this._styleClass=t,this.text=i??"",this.style=n,this.resolution=s??null,this.allowChildren=false,this._anchor=new we({_onUpdate:()=>{this.onViewUpdate();}}),o&&(this.anchor=o),this.roundPixels=l??false,a!==void 0&&(this.width=a),u!==void 0&&(this.height=u);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}set text(e){e=e.toString(),this._text!==e&&(this._text=e,this.onViewUpdate());}get text(){return this._text}set resolution(e){this._autoResolution=e===null,this._resolution=e,this.onViewUpdate();}get resolution(){return this._resolution}get style(){return this._style}set style(e){e||(e={}),this._style?.off("update",this.onViewUpdate,this),e instanceof this._styleClass?this._style=e:this._style=new this._styleClass(e),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate();}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(e){this._setWidth(e,this.bounds.width);}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(e){this._setHeight(e,this.bounds.height);}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this.bounds.width,e.height=Math.abs(this.scale.y)*this.bounds.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this.bounds.width),t!==void 0&&this._setHeight(t,this.bounds.height);}containsPoint(e){let t=this.bounds.width,i=this.bounds.height,s=-t*this.anchor.x,n=0;return e.x>=s&&e.x<=s+t&&(n=-i*this.anchor.y,e.y>=n&&e.y<=n+i)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=true),super.onViewUpdate();}destroy(e=false){super.destroy(e),this.owner=null,this._bounds=null,this._anchor=null,(typeof e=="boolean"?e:e?.style)&&this._style.destroy(e),this._style=null,this._text=null;}};});var Rr,P_=f(()=>{Mi();xd();mm();eo();Os();Rr=class extends bi{constructor(...e){let t=an(e,"Text");super(t,gt),this.renderPipeId="text",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof st?t.textureStyle:new st(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=0,s=0;if(this._style.trim){let{frame:n,canvasAndContext:o}=Vi.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Vi.returnCanvasAndContext(o),i=n.width,s=n.height;}else {let n=xt.measureText(this._text,this._style);i=n.width,s=n.height;}e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};});var Tl,J1=f(()=>{ct();ce();qt();gm();Zn();ua();ms();K1();Q1();P_();q1();Tl=class extends E_{resolveQueueItem(e,t){return e instanceof te?this.resolveContainerQueueItem(e,t):e instanceof oe||e instanceof C?t.push(e.source):e instanceof Je&&t.push(e),null}resolveContainerQueueItem(e,t){e instanceof Ee||e instanceof C_||e instanceof rr?t.push(e.texture.source):e instanceof Rr?t.push(e):e instanceof Us?t.push(e.context):e instanceof yl&&e.textures.forEach(i=>{i.source?t.push(i.source):t.push(i.texture.source);});}resolveGraphicsContextQueueItem(e){this.renderer.graphicsContext.getGpuContext(e);let{instructions:t}=e;for(let i of t)if(i.action==="texture"){let{image:s}=i.data;return s.source}else if(i.action==="fill"){let{texture:s}=i.data.style;return s.source}return null}};});var Sl,eE=f(()=>{_e();xd();Os();Wc();Sl=class extends bi{constructor(...e){var t;let i=an(e,"BitmapText");i.style??(i.style=i.style||{}),(t=i.style).fill??(t.fill=16777215),super(i,gt),this.renderPipeId="bitmapText";}updateBounds(){let e=this._bounds,t=this._anchor,i=zi.measureText(this.text,this._style),s=i.scale,n=i.offsetY*s,o=i.width*s,a=i.height*s,u=this._style._stroke;u&&(o+=u.width,a+=u.width),e.minX=-t._x*o,e.maxX=e.minX+o,e.minY=-t._y*(a+n),e.maxY=e.minY+a;}set resolution(e){e!==null&&F("[BitmapText] dynamically updating the resolution is not supported. Resolution should be managed by the BitmapFont.");}get resolution(){return this._resolution}};});var El,tE=f(()=>{Mi();xd();wm();Fm();El=class extends bi{constructor(...e){let t=an(e,"HtmlText");super(t,Hs),this.renderPipeId="htmlText",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof st?t.textureStyle:new st(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=gu(this.text,this._style),{width:s,height:n}=i;e.minX=-t._x*s,e.maxX=e.minX+s,e.minY=-t._y*n,e.maxY=e.minY+n;}};});var Al,rE=f(()=>{ct();Zn();P_();eE();tE();J1();Al=class extends Tl{uploadQueueItem(e){e instanceof oe?this.uploadTextureSource(e):e instanceof Rr?this.uploadText(e):e instanceof El?this.uploadHTMLText(e):e instanceof Sl?this.uploadBitmapText(e):e instanceof Je&&this.uploadGraphicsContext(e);}uploadTextureSource(e){this.renderer.texture.initSource(e);}uploadText(e){this.renderer.renderPipes.text.initGpuText(e);}uploadBitmapText(e){this.renderer.renderPipes.bitmapText.initGpuText(e);}uploadHTMLText(e){this.renderer.renderPipes.htmlText.initGpuText(e);}uploadGraphicsContext(e){this.renderer.graphicsContext.getGpuContext(e);let{instructions:t}=e;for(let i of t)if(i.action==="texture"){let{image:s}=i.data;this.uploadTextureSource(s.source);}else if(i.action==="fill"){let{texture:s}=i.data.style;this.uploadTextureSource(s.source);}return null}};});var _d,mB=f(()=>{E();rE();_d=class extends Al{destroy(){clearTimeout(this.timeout),this.renderer=null,this.queue=null,this.resolves=null;}};_d.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"prepare"};});function gB(r){let e=[],t=0;for(let i=0;i<r;i++)e[t]={texture:{sampleType:"float",viewDimension:"2d",multisampled:false},binding:t,visibility:GPUShaderStage.FRAGMENT},t++,e[t]={sampler:{type:"filtering"},binding:t,visibility:GPUShaderStage.FRAGMENT},t++;return e}var xB=f(()=>{});function _B(r){let e={},t=0;for(let i=0;i<r;i++)e[`textureSource${i+1}`]=t++,e[`textureSampler${i+1}`]=t++;return e}var bB=f(()=>{});function yB(r){let e=r.split(/([\n{}])/g).map(s=>s.trim()).filter(s=>s.length),t="";return e.map(s=>{let n=t+s;return s==="{"?t+=" ":s==="}"&&(t=t.substr(0,t.length-4),n=t+s),n}).join(`
|
|
3226
|
+
}`;});function gd(r,e,t,i,s,n,o,a){let u=o-t,l=a-i,c=s-t,h=n-i,d=r-t,p=e-i,_=u*u+l*l,b=u*c+l*h,x=u*d+l*p,m=c*c+h*h,v=c*d+h*p,T=1/(_*m-b*b),S=(m*x-b*v)*T,B=(_*v-b*x)*T;return S>=0&&B>=0&&S+B<1}var j1=f(()=>{});var S_,hB=f(()=>{qp();Ze();S_=class r{constructor(e=0,t=0,i=0,s=0,n=0,o=0){this.type="triangle",this.x=e,this.y=t,this.x2=i,this.y2=s,this.x3=n,this.y3=o;}contains(e,t){let i=(this.x-this.x3)*(t-this.y3)-(this.y-this.y3)*(e-this.x3),s=(this.x2-this.x)*(t-this.y)-(this.y2-this.y)*(e-this.x);if(i<0!=s<0&&i!==0&&s!==0)return false;let n=(this.x3-this.x2)*(t-this.y2)-(this.y3-this.y2)*(e-this.x2);return n===0||n<0==i+s<=0}strokeContains(e,t,i,s=.5){let n=i/2,o=n*n,{x:a,x2:u,x3:l,y:c,y2:h,y3:d}=this;return Is(e,t,a,c,u,d)<=o||Is(e,t,u,h,l,d)<=o||Is(e,t,l,d,a,c)<=o}clone(){return new r(this.x,this.y,this.x2,this.y2,this.x3,this.y3)}copyFrom(e){return this.x=e.x,this.y=e.y,this.x2=e.x2,this.y2=e.y2,this.x3=e.x3,this.y3=e.y3,this}copyTo(e){return e.copyFrom(this),e}getBounds(e){e||(e=new Z);let t=Math.min(this.x,this.x2,this.x3),i=Math.max(this.x,this.x2,this.x3),s=Math.min(this.y,this.y2,this.y3),n=Math.max(this.y,this.y2,this.y3);return e.x=t,e.y=s,e.width=i-t,e.height=n-s,e}};});var dB,E_,q1=f(()=>{qt();Bn();ds();dB=class fB{constructor(e){this._tick=()=>{this.timeout=setTimeout(this._processQueue,0);},this._processQueue=()=>{let{queue:t}=this,i=0;for(;t.length&&i<fB.uploadsPerFrame;){let s=t.shift();this.uploadQueueItem(s),i++;}t.length?ye.system.addOnce(this._tick,this,Ht.UTILITY):this._resolve();},this.renderer=e,this.queue=[],this.resolves=[];}getQueue(){return [...this.queue]}add(e){let t=Array.isArray(e)?e:[e];for(let i of t)i instanceof te?this._addContainer(i):this.resolveQueueItem(i,this.queue);return this}_addContainer(e){this.resolveQueueItem(e,this.queue);for(let t of e.children)this._addContainer(t);}upload(e){return e&&this.add(e),new Promise(t=>{this.queue.length?(this.resolves.push(t),this.dedupeQueue(),ye.system.addOnce(this._tick,this,Ht.UTILITY)):t();})}dedupeQueue(){let e=Object.create(null),t=0;for(let i=0;i<this.queue.length;i++){let s=this.queue[i];e[s.uid]||(e[s.uid]=true,this.queue[t++]=s);}this.queue.length=t;}_resolve(){let{resolves:e}=this,t=e.slice(0);e.length=0;for(let i of t)i();}};dB.uploadsPerFrame=4;E_=dB;});var rr,ua=f(()=>{j1();vs();cr();ce();xe();Gr();Vs();rr=class extends qe{constructor(...e){let t=e[0];t instanceof Mt&&(I(H,"Mesh: use new Mesh({ geometry, shader }) instead"),t={geometry:t,shader:e[1]},e[3]&&(I(H,"Mesh: drawMode argument has been removed, use geometry.topology instead"),t.geometry.topology=e[3]));let{geometry:i,shader:s,texture:n,roundPixels:o,state:a,...u}=t;super({label:"Mesh",...u}),this.renderPipeId="mesh",this._shader=null,this.allowChildren=false,this.shader=s??null,this.texture=n??s?.texture??C.WHITE,this.state=a??Ue.for2d(),this._geometry=i,this._geometry.on("update",this.onViewUpdate,this),this.roundPixels=o??false;}get material(){return I(H,"mesh.material property has been removed, use mesh.shader instead"),this._shader}set shader(e){this._shader!==e&&(this._shader=e,this.onViewUpdate());}get shader(){return this._shader}set geometry(e){this._geometry!==e&&(this._geometry?.off("update",this.onViewUpdate,this),e.on("update",this.onViewUpdate,this),this._geometry=e,this.onViewUpdate());}get geometry(){return this._geometry}set texture(e){e||(e=C.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this.shader&&(this.shader.texture=e),this._texture=e,this.onViewUpdate());}get texture(){return this._texture}get batched(){return this._shader||(this.state.data&12)!==0?false:this._geometry instanceof Zt?this._geometry.batchMode==="auto"?this._geometry.positions.length/2<=100:this._geometry.batchMode==="batch":false}get bounds(){return this._geometry.bounds}updateBounds(){this._bounds=this._geometry.bounds;}containsPoint(e){let{x:t,y:i}=e;if(!this.bounds.containsPoint(t,i))return false;let s=this.geometry.getBuffer("aPosition").data,n=this.geometry.topology==="triangle-strip"?3:1;if(this.geometry.getIndex()){let o=this.geometry.getIndex().data,a=o.length;for(let u=0;u+2<a;u+=n){let l=o[u]*2,c=o[u+1]*2,h=o[u+2]*2;if(gd(t,i,s[l],s[l+1],s[c],s[c+1],s[h],s[h+1]))return true}}else {let o=s.length/2;for(let a=0;a+2<o;a+=n){let u=a*2,l=(a+1)*2,c=(a+2)*2;if(gd(t,i,s[u],s[u+1],s[l],s[l+1],s[c],s[c+1]))return true}}return false}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._geometry?.off("update",this.onViewUpdate,this),this._texture=null,this._geometry=null,this._shader=null,this._gpuData=null;}};});var yl,K1=f(()=>{ce();Bn();ds();ms();yl=class r extends Ee{constructor(...e){let t=e[0];Array.isArray(e[0])&&(t={textures:e[0],autoUpdate:e[1]});let{animationSpeed:i=1,autoPlay:s=false,autoUpdate:n=true,loop:o=true,onComplete:a=null,onFrameChange:u=null,onLoop:l=null,textures:c,updateAnchor:h=false,...d}=t,[p]=c;super({...d,texture:p instanceof C?p:p.texture}),this._textures=null,this._durations=null,this._autoUpdate=n,this._isConnectedToTicker=false,this.animationSpeed=i,this.loop=o,this.updateAnchor=h,this.onComplete=a,this.onFrameChange=u,this.onLoop=l,this._currentTime=0,this._playing=false,this._previousFrame=null,this.textures=c,s&&this.play();}stop(){this._playing&&(this._playing=false,this._autoUpdate&&this._isConnectedToTicker&&(ye.shared.remove(this.update,this),this._isConnectedToTicker=false));}play(){this._playing||(this._playing=true,this._autoUpdate&&!this._isConnectedToTicker&&(ye.shared.add(this.update,this,Ht.HIGH),this._isConnectedToTicker=true));}gotoAndStop(e){this.stop(),this.currentFrame=e;}gotoAndPlay(e){this.currentFrame=e,this.play();}update(e){if(!this._playing)return;let t=e.deltaTime,i=this.animationSpeed*t,s=this.currentFrame;if(this._durations!==null){let n=this._currentTime%1*this._durations[this.currentFrame];for(n+=i/60*1e3;n<0;)this._currentTime--,n+=this._durations[this.currentFrame];let o=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);n>=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*o,this._currentTime+=o;this._currentTime+=n/this._durations[this.currentFrame];}else this._currentTime+=i;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()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<s||this.animationSpeed<0&&this.currentFrame>s)&&this.onLoop(),this._updateTexture());}_updateTexture(){let e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this.texture=this._textures[e],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame));}destroy(){this.stop(),super.destroy(),this.onComplete=null,this.onFrameChange=null,this.onLoop=null;}static fromFrames(e){let t=[];for(let i=0;i<e.length;++i)t.push(C.from(e[i]));return new r(t)}static fromImages(e){let t=[];for(let i=0;i<e.length;++i)t.push(C.from(e[i]));return new r(t)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(e){if(e[0]instanceof C)this._textures=e,this._durations=null;else {this._textures=[],this._durations=[];for(let t=0;t<e.length;t++)this._textures.push(e[t].texture),this._durations.push(e[t].time);}this._previousFrame=null,this.gotoAndStop(0),this._updateTexture();}get currentFrame(){let e=Math.floor(this._currentTime)%this._textures.length;return e<0&&(e+=this._textures.length),e}set currentFrame(e){if(e<0||e>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${e}, expected to be between 0 and totalFrames ${this.totalFrames}.`);let t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this._updateTexture();}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(ye.shared.remove(this.update,this),this._isConnectedToTicker=false):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(ye.shared.add(this.update,this),this._isConnectedToTicker=true));}};});var vl,Z1=f(()=>{he();is();vl=class{constructor({matrix:e,observer:t}={}){this.dirty=true,this._matrix=e??new D,this.observer=t,this.position=new we(this,0,0),this.scale=new we(this,1,1),this.pivot=new we(this,0,0),this.skew=new we(this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1;}get matrix(){let e=this._matrix;return this.dirty&&(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.dirty=false),e}_onUpdate(e){this.dirty=true,e===this.skew&&this.updateSkew(),this.observer?._onUpdate(this);}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.dirty=true;}toString(){return `[pixi.js/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}) ]`}setFromMatrix(e){e.decompose(this),this.dirty=true;}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this.skew));}};});var pB,C_,Q1=f(()=>{ni();is();ce();xe();_e();Z1();Gr();pB=class A_ extends qe{constructor(...e){let t=e[0]||{};t instanceof C&&(t={texture:t}),e.length>1&&(I(H,"use new TilingSprite({ texture, width:100, height:100 }) instead"),t.width=e[1],t.height=e[2]),t={...A_.defaultOptions,...t};let{texture:i,anchor:s,tilePosition:n,tileScale:o,tileRotation:a,width:u,height:l,applyAnchorToTexture:c,roundPixels:h,...d}=t??{};super({label:"TilingSprite",...d}),this.renderPipeId="tilingSprite",this.batched=true,this.allowChildren=false,this._anchor=new we({_onUpdate:()=>{this.onViewUpdate();}}),this.applyAnchorToTexture=c,this.texture=i,this._width=u??i.width,this._height=l??i.height,this._tileTransform=new vl({observer:{_onUpdate:()=>this.onViewUpdate()}}),s&&(this.anchor=s),this.tilePosition=n,this.tileScale=o,this.tileRotation=a,this.roundPixels=h??false;}static from(e,t={}){return typeof e=="string"?new A_({texture:de.get(e),...t}):new A_({texture:e,...t})}get uvRespectAnchor(){return F("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture}set uvRespectAnchor(e){F("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture=e;}get clampMargin(){return this._texture.textureMatrix.clampMargin}set clampMargin(e){this._texture.textureMatrix.clampMargin=e;}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get tilePosition(){return this._tileTransform.position}set tilePosition(e){this._tileTransform.position.copyFrom(e);}get tileScale(){return this._tileTransform.scale}set tileScale(e){typeof e=="number"?this._tileTransform.scale.set(e):this._tileTransform.scale.copyFrom(e);}set tileRotation(e){this._tileTransform.rotation=e;}get tileRotation(){return this._tileTransform.rotation}get tileTransform(){return this._tileTransform}set texture(e){e||(e=C.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get texture(){return this._texture}set width(e){this._width=e,this.onViewUpdate();}get width(){return this._width}set height(e){this._height=e,this.onViewUpdate();}get height(){return this._height}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}containsPoint(e){let t=this._width,i=this._height,s=-t*this._anchor._x,n=0;return e.x>=s&&e.x<=s+t&&(n=-i*this._anchor._y,e.y>=n&&e.y<=n+i)}destroy(e=false){if(super.destroy(e),this._anchor=null,this._tileTransform=null,this._bounds=null,typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}};pB.defaultOptions={texture:C.EMPTY,anchor:{x:0,y:0},tilePosition:{x:0,y:0},tileScale:{x:1,y:1},tileRotation:0,applyAnchorToTexture:false};C_=pB;});function an(r,e){let t=r[0]??{};return (typeof t=="string"||r[1])&&(I(H,`use new ${e}({ text: "hi!", style }) instead`),t={text:t,style:r[1]}),t}var bi,xd=f(()=>{is();xe();Gr();bi=class extends qe{constructor(e,t){let{text:i,resolution:s,style:n,anchor:o,width:a,height:u,roundPixels:l,...c}=e;super({...c}),this.batched=true,this._resolution=null,this._autoResolution=true,this._didTextUpdate=true,this._styleClass=t,this.text=i??"",this.style=n,this.resolution=s??null,this.allowChildren=false,this._anchor=new we({_onUpdate:()=>{this.onViewUpdate();}}),o&&(this.anchor=o),this.roundPixels=l??false,a!==void 0&&(this.width=a),u!==void 0&&(this.height=u);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}set text(e){e=e.toString(),this._text!==e&&(this._text=e,this.onViewUpdate());}get text(){return this._text}set resolution(e){this._autoResolution=e===null,this._resolution=e,this.onViewUpdate();}get resolution(){return this._resolution}get style(){return this._style}set style(e){e||(e={}),this._style?.off("update",this.onViewUpdate,this),e instanceof this._styleClass?this._style=e:this._style=new this._styleClass(e),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate();}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(e){this._setWidth(e,this.bounds.width);}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(e){this._setHeight(e,this.bounds.height);}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this.bounds.width,e.height=Math.abs(this.scale.y)*this.bounds.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this.bounds.width),t!==void 0&&this._setHeight(t,this.bounds.height);}containsPoint(e){let t=this.bounds.width,i=this.bounds.height,s=-t*this.anchor.x,n=0;return e.x>=s&&e.x<=s+t&&(n=-i*this.anchor.y,e.y>=n&&e.y<=n+i)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=true),super.onViewUpdate();}destroy(e=false){super.destroy(e),this.owner=null,this._bounds=null,this._anchor=null,(typeof e=="boolean"?e:e?.style)&&this._style.destroy(e),this._style=null,this._text=null;}};});var Rr,P_=f(()=>{Mi();xd();mm();eo();Os();Rr=class extends bi{constructor(...e){let t=an(e,"Text");super(t,gt),this.renderPipeId="text",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof st?t.textureStyle:new st(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=0,s=0;if(this._style.trim){let{frame:n,canvasAndContext:o}=Vi.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Vi.returnCanvasAndContext(o),i=n.width,s=n.height;}else {let n=xt.measureText(this._text,this._style);i=n.width,s=n.height;}e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};});var Tl,J1=f(()=>{ct();ce();qt();gm();Zn();ua();ms();K1();Q1();P_();q1();Tl=class extends E_{resolveQueueItem(e,t){return e instanceof te?this.resolveContainerQueueItem(e,t):e instanceof oe||e instanceof C?t.push(e.source):e instanceof Je&&t.push(e),null}resolveContainerQueueItem(e,t){e instanceof Ee||e instanceof C_||e instanceof rr?t.push(e.texture.source):e instanceof Rr?t.push(e):e instanceof Us?t.push(e.context):e instanceof yl&&e.textures.forEach(i=>{i.source?t.push(i.source):t.push(i.texture.source);});}resolveGraphicsContextQueueItem(e){this.renderer.graphicsContext.getGpuContext(e);let{instructions:t}=e;for(let i of t)if(i.action==="texture"){let{image:s}=i.data;return s.source}else if(i.action==="fill"){let{texture:s}=i.data.style;return s.source}return null}};});var Sl,eE=f(()=>{_e();xd();Os();Wc();Sl=class extends bi{constructor(...e){var t;let i=an(e,"BitmapText");i.style??(i.style=i.style||{}),(t=i.style).fill??(t.fill=16777215),super(i,gt),this.renderPipeId="bitmapText";}updateBounds(){let e=this._bounds,t=this._anchor,i=zi.measureText(this.text,this._style),s=i.scale,n=i.offsetY*s,o=i.width*s,a=i.height*s,u=this._style._stroke;u&&(o+=u.width,a+=u.width),e.minX=-t._x*o,e.maxX=e.minX+o,e.minY=-t._y*(a+n),e.maxY=e.minY+a;}set resolution(e){e!==null&&F("[BitmapText] dynamically updating the resolution is not supported. Resolution should be managed by the BitmapFont.");}get resolution(){return this._resolution}};});var El,tE=f(()=>{Mi();xd();wm();Fm();El=class extends bi{constructor(...e){let t=an(e,"HtmlText");super(t,Hs),this.renderPipeId="htmlText",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof st?t.textureStyle:new st(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=gu(this.text,this._style),{width:s,height:n}=i;e.minX=-t._x*s,e.maxX=e.minX+s,e.minY=-t._y*n,e.maxY=e.minY+n;}};});var Al,rE=f(()=>{ct();Zn();P_();eE();tE();J1();Al=class extends Tl{uploadQueueItem(e){e instanceof oe?this.uploadTextureSource(e):e instanceof Rr?this.uploadText(e):e instanceof El?this.uploadHTMLText(e):e instanceof Sl?this.uploadBitmapText(e):e instanceof Je&&this.uploadGraphicsContext(e);}uploadTextureSource(e){this.renderer.texture.initSource(e);}uploadText(e){this.renderer.renderPipes.text.initGpuText(e);}uploadBitmapText(e){this.renderer.renderPipes.bitmapText.initGpuText(e);}uploadHTMLText(e){this.renderer.renderPipes.htmlText.initGpuText(e);}uploadGraphicsContext(e){this.renderer.graphicsContext.getGpuContext(e);let{instructions:t}=e;for(let i of t)if(i.action==="texture"){let{image:s}=i.data;this.uploadTextureSource(s.source);}else if(i.action==="fill"){let{texture:s}=i.data.style;this.uploadTextureSource(s.source);}return null}};});var _d,mB=f(()=>{E();rE();_d=class extends Al{destroy(){clearTimeout(this.timeout),this.renderer=null,this.queue=null,this.resolves=null;}};_d.extension={type:[g.WebGLSystem,g.WebGPUSystem],name:"prepare"};});function gB(r){let e=[],t=0;for(let i=0;i<r;i++)e[t]={texture:{sampleType:"float",viewDimension:"2d",multisampled:false},binding:t,visibility:GPUShaderStage.FRAGMENT},t++,e[t]={sampler:{type:"filtering"},binding:t,visibility:GPUShaderStage.FRAGMENT},t++;return e}var xB=f(()=>{});function _B(r){let e={},t=0;for(let i=0;i<r;i++)e[`textureSource${i+1}`]=t++,e[`textureSampler${i+1}`]=t++;return e}var bB=f(()=>{});function yB(r){let e=r.split(/([\n{}])/g).map(s=>s.trim()).filter(s=>s.length),t="";return e.map(s=>{let n=t+s;return s==="{"?t+=" ":s==="}"&&(t=t.substr(0,t.length-4),n=t+s),n}).join(`
|
|
3227
3227
|
`)}var vB=f(()=>{});var w_,TB=f(()=>{dc();fc();w_=class{constructor(e){this.priority=0,this.pipe="scissorMask",this.mask=e,this.mask.renderable=false,this.mask.measurable=false;}addBounds(e,t){gs(this.mask,e,t);}addLocalBounds(e,t){xs(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}reset(){this.mask.measurable=true,this.mask=null;}destroy(){this.reset();}};});function SB(r){return r=r.replaceAll("texture2D","texture").replaceAll("gl_FragColor","finalColor").replaceAll("varying","in"),r=`
|
|
3228
3228
|
out vec4 finalColor;
|
|
3229
3229
|
${r}
|
|
3230
|
-
`,r}var EB=f(()=>{});function AB(r){return yF[r]}var yF,CB=f(()=>{yF={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};});var PB,wB,BB=f(()=>{xe();PB={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},wB=new Proxy(PB,{get(r,e){return I(H,`DRAW_MODES.${e} is deprecated, use '${PB[e]}' instead`),r[e]}});});var bd,RB,yd,MB,DB=f(()=>{xe();bd=(r=>(r.CLAMP="clamp-to-edge",r.REPEAT="repeat",r.MIRRORED_REPEAT="mirror-repeat",r))(bd||{}),RB=new Proxy(bd,{get(r,e){return I(H,`DRAW_MODES.${e} is deprecated, use '${bd[e]}' instead`),r[e]}}),yd=(r=>(r.NEAREST="nearest",r.LINEAR="linear",r))(yd||{}),MB=new Proxy(yd,{get(r,e){return I(H,`DRAW_MODES.${e} is deprecated, use '${yd[e]}' instead`),r[e]}});});var B_,IB=f(()=>{yf();B_=class{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8);}set(e,t,i){let s=t.width,n=t.height;if(i){let o=e.width/2/s,a=e.height/2/n,u=e.x/s+o,l=e.y/n+a;i=le.add(i,le.NW),this.x0=u+o*le.uX(i),this.y0=l+a*le.uY(i),i=le.add(i,2),this.x1=u+o*le.uX(i),this.y1=l+a*le.uY(i),i=le.add(i,2),this.x2=u+o*le.uX(i),this.y2=l+a*le.uY(i),i=le.add(i,2),this.x3=u+o*le.uX(i),this.y3=l+a*le.uY(i);}else this.x0=e.x/s,this.y0=e.y/n,this.x1=(e.x+e.width)/s,this.y1=e.y/n,this.x2=(e.x+e.width)/s,this.y2=(e.y+e.height)/n,this.x3=e.x/s,this.y3=(e.y+e.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3;}toString(){return `[pixi.js/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}};});function kB(r){let e=r.toString(),t=e.indexOf("{"),i=e.lastIndexOf("}");if(t===-1||i===-1)throw new Error("getFunctionBody: No body found in function definition");return e.slice(t+1,i).trim()}var FB=f(()=>{});function OB(r,e){return I("8.7.0","Use container.getFastGlobalBounds() instead"),r.getFastGlobalBounds(true,e)}var GB=f(()=>{xe();});var R_,UB=f(()=>{Gr();R_=class extends qe{constructor(e){typeof e=="function"&&(e={render:e});let{render:t,...i}=e;super({label:"RenderContainer",...i}),this.renderPipeId="customRender",this.batched=false,t&&(this.render=t),this.containsPoint=e.containsPoint??(()=>false),this.addBounds=e.addBounds??(()=>false);}updateBounds(){this._bounds.clear(),this.addBounds(this._bounds);}render(e){}};});function LB(r,e,t){I("8.7.0","Please use container.collectRenderables instead.");let i=t.renderPipes?t:t.batch.renderer;return r.collectRenderables(e,i,null)}var NB=f(()=>{xe();});function HB(r,e){let t=e._scale,i=e._pivot,s=e._position,n=t._x,o=t._y,a=i._x,u=i._y;r.a=e._cx*n,r.b=e._sx*n,r.c=e._cy*o,r.d=e._sy*o,r.tx=s._x-(a*r.a+u*r.c),r.ty=s._y-(a*r.b+u*r.d);}var VB=f(()=>{});function zB(r,e,t){let i=r.a,s=r.b,n=r.c,o=r.d,a=r.tx,u=r.ty,l=e.a,c=e.b,h=e.c,d=e.d;t.a=i*l+s*h,t.b=i*c+s*d,t.c=n*l+o*h,t.d=n*c+o*d,t.tx=a*l+u*h+e.tx,t.ty=a*c+u*d+e.ty;}var WB=f(()=>{});var XB,vF,$B,jB=f(()=>{_e();qt();XB=class YB extends te{constructor(e={}){e={...YB.defaultOptions,...e},super(),this.renderLayerChildren=[],this.sortableChildren=e.sortableChildren,this.sortFunction=e.sortFunction;}attach(...e){for(let t=0;t<e.length;t++){let i=e[t];if(i.parentRenderLayer){if(i.parentRenderLayer===this)continue;i.parentRenderLayer.detach(i);}this.renderLayerChildren.push(i),i.parentRenderLayer=this;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true);}return e[0]}detach(...e){for(let t=0;t<e.length;t++){let i=e[t],s=this.renderLayerChildren.indexOf(i);s!==-1&&this.renderLayerChildren.splice(s,1),i.parentRenderLayer=null;let n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=true);}return e[0]}detachAll(){let e=this.renderLayerChildren;for(let t=0;t<e.length;t++)e[t].parentRenderLayer=null;this.renderLayerChildren.length=0;}collectRenderables(e,t,i){let s=this.renderLayerChildren,n=s.length;this.sortableChildren&&this.sortRenderLayerChildren();for(let o=0;o<n;o++)s[o].parent||F("Container must be added to both layer and scene graph. Layers only handle render order - the scene graph is required for transforms (addChild)",s[o]),s[o].collectRenderables(e,t,this);}sortRenderLayerChildren(){this.renderLayerChildren.sort(this.sortFunction);}_getGlobalBoundsRecursive(e,t,i){if(!e)return;let s=this.renderLayerChildren;for(let n=0;n<s.length;n++)s[n]._getGlobalBoundsRecursive(true,t,this);}};XB.defaultOptions={sortableChildren:false,sortFunction:(r,e)=>r.zIndex-e.zIndex};vF=XB,$B=vF;});function M_(r,e,t,i){let s=t.buffers[0],n=s.data,{verticesX:o,verticesY:a}=t,u=r/(o-1),l=e/(a-1),c=0,h=i[0],d=i[1],p=i[2],_=i[3],b=i[4],x=i[5],g=i[6],v=i[7],T=i[8];for(let S=0;S<n.length;S+=2){let B=c%o*u,A=(c/o|0)*l,R=h*B+d*A+p,Y=_*B+b*A+x,M=g*B+v*A+T;n[S]=R/M,n[S+1]=Y/M,c++;}s.update();}var iE=f(()=>{});function KB(r,e){let t=e[0],i=e[1],s=e[2],n=e[3],o=e[4],a=e[5],u=e[6],l=e[7],c=e[8];return r[0]=o*c-a*l,r[1]=s*l-i*c,r[2]=i*a-s*o,r[3]=a*u-n*c,r[4]=t*c-s*u,r[5]=s*n-t*a,r[6]=n*l-o*u,r[7]=i*u-t*l,r[8]=t*o-i*n,r}function ZB(r,e,t){let i=e[0],s=e[1],n=e[2],o=e[3],a=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=t[0],p=t[1],_=t[2],b=t[3],x=t[4],g=t[5],v=t[6],T=t[7],S=t[8];return r[0]=d*i+p*o+_*l,r[1]=d*s+p*a+_*c,r[2]=d*n+p*u+_*h,r[3]=b*i+x*o+g*l,r[4]=b*s+x*a+g*c,r[5]=b*n+x*u+g*h,r[6]=v*i+T*o+S*l,r[7]=v*s+T*a+S*c,r[8]=v*n+T*u+S*h,r}function TF(r,e,t){let i=t[0],s=t[1],n=t[2];return r[0]=e[0]*i+e[1]*s+e[2]*n,r[1]=e[3]*i+e[4]*s+e[5]*n,r[2]=e[6]*i+e[7]*s+e[8]*n,r}function qB(r,e,t,i,s,n,o,a,u){let l=SF;l[0]=e,l[1]=i,l[2]=n,l[3]=t,l[4]=s,l[5]=o,l[6]=1,l[7]=1,l[8]=1;let c=KB(r,l);D_[0]=a,D_[1]=u,D_[2]=1;let h=TF(EF,c,D_),d=r;return r[0]=h[0],r[1]=0,r[2]=0,r[3]=0,r[4]=h[1],r[5]=0,r[6]=0,r[7]=0,r[8]=h[2],ZB(r,d,l)}function I_(r,e,t,i,s,n,o,a,u,l,c,h,d,p,_,b,x){let g=qB(AF,e,t,n,o,l,c,p,_),v=qB(CF,i,s,a,u,h,d,b,x);return ZB(r,KB(g,g),v)}var SF,EF,D_,AF,CF,sE=f(()=>{SF=[0,0,0,0,0,0,0,0,0],EF=[0,0,0],D_=[0,0,0];AF=[0,0,0,0,0,0,0,0,0],CF=[0,0,0,0,0,0,0,0,0];});var Cl,nE=f(()=>{jc();iE();sE();Cl=class extends Ws{constructor(e){super(e),this._projectionMatrix=[0,0,0,0,0,0,0,0,0];let{width:t,height:i}=e;this.corners=[0,0,t,0,t,i,0,i];}setCorners(e,t,i,s,n,o,a,u){let l=this.corners;l[0]=e,l[1]=t,l[2]=i,l[3]=s,l[4]=n,l[5]=o,l[6]=a,l[7]=u,this.updateProjection();}updateProjection(){let{width:e,height:t}=this,i=this.corners,s=I_(this._projectionMatrix,0,0,i[0],i[1],e,0,i[2],i[3],e,t,i[4],i[5],0,t,i[6],i[7]);M_(e,t,this,s);}};});var QB,eR,tR=f(()=>{ce();us();ua();nE();QB=class JB extends rr{constructor(e){e={...JB.defaultOptions,...e};let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new Cl(mt({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(mt({...n,geometry:o})),this._texture=t,this.geometry.setCorners(e.x0,e.y0,e.x1,e.y1,e.x2,e.y2,e.x3,e.y3);}textureUpdated(){let e=this.geometry;if(!e)return;let{width:t,height:i}=this.texture;(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.updateProjection());}set texture(e){this._texture!==e&&(super.texture=e,this.textureUpdated());}get texture(){return this._texture}setCorners(e,t,i,s,n,o,a,u){this.geometry.setCorners(e,t,i,s,n,o,a,u);}};QB.defaultOptions={texture:C.WHITE,verticesX:10,verticesY:10,x0:0,y0:0,x1:100,y1:0,x2:100,y2:100,x3:0,y3:100};eR=QB;});var k_,rR=f(()=>{us();ua();jc();k_=class extends rr{constructor(e){let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new Ws(mt({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(mt({...n,geometry:o,texture:t})),this.texture=t,this.autoResize=true;}textureUpdated(){let e=this.geometry,{width:t,height:i}=this.texture;this.autoResize&&(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.build({}));}set texture(e){this._texture?.off("update",this.textureUpdated,this),super.texture=e,e.on("update",this.textureUpdated,this),this.textureUpdated();}get texture(){return this._texture}destroy(e){this.texture.off("update",this.textureUpdated,this),super.destroy(e);}};});var iR,F_,oE=f(()=>{Vs();iR=class sR extends Zt{constructor(e){let{width:t,points:i,textureScale:s}={...sR.defaultOptions,...e};super({positions:new Float32Array(i.length*4),uvs:new Float32Array(i.length*4),indices:new Uint32Array((i.length-1)*6)}),this.points=i,this._width=t,this.textureScale=s,this._build();}get width(){return this._width}_build(){let e=this.points;if(!e)return;let t=this.getBuffer("aPosition"),i=this.getBuffer("aUV"),s=this.getIndex();if(e.length<1)return;t.data.length/4!==e.length&&(t.data=new Float32Array(e.length*4),i.data=new Float32Array(e.length*4),s.data=new Uint16Array((e.length-1)*6));let n=i.data,o=s.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;let a=0,u=e[0],l=this._width*this.textureScale,c=e.length;for(let d=0;d<c;d++){let p=d*4;if(this.textureScale>0){let _=u.x-e[d].x,b=u.y-e[d].y,x=Math.sqrt(_*_+b*b);u=e[d],a+=x/l;}else a=d/(c-1);n[p]=a,n[p+1]=0,n[p+2]=a,n[p+3]=1;}let h=0;for(let d=0;d<c-1;d++){let p=d*2;o[h++]=p,o[h++]=p+1,o[h++]=p+2,o[h++]=p+2,o[h++]=p+1,o[h++]=p+3;}i.update(),s.update(),this.updateVertices();}updateVertices(){let e=this.points;if(e.length<1)return;let t=e[0],i,s=0,n=0,o=this.buffers[0].data,a=e.length,u=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let l=0;l<a;l++){let c=e[l],h=l*4;l<e.length-1?i=e[l+1]:i=c,n=-(i.x-t.x),s=i.y-t.y;let p=Math.sqrt(s*s+n*n);p<1e-6?(s=0,n=0):(s/=p,n/=p,s*=u,n*=u),o[h]=c.x+s,o[h+1]=c.y+n,o[h+2]=c.x-s,o[h+3]=c.y-n,t=c;}this.buffers[0].update();}update(){this.textureScale>0?this._build():this.updateVertices();}};iR.defaultOptions={width:200,points:[],textureScale:0};F_=iR;});var nR,aR,uR=f(()=>{us();ua();oE();nR=class oR extends rr{constructor(e){let{texture:t,points:i,textureScale:s,...n}={...oR.defaultOptions,...e},o=new F_(mt({width:t.height,points:i,textureScale:s}));s>0&&(t.source.style.addressMode="repeat"),super(mt({...n,texture:t,geometry:o})),this.autoUpdate=true,this.onRender=this._render;}_render(){let e=this.geometry;(this.autoUpdate||e._width!==this.texture.height)&&(e._width=this.texture.height,e.update());}};nR.defaultOptions={textureScale:0};aR=nR;});var O_,lR=f(()=>{us();ua();Vs();O_=class extends rr{constructor(e){let{texture:t,vertices:i,uvs:s,indices:n,topology:o,...a}=e,u=new Zt(mt({positions:i,uvs:s,indices:n,topology:o}));super(mt({...a,texture:t,geometry:u})),this.autoUpdate=true,this.onRender=this._render;}get vertices(){return this.geometry.getBuffer("aPosition").data}set vertices(e){this.geometry.getBuffer("aPosition").data=e;}_render(){this.autoUpdate&&this.geometry.getBuffer("aPosition").update();}};});function cR(r,e){let{width:t,height:i}=r.frame;return e.scale(1/t,1/i),e}var hR=f(()=>{});var dR,fR,pR=f(()=>{it();ce();ff();Sf();dR=class aE{constructor(e){if(e instanceof C)this.texture=e,Cn(this,aE.defaultOptions,{});else {let t={...aE.defaultOptions,...e};Cn(this,t,{});}}get alpha(){return this._alpha}set alpha(e){this._alpha=Math.min(Math.max(e,0),1),this._updateColor();}get tint(){return Ri(this._tint)}set tint(e){typeof e=="number"?this._tint=e:this._tint=K.shared.setValue(e??16777215).toBgrNumber(),this._updateColor();}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24);}};dR.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};fR=dR;});var vd,uE=f(()=>{vd={vertex:{attributeName:"aVertex",format:"float32x2",code:`
|
|
3230
|
+
`,r}var EB=f(()=>{});function AB(r){return yF[r]}var yF,CB=f(()=>{yF={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};});var PB,wB,BB=f(()=>{xe();PB={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},wB=new Proxy(PB,{get(r,e){return I(H,`DRAW_MODES.${e} is deprecated, use '${PB[e]}' instead`),r[e]}});});var bd,RB,yd,MB,DB=f(()=>{xe();bd=(r=>(r.CLAMP="clamp-to-edge",r.REPEAT="repeat",r.MIRRORED_REPEAT="mirror-repeat",r))(bd||{}),RB=new Proxy(bd,{get(r,e){return I(H,`DRAW_MODES.${e} is deprecated, use '${bd[e]}' instead`),r[e]}}),yd=(r=>(r.NEAREST="nearest",r.LINEAR="linear",r))(yd||{}),MB=new Proxy(yd,{get(r,e){return I(H,`DRAW_MODES.${e} is deprecated, use '${yd[e]}' instead`),r[e]}});});var B_,IB=f(()=>{yf();B_=class{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8);}set(e,t,i){let s=t.width,n=t.height;if(i){let o=e.width/2/s,a=e.height/2/n,u=e.x/s+o,l=e.y/n+a;i=le.add(i,le.NW),this.x0=u+o*le.uX(i),this.y0=l+a*le.uY(i),i=le.add(i,2),this.x1=u+o*le.uX(i),this.y1=l+a*le.uY(i),i=le.add(i,2),this.x2=u+o*le.uX(i),this.y2=l+a*le.uY(i),i=le.add(i,2),this.x3=u+o*le.uX(i),this.y3=l+a*le.uY(i);}else this.x0=e.x/s,this.y0=e.y/n,this.x1=(e.x+e.width)/s,this.y1=e.y/n,this.x2=(e.x+e.width)/s,this.y2=(e.y+e.height)/n,this.x3=e.x/s,this.y3=(e.y+e.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3;}toString(){return `[pixi.js/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}};});function kB(r){let e=r.toString(),t=e.indexOf("{"),i=e.lastIndexOf("}");if(t===-1||i===-1)throw new Error("getFunctionBody: No body found in function definition");return e.slice(t+1,i).trim()}var FB=f(()=>{});function OB(r,e){return I("8.7.0","Use container.getFastGlobalBounds() instead"),r.getFastGlobalBounds(true,e)}var GB=f(()=>{xe();});var R_,UB=f(()=>{Gr();R_=class extends qe{constructor(e){typeof e=="function"&&(e={render:e});let{render:t,...i}=e;super({label:"RenderContainer",...i}),this.renderPipeId="customRender",this.batched=false,t&&(this.render=t),this.containsPoint=e.containsPoint??(()=>false),this.addBounds=e.addBounds??(()=>false);}updateBounds(){this._bounds.clear(),this.addBounds(this._bounds);}render(e){}};});function LB(r,e,t){I("8.7.0","Please use container.collectRenderables instead.");let i=t.renderPipes?t:t.batch.renderer;return r.collectRenderables(e,i,null)}var NB=f(()=>{xe();});function HB(r,e){let t=e._scale,i=e._pivot,s=e._position,n=t._x,o=t._y,a=i._x,u=i._y;r.a=e._cx*n,r.b=e._sx*n,r.c=e._cy*o,r.d=e._sy*o,r.tx=s._x-(a*r.a+u*r.c),r.ty=s._y-(a*r.b+u*r.d);}var VB=f(()=>{});function zB(r,e,t){let i=r.a,s=r.b,n=r.c,o=r.d,a=r.tx,u=r.ty,l=e.a,c=e.b,h=e.c,d=e.d;t.a=i*l+s*h,t.b=i*c+s*d,t.c=n*l+o*h,t.d=n*c+o*d,t.tx=a*l+u*h+e.tx,t.ty=a*c+u*d+e.ty;}var WB=f(()=>{});var XB,vF,$B,jB=f(()=>{_e();qt();XB=class YB extends te{constructor(e={}){e={...YB.defaultOptions,...e},super(),this.renderLayerChildren=[],this.sortableChildren=e.sortableChildren,this.sortFunction=e.sortFunction;}attach(...e){for(let t=0;t<e.length;t++){let i=e[t];if(i.parentRenderLayer){if(i.parentRenderLayer===this)continue;i.parentRenderLayer.detach(i);}this.renderLayerChildren.push(i),i.parentRenderLayer=this;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true);}return e[0]}detach(...e){for(let t=0;t<e.length;t++){let i=e[t],s=this.renderLayerChildren.indexOf(i);s!==-1&&this.renderLayerChildren.splice(s,1),i.parentRenderLayer=null;let n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=true);}return e[0]}detachAll(){let e=this.renderLayerChildren;for(let t=0;t<e.length;t++)e[t].parentRenderLayer=null;this.renderLayerChildren.length=0;}collectRenderables(e,t,i){let s=this.renderLayerChildren,n=s.length;this.sortableChildren&&this.sortRenderLayerChildren();for(let o=0;o<n;o++)s[o].parent||F("Container must be added to both layer and scene graph. Layers only handle render order - the scene graph is required for transforms (addChild)",s[o]),s[o].collectRenderables(e,t,this);}sortRenderLayerChildren(){this.renderLayerChildren.sort(this.sortFunction);}_getGlobalBoundsRecursive(e,t,i){if(!e)return;let s=this.renderLayerChildren;for(let n=0;n<s.length;n++)s[n]._getGlobalBoundsRecursive(true,t,this);}};XB.defaultOptions={sortableChildren:false,sortFunction:(r,e)=>r.zIndex-e.zIndex};vF=XB,$B=vF;});function M_(r,e,t,i){let s=t.buffers[0],n=s.data,{verticesX:o,verticesY:a}=t,u=r/(o-1),l=e/(a-1),c=0,h=i[0],d=i[1],p=i[2],_=i[3],b=i[4],x=i[5],m=i[6],v=i[7],T=i[8];for(let S=0;S<n.length;S+=2){let B=c%o*u,A=(c/o|0)*l,R=h*B+d*A+p,Y=_*B+b*A+x,M=m*B+v*A+T;n[S]=R/M,n[S+1]=Y/M,c++;}s.update();}var iE=f(()=>{});function KB(r,e){let t=e[0],i=e[1],s=e[2],n=e[3],o=e[4],a=e[5],u=e[6],l=e[7],c=e[8];return r[0]=o*c-a*l,r[1]=s*l-i*c,r[2]=i*a-s*o,r[3]=a*u-n*c,r[4]=t*c-s*u,r[5]=s*n-t*a,r[6]=n*l-o*u,r[7]=i*u-t*l,r[8]=t*o-i*n,r}function ZB(r,e,t){let i=e[0],s=e[1],n=e[2],o=e[3],a=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=t[0],p=t[1],_=t[2],b=t[3],x=t[4],m=t[5],v=t[6],T=t[7],S=t[8];return r[0]=d*i+p*o+_*l,r[1]=d*s+p*a+_*c,r[2]=d*n+p*u+_*h,r[3]=b*i+x*o+m*l,r[4]=b*s+x*a+m*c,r[5]=b*n+x*u+m*h,r[6]=v*i+T*o+S*l,r[7]=v*s+T*a+S*c,r[8]=v*n+T*u+S*h,r}function TF(r,e,t){let i=t[0],s=t[1],n=t[2];return r[0]=e[0]*i+e[1]*s+e[2]*n,r[1]=e[3]*i+e[4]*s+e[5]*n,r[2]=e[6]*i+e[7]*s+e[8]*n,r}function qB(r,e,t,i,s,n,o,a,u){let l=SF;l[0]=e,l[1]=i,l[2]=n,l[3]=t,l[4]=s,l[5]=o,l[6]=1,l[7]=1,l[8]=1;let c=KB(r,l);D_[0]=a,D_[1]=u,D_[2]=1;let h=TF(EF,c,D_),d=r;return r[0]=h[0],r[1]=0,r[2]=0,r[3]=0,r[4]=h[1],r[5]=0,r[6]=0,r[7]=0,r[8]=h[2],ZB(r,d,l)}function I_(r,e,t,i,s,n,o,a,u,l,c,h,d,p,_,b,x){let m=qB(AF,e,t,n,o,l,c,p,_),v=qB(CF,i,s,a,u,h,d,b,x);return ZB(r,KB(m,m),v)}var SF,EF,D_,AF,CF,sE=f(()=>{SF=[0,0,0,0,0,0,0,0,0],EF=[0,0,0],D_=[0,0,0];AF=[0,0,0,0,0,0,0,0,0],CF=[0,0,0,0,0,0,0,0,0];});var Cl,nE=f(()=>{jc();iE();sE();Cl=class extends Ws{constructor(e){super(e),this._projectionMatrix=[0,0,0,0,0,0,0,0,0];let{width:t,height:i}=e;this.corners=[0,0,t,0,t,i,0,i];}setCorners(e,t,i,s,n,o,a,u){let l=this.corners;l[0]=e,l[1]=t,l[2]=i,l[3]=s,l[4]=n,l[5]=o,l[6]=a,l[7]=u,this.updateProjection();}updateProjection(){let{width:e,height:t}=this,i=this.corners,s=I_(this._projectionMatrix,0,0,i[0],i[1],e,0,i[2],i[3],e,t,i[4],i[5],0,t,i[6],i[7]);M_(e,t,this,s);}};});var QB,eR,tR=f(()=>{ce();us();ua();nE();QB=class JB extends rr{constructor(e){e={...JB.defaultOptions,...e};let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new Cl(mt({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(mt({...n,geometry:o})),this._texture=t,this.geometry.setCorners(e.x0,e.y0,e.x1,e.y1,e.x2,e.y2,e.x3,e.y3);}textureUpdated(){let e=this.geometry;if(!e)return;let{width:t,height:i}=this.texture;(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.updateProjection());}set texture(e){this._texture!==e&&(super.texture=e,this.textureUpdated());}get texture(){return this._texture}setCorners(e,t,i,s,n,o,a,u){this.geometry.setCorners(e,t,i,s,n,o,a,u);}};QB.defaultOptions={texture:C.WHITE,verticesX:10,verticesY:10,x0:0,y0:0,x1:100,y1:0,x2:100,y2:100,x3:0,y3:100};eR=QB;});var k_,rR=f(()=>{us();ua();jc();k_=class extends rr{constructor(e){let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new Ws(mt({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(mt({...n,geometry:o,texture:t})),this.texture=t,this.autoResize=true;}textureUpdated(){let e=this.geometry,{width:t,height:i}=this.texture;this.autoResize&&(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.build({}));}set texture(e){this._texture?.off("update",this.textureUpdated,this),super.texture=e,e.on("update",this.textureUpdated,this),this.textureUpdated();}get texture(){return this._texture}destroy(e){this.texture.off("update",this.textureUpdated,this),super.destroy(e);}};});var iR,F_,oE=f(()=>{Vs();iR=class sR extends Zt{constructor(e){let{width:t,points:i,textureScale:s}={...sR.defaultOptions,...e};super({positions:new Float32Array(i.length*4),uvs:new Float32Array(i.length*4),indices:new Uint32Array((i.length-1)*6)}),this.points=i,this._width=t,this.textureScale=s,this._build();}get width(){return this._width}_build(){let e=this.points;if(!e)return;let t=this.getBuffer("aPosition"),i=this.getBuffer("aUV"),s=this.getIndex();if(e.length<1)return;t.data.length/4!==e.length&&(t.data=new Float32Array(e.length*4),i.data=new Float32Array(e.length*4),s.data=new Uint16Array((e.length-1)*6));let n=i.data,o=s.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;let a=0,u=e[0],l=this._width*this.textureScale,c=e.length;for(let d=0;d<c;d++){let p=d*4;if(this.textureScale>0){let _=u.x-e[d].x,b=u.y-e[d].y,x=Math.sqrt(_*_+b*b);u=e[d],a+=x/l;}else a=d/(c-1);n[p]=a,n[p+1]=0,n[p+2]=a,n[p+3]=1;}let h=0;for(let d=0;d<c-1;d++){let p=d*2;o[h++]=p,o[h++]=p+1,o[h++]=p+2,o[h++]=p+2,o[h++]=p+1,o[h++]=p+3;}i.update(),s.update(),this.updateVertices();}updateVertices(){let e=this.points;if(e.length<1)return;let t=e[0],i,s=0,n=0,o=this.buffers[0].data,a=e.length,u=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let l=0;l<a;l++){let c=e[l],h=l*4;l<e.length-1?i=e[l+1]:i=c,n=-(i.x-t.x),s=i.y-t.y;let p=Math.sqrt(s*s+n*n);p<1e-6?(s=0,n=0):(s/=p,n/=p,s*=u,n*=u),o[h]=c.x+s,o[h+1]=c.y+n,o[h+2]=c.x-s,o[h+3]=c.y-n,t=c;}this.buffers[0].update();}update(){this.textureScale>0?this._build():this.updateVertices();}};iR.defaultOptions={width:200,points:[],textureScale:0};F_=iR;});var nR,aR,uR=f(()=>{us();ua();oE();nR=class oR extends rr{constructor(e){let{texture:t,points:i,textureScale:s,...n}={...oR.defaultOptions,...e},o=new F_(mt({width:t.height,points:i,textureScale:s}));s>0&&(t.source.style.addressMode="repeat"),super(mt({...n,texture:t,geometry:o})),this.autoUpdate=true,this.onRender=this._render;}_render(){let e=this.geometry;(this.autoUpdate||e._width!==this.texture.height)&&(e._width=this.texture.height,e.update());}};nR.defaultOptions={textureScale:0};aR=nR;});var O_,lR=f(()=>{us();ua();Vs();O_=class extends rr{constructor(e){let{texture:t,vertices:i,uvs:s,indices:n,topology:o,...a}=e,u=new Zt(mt({positions:i,uvs:s,indices:n,topology:o}));super(mt({...a,texture:t,geometry:u})),this.autoUpdate=true,this.onRender=this._render;}get vertices(){return this.geometry.getBuffer("aPosition").data}set vertices(e){this.geometry.getBuffer("aPosition").data=e;}_render(){this.autoUpdate&&this.geometry.getBuffer("aPosition").update();}};});function cR(r,e){let{width:t,height:i}=r.frame;return e.scale(1/t,1/i),e}var hR=f(()=>{});var dR,fR,pR=f(()=>{it();ce();ff();Sf();dR=class aE{constructor(e){if(e instanceof C)this.texture=e,Cn(this,aE.defaultOptions,{});else {let t={...aE.defaultOptions,...e};Cn(this,t,{});}}get alpha(){return this._alpha}set alpha(e){this._alpha=Math.min(Math.max(e,0),1),this._updateColor();}get tint(){return Ri(this._tint)}set tint(e){typeof e=="number"?this._tint=e:this._tint=K.shared.setValue(e??16777215).toBgrNumber(),this._updateColor();}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24);}};dR.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};fR=dR;});var vd,uE=f(()=>{vd={vertex:{attributeName:"aVertex",format:"float32x2",code:`
|
|
3231
3231
|
const texture = p.texture;
|
|
3232
3232
|
const sx = p.scaleX;
|
|
3233
3233
|
const sy = p.scaleY;
|
|
@@ -3307,4 +3307,4 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3307
3307
|
u32v[offset + stride] = c;
|
|
3308
3308
|
u32v[offset + (stride * 2)] = c;
|
|
3309
3309
|
u32v[offset + (stride * 3)] = c;
|
|
3310
|
-
`,dynamic:false}};});var PF,mR,gR,xR=f(()=>{Et();Gr();uE();PF=new me(0,0,0,0),mR=class lE extends qe{constructor(e={}){e={...lE.defaultOptions,...e,dynamicProperties:{...lE.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in vd){let l=vd[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return PF}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){e??(e=0),t??(t=this.particleChildren.length);let i=this.particleChildren.splice(e,t-e);return this.onViewUpdate(),i}removeParticleAt(e){let t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};mR.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};gR=mR;});var _R,cE,G_,yR=f(()=>{is();ce();xe();Gr();zm();_R=class bR extends qe{constructor(e){e instanceof C&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??zr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??zr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??zr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??zr.defaultOptions.bottomHeight,this._width=t??l.width??zr.defaultOptions.width,this._height=i??l.height??zr.defaultOptions.height,this.allowChildren=false,this.texture=l??bR.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new we({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=C.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};_R.defaultOptions={texture:C.EMPTY};cE=_R,G_=class extends cE{constructor(...e){let t=e[0];t instanceof C&&(I(H,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),t={texture:t,leftWidth:e[1],topHeight:e[2],rightWidth:e[3],bottomHeight:e[4]}),I(H,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});async function vR(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var TR=f(()=>{});function hE(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=wF[BF++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Ee&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];hE(a,e,{...t});}}function dE(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];dE(o,e,{...t,index:n});}}var wF,BF,SR=f(()=>{ms();wF=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],BF=0;});var ER={};zd(ER,{AbstractBitmapFont:()=>Ls,AbstractRenderer:()=>di,AbstractText:()=>bi,AccessibilitySystem:()=>Pf,AlphaFilter:()=>Q3,AlphaMask:()=>In,AlphaMaskPipe:()=>So,AnimatedSprite:()=>yl,Application:()=>Oh,ApplicationInitHook:()=>vo,Assets:()=>et,AssetsClass:()=>zh,BLEND_TO_NPM:()=>$f,BUFFER_TYPE:()=>jo,BackgroundLoader:()=>$u,BackgroundSystem:()=>cg,Batch:()=>gc,BatchGeometry:()=>Ha,BatchTextureArray:()=>Na,BatchableGraphics:()=>Li,BatchableHTMLText:()=>pu,BatchableMesh:()=>ai,BatchableSprite:()=>Pr,BatchableText:()=>ru,Batcher:()=>Qf,BatcherPipe:()=>Th,BigPool:()=>Re,BindGroup:()=>nt,BindGroupSystem:()=>Mo,BitmapFont:()=>oa,BitmapFontManager:()=>zi,BitmapText:()=>Sl,BitmapTextGraphics:()=>Xc,BitmapTextPipe:()=>ro,BlendModeFilter:()=>ee,BlendModePipe:()=>Co,BlurFilter:()=>dd,BlurFilterPass:()=>bl,Bounds:()=>me,BrowserAdapter:()=>Ff,Buffer:()=>Ve,BufferImageSource:()=>Di,BufferResource:()=>mi,BufferUsage:()=>ie,CLEAR:()=>ot,Cache:()=>de,CanvasPool:()=>Vt,CanvasPoolClass:()=>Hc,CanvasSource:()=>ht,CanvasTextGenerator:()=>Vi,CanvasTextMetrics:()=>xt,CanvasTextPipe:()=>qn,CanvasTextSystem:()=>to,Circle:()=>iu,Color:()=>K,ColorBlend:()=>Qc,ColorBurnBlend:()=>Jc,ColorDodgeBlend:()=>eh,ColorMask:()=>kn,ColorMaskPipe:()=>Eo,ColorMatrixFilter:()=>__,CompressedSource:()=>Br,Container:()=>te,Culler:()=>Jx,CullerPlugin:()=>Zh,CustomRenderPipe:()=>mo,D3D10_RESOURCE_DIMENSION:()=>Xx,D3DFMT:()=>zt,DATA_URI:()=>GP,DDS:()=>Q,DEG_TO_RAD:()=>Zd,DEPRECATED_SCALE_MODES:()=>yd,DEPRECATED_WRAP_MODES:()=>bd,DOMAdapter:()=>V,DOMContainer:()=>kf,DOMPipe:()=>Mn,DRAW_MODES:()=>wB,DXGI_FORMAT:()=>Wx,DXGI_TO_TEXTURE_FORMAT:()=>Ft,DarkenBlend:()=>th,DefaultBatcher:()=>Ln,DefaultShader:()=>Ya,DifferenceBlend:()=>rh,DisplacementFilter:()=>v_,DivideBlend:()=>ih,DynamicBitmapFont:()=>zc,Ellipse:()=>su,EventBoundary:()=>Ma,EventEmitter:()=>ue,EventSystem:()=>Da,EventsTicker:()=>_r,ExclusionBlend:()=>sh,ExtensionType:()=>m,ExtractSystem:()=>hg,FOURCC_TO_TEXTURE_FORMAT:()=>jh,FederatedContainer:()=>If,FederatedEvent:()=>si,FederatedMouseEvent:()=>Or,FederatedPointerEvent:()=>At,FederatedWheelEvent:()=>br,FillGradient:()=>It,FillPattern:()=>Hr,Filter:()=>_t,FilterEffect:()=>Ir,FilterPipe:()=>uo,FilterSystem:()=>lo,FontStylePromiseCache:()=>mu,GAUSSIAN_VALUES:()=>_l,GL_FORMATS:()=>Uu,GL_INTERNAL_FORMAT:()=>a1,GL_TARGETS:()=>Bh,GL_TYPES:()=>fe,GL_WRAP_MODES:()=>OT,GenerateTextureSystem:()=>Po,Geometry:()=>Mt,GlBackBufferSystem:()=>Vg,GlBatchAdaptor:()=>$o,GlBuffer:()=>Gu,GlBufferSystem:()=>qo,GlColorMaskSystem:()=>Zo,GlContextSystem:()=>Lg,GlEncoderSystem:()=>Qo,GlGeometrySystem:()=>Ko,GlGraphicsAdaptor:()=>Xo,GlLimitsSystem:()=>Jo,GlMeshAdaptor:()=>Yo,GlParticleContainerAdaptor:()=>Za,GlParticleContainerPipe:()=>Yn,GlProgram:()=>ke,GlProgramData:()=>Hu,GlRenderTarget:()=>Lu,GlRenderTargetAdaptor:()=>Nu,GlRenderTargetSystem:()=>ra,GlShaderSystem:()=>ia,GlStateSystem:()=>lx,GlStencilSystem:()=>ea,GlTexture:()=>zu,GlTextureSystem:()=>na,GlUboSystem:()=>ta,GlUniformGroupSystem:()=>sa,GlobalUniformSystem:()=>wo,GpuBatchAdaptor:()=>po,GpuBlendModesToPixi:()=>wt,GpuBufferSystem:()=>Do,GpuColorMaskSystem:()=>Io,GpuDeviceSystem:()=>Ks,GpuEncoderSystem:()=>ko,GpuGraphicsAdaptor:()=>ho,GpuGraphicsContext:()=>Bc,GpuLimitsSystem:()=>Fo,GpuMeshAdapter:()=>fo,GpuMipmapGenerator:()=>Ou,GpuParticleContainerAdaptor:()=>eu,GpuParticleContainerPipe:()=>$n,GpuProgram:()=>Fe,GpuRenderTarget:()=>Iu,GpuRenderTargetAdaptor:()=>ku,GpuRenderTargetSystem:()=>Ho,GpuShaderSystem:()=>Vo,GpuStateSystem:()=>zo,GpuStencilModesToPixi:()=>wr,GpuStencilSystem:()=>Oo,GpuTextureSystem:()=>Wo,GpuUboSystem:()=>Uo,GpuUniformBatchPipe:()=>Lo,Graphics:()=>Us,GraphicsContext:()=>Je,GraphicsContextRenderData:()=>Rc,GraphicsContextSystem:()=>Ms,GraphicsGpuData:()=>Dc,GraphicsPath:()=>ui,GraphicsPipe:()=>Wn,HTMLText:()=>El,HTMLTextPipe:()=>io,HTMLTextRenderData:()=>Ns,HTMLTextStyle:()=>Hs,HTMLTextSystem:()=>so,HardLightBlend:()=>nh,HardMixBlend:()=>oh,HelloSystem:()=>qs,IGLUniformData:()=>jg,ImageSource:()=>Rt,InstructionSet:()=>as,KTX:()=>Xe,LightenBlend:()=>ah,LinearBurnBlend:()=>uh,LinearDodgeBlend:()=>lh,LinearLightBlend:()=>ch,Loader:()=>qu,LoaderParserPriority:()=>Me,LuminosityBlend:()=>hh,MaskEffectManager:()=>Ea,MaskEffectManagerClass:()=>Ql,MaskFilter:()=>Su,Matrix:()=>D,Mesh:()=>rr,MeshGeometry:()=>Zt,MeshGpuData:()=>Ka,MeshPipe:()=>Xn,MeshPlane:()=>k_,MeshRope:()=>aR,MeshSimple:()=>O_,NOOP:()=>rc,NegationBlend:()=>dh,NineSliceGeometry:()=>zr,NineSlicePlane:()=>G_,NineSliceSprite:()=>cE,NineSliceSpriteGpuData:()=>qc,NineSliceSpritePipe:()=>ao,NoiseFilter:()=>aB,ObservablePoint:()=>we,OverlayBlend:()=>fh,PI_2:()=>qd,Particle:()=>fR,ParticleBuffer:()=>Qa,ParticleContainer:()=>gR,ParticleContainerPipe:()=>Ds,ParticleShader:()=>Ja,PerspectiveMesh:()=>eR,PerspectivePlaneGeometry:()=>Cl,PinLightBlend:()=>ph,PipelineSystem:()=>No,PlaneGeometry:()=>Ws,Point:()=>ne,Polygon:()=>ks,Pool:()=>Bi,PoolGroupClass:()=>Kl,PrepareBase:()=>E_,PrepareQueue:()=>Tl,PrepareSystem:()=>_d,PrepareUpload:()=>Al,QuadGeometry:()=>_u,RAD_TO_DEG:()=>Kd,Rectangle:()=>Z,RenderContainer:()=>R_,RenderGroup:()=>wa,RenderGroupPipe:()=>xo,RenderGroupSystem:()=>bo,RenderLayer:()=>$B,RenderTarget:()=>Ro,RenderTargetSystem:()=>Js,RenderTexture:()=>Eu,RenderableGCSystem:()=>mg,RendererInitHook:()=>To,RendererType:()=>Oe,ResizePlugin:()=>wn,Resolver:()=>Pt,RopeGeometry:()=>F_,RoundedRectangle:()=>nu,SCALE_MODES:()=>MB,STENCIL_MODES:()=>Be,SVGParser:()=>lm,SaturationBlend:()=>mh,SchedulerSystem:()=>Bo,ScissorMask:()=>w_,SdfShader:()=>du,Shader:()=>ze,ShaderStage:()=>Ss,ShapePath:()=>lu,SharedRenderPipes:()=>wu,SharedSystems:()=>Pu,SoftLightBlend:()=>gh,Sprite:()=>Ee,SpritePipe:()=>yo,Spritesheet:()=>hc,State:()=>Ue,StencilMask:()=>Fn,StencilMaskPipe:()=>Ao,SubtractBlend:()=>xh,SystemRunner:()=>$s,TEXTURE_FORMAT_BLOCK_SIZE:()=>Yx,Text:()=>Rr,TextStyle:()=>gt,Texture:()=>C,TextureGCSystem:()=>gg,TextureMatrix:()=>ls,TexturePool:()=>be,TexturePoolClass:()=>ic,TextureSource:()=>oe,TextureStyle:()=>st,TextureUvs:()=>B_,Ticker:()=>ye,TickerListener:()=>hs,TickerPlugin:()=>Rn,TilingSprite:()=>C_,TilingSpriteGpuData:()=>$c,TilingSpritePipe:()=>oo,TilingSpriteShader:()=>xu,Transform:()=>vl,Triangle:()=>S_,UNIFORM_TO_ARRAY_SETTERS:()=>ox,UNIFORM_TO_SINGLE_SETTERS:()=>nx,UNIFORM_TYPES_MAP:()=>yp,UNIFORM_TYPES_VALUES:()=>Tc,UPDATE_BLEND:()=>Ba,UPDATE_COLOR:()=>Pn,UPDATE_PRIORITY:()=>Ht,UPDATE_TRANSFORM:()=>mA,UPDATE_VISIBLE:()=>cs,UboBatch:()=>Mu,UboSystem:()=>Zs,UniformGroup:()=>ae,VERSION:()=>js,VideoSource:()=>_s,ViewContainer:()=>qe,ViewSystem:()=>bg,ViewableBuffer:()=>yr,VividLightBlend:()=>_h,WGSL_ALIGN_SIZE_DATA:()=>Go,WGSL_TO_STD40_SIZE:()=>Rh,WRAP_MODES:()=>RB,WebGLRenderer:()=>Fh,WebGPURenderer:()=>wh,WebWorkerAdapter:()=>j3,WorkerManager:()=>Vh,accessibilityTarget:()=>wf,addBits:()=>_c,addMaskBounds:()=>gs,addMaskLocalBounds:()=>xs,addProgramDefines:()=>rp,alphaFrag:()=>c_,alphaWgsl:()=>hd,applyMatrix:()=>Nm,applyProjectiveTransformationToPlane:()=>M_,applyStyleParams:()=>kh,assignWithIgnore:()=>Cn,autoDetectEnvironment:()=>DP,autoDetectRenderer:()=>bx,autoDetectSource:()=>zA,basisTranscoderUrls:()=>nl,bgr2rgb:()=>Ri,bitmapFontCachePlugin:()=>yx,bitmapFontTextParser:()=>Yu,bitmapFontXMLParser:()=>Gh,bitmapFontXMLStringParser:()=>Uh,blendTemplateFrag:()=>Xm,blendTemplateVert:()=>Ym,blendTemplateWgsl:()=>$m,blockDataMap:()=>Ph,blurTemplateWgsl:()=>m_,boundsPool:()=>Nt,browserExt:()=>u2,buildAdaptiveBezier:()=>au,buildAdaptiveQuadratic:()=>Jp,buildArc:()=>uu,buildArcTo:()=>tm,buildArcToSvg:()=>rm,buildCircle:()=>Rs,buildContextBatches:()=>Vp,buildEllipse:()=>Cp,buildLine:()=>Mp,buildPixelLine:()=>Dp,buildPolygon:()=>Up,buildRectangle:()=>Lp,buildRoundedRectangle:()=>Pp,buildSimpleUvs:()=>Ep,buildTriangle:()=>Np,buildUvs:()=>Sp,cacheAsTextureMixin:()=>tf,cacheTextureArray:()=>Tx,calculateProjection:()=>Dg,checkChildrenDidChange:()=>ec,checkDataUrl:()=>Qt,checkExtension:()=>We,checkMaxIfStatementsInShader:()=>Ua,childrenHelperMixin:()=>sf,cleanArray:()=>pg,cleanHash:()=>fg,clearList:()=>_o,closePointEps:()=>wp,collectAllRenderables:()=>LB,collectRenderablesMixin:()=>nf,color32BitToUniform:()=>Cr,colorBit:()=>As,colorBitGl:()=>Cs,colorMatrixFilterFrag:()=>x_,colorMatrixFilterWgsl:()=>fd,colorToUniform:()=>TC,compareModeToGlCompare:()=>mx,compileHighShader:()=>dp,compileHighShaderGl:()=>fp,compileHighShaderGlProgram:()=>Tr,compileHighShaderGpuProgram:()=>vr,compileHooks:()=>bc,compileInputs:()=>yc,compileOutputs:()=>hp,compileShader:()=>Mh,compute2DProjection:()=>I_,convertFormatIfRequired:()=>Hw,convertToList:()=>Ct,copySearchParams:()=>Dn,createIdFromString:()=>Nr,createIndicesForQuads:()=>kc,createLevelBuffers:()=>Pw,createLevelBuffersFromKTX:()=>zw,createStringVariations:()=>Of,createTexture:()=>kt,createUboElementsSTD40:()=>zg,createUboElementsWGSL:()=>Tg,createUboSyncFunction:()=>Bu,createUboSyncFunctionSTD40:()=>Yg,createUboSyncFunctionWGSL:()=>Bg,crossOrigin:()=>qS,cullingMixin:()=>jd,curveEps:()=>Bp,defaultFilterVert:()=>on,defaultValue:()=>Vu,definedProps:()=>mt,deprecation:()=>I,detectAvif:()=>Ex,detectBasis:()=>yw,detectCompressed:()=>Kw,detectDefaults:()=>Ax,detectMp4:()=>Cx,detectOgv:()=>Px,detectVideoAlphaMode:()=>Fa,detectWebm:()=>wx,detectWebp:()=>Bx,determineCrossOrigin:()=>ZS,displacementFrag:()=>b_,displacementVert:()=>y_,displacementWgsl:()=>pd,earcut:()=>Op,effectsMixin:()=>of,ensureAttributes:()=>Du,ensureIsBuffer:()=>xc,ensurePrecision:()=>ip,ensureTextOptions:()=>an,executeInstructions:()=>go,extensions:()=>O,extractAttributesFromGlProgram:()=>Jg,extractAttributesFromGpuProgram:()=>ap,extractFontFamilies:()=>Bm,extractStructAndGroups:()=>za,extractSvgUrlId:()=>Lc,fastCopy:()=>Un,findMixin:()=>af,fontStringFromTextStyle:()=>Hi,formatShader:()=>yB,fragmentGPUTemplate:()=>mp,fragmentGlTemplate:()=>xp,generateArraySyncSTD40:()=>Xg,generateArraySyncWGSL:()=>wg,generateBlurFragSource:()=>d_,generateBlurGlProgram:()=>p_,generateBlurProgram:()=>g_,generateBlurVertSource:()=>f_,generateGPULayout:()=>gB,generateGpuLayoutGroups:()=>up,generateLayout:()=>_B,generateLayoutHash:()=>lp,generateParticleUpdateFunction:()=>zp,generateProgram:()=>ix,generateShaderSyncCode:()=>$g,generateTextStyleKey:()=>hm,generateTextureBatchBit:()=>Ps,generateTextureBatchBitGl:()=>ws,generateTextureMatrix:()=>Hp,generateUniformsSync:()=>ax,getAdjustedBlendModeBlend:()=>Lr,getAttributeInfoFromFormat:()=>Dt,getBatchSamplersUniformGroup:()=>Bs,getBitmapTextLayout:()=>fu,getCanvasBoundingBox:()=>fm,getCanvasFillStyle:()=>Gs,getCanvasTexture:()=>Cu,getDefaultUniformValue:()=>vp,getFastGlobalBounds:()=>OB,getFastGlobalBoundsMixin:()=>lf,getFontCss:()=>Mm,getFontFamilyName:()=>VS,getGeometryBounds:()=>Jf,getGlTypeFromFormat:()=>Hg,getGlobalBounds:()=>ii,getGlobalMixin:()=>df,getGlobalRenderableBounds:()=>Wm,getLocalBounds:()=>os,getMaxFragmentPrecision:()=>tp,getMaxTexturesPerBatch:()=>Zf,getOrientationOfPoints:()=>Rp,getPo2TextureFromSource:()=>hu,getResolutionOfUrl:()=>rn,getSVGUrl:()=>Dm,getSupportedCompressedTextureFormats:()=>rl,getSupportedGPUCompressedTextureFormats:()=>Xh,getSupportedGlCompressedTextureFormats:()=>Wh,getSupportedTextureFormats:()=>gi,getTemporaryCanvasFromImage:()=>Im,getTestContext:()=>Ga,getTextureBatchBindGroup:()=>bs,getTextureDefaultMatrix:()=>cR,getTextureFormatFromKTXTexture:()=>Xw,getUboData:()=>ex,getUniformData:()=>tx,getUrlExtension:()=>ay,glFormatToGPUFormat:()=>Kx,glUploadBufferImageResource:()=>cx,glUploadCompressedTextureResource:()=>hx,glUploadImageResource:()=>Wu,glUploadVideoResource:()=>fx,globalUniformsBit:()=>_p,globalUniformsBitGl:()=>bp,globalUniformsUBOBitGl:()=>iC,gpuFormatToBasisTranscoderFormat:()=>Bw,gpuFormatToKTXBasisTranscoderFormat:()=>$w,gpuUploadBufferImageResource:()=>Fg,gpuUploadCompressedTextureResource:()=>Og,gpuUploadImageResource:()=>Fu,gpuUploadVideoResource:()=>Ug,groupD8:()=>le,hasCachedCanvasTexture:()=>YP,hslWgsl:()=>lB,hslgl:()=>Xs,hslgpu:()=>Ys,injectBits:()=>vc,insertVersion:()=>sp,isMobile:()=>Af,isPow2:()=>tc,isRenderingToScreen:()=>Ig,isSafari:()=>Am,isSingleItem:()=>ki,isWebGLSupported:()=>fi,isWebGPUSupported:()=>pi,ktxTranscoderUrls:()=>al,loadBasis:()=>Aw,loadBasisOnWorker:()=>zx,loadBitmapFont:()=>vx,loadDDS:()=>Mw,loadEnvironmentExtensions:()=>bh,loadFontAsBase64:()=>Rm,loadFontCSS:()=>Yc,loadImageBitmap:()=>jS,loadJson:()=>Rx,loadKTX:()=>Iw,loadKTX2:()=>Uw,loadKTX2onWorker:()=>qx,loadSVGImage:()=>km,loadSvg:()=>Ix,loadTextures:()=>Ju,loadTxt:()=>Mx,loadVideoTextures:()=>Fx,loadWebFont:()=>Dx,localUniformBit:()=>Wi,localUniformBitGl:()=>zs,localUniformBitGroup2:()=>Om,localUniformMSDFBit:()=>xm,localUniformMSDFBitGl:()=>_m,log2:()=>aA,logDebugTexture:()=>vR,logProgramError:()=>rx,logRenderGroupScene:()=>dE,logScene:()=>hE,mSDFBit:()=>bm,mSDFBitGl:()=>ym,mapFormatToGlFormat:()=>gx,mapFormatToGlInternalFormat:()=>xx,mapFormatToGlType:()=>_x,mapGlToVertexFormat:()=>Zg,mapSize:()=>AB,mapType:()=>Dh,mapWebGLBlendModesToPixi:()=>ux,maskFrag:()=>ug,maskVert:()=>lg,maskWgsl:()=>Sh,matrixPool:()=>je,measureHtmlText:()=>gu,measureMixin:()=>pf,migrateFragmentFromV7toV8:()=>SB,mipmapScaleModeToGlFilter:()=>px,multiplyColors:()=>ns,multiplyHexColors:()=>Ca,nextPow2:()=>kr,noiseFrag:()=>T_,noiseWgsl:()=>md,nonCompressedFormats:()=>r1,normalizeExtensionPriority:()=>va,onRenderMixin:()=>mf,parseDDS:()=>$x,parseFunctionBody:()=>kB,parseKTX:()=>jx,parseSVGDefinitions:()=>am,parseSVGFloatAttribute:()=>Ge,parseSVGPath:()=>jp,parseSVGStyle:()=>Nc,particleData:()=>vd,particlesFrag:()=>Wp,particlesVert:()=>Xp,particlesWgsl:()=>Fc,path:()=>De,pointInTriangle:()=>gd,preloadVideo:()=>KS,removeItems:()=>Sa,removeStructAndGroupDuplicates:()=>cp,resetUids:()=>tA,resolveCharacters:()=>Sm,resolveCompressedTextureUrl:()=>qw,resolveJsonUrl:()=>Gx,resolveTextureUrl:()=>el,resourceToTexture:()=>xy,roundPixelsBit:()=>Sr,roundPixelsBitGl:()=>Er,roundedShapeArc:()=>im,roundedShapeQuadraticCurve:()=>sm,sayHello:()=>dg,scaleModeToGlFilter:()=>Ih,setBasisTranscoderPath:()=>Sw,setKTXTranscoderPath:()=>Ow,setPositions:()=>Lm,setProgramName:()=>np,setUvs:()=>Hm,shapeBuilders:()=>qa,sortMixin:()=>gf,spritesheetAsset:()=>Uf,squaredDistanceToLineSegment:()=>Is,stripVersion:()=>op,styleAttributes:()=>um,testImageFormat:()=>ju,testVideoFormat:()=>en,textStyleToCSS:()=>Pm,textureBit:()=>Qm,textureBitGl:()=>Jm,textureFrom:()=>_y,tilingBit:()=>Gm,tilingBitGl:()=>Um,toFillStyle:()=>Vr,toLocalGlobalMixin:()=>xf,toStrokeStyle:()=>Fs,transformVertices:()=>Ec,triangulateWithHoles:()=>ja,uboSyncFunctionsSTD40:()=>Ah,uboSyncFunctionsWGSL:()=>Cg,uid:()=>re,uniformParsers:()=>Wr,unpremultiplyAlpha:()=>sw,unsafeEvalSupported:()=>bu,updateLocalTransform:()=>HB,updateQuadBounds:()=>ka,updateRenderGroupTransform:()=>v2,updateRenderGroupTransforms:()=>vh,updateTextBounds:()=>jn,updateTransformAndChildren:()=>sg,updateTransformBackwards:()=>Aa,updateWorldTransform:()=>zB,v8_0_0:()=>H,v8_3_4:()=>Jd,validFormats:()=>ul,validateRenderables:()=>ng,vertexGPUTemplate:()=>pp,vertexGlTemplate:()=>gp,vkFormatToGPUFormat:()=>Zx,warn:()=>F,webworkerExt:()=>l2,wrapModeToGlAddress:()=>Xu});var Ce=f(()=>{oP();uP();E();E();Wf();Lf();Yb();$b();hP();dP();fP();pP();mP();gP();xP();_P();bP();yP();vP();TP();SP();EP();AP();CP();PP();wP();BP();RP();MP();dw();jb();Kb();bw();MS();ni();DS();IS();kS();FS();OS();GS();US();Sx();Lh();LS();ar();NS();HS();zS();WS();kx();QS();Xi();$S();JS();Ox();ps();tn();hr();Ia();Gf();oy();lc();it();vw();Cw();ww();Rw();i1();s1();n1();Dw();o1();kw();l1();u1();Lw();Vw();Ww();Yw();f1();jw();c1();p1();h1();Zw();m1();x1();Qw();vb();FA();sy();Se();m2();ny();q3();ey();Df();Bf();sc();iy();oc();Rf();Mf();h2();d2();f2();cB();I1();k1();U1();H1();V1();cd();z1();W1();X1();Y1();$1();w2();B2();R2();$e();Kc();Zc();J3();rB();N1();h_();F1();G1();O1();L1();iB();sB();uB();hi();Zl();i2();o2();M2();yf();he();Qd();Pa();qp();is();jt();j1();K0();Z0();Q0();Ze();J0();hB();q1();J1();mB();rE();RT();Kf();yy();xB();bB();pc();_2();Sy();P2();Cy();vy();Tp();i0();Gi();Ky();Wy();Xy();Yy();$y();vB();jy();Zy();Wa();Xa();Qy();no();Ui();eg();cy();I2();hy();k2();Cb();TB();dy();F2();dc();fc();ES();MT();DT();IT();co();FT();UT();GT();NT();HT();VT();zT();jT();WT();$T();qT();KT();ZT();Sc();Kt();QT();oS();lS();EB();JT();qg();Rg();tS();nS();wy();qf();rS();iS();sS();CB();Qg();By();Ry();My();Dy();Iy();Wg();YT();XT();uS();aS();dS();cS();Ng();fS();TS();pS();mS();dx();gS();_S();e1();bS();yS();vS();xS();nw();SS();tT();rT();hT();iT();sT();nT();oT();aT();cT();dT();fT();pT();gT();xT();_T();Fi();ur();bT();Sg();lT();Gy();Uy();uT();Ny();Hy();Vy();yT();vT();Mg();CT();TT();ST();Gg();ET();t1();AT();PT();G2();U2();Oi();Ch();oi();Yf();H2();z2();BB();vs();n0();Ey();Ts();Ay();o0();_f();W2();mT();xg();kg();X2();Ly();Ar();t0();vg();Qe();Ag();r0();Pg();Eg();$2();ys();Oa();cr();yu();yg();qm();Qn();DB();K2();V2();vf();On();tl();Gn();ct();zf();ce();Q2();Tf();Fr();Mi();IB();_g();Hx();il();by();Va();FB();eT();lr();U0();L0();N0();Et();GB();vn();Jl();s2();ss();Sb();Eb();Ab();Pb();wb();Bb();ff();Mb();Db();Ib();kb();qt();b2();UB();Gb();y2();E2();Sf();Rb();ig();NB();us();rg();hf();cf();VB();T2();WB();S2();wT();zn();g2();Ap();Qp();iv();em();sv();av();a0();l0();c0();p0();m0();g0();lC();Vn();Oc();gm();Zn();Mc();R0();nm();uv();lv();cv();om();q0();dv();fv();hv();y0();cm();b0();u0();Gp();jB();tR();nE();iE();sE();rR();jc();uR();lR();oE();BT();x2();Ic();hR();ua();Vs();D0();k0();z0();V0();W0();pR();G0();xR();Yp();uE();H0();F0();O0();K1();zm();yR();t2();Xv();jv();Q1();Jv();Zv();qv();Kv();Qv();tu();ms();A2();vm();PS();wS();BS();RS();CS();Wc();eE();Rv();Pv();Tm();wv();Dv();tE();Iv();Cm();wm();zv();Ov();Lv();Nv();Hv();Gv();Uv();Vv();Fm();Fv();xd();Y0();mm();eo();$0();yv();Vc();pm();Cv();Tv();Sv();P_();Os();mv();dm();$p();Gr();uy();ly();Bn();ds();qb();Hf();Wb();kv();vu();Tu();jm();xv();og();St();j2();rf();lt();Nf();Xf();ag();xe();TR();SR();_e();Ob();Z1();Nh();fs();ef();ri();Y2();f0();O.add(u2,l2);});var kR=ti((j_,IR)=>{(function(r,e){typeof j_=="object"?IR.exports=j_=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(j_,function(){var r=r||function(e,t){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof db=="function")try{i=db("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function g(){}return function(v){var T;return g.prototype=v,T=new g,g.prototype=null,T}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(g){var v=n(this);return g&&v.mixIn(g),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments);}),v.init.prototype=v,v.$super=this,v},create:function(){var g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var v in g)g.hasOwnProperty(v)&&(this[v]=g[v]);g.hasOwnProperty("toString")&&(this.toString=g.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(g,v){g=this.words=g||[],v!=t?this.sigBytes=v:this.sigBytes=g.length*4;},toString:function(g){return (g||h).stringify(this)},concat:function(g){var v=this.words,T=g.words,S=this.sigBytes,B=g.sigBytes;if(this.clamp(),S%4)for(var A=0;A<B;A++){var R=T[A>>>2]>>>24-A%4*8&255;v[S+A>>>2]|=R<<24-(S+A)%4*8;}else for(var Y=0;Y<B;Y+=4)v[S+Y>>>2]=T[Y>>>2];return this.sigBytes+=B,this},clamp:function(){var g=this.words,v=this.sigBytes;g[v>>>2]&=4294967295<<32-v%4*8,g.length=e.ceil(v/4);},clone:function(){var g=u.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var v=[],T=0;T<g;T+=4)v.push(s());return new l.init(v,g)}}),c=o.enc={},h=c.Hex={stringify:function(g){for(var v=g.words,T=g.sigBytes,S=[],B=0;B<T;B++){var A=v[B>>>2]>>>24-B%4*8&255;S.push((A>>>4).toString(16)),S.push((A&15).toString(16));}return S.join("")},parse:function(g){for(var v=g.length,T=[],S=0;S<v;S+=2)T[S>>>3]|=parseInt(g.substr(S,2),16)<<24-S%8*4;return new l.init(T,v/2)}},d=c.Latin1={stringify:function(g){for(var v=g.words,T=g.sigBytes,S=[],B=0;B<T;B++){var A=v[B>>>2]>>>24-B%4*8&255;S.push(String.fromCharCode(A));}return S.join("")},parse:function(g){for(var v=g.length,T=[],S=0;S<v;S++)T[S>>>2]|=(g.charCodeAt(S)&255)<<24-S%4*8;return new l.init(T,v)}},p=c.Utf8={stringify:function(g){try{return decodeURIComponent(escape(d.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return d.parse(unescape(encodeURIComponent(g)))}},_=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(g){typeof g=="string"&&(g=p.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes;},_process:function(g){var v,T=this._data,S=T.words,B=T.sigBytes,A=this.blockSize,R=A*4,Y=B/R;g?Y=e.ceil(Y):Y=e.max((Y|0)-this._minBufferSize,0);var M=Y*A,U=e.min(M*4,B);if(M){for(var k=0;k<M;k+=A)this._doProcessBlock(S,k);v=S.splice(0,M),T.sigBytes-=U;}return new l.init(v,U)},clone:function(){var g=u.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});a.Hasher=_.extend({cfg:u.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset();},reset:function(){_.reset.call(this),this._doReset();},update:function(g){return this._append(g),this._process(),this},finalize:function(g){g&&this._append(g);var v=this._doFinalize();return v},blockSize:512/32,_createHelper:function(g){return function(v,T){return new g.init(T).finalize(v)}},_createHmacHelper:function(g){return function(v,T){return new x.HMAC.init(g,T).finalize(v)}}});var x=o.algo={};return o}(Math);return r});});var OR=ti((q_,FR)=>{(function(r,e){typeof q_=="object"?FR.exports=q_=e(kR()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(q_,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],d=c[1],p=c[2],_=c[3],b=c[4],x=0;x<80;x++){if(x<16)o[x]=u[l+x]|0;else {var g=o[x-3]^o[x-8]^o[x-14]^o[x-16];o[x]=g<<1|g>>>31;}var v=(h<<5|h>>>27)+b+o[x];x<20?v+=(d&p|~d&_)+1518500249:x<40?v+=(d^p^_)+1859775393:x<60?v+=(d&p|d&_|p&_)-1894007588:v+=(d^p^_)-899497514,b=_,_=p,p=d<<30|d>>>2,d=h,h=v;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+p|0,c[3]=c[3]+_|0,c[4]=c[4]+b|0;},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,h=u.sigBytes*8;return l[h>>>5]|=128<<24-h%32,l[(h+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(h+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});Ce();var yi={};zd(yi,{DistortionFilter:()=>U_,EqualizerFilter:()=>Mr,Filter:()=>dt,MonoFilter:()=>L_,ReverbFilter:()=>N_,StereoFilter:()=>H_,StreamFilter:()=>V_,TelephoneFilter:()=>z_});var AR;function CR(r){return AR=r,r}function ve(){return AR}var dt=class{constructor(e,t){this.init(e,t);}init(e,t){this.destination=e,this.source=t||e;}connect(e){this.source?.connect(e);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var U_=class extends dt{constructor(e=0){let t;if(!ve().useLegacy){let{audioContext:i}=ve().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,ve().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var at=class{static setParamValue(e,t){if(e.setValueAtTime){let i=ve().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Te=class extends dt{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Te.F32,type:"lowshelf",gain:r},{f:Te.F64,type:"peaking",gain:e},{f:Te.F125,type:"peaking",gain:t},{f:Te.F250,type:"peaking",gain:i},{f:Te.F500,type:"peaking",gain:s},{f:Te.F1K,type:"peaking",gain:n},{f:Te.F2K,type:"peaking",gain:o},{f:Te.F4K,type:"peaking",gain:a},{f:Te.F8K,type:"peaking",gain:u},{f:Te.F16K,type:"highshelf",gain:l}];ve().useLegacy||(c=h.map(d=>{let p=ve().context.audioContext.createBiquadFilter();return p.type=d.type,at.setParamValue(p.Q,1),p.frequency.value=d.f,at.setParamValue(p.gain,d.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let p=this.bands[d];d>0&&this.bands[d-1].connect(p),this.bandsMap[p.frequency.value]=p;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);at.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(Te.F32,r);}get f32(){return this.getGain(Te.F32)}set f64(r){this.setGain(Te.F64,r);}get f64(){return this.getGain(Te.F64)}set f125(r){this.setGain(Te.F125,r);}get f125(){return this.getGain(Te.F125)}set f250(r){this.setGain(Te.F250,r);}get f250(){return this.getGain(Te.F250)}set f500(r){this.setGain(Te.F500,r);}get f500(){return this.getGain(Te.F500)}set f1k(r){this.setGain(Te.F1K,r);}get f1k(){return this.getGain(Te.F1K)}set f2k(r){this.setGain(Te.F2K,r);}get f2k(){return this.getGain(Te.F2K)}set f4k(r){this.setGain(Te.F4K,r);}get f4k(){return this.getGain(Te.F4K)}set f8k(r){this.setGain(Te.F8K,r);}get f8k(){return this.getGain(Te.F8K)}set f16k(r){this.setGain(Te.F16K,r);}get f16k(){return this.getGain(Te.F16K)}reset(){this.bands.forEach(r=>{at.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},Mr=Te;Mr.F32=32;Mr.F64=64;Mr.F125=125;Mr.F250=250;Mr.F500=500;Mr.F1K=1e3;Mr.F2K=2e3;Mr.F4K=4e3;Mr.F8K=8e3;Mr.F16K=16e3;var L_=class extends dt{constructor(){let e,t;if(!ve().useLegacy){let{audioContext:i}=ve().context;t=i.createChannelSplitter(),e=i.createChannelMerger(),e.connect(t);}super(e,t),this._merger=e;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var N_=class extends dt{constructor(e=3,t=2,i=false){super(null),this._seconds=this._clamp(e,1,50),this._decay=this._clamp(t,0,100),this._reverse=i,this._rebuild();}_clamp(e,t,i){return Math.min(i,Math.max(t,e))}get seconds(){return this._seconds}set seconds(e){this._seconds=this._clamp(e,1,50),this._rebuild();}get decay(){return this._decay}set decay(e){this._decay=this._clamp(e,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(e){this._reverse=e,this._rebuild();}_rebuild(){if(ve().useLegacy)return;let{audioContext:e}=ve().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var H_=class extends dt{constructor(e=0){let t,i,s;if(!ve().useLegacy){let{audioContext:n}=ve().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?at.setParamValue(this._stereo.pan,e):this._panner&&this._panner.setPosition(e,0,1-Math.abs(e));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var V_=class extends dt{constructor(){let e,t;if(!ve().useLegacy){let{audioContext:i}=ve().context;e=i.createMediaStreamDestination(),t=i.createMediaStreamSource(e.stream);}super(e,t),this._stream=e?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var z_=class extends dt{constructor(){let e,t;if(!ve().useLegacy){let{audioContext:i}=ve().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",at.setParamValue(s.frequency,2e3),n.type="lowpass",at.setParamValue(n.frequency,2e3),o.type="highpass",at.setParamValue(o.frequency,500),a.type="highpass",at.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};Ce();var Td=class extends ue{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};Ce();var RF=0,fE=class extends ue{constructor(r){super(),this.id=RF++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-fE.PADDING),this._end=Math.min(this._end+fE.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),ye.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){ye.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){ye.shared.remove(this._onUpdate,this),this.removeAllListeners();let r=this._source;r&&(r.onended=null,r.onplay=null,r.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},W_=fE;W_.PADDING=.1;Ce();var Sd=class extends ue{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new W_(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};Ce();var Ed=class{constructor(e,t){this.parent=e,Object.assign(this,t),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(e){return this.parent.play({complete:e,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var la=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],pE=["audio/mpeg","audio/ogg"],ca={};function PR(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;la.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(ca,i);}PR();Ce();Ce();var DF=0,Ad=class extends ue{constructor(e){super(),this.id=DF++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);at.setParamValue(this._gain.gain,n*s*i),at.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){ye.shared.remove(this._updateListener,this),e&&ye.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var ha=class{constructor(e,t){this._output=t,this._input=e;}get destination(){return this._input}get filters(){return this._filters}set filters(e){if(this._filters&&(this._filters.forEach(t=>{t&&t.disconnect();}),this._filters=null,this._input.connect(this._output)),e&&e.length){this._filters=e.slice(0),this._input.disconnect();let t=null;e.forEach(i=>{t===null?this._input.connect(i.destination):t.connect(i.destination),t=i;}),t.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var wR=class extends ha{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(wR.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let r=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=r.buffer,at.setParamValue(e.playbackRate,r.playbackRate.value),e.loop=r.loop;let t=this.context.audioContext.createGain();return e.connect(t),t.connect(this.destination),{source:e,gain:t}}get bufferSize(){return this.script.bufferSize}},X_=wR;X_.BUFFER_SIZE=0;var da=class{init(e){this.parent=e,this._nodes=new X_(this.context),this._source=this._nodes.bufferSource,this.source=e.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null,this.source=null;}create(){return new Ad(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await V.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var Pl=class{static from(r){let e={};typeof r=="string"?e.url=r:r instanceof ArrayBuffer||r instanceof AudioBuffer||r instanceof HTMLAudioElement?e.source=r:Array.isArray(r)?e.url=r:e=r,e={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...e},Object.freeze(e);let t=ve().useLegacy?new Sd:new da;return new Pl(t,e)}constructor(r,e){this.media=r,this.options=e,this._instances=[],this._sprites={},this.media.init(this);let t=e.complete;this._autoPlayOptions=t?{complete:t}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=Array.isArray(e.url)?this.preferUrl(e.url):e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded);}preferUrl(r){let[e]=r.map(t=>({url:t,ext:De.extname(t).slice(1)})).filter(({ext:t})=>ca[t]).sort((t,i)=>la.indexOf(t.ext)-la.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return ve().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new Ed(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(Pl._pool.length>0){let r=Pl._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Pl._pool.indexOf(r)<0&&Pl._pool.push(r);}},un=Pl;un._pool=[];Ce();var wl=class r extends ha{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new ue,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var Y_=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new wl),this._htmlAudioContext=new Td,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(e){this.useLegacy||(this._context.filters=e);}get supported(){return wl.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof un)return this._sounds[e]=t,t;let i=this._getOptions(t),s=un.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};Ce();Ce();var BR=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=De.basename(e,De.extname(e))),t},RR={extension:m.Asset,detection:{test:async()=>true,add:async r=>[...r,...la.filter(e=>ca[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[m.LoadParser],priority:Me.High},test(r){let e=De.extname(r).slice(1);return !!ca[e]||pE.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>un.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return ve().add(BR(e),t),t},async unload(r,e){ve().remove(BR(e));}}};O.add(RR);CR(new Y_);var Cd="repeat";({DistortionFilter:yi.DistortionFilter,EqualizerFilter:yi.EqualizerFilter,MonoFilter:yi.MonoFilter,ReverbFilter:yi.ReverbFilter,StereoFilter:yi.StereoFilter,StreamFilter:yi.StreamFilter,TelephoneFilter:yi.TelephoneFilter});var MR=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],Yr="__game_layer__",Bl="Container",$_="ImageContainer",mE="Image",Rl="Sprite",Ml="Text",gE="Video";var N;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(N||(N={}));function Gt(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw N.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function DR(r){var e;let t={importPixi:false,...r};t.app&&(t.renderer=t.app.renderer,t.stage=t.app.stage),t.importPixi&&!t.pixi&&(t.pixi=await Promise.resolve().then(()=>(Ce(),ER))),window.__PIXI_DEVTOOLS__={...window.__PIXI_DEVTOOLS__||{},app:t.app,stage:t.stage,renderer:t.renderer,extensions:[...((e=window.__PIXI_DEVTOOLS__)==null?void 0:e.extensions)||[],...t.extensions||[]],plugins:{}};}var UR=Wd(OR());Ce();var FF={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Pe||r instanceof Wt||r instanceof Le},testProp(r){switch(r){case "xAlign":case "yAlign":case "xPercentagePosition":case "yPercentagePosition":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof Pe||r instanceof Wt||r instanceof Le)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "xPercentagePosition":r.xPercentagePosition=t/100;break;case "yPercentagePosition":r.yPercentagePosition=t/100;break}},getProperties(r){return [{value:r.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:r.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:r.xPercentagePosition*100,prop:"xPercentagePosition",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yPercentagePosition*100,prop:"yPercentagePosition",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},GR=FF;function OF(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var W=class W{constructor(){}static get app(){if(!W._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return W._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(Yr);return e||(e=new te,e.label=Yr,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return W.canvasWidth=t,W.canvasHeight=i,W._app=new Oh,W.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=W.app,extensions:a=[],...u}=n||{};DR({app:o,extensions:[GR,...a],...u}),W._isInitialized=true,W.addCanvasIntoHTMLElement(e),window.addEventListener("resize",W.resize),W.resize(),W.gameLayer;})}static addCanvasIntoHTMLElement(e){W._isInitialized?e.appendChild(W.app.canvas):N.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return W.htmlLayers.push(s),W.resize(),n}static removeHtmlLayer(e){let t=W.htmlLayers.find(i=>i.id===e);t&&(t.remove(),W.htmlLayers=W.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return W.htmlLayers.find(t=>t.id===e)}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/W.canvasWidth,t/W.canvasHeight)}static get screenWidth(){return Math.floor(W.screenScale*W.canvasWidth)}static get screenHeight(){return Math.floor(W.screenScale*W.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-W.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-W.screenHeight)/2}static async resize(){await OF(async()=>{if(W._isInitialized){let i=W.app.canvas.style;i.width=`${W.screenWidth}px`,i.height=`${W.screenHeight}px`,i.marginLeft=`${W.horizontalMargin}px`,i.marginRight=`${W.horizontalMargin}px`,i.marginTop=`${W.verticalMargin}px`,i.marginBottom=`${W.verticalMargin}px`;}let t=W.htmlLayers.map(i=>{i.style.width=`${W.screenWidth}px`,i.style.height=`${W.screenHeight}px`,i.style.marginLeft=`${W.horizontalMargin}px`,i.style.marginRight=`${W.horizontalMargin}px`,i.style.marginTop=`${W.verticalMargin}px`,i.style.marginBottom=`${W.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return W.gameLayer.children.filter(e=>e.label).sort((e,t)=>W.gameLayer.getChildIndex(e)-W.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(W._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static generateTickerId(e){try{return (0,UR.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),W._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),W._currentTickersTimeouts[e]&&delete W._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),W.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(W._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&W.removeTickerTimeout(i);}else W._currentTickersTimeouts[i].aliases=n;});}};L(W,"_app"),L(W,"htmlLayers",[]),L(W,"canvasWidth",300),L(W,"canvasHeight",300),L(W,"_isInitialized",false),L(W,"_currentTickers",{}),L(W,"_currentTickersSequence",{}),L(W,"_currentTickersTimeouts",{}),L(W,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),L(W,"_tickersOnPause",{});var w=W;Ce();var Dl=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,VR=new Set,xE=typeof process=="object"&&process?process:{},zR=(r,e,t,i)=>{typeof xE.emitWarning=="function"?xE.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},Q_=globalThis.AbortController,LR=globalThis.AbortSignal;if(typeof Q_>"u"){LR=class{constructor(){L(this,"onabort");L(this,"_onabort",[]);L(this,"reason");L(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Q_=class{constructor(){L(this,"signal",new LR);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=xE.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,zR("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var GF=r=>!VR.has(r),ln=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),WR=r=>ln(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Il:null:null,Il=class extends Array{constructor(e){super(e),this.fill(0);}},kl,fa=class fa{constructor(e,t){L(this,"heap");L(this,"length");if(!y(fa,kl))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=WR(e);if(!t)return [];q(fa,kl,true);let i=new fa(e,t);return q(fa,kl,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};kl=new WeakMap,pe(fa,kl,false);var _E=fa,NR,HR,$r,dr,jr,pa,qr,Fl,Ol,ft,Kr,ut,He,se,Xt,fr,Ut,vt,Zr,Tt,Qr,Jr,pr,ei,fn,Yt,Gl,G,bE,ma,qi,wd,mr,XR,ga,Ul,Bd,cn,hn,yE,K_,Z_,Ne,vE,Pd,dn,TE,SE=class SE{constructor(e){pe(this,G);pe(this,$r);pe(this,dr);pe(this,jr);pe(this,pa);pe(this,qr);pe(this,Fl);pe(this,Ol);L(this,"ttl");L(this,"ttlResolution");L(this,"ttlAutopurge");L(this,"updateAgeOnGet");L(this,"updateAgeOnHas");L(this,"allowStale");L(this,"noDisposeOnSet");L(this,"noUpdateTTL");L(this,"maxEntrySize");L(this,"sizeCalculation");L(this,"noDeleteOnFetchRejection");L(this,"noDeleteOnStaleGet");L(this,"allowStaleOnFetchAbort");L(this,"allowStaleOnFetchRejection");L(this,"ignoreFetchAbort");pe(this,ft);pe(this,Kr);pe(this,ut);pe(this,He);pe(this,se);pe(this,Xt);pe(this,fr);pe(this,Ut);pe(this,vt);pe(this,Zr);pe(this,Tt);pe(this,Qr);pe(this,Jr);pe(this,pr);pe(this,ei);pe(this,fn);pe(this,Yt);pe(this,Gl);pe(this,ma,()=>{});pe(this,qi,()=>{});pe(this,wd,()=>{});pe(this,mr,()=>false);pe(this,ga,e=>{});pe(this,Ul,(e,t,i)=>{});pe(this,Bd,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});L(this,NR,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:p,maxSize:_=0,maxEntrySize:b=0,sizeCalculation:x,fetchMethod:g,memoMethod:v,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:B,allowStaleOnFetchAbort:A,ignoreFetchAbort:R}=e;if(t!==0&&!ln(t))throw new TypeError("max option must be a nonnegative integer");let Y=t?WR(t):Array;if(!Y)throw new Error("invalid max value: "+t);if(q(this,$r,t),q(this,dr,_),this.maxEntrySize=b||y(this,dr),this.sizeCalculation=x,this.sizeCalculation){if(!y(this,dr)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(q(this,Ol,v),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(q(this,Fl,g),q(this,fn,!!g),q(this,ut,new Map),q(this,He,new Array(t).fill(void 0)),q(this,se,new Array(t).fill(void 0)),q(this,Xt,new Y(t)),q(this,fr,new Y(t)),q(this,Ut,0),q(this,vt,0),q(this,Zr,_E.create(t)),q(this,ft,0),q(this,Kr,0),typeof l=="function"&&q(this,jr,l),typeof c=="function"&&q(this,pa,c),typeof h=="function"?(q(this,qr,h),q(this,Tt,[])):(q(this,qr,void 0),q(this,Tt,void 0)),q(this,ei,!!y(this,jr)),q(this,Gl,!!y(this,pa)),q(this,Yt,!!y(this,qr)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!B,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(y(this,dr)!==0&&!ln(y(this,dr)))throw new TypeError("maxSize must be a positive integer if specified");if(!ln(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");X(this,G,XR).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ln(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!ln(this.ttl))throw new TypeError("ttl must be a positive integer if specified");X(this,G,bE).call(this);}if(y(this,$r)===0&&this.ttl===0&&y(this,dr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!y(this,$r)&&!y(this,dr)){let M="LRU_CACHE_UNBOUNDED";GF(M)&&(VR.add(M),zR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,SE));}}static unsafeExposeInternals(e){return {starts:y(e,Jr),ttls:y(e,pr),sizes:y(e,Qr),keyMap:y(e,ut),keyList:y(e,He),valList:y(e,se),next:y(e,Xt),prev:y(e,fr),get head(){return y(e,Ut)},get tail(){return y(e,vt)},free:y(e,Zr),isBackgroundFetch:t=>{var i;return X(i=e,G,Ne).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return X(o=e,G,Z_).call(o,t,i,s,n)},moveToTail:t=>{var i;return X(i=e,G,Pd).call(i,t)},indexes:t=>{var i;return X(i=e,G,cn).call(i,t)},rindexes:t=>{var i;return X(i=e,G,hn).call(i,t)},isStale:t=>{var i;return y(i=e,mr).call(i,t)}}}get max(){return y(this,$r)}get maxSize(){return y(this,dr)}get calculatedSize(){return y(this,Kr)}get size(){return y(this,ft)}get fetchMethod(){return y(this,Fl)}get memoMethod(){return y(this,Ol)}get dispose(){return y(this,jr)}get onInsert(){return y(this,pa)}get disposeAfter(){return y(this,qr)}getRemainingTTL(e){return y(this,ut).has(e)?1/0:0}*entries(){for(let e of X(this,G,cn).call(this))y(this,se)[e]!==void 0&&y(this,He)[e]!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield [y(this,He)[e],y(this,se)[e]]);}*rentries(){for(let e of X(this,G,hn).call(this))y(this,se)[e]!==void 0&&y(this,He)[e]!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield [y(this,He)[e],y(this,se)[e]]);}*keys(){for(let e of X(this,G,cn).call(this)){let t=y(this,He)[e];t!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield t);}}*rkeys(){for(let e of X(this,G,hn).call(this)){let t=y(this,He)[e];t!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield t);}}*values(){for(let e of X(this,G,cn).call(this))y(this,se)[e]!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield y(this,se)[e]);}*rvalues(){for(let e of X(this,G,hn).call(this))y(this,se)[e]!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield y(this,se)[e]);}[(HR=Symbol.iterator,NR=Symbol.toStringTag,HR)](){return this.entries()}find(e,t={}){for(let i of X(this,G,cn).call(this)){let s=y(this,se)[i],n=X(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,y(this,He)[i],this))return this.get(y(this,He)[i],t)}}forEach(e,t=this){for(let i of X(this,G,cn).call(this)){let s=y(this,se)[i],n=X(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,y(this,He)[i],this);}}rforEach(e,t=this){for(let i of X(this,G,hn).call(this)){let s=y(this,se)[i],n=X(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,y(this,He)[i],this);}}purgeStale(){let e=false;for(let t of X(this,G,hn).call(this,{allowStale:true}))y(this,mr).call(this,t)&&(X(this,G,dn).call(this,y(this,He)[t],"expire"),e=true);return e}info(e){let t=y(this,ut).get(e);if(t===void 0)return;let i=y(this,se)[t],s=X(this,G,Ne).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(y(this,pr)&&y(this,Jr)){let o=y(this,pr)[t],a=y(this,Jr)[t];if(o&&a){let u=o-(Dl.now()-a);n.ttl=u,n.start=Date.now();}}return y(this,Qr)&&(n.size=y(this,Qr)[t]),n}dump(){let e=[];for(let t of X(this,G,cn).call(this,{allowStale:true})){let i=y(this,He)[t],s=y(this,se)[t],n=X(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(y(this,pr)&&y(this,Jr)){o.ttl=y(this,pr)[t];let a=Dl.now()-y(this,Jr)[t];o.start=Math.floor(Date.now()-a);}y(this,Qr)&&(o.size=y(this,Qr)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=Dl.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,p,_,b;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=y(this,Bd).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),X(this,G,dn).call(this,e,"set"),this;let h=y(this,ft)===0?void 0:y(this,ut).get(e);if(h===void 0)h=y(this,ft)===0?y(this,vt):y(this,Zr).length!==0?y(this,Zr).pop():y(this,ft)===y(this,$r)?X(this,G,K_).call(this,false):y(this,ft),y(this,He)[h]=e,y(this,se)[h]=t,y(this,ut).set(e,h),y(this,Xt)[y(this,vt)]=h,y(this,fr)[h]=y(this,vt),q(this,vt,h),Xd(this,ft)._++,y(this,Ul).call(this,h,c,u),u&&(u.set="add"),l=false,y(this,Gl)&&((d=y(this,pa))==null||d.call(this,t,e,"add"));else {X(this,G,Pd).call(this,h);let x=y(this,se)[h];if(t!==x){if(y(this,fn)&&X(this,G,Ne).call(this,x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=x;g!==void 0&&!o&&(y(this,ei)&&((p=y(this,jr))==null||p.call(this,g,e,"set")),y(this,Yt)&&y(this,Tt)?.push([g,e,"set"]));}else o||(y(this,ei)&&((_=y(this,jr))==null||_.call(this,x,e,"set")),y(this,Yt)&&y(this,Tt)?.push([x,e,"set"]));if(y(this,ga).call(this,h),y(this,Ul).call(this,h,c,u),y(this,se)[h]=t,u){u.set="replace";let g=x&&X(this,G,Ne).call(this,x)?x.__staleWhileFetching:x;g!==void 0&&(u.oldValue=g);}}else u&&(u.set="update");y(this,Gl)&&this.onInsert?.(t,e,t===x?"update":"replace");}if(s!==0&&!y(this,pr)&&X(this,G,bE).call(this),y(this,pr)&&(l||y(this,wd).call(this,h,s,n),u&&y(this,qi).call(this,u,h)),!o&&y(this,Yt)&&y(this,Tt)){let x=y(this,Tt),g;for(;g=x?.shift();)(b=y(this,qr))==null||b.call(this,...g);}return this}pop(){var e;try{for(;y(this,ft);){let t=y(this,se)[y(this,Ut)];if(X(this,G,K_).call(this,!0),X(this,G,Ne).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(y(this,Yt)&&y(this,Tt)){let t=y(this,Tt),i;for(;i=t?.shift();)(e=y(this,qr))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=y(this,ut).get(e);if(n!==void 0){let o=y(this,se)[n];if(X(this,G,Ne).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(y(this,mr).call(this,n))s&&(s.has="stale",y(this,qi).call(this,s,n));else return i&&y(this,ma).call(this,n),s&&(s.has="hit",y(this,qi).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=y(this,ut).get(e);if(s===void 0||!i&&y(this,mr).call(this,s))return;let n=y(this,se)[s];return X(this,G,Ne).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:b,forceRefresh:x=false,status:g,signal:v}=t;if(!y(this,fn))return g&&(g.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});let T={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:_,ignoreFetchAbort:p,status:g,signal:v},S=y(this,ut).get(e);if(S===void 0){g&&(g.fetch="miss");let B=X(this,G,Z_).call(this,e,S,T,b);return B.__returned=B}else {let B=y(this,se)[S];if(X(this,G,Ne).call(this,B)){let U=i&&B.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",U&&(g.returnedStale=true)),U?B.__staleWhileFetching:B.__returned=B}let A=y(this,mr).call(this,S);if(!x&&!A)return g&&(g.fetch="hit"),X(this,G,Pd).call(this,S),s&&y(this,ma).call(this,S),g&&y(this,qi).call(this,g,S),B;let R=X(this,G,Z_).call(this,e,S,T,b),M=R.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=A?"stale":"refresh",M&&A&&(g.returnedStale=true)),M?R.__staleWhileFetching:R.__returned=R}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=y(this,Ol);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=y(this,ut).get(e);if(a!==void 0){let u=y(this,se)[a],l=X(this,G,Ne).call(this,u);return o&&y(this,qi).call(this,o,a),y(this,mr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||X(this,G,dn).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(X(this,G,Pd).call(this,a),s&&y(this,ma).call(this,a),u))}else o&&(o.get="miss");}delete(e){return X(this,G,dn).call(this,e,"delete")}clear(){return X(this,G,TE).call(this,"delete")}};$r=new WeakMap,dr=new WeakMap,jr=new WeakMap,pa=new WeakMap,qr=new WeakMap,Fl=new WeakMap,Ol=new WeakMap,ft=new WeakMap,Kr=new WeakMap,ut=new WeakMap,He=new WeakMap,se=new WeakMap,Xt=new WeakMap,fr=new WeakMap,Ut=new WeakMap,vt=new WeakMap,Zr=new WeakMap,Tt=new WeakMap,Qr=new WeakMap,Jr=new WeakMap,pr=new WeakMap,ei=new WeakMap,fn=new WeakMap,Yt=new WeakMap,Gl=new WeakMap,G=new WeakSet,bE=function(){let e=new Il(y(this,$r)),t=new Il(y(this,$r));q(this,pr,e),q(this,Jr,t),q(this,wd,(n,o,a=Dl.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{y(this,mr).call(this,n)&&X(this,G,dn).call(this,y(this,He)[n],"expire");},o+1);u.unref&&u.unref();}}),q(this,ma,n=>{t[n]=e[n]!==0?Dl.now():0;}),q(this,qi,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=Dl.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=y(this,ut).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},q(this,mr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},ma=new WeakMap,qi=new WeakMap,wd=new WeakMap,mr=new WeakMap,XR=function(){let e=new Il(y(this,$r));q(this,Kr,0),q(this,Qr,e),q(this,ga,t=>{q(this,Kr,y(this,Kr)-e[t]),e[t]=0;}),q(this,Bd,(t,i,s,n)=>{if(X(this,G,Ne).call(this,i))return 0;if(!ln(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!ln(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),q(this,Ul,(t,i,s)=>{if(e[t]=i,y(this,dr)){let n=y(this,dr)-e[t];for(;y(this,Kr)>n;)X(this,G,K_).call(this,true);}q(this,Kr,y(this,Kr)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=y(this,Kr));});},ga=new WeakMap,Ul=new WeakMap,Bd=new WeakMap,cn=function*({allowStale:e=this.allowStale}={}){if(y(this,ft))for(let t=y(this,vt);!(!X(this,G,yE).call(this,t)||((e||!y(this,mr).call(this,t))&&(yield t),t===y(this,Ut)));)t=y(this,fr)[t];},hn=function*({allowStale:e=this.allowStale}={}){if(y(this,ft))for(let t=y(this,Ut);!(!X(this,G,yE).call(this,t)||((e||!y(this,mr).call(this,t))&&(yield t),t===y(this,vt)));)t=y(this,Xt)[t];},yE=function(e){return e!==void 0&&y(this,ut).get(y(this,He)[e])===e},K_=function(e){var n;let t=y(this,Ut),i=y(this,He)[t],s=y(this,se)[t];return y(this,fn)&&X(this,G,Ne).call(this,s)?s.__abortController.abort(new Error("evicted")):(y(this,ei)||y(this,Yt))&&(y(this,ei)&&((n=y(this,jr))==null||n.call(this,s,i,"evict")),y(this,Yt)&&y(this,Tt)?.push([s,i,"evict"])),y(this,ga).call(this,t),e&&(y(this,He)[t]=void 0,y(this,se)[t]=void 0,y(this,Zr).push(t)),y(this,ft)===1?(q(this,Ut,q(this,vt,0)),y(this,Zr).length=0):q(this,Ut,y(this,Xt)[t]),y(this,ut).delete(i),Xd(this,ft)._--,t},Z_=function(e,t,i,s){let n=t===void 0?void 0:y(this,se)[t];if(X(this,G,Ne).call(this,n))return n;let o=new Q_,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(b,x=false)=>{let{aborted:g}=o.signal,v=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(g&&!x?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,v&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),g&&!v&&!x)return h(o.signal.reason);let T=p;return y(this,se)[t]===p&&(b===void 0?T.__staleWhileFetching?y(this,se)[t]=T.__staleWhileFetching:X(this,G,dn).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,b,u.options))),b},c=b=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=b),h(b)),h=b=>{let{aborted:x}=o.signal,g=x&&i.allowStaleOnFetchAbort,v=g||i.allowStaleOnFetchRejection,T=v||i.noDeleteOnFetchRejection,S=p;if(y(this,se)[t]===p&&(!T||S.__staleWhileFetching===void 0?X(this,G,dn).call(this,e,"fetch"):g||(y(this,se)[t]=S.__staleWhileFetching)),v)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw b},d=(b,x)=>{var v;let g=(v=y(this,Fl))==null?void 0:v.call(this,e,n,u);g&&g instanceof Promise&&g.then(T=>b(T===void 0?void 0:T),x),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=T=>l(T,true)));});};i.status&&(i.status.fetchDispatched=true);let p=new Promise(d).then(l,c),_=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,_,{...u.options,status:void 0}),t=y(this,ut).get(e)):y(this,se)[t]=_,_},Ne=function(e){if(!y(this,fn))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Q_},vE=function(e,t){y(this,fr)[t]=e,y(this,Xt)[e]=t;},Pd=function(e){e!==y(this,vt)&&(e===y(this,Ut)?q(this,Ut,y(this,Xt)[e]):X(this,G,vE).call(this,y(this,fr)[e],y(this,Xt)[e]),X(this,G,vE).call(this,y(this,vt),e),q(this,vt,e));},dn=function(e,t){var s,n;let i=false;if(y(this,ft)!==0){let o=y(this,ut).get(e);if(o!==void 0)if(i=true,y(this,ft)===1)X(this,G,TE).call(this,t);else {y(this,ga).call(this,o);let a=y(this,se)[o];if(X(this,G,Ne).call(this,a)?a.__abortController.abort(new Error("deleted")):(y(this,ei)||y(this,Yt))&&(y(this,ei)&&((s=y(this,jr))==null||s.call(this,a,e,t)),y(this,Yt)&&y(this,Tt)?.push([a,e,t])),y(this,ut).delete(e),y(this,He)[o]=void 0,y(this,se)[o]=void 0,o===y(this,vt))q(this,vt,y(this,fr)[o]);else if(o===y(this,Ut))q(this,Ut,y(this,Xt)[o]);else {let u=y(this,fr)[o];y(this,Xt)[u]=y(this,Xt)[o];let l=y(this,Xt)[o];y(this,fr)[l]=y(this,fr)[o];}Xd(this,ft)._--,y(this,Zr).push(o);}}if(y(this,Yt)&&y(this,Tt)?.length){let o=y(this,Tt),a;for(;a=o?.shift();)(n=y(this,qr))==null||n.call(this,...a);}return i},TE=function(e){var t,i;for(let s of X(this,G,hn).call(this,{allowStale:true})){let n=y(this,se)[s];if(X(this,G,Ne).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=y(this,He)[s];y(this,ei)&&((t=y(this,jr))==null||t.call(this,n,o,e)),y(this,Yt)&&y(this,Tt)?.push([n,o,e]);}}if(y(this,ut).clear(),y(this,se).fill(void 0),y(this,He).fill(void 0),y(this,pr)&&y(this,Jr)&&(y(this,pr).fill(0),y(this,Jr).fill(0)),y(this,Qr)&&y(this,Qr).fill(0),q(this,Ut,0),q(this,vt,0),y(this,Zr).length=0,q(this,Kr,0),q(this,ft,0),y(this,Yt)&&y(this,Tt)){let s=y(this,Tt),n;for(;n=s?.shift();)(i=y(this,qr))==null||i.call(this,...n);}};var J_=SE;var vi=class{constructor(e){L(this,"cache");L(this,"map",new Map);this.cache=new J_({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Rd=new vi({cacheSize:5});function UF(r){return function(e){eb.add(e,r);}}var eb;(s=>{function r(n,o){o||(o=n.name),Rd.get(o)&&N.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Rd.set(o,n);}s.add=r;function e(n){try{let o=Rd.get(n);if(!o){N.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){N.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Rd.values())}s.values=t;function i(n){return Rd.has(n)}s.has=i;})(eb||(eb={}));var $t=eb;var Ll=new vi({cacheSize:5});function LF(r){return function(e){tb.add(e,r);}}var tb;(n=>{function r(o,a){a||(a=o.name),Ll.get(a)&&N.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,Ll.set(a,o);}n.add=r;function e(o){try{let a=Ll.get(o);if(!a){N.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){N.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=Ll.get(o);if(!a){N.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){N.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(Ll.values())}n.values=i;function s(o){return Ll.has(o)}n.has=s;})(tb||(tb={}));var Ki=tb;async function rb(r){let e=NF(r.pixivnId);if(e)await e.setMemory(r);else throw new Error("[Pixi\u2019VN] The element "+r.pixivnId+" could not be created");return e}function NF(r){try{let e=$t.get(r);return e?new e:void 0}catch(e){N.error(`Error while getting CanvasElement ${r}`,e);return}}Ce();function EE(r){return "memory"in r?r.memory:r instanceof Rr?AE(r):r instanceof Ee?Md(r):xa(r)}function HF(r){return {width:r.width,height:r.height,isRenderGroup:r.isRenderGroup,blendMode:r.blendMode,tint:r.tint,alpha:r.alpha,angle:r.angle,renderable:r.renderable,rotation:r.rotation,scale:{x:r.scale.x,y:r.scale.y},pivot:{x:r.pivot.x,y:r.pivot.y},position:{x:r.position.x,y:r.position.y},skew:{x:r.skew.x,y:r.skew.y},visible:r.visible,x:r.x,y:r.y,boundsArea:r.boundsArea,cursor:r.cursor,eventMode:r.eventMode,interactive:r.interactive,interactiveChildren:r.interactiveChildren,hitArea:r.hitArea}}function YR(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function xa(r,e){let t=VF(r,Bl),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>EE(n)):[];return {pixivnId:t,elements:s,...HF(r)}}function Md(r){let e=xa(r),t=e.pixivnId??Rl,i=jR(r),s="textureAlias"in r?YR(r.texture,r.textureAlias):YR(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function AE(r){let e=xa(r),t=e.pixivnId??Ml,i=jR(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:zF(r.style),roundPixels:r.roundPixels,onEvents:i}}function VF(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function jR(r){return "onEvents"in r?r.onEvents:{}}function $R(r,e){if(typeof r!="object"||r===null)return r;N.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function zF(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:$R(r.stroke,"fill"),fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontVariant:r.fontVariant,fontWeight:r.fontWeight,leading:r.leading,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,padding:r.padding,stroke:$R(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var _a=class extends te{constructor(t){super(t);L(this,"pixivnId",Bl);L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Bl;}get memory(){return xa(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await Ti(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await rb(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ki.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):N.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};$t.add(_a,Bl);async function Ti(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}Ce();var Dd=class Dd{static init(e){Dd._getScreen=e.getScreen;}static get screen(){return Dd._getScreen()}};L(Dd,"_getScreen");var ir=Dd;function Zi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(ir.screen.width-t)+i+n*t+(s?t:0):e*(ir.screen.height-t)+i+n*t+(s?t:0)}function Si(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(ir.screen.width-t):(e-i-n*t-(s?t:0))/(ir.screen.height-t)}function Qi(r,e){return r==="width"?e*ir.screen.width:e*ir.screen.height}function Ei(r,e){return r==="width"?e/ir.screen.width:e/ir.screen.height}function rt(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.x*i-r.y*s,o=r.x*s+r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.y*s-r.x*i,o=r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.x*i+r.y*s,o=-r.x*s-r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.y*s-r.x*i,o=-r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}return {x:0,y:0}}function CE(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function Ai(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?e:i===90||i===270?t:Math.abs(e*Math.cos(i*Math.PI/180))+Math.abs(t*Math.sin(i*Math.PI/180))}function Ci(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?t:i===90||i===270?e:Math.abs(t*Math.cos(i*Math.PI/180))+Math.abs(e*Math.sin(i*Math.PI/180))}Ce();var WF=new RegExp(`(${MR.join("|")})$`);function Id(r){let e=et.cache.has(r)?et.get(r):null;return e instanceof C&&(r=e.source?.label||r),WF.test(r)}function ba(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===void 0?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===void 0?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.xPercentagePosition},delete r.xPercentagePosition):(r.percentagePosition.x=r.xPercentagePosition,delete r.xPercentagePosition)),r.yPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.yPercentagePosition},delete r.yPercentagePosition):(r.percentagePosition.y=r.yPercentagePosition,delete r.yPercentagePosition))),r)}Ce();Ce();async function Pi(r){if(r!=="EMPTY"){if(!r){N.error("Texture not found",r);return}if(et.cache.has(r)){let e=et.get(r);if(e)return e}return et.load(r).then(e=>{if(!e){N.error("Texture not found",r);return}if(!(e instanceof C)){N.error("File not is a file",r);return}return e}).catch(e=>{N.error("Error loading file",e);})}}Ce();var Ji=class r extends Ee{constructor(t){super(t);L(this,"pixivnId",Rl);L(this,"_textureAlias");L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Rl;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return Md(this)}set memory(t){}async setMemory(t){return this.memory=t,await kd(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ki.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):N.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}};$t.add(Ji,Rl);async function kd(r,e,t){let i=t?.ignoreTexture||false;if(await Ti(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await Pi(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&et.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await Pi(n);o&&(r.texture=o);}}let s=t?.half;if(s&&await s(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=Ki.get(o);a&&r.onEvent(n,a);}}var Pe=class r extends Ji{constructor(t,i){t=ba(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);L(this,"pixivnId",mE);L(this,"_loadIsStarted",false);L(this,"_align");L(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...Md(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Fd(this,t),this.reloadPosition();}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Pi(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,N.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return {x:Si("width",this.x,Ai(this),t.x,i.x<0,this.anchor.x),y:Si("height",this.y,Ci(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return Si("width",this.x,Ai(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return Si("height",this.y,Ci(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ei("width",this.x),y:Ei("height",this.y)}}get xPercentagePosition(){return Ei("width",this.x)}set xPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get yPercentagePosition(){return Ei("height",this.y)}set yPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);this._align.x!==void 0&&(super.x=Zi("width",this._align.x,Ai(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=Zi("height",this._align.y,Ci(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Qi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Qi("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};$t.add(Pe,mE);async function Fd(r,e,t){let i=t?.ignoreTexture||false;return e=ba(e),await kd(r,e,{half:async()=>{"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();},ignoreTexture:t?.ignoreTexture})}Ce();var Wt=class r extends Pe{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);L(this,"pixivnId",gE);L(this,"_looop",false);L(this,"_paused",false);L(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await PE(this,t)}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};$t.add(Wt,gE);async function PE(r,e,t){await Fd(r,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(r.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(r.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(r.paused=e.paused);}var Le=class extends _a{constructor(t,i=[]){t=ba(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);L(this,"pixivnId",$_);L(this,"_loadIsStarted",false);L(this,"_anchor");L(this,"_align");L(this,"_percentagePosition");t=ba(t),i&&i.forEach(a=>{let u;Id(a)?u=new Wt(void 0,a):u=new Pe(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:$_,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await wE(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,N.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new C}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return {x:Si("width",this.x,Ai(this),t.x,i.x<0,this.anchor.x),y:Si("height",this.y,Ci(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return Si("width",this.x,Ai(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return Si("height",this.y,Ci(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ei("width",this.x),y:Ei("height",this.y)}}set xPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get xPercentagePosition(){return Ei("width",this.x)}set yPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get yPercentagePosition(){return Ei("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);this._align.x!==void 0&&(super.x=Zi("width",this._align.x,Ai(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=Zi("height",this._align.y,Ci(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Qi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Qi("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};$t.add(Le,$_);async function wE(r,e,t){e=ba(e),Ti(r,e,{...t,end:async()=>{"anchor"in e&&e.anchor!==void 0&&(r.anchor=e.anchor),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}Ce();var ya=class extends Rr{constructor(t){super(t);L(this,"pixivnId",Ml);L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Ml;}get memory(){return AE(this)}set memory(t){}async setMemory(t){return this.memory=t,await BE(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ki.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):N.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};$t.add(ya,Ml);async function BE(r,e){if(await Ti(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=Ki.get(i);s&&r.onEvent(t,s);}}var sr=class{constructor(e,t,i){L(this,"id","ticker_id_not_set");L(this,"args");L(this,"duration");L(this,"priority");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}fn(e,t,i,s){throw new Error("[Pixi\u2019VN] The method TickerBase.fn() must be overridden")}onEndOfTicker(e,t,i){let s="aliasToRemoveAfter"in i&&i.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in i&&i.tickerAliasToResume||[];typeof n=="string"&&(n=[n]),P.onEndOfTicker(t,{aliasToRemoveAfter:s,tickerAliasToResume:n});}};var Nl=new vi({cacheSize:5});function XF(r){return function(e){ib.add(e,r);}}var ib;(n=>{function r(o,a){a||(a=o.name),Nl.get(a)&&N.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,Nl.set(a,o);}n.add=r;function e(o){try{let a=Nl.get(o);if(!a){N.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){N.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=Nl.get(o);if(!c){N.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){N.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(Nl.values())}n.values=i;function s(o){return Nl.has(o)}n.has=s;})(ib||(ib={}));var nr=ib;var Hl="aliasToRemoveAfter";var Od=class{get app(){return w.app}get gameLayer(){return w.gameLayer}get isInitialized(){return w._isInitialized}get htmlLayout(){return w.htmlLayers[0]}set htmlLayout(e){this.addHtmlLayer("ui",e);}get canvasWidth(){return w.canvasWidth}get canvasHeight(){return w.canvasHeight}set canvasWidth(e){w.canvasWidth=e;}set canvasHeight(e){w.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await w.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await w.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){this.addHtmlLayer("ui",e);}get children(){return w.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {N.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {N.error(`Canvas element ${e} not found`);return}}e instanceof te&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof Wt?await PE(t,e,{ignoreTexture:true}):t instanceof Pe?await Fd(t,e,{ignoreTexture:true}):t instanceof Ji?await kd(t,e,{ignoreTexture:true}):t instanceof ya?await BE(t,e):t instanceof Le?await wE(t,e):t instanceof te&&await Ti(t,e);}transferTickers(e,t,i="move"){w._currentTickersSequence[e]&&(i==="move"?w._currentTickersSequence[t]=Gt(w._currentTickersSequence[e]):i==="duplicate"&&(w._currentTickersSequence[t]=Gt(w._currentTickersSequence[e]))),Object.entries(w._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.canvasElementAliases.includes(e)&&(i==="move"?n.canvasElementAliases=n.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&n.canvasElementAliases.find(o=>o===e)&&n.canvasElementAliases.push(t),n.args.hasOwnProperty(Hl))){let o=n.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?n.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(n.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(w._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),w._currentTickersSequence[t]&&Object.keys(w._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&w._currentTickersSequence[e]&&Object.keys(w._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===Yr){N.error(`The alias ${Yr} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?N.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===Yr){N.error(`The alias ${Yr} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}find(e){if(e===Yr)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren(),this.removeAllTickers();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return w._currentTickers}get currentTickersSteps(){return w._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!nr.getInstance(i,t.args,t.duration,t.priority)){N.error(`Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:Gt(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=w.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{w.removeTickerTimeoutInfo(o),w._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:Hl in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);w.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){w._currentTickers[e]=t,t.fn=s=>{let n=w._currentTickers[e];if(n){let o=n.canvasElementAliases;if(t.createdByTicketSteps){if(this.isTickerPaused(t.createdByTicketSteps.canvasElementAlias,t.createdByTicketSteps.id))return}else o=o.filter(a=>!this.isTickerPaused(a,e));i?.fn(s,n.args,o,e);}},this.app.ticker.add(t.fn,void 0,t.priority);}pushEndOfTicker(e,t,i){t.onEndOfTicker=()=>{i.onEndOfTicker(t.canvasElementAliases,e,t.args);};}addTickersSequence(e,t,i=0){if(t.length==0){N.warn("The steps of the tickers is empty");return}e in w._currentTickersSequence||(w._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Cd||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:Gt(o.args),duration:o.duration})},n=w.generateTickerId(s);return w._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!w._currentTickersSequence[e]||!w._currentTickersSequence[e][t])return;let i=w._currentTickersSequence[e][t].steps[w._currentTickersSequence[e][t].currentStepNumber];if(i===Cd&&(i=w._currentTickersSequence[e][t].steps[0],w._currentTickersSequence[e][t].currentStepNumber=0,i===Cd)){N.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=w._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),w.removeTickerTimeoutInfo(u);},i.duration*1e3);w.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=nr.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){N.error(`Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:Gt(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=w.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=w._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Hl in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),w.removeTickerTimeoutInfo(u);},s.duration*1e3);w.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(w._currentTickersSequence[e]&&w._currentTickersSequence[e][t]){let i=w._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,w._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&w._currentTickersSequence[e]&&w._currentTickersSequence[e][t]&&(delete w._currentTickersSequence[e][t],Object.entries(w._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=w._currentTickers[e],s=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!s&&i.duration==null&&i.createdByTicketSteps&&this.nextTickerStep(i.createdByTicketSteps.canvasElementAlias,i.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(w._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),w._currentTickersSequence[s]&&delete w._currentTickersSequence[s],w.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof sr?i=t.id:i=t.prototype.id,e.forEach(s=>{w._currentTickersSequence[s]&&Object.entries(w._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete w._currentTickersSequence[s][n];});}),Object.entries(w._currentTickers).forEach(([s,n])=>{n.id===i&&(w._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(w._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(w._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(w._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Hl in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(w._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete w._currentTickersSequence[e];}),Object.entries(w._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&w.removeTickerTimeout(e);});}removeAllTickers(){w._currentTickersSequence={},Object.keys(w._currentTickers).forEach(e=>{this.removeTicker(e);}),w._currentTickers={};for(let e in w._currentTickersTimeouts)w.removeTickerTimeout(e);w._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},w._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=w._currentTickers[t];if(i){if(i.args.hasOwnProperty(Hl)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete w._currentTickers[t];}});}pauseTicker(e,t={}){let i=w._tickersOnPause[e];if(!i){w._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?w._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:w._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?w._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:w._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete w._tickersOnPause[t];});}isTickerPaused(e,t){let i=w._tickersOnPause[e];if(i){if(t){if("tickerIdsIncluded"in i&&i.tickerIdsIncluded)return i.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in i&&i.tickerIdsExcluded)return !i.tickerIdsExcluded.includes(t)}return true}return false}completeTickerOnStepEnd(e){e.alias?w._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):w._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=w._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Cd)?N.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(s=>{if(typeof s=="object"&&"ticker"in s){let n=nr.getInstance(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=w._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===Yr){N.error(`The alias ${Yr} is reserved`);return}return t.label=e,w.app.stage.addChild(t)}getLayer(e){return w.app.stage.getChildByLabel(e)}removeLayer(e){w.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return w.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return w.removeHtmlLayer(e)}getHtmlLayer(e){return w.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=EE(t));}),{tickers:Gt(w.currentTickersWithoutCreatedBySteps),tickersSteps:Gt(w._currentTickersSequence),elements:Gt(e),stage:Gt(xa(this.gameLayer)),elementAliasesOrder:Gt(w.childrenAliasesOrder),tickersOnPause:Gt(w._tickersOnPause),tickersToCompleteOnStepEnd:Gt(w._tickersToCompleteOnStepEnd)}}async restore(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,s=e.elementAliasesOrder,n=s.filter(a=>i[a]).map(a=>rb(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),w.childrenAliasesOrder.push(l);});}else {N.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Ti(this.gameLayer,e.stage,{ignoreScale:!0}):N.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([s,n])=>{let o=n.canvasElementAliases,a=nr.getInstance(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else N.error(`Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{w._currentTickersSequence[s]=n,Object.keys(n).forEach(o=>{this.runTickersSequence(s,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(s=>{let n=i[s];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(i[s].tickerIdsExcluded=n.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(i[s].tickerIdsIncluded=n.tickerIdsIncluded.map(o=>t[o]||o));}),w._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds.map(o=>({id:t[o.id]||o.id})),n=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));w._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){N.error("Error importing data",t);}}};var sb=class{constructor(){L(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var nb=class{constructor(){L(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};Ce();Ce();function pn(r){return (r instanceof Pe||r instanceof Le)&&r.haveEmptyTexture?false:!(r instanceof Ee&&r.texture?.label=="EMPTY")}function mn(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=RE(r[e],t):t.type==="exponential"&&(r[e]=ME(r[e],t)):r[e]!==void 0&&typeof r[e]=="object"&&r[e].haveOwnProperty("x")&&r[e].haveOwnProperty("y")&&typeof r[e].x=="number"&&typeof r[e].y=="number"&&(t.type==="linear"?(r[e].x=RE(r[e].x,t),r[e].y=RE(r[e].y,t)):t.type==="exponential"&&(r[e].x=ME(r[e].x,t),r[e].y=ME(r[e].y,t))));}function RE(r,e){let{limit:t,amt:i}=e;if(t!==void 0){if(r>t&&i>0)return t;if(r<t&&i<0)return t}return r+i}function ME(r,e){let{limit:t}=e;if(t!==void 0){if(r>t&&e.percentage>0)return t;if(r<t&&e.percentage<0)return t}return r+r*e.percentage}var YF=5,es=class extends sr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=YF:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=P.find(c);return !(!h||o&&!pn(h))}).forEach(c=>{let h=P.find(c);if(h&&h instanceof te){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.onEndOfTicker(c,s,t);return}else if(n==="hide"&&h.alpha<=l){this.onEndOfTicker(c,s,t);return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){N.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,s,t,{editAlpha:false});return}}}),a&&mn(t,"speed",a);}onEndOfTicker(e,t,i,s={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=P.find(n);if(o&&s.editAlpha){let a=this.getLimit(i);o.alpha=a;}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}};nr.add(es);Ce();var $F=10;function jF(r,e){let t=Gt(r.destination);if(t.type==="align"){let i,s;e instanceof Ee&&(i=e.anchor.x,s=e.anchor.y);let n=rt(e.pivot,e.angle),o=rt(e.scale,e.angle);t.x=Zi("width",t.x,Ai(e),n.x,o.x<0,i),t.y=Zi("height",t.y,Ci(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=Qi("width",t.x),t.y=Qi("height",t.y)),t}var gr=class extends sr{fn(e,t,i,s){t.speed===void 0&&(t.speed=$F);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=P.find(u);return !(!l||o&&!pn(l))}).forEach(u=>{let l=P.find(u);if(l&&l instanceof te){let c=jF(t,l),h=c.x-l.x,d=c.y-l.y,p=h>0?1:-1,_=d>0?1:-1,b,x;if(typeof n=="number"){let g=this.speedConvert(n);h===0||d===0?b=x=g:(b=Math.abs(h/(h+d))*g,x=Math.abs(d/(h+d))*g);}else b=this.speedConvert(n.x),x=this.speedConvert(n.y);if(b>0){l.x+=p*b*e.deltaTime;let g=c.x-l.x;(p<0&&g>0||p>0&&g<0)&&(l.x=c.x);}if(x>0){l.y+=_*x*e.deltaTime;let g=c.y-l.y;(_<0&&g>0||_>0&&g<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.onEndOfTicker(u,s,t);return}else if(b<1e-5&&x<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){N.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,s,t,{editPosition:false});return}}}),a&&mn(t,"speed",a);}onEndOfTicker(e,t,i,s={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=P.find(n);if(o){let a=i.destination;s.editPosition&&(o instanceof Pe||o instanceof Le?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};nr.add(gr);Ce();var qF=1,Gd=class extends sr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=qF);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=P.find(l);return !(!c||t.startOnlyIfHaveTexture&&!pn(c))}).forEach(l=>{let c=P.find(l);if(c&&c instanceof te&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.onEndOfTicker(l,s,t)):!n&&c.angle<=a&&(c.angle=a,this.onEndOfTicker(l,s,t))),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){N.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,s,t,{editRotation:false});return}}),o&&mn(t,"speed",o);}onEndOfTicker(e,t,i,s={editRotation:true}){let{limit:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=P.find(o);a&&s.editRotation&&n!==void 0&&(a.angle=n);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};nr.add(Gd);Ce();var KF=10,gn=class extends sr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=KF);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(d=>{let p=P.find(d);return !(!p||a&&!pn(p))}).forEach(d=>{let p=P.find(d);if(p&&p instanceof te){if(o==="zoom"&&(p.scale.x<h.x||p.scale.y<h.y)?(p.scale.x+=l*e.deltaTime,p.scale.y+=c*e.deltaTime):o==="unzoom"&&(p.scale.x>h.x||p.scale.y>h.y)&&(p.scale.x-=l*e.deltaTime,p.scale.y-=c*e.deltaTime),o==="zoom"){if(p.scale.x>h.x&&(p.scale.x=h.x),p.scale.y>h.y&&(p.scale.y=h.y),p.scale.x>=h.x&&p.scale.y>=h.y){this.onEndOfTicker(d,s,t);return}}else if(o==="unzoom"&&(p.scale.x<h.x&&(p.scale.x=h.x),p.scale.y<h.y&&(p.scale.y=h.y),p.scale.x<=h.x&&p.scale.y<=h.y)){this.onEndOfTicker(d,s,t);return}if((l<1e-5&&c<1e-5||l<1e-5&&p.scale.y==h.y||c<1e-5&&p.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){N.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(d,s,t,{editScale:false});return}}}),u&&mn(t,"speed",u);}speedConvert(e){return e/600}onEndOfTicker(e,t,i,s={editScale:true}){let{isZoomInOut:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=P.find(o);if(a){if(s.editScale){let u=this.getLimit(i);a.scale.x=u.x,a.scale.y=u.y;}if(n){let{pivot:u,position:l}=n;a.pivot=u.x,a.position=l;}}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}};nr.add(gn);async function ZF(r,e={},t){let i=P.find(r);if(!i){N.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},n=e.speed||20,o=e.speedProgression||void 0,a=e.startOnlyIfHaveTexture||false,u=e.type||"horizontal",l=e.maximumShockSize||10,c=(e.shocksNumber||10)-1;if(c<2){N.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),d=Math.ceil(c/2),p=[];for(let x=0;x<h;x++){let g={x:s.x,y:s.y},v=l*(x+1)/h;u==="horizontal"?x%2!==0?g.x=s.x+v:g.x=s.x-v:x%2!==0?g.y=s.y+v:g.y=s.y-v,p.push(new gr({destination:g,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let _=h%2===0;for(let x=d;x>0;x--){let g={x:s.x,y:s.y},v=l*(x+1)/(d-1);u==="horizontal"?x%2===0&&!_||x%2!==0&&_?g.x=s.x-v:g.x=s.x+v:x%2===0&&!_||x%2!==0&&_?g.y=s.y-v:g.y=s.y+v,p.push(new gr({destination:g,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}p.push(new gr({destination:s,speed:n,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let b=P.addTickersSequence(r,p);b&&(P.completeTickerOnStepEnd({id:b,alias:r}),P.pauseTicker(r,{tickerIdsExcluded:[b]}));}function ob(r,e,t){let i=new Le(t,e);return P.add(r,i),i}async function QF(r,e,t){let i=new Le(t,e);return await i.load(),P.add(r,i),i}Ce();function ab(r,e,t){if(!e)if(et.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return P.add(r,i),i}async function JF(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Pi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function eO(r,e,t){if(!e)if(et.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return await i.load(),P.add(r,i),i}Ce();function ub(r,e,t){if(!e)if(et.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Wt(t,e);return P.add(r,i),i}async function tO(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Pi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function rO(r,e,t){if(!e)if(et.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Wt(t,e);return await i.load(),P.add(r,i),i}function Ud(r,e){if(typeof e=="string")return Id(e)?ub(r,e):ab(r,e);if(Array.isArray(e))return ob(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Id(e.value)?ub(r,e.value,e.options):ab(r,e.value,e.options);if(Array.isArray(e.value))return ob(r,e.value,e.options)}return P.add(r,e),e}async function qR(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(P.find(r)&&(a=r+"_temp_disolve",P.editAlias(r,a)),e=Ud(r,e),a&&P.copyCanvasElementProperty(a,r),a&&P.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=lb(a,t,i);c&&(o.push(...c),P.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new es({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},void 0,i),l=P.addTicker(r,u);if(l&&(s&&P.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function lb(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:s=[]}=e;typeof r=="string"&&(r=[r]),typeof s=="string"&&(s=[s]),s.push(...r);let n=new es({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},void 0,t),o=P.addTicker(r,n);if(o)return i&&P.completeTickerOnStepEnd({id:o}),[o]}async function iO(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!P.find(r))return qR(r,e,t,i);let a=r+"_temp_fade";P.editAlias(r,a),n.push(a),e=Ud(r,e),a&&P.copyCanvasElementProperty(a,r),a&&P.transferTickers(a,r,"duplicate"),e.alpha=0;let u=lb(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new es({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,i),c=P.addTicker(r,l);if(c&&(s&&P.completeTickerOnStepEnd({id:c}),o.push(c),P.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function sO(r,e={},t){return lb(r,e,t)}async function nO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;P.find(r)&&(c=r+"_temp_movein",P.editAlias(r,c)),e=Ud(r,e),c&&P.copyCanvasElementProperty(c,r),c&&P.transferTickers(c,r,"move");let h;e instanceof Pe||e instanceof Le?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d;switch(c&&(u?(d=DE(c,t,i),d&&(l.push(...d),o.push(c))):a.push(c)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),c&&P.pauseTicker(c,{tickerIdsIncluded:d}),s){case "up":e.y=P.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=P.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new gr({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),_=P.addTicker(r,p);if(_&&(P.pauseTicker(r,{tickerIdsExcluded:[_]}),n&&P.completeTickerOnStepEnd({id:_}),l.push(_)),l.length>0)return l}function DE(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=P.find(r);if(!o){N.warn("The canvas component is not found.");return}let a={x:o.x,y:o.y};switch(i){case "up":a.y=-o.height;break;case "down":a.y=P.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=P.canvasWidth+o.width;break}let u=new gr({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,t),l=P.addTicker(r,u);if(l)return P.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&P.completeTickerOnStepEnd({id:l}),[l]}async function oO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=P.find(r);c&&(l=r+"_temp_zoom",P.editAlias(r,l)),e=Ud(r,e),l&&P.copyCanvasElementProperty(l,r),l&&P.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=P.canvasHeight-e.y,e.pivot.x=P.canvasWidth/2-e.x,e.y=P.canvasHeight,e.x=P.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=P.canvasWidth/2-e.x,e.y=0,e.x=P.canvasWidth/2):s=="left"?(e.pivot.x=P.canvasWidth-e.x,e.pivot.y=P.canvasHeight/2-e.y,e.x=P.canvasWidth,e.y=P.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=P.canvasHeight/2-e.y,e.x=0,e.y=P.canvasHeight/2),e.pivot=CE(e.pivot,e.angle),e.scale.set(0);let h=c?{pivot:{x:c.pivot.x,y:c.pivot.y},position:{x:c.x,y:c.y}}:void 0;if(l){if(t.removeOldComponentWithZoomOut){let _=KR(l,t,i);_&&(u.push(..._),o.push(l));}else a.push(l);P.pauseTicker(l);}o.push(r);let d=new gn({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),p=P.addTicker(r,d);if(p&&(P.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&P.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function KR(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=P.find(r);if(!o){N.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=P.canvasHeight-o.y,o.pivot.x=P.canvasWidth/2-o.x,o.y=P.canvasHeight,o.x=P.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=P.canvasWidth/2-o.x,o.y=0,o.x=P.canvasWidth/2):i=="left"?(o.pivot.x=P.canvasWidth-o.x,o.pivot.y=P.canvasHeight/2-o.y,o.x=P.canvasWidth,o.y=P.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=P.canvasHeight/2-o.y,o.x=0,o.y=P.canvasHeight/2),o.pivot=CE(o.pivot,o.angle),o.scale.set(1);let a=new gn({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},void 0,t),u=P.addTicker(r,a);if(u)return P.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&P.completeTickerOnStepEnd({id:u}),[u]}async function aO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;P.find(r)&&(u=r+"_temp_push",P.editAlias(r,u)),e=Ud(r,e),u&&P.copyCanvasElementProperty(u,r),u&&P.transferTickers(u,r,"move");let l;if((e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-P.canvasHeight+e.y:s=="down"?e.y=P.canvasHeight+e.y:s=="left"?e.x=-P.canvasWidth+e.x:s=="right"&&(e.x=P.canvasWidth+e.x),u){let d=ZR(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);d&&a.push(...d);}o.push(r);let c=new gr({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=P.addTicker(r,c);if(h&&(P.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&P.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function ZR(r,e={direction:"right"},t){return DE(r,e,t)}var P=new Od;ir.init({getScreen:()=>P.screen});exports.CanvasBaseItem=nb;exports.CanvasEvent=sb;exports.CanvasManagerStatic=w;exports.Container=_a;exports.FadeAlphaTicker=es;exports.ImageContainer=Le;exports.ImageSprite=Pe;exports.MoveTicker=gr;exports.RegisteredCanvasComponents=$t;exports.RegisteredEvents=Ki;exports.RegisteredTickers=nr;exports.RotateTicker=Gd;exports.Sprite=Ji;exports.Text=ya;exports.TickerBase=sr;exports.VideoSprite=Wt;exports.ZoomTicker=gn;exports.addImage=ab;exports.addImageCointainer=ob;exports.addVideo=ub;exports.canvas=P;exports.canvasComponentDecorator=UF;exports.eventDecorator=LF;exports.getTexture=Pi;exports.loadImage=JF;exports.loadVideo=tO;exports.moveIn=nO;exports.moveOut=DE;exports.pushIn=aO;exports.pushOut=ZR;exports.removeWithDissolve=lb;exports.removeWithFade=sO;exports.shakeEffect=ZF;exports.showImage=eO;exports.showImageContainer=QF;exports.showVideo=rO;exports.showWithDissolve=qR;exports.showWithFade=iO;exports.tickerDecorator=XF;exports.zoomIn=oO;exports.zoomOut=KR;
|
|
3310
|
+
`,dynamic:false}};});var PF,mR,gR,xR=f(()=>{Et();Gr();uE();PF=new me(0,0,0,0),mR=class lE extends qe{constructor(e={}){e={...lE.defaultOptions,...e,dynamicProperties:{...lE.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in vd){let l=vd[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return PF}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){e??(e=0),t??(t=this.particleChildren.length);let i=this.particleChildren.splice(e,t-e);return this.onViewUpdate(),i}removeParticleAt(e){let t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};mR.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};gR=mR;});var _R,cE,G_,yR=f(()=>{is();ce();xe();Gr();zm();_R=class bR extends qe{constructor(e){e instanceof C&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??zr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??zr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??zr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??zr.defaultOptions.bottomHeight,this._width=t??l.width??zr.defaultOptions.width,this._height=i??l.height??zr.defaultOptions.height,this.allowChildren=false,this.texture=l??bR.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new we({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=C.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};_R.defaultOptions={texture:C.EMPTY};cE=_R,G_=class extends cE{constructor(...e){let t=e[0];t instanceof C&&(I(H,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),t={texture:t,leftWidth:e[1],topHeight:e[2],rightWidth:e[3],bottomHeight:e[4]}),I(H,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});async function vR(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var TR=f(()=>{});function hE(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=wF[BF++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Ee&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];hE(a,e,{...t});}}function dE(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];dE(o,e,{...t,index:n});}}var wF,BF,SR=f(()=>{ms();wF=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],BF=0;});var ER={};zd(ER,{AbstractBitmapFont:()=>Ls,AbstractRenderer:()=>di,AbstractText:()=>bi,AccessibilitySystem:()=>Pf,AlphaFilter:()=>Q3,AlphaMask:()=>In,AlphaMaskPipe:()=>So,AnimatedSprite:()=>yl,Application:()=>Oh,ApplicationInitHook:()=>vo,Assets:()=>et,AssetsClass:()=>zh,BLEND_TO_NPM:()=>$f,BUFFER_TYPE:()=>jo,BackgroundLoader:()=>$u,BackgroundSystem:()=>cg,Batch:()=>gc,BatchGeometry:()=>Ha,BatchTextureArray:()=>Na,BatchableGraphics:()=>Li,BatchableHTMLText:()=>pu,BatchableMesh:()=>ai,BatchableSprite:()=>Pr,BatchableText:()=>ru,Batcher:()=>Qf,BatcherPipe:()=>Th,BigPool:()=>Re,BindGroup:()=>nt,BindGroupSystem:()=>Mo,BitmapFont:()=>oa,BitmapFontManager:()=>zi,BitmapText:()=>Sl,BitmapTextGraphics:()=>Xc,BitmapTextPipe:()=>ro,BlendModeFilter:()=>ee,BlendModePipe:()=>Co,BlurFilter:()=>dd,BlurFilterPass:()=>bl,Bounds:()=>me,BrowserAdapter:()=>Ff,Buffer:()=>Ve,BufferImageSource:()=>Di,BufferResource:()=>mi,BufferUsage:()=>ie,CLEAR:()=>ot,Cache:()=>de,CanvasPool:()=>Vt,CanvasPoolClass:()=>Hc,CanvasSource:()=>ht,CanvasTextGenerator:()=>Vi,CanvasTextMetrics:()=>xt,CanvasTextPipe:()=>qn,CanvasTextSystem:()=>to,Circle:()=>iu,Color:()=>K,ColorBlend:()=>Qc,ColorBurnBlend:()=>Jc,ColorDodgeBlend:()=>eh,ColorMask:()=>kn,ColorMaskPipe:()=>Eo,ColorMatrixFilter:()=>__,CompressedSource:()=>Br,Container:()=>te,Culler:()=>Jx,CullerPlugin:()=>Zh,CustomRenderPipe:()=>mo,D3D10_RESOURCE_DIMENSION:()=>Xx,D3DFMT:()=>zt,DATA_URI:()=>GP,DDS:()=>Q,DEG_TO_RAD:()=>Zd,DEPRECATED_SCALE_MODES:()=>yd,DEPRECATED_WRAP_MODES:()=>bd,DOMAdapter:()=>V,DOMContainer:()=>kf,DOMPipe:()=>Mn,DRAW_MODES:()=>wB,DXGI_FORMAT:()=>Wx,DXGI_TO_TEXTURE_FORMAT:()=>Ft,DarkenBlend:()=>th,DefaultBatcher:()=>Ln,DefaultShader:()=>Ya,DifferenceBlend:()=>rh,DisplacementFilter:()=>v_,DivideBlend:()=>ih,DynamicBitmapFont:()=>zc,Ellipse:()=>su,EventBoundary:()=>Ma,EventEmitter:()=>ue,EventSystem:()=>Da,EventsTicker:()=>_r,ExclusionBlend:()=>sh,ExtensionType:()=>g,ExtractSystem:()=>hg,FOURCC_TO_TEXTURE_FORMAT:()=>jh,FederatedContainer:()=>If,FederatedEvent:()=>si,FederatedMouseEvent:()=>Or,FederatedPointerEvent:()=>At,FederatedWheelEvent:()=>br,FillGradient:()=>It,FillPattern:()=>Hr,Filter:()=>_t,FilterEffect:()=>Ir,FilterPipe:()=>uo,FilterSystem:()=>lo,FontStylePromiseCache:()=>mu,GAUSSIAN_VALUES:()=>_l,GL_FORMATS:()=>Uu,GL_INTERNAL_FORMAT:()=>a1,GL_TARGETS:()=>Bh,GL_TYPES:()=>fe,GL_WRAP_MODES:()=>OT,GenerateTextureSystem:()=>Po,Geometry:()=>Mt,GlBackBufferSystem:()=>Vg,GlBatchAdaptor:()=>$o,GlBuffer:()=>Gu,GlBufferSystem:()=>qo,GlColorMaskSystem:()=>Zo,GlContextSystem:()=>Lg,GlEncoderSystem:()=>Qo,GlGeometrySystem:()=>Ko,GlGraphicsAdaptor:()=>Xo,GlLimitsSystem:()=>Jo,GlMeshAdaptor:()=>Yo,GlParticleContainerAdaptor:()=>Za,GlParticleContainerPipe:()=>Yn,GlProgram:()=>ke,GlProgramData:()=>Hu,GlRenderTarget:()=>Lu,GlRenderTargetAdaptor:()=>Nu,GlRenderTargetSystem:()=>ra,GlShaderSystem:()=>ia,GlStateSystem:()=>lx,GlStencilSystem:()=>ea,GlTexture:()=>zu,GlTextureSystem:()=>na,GlUboSystem:()=>ta,GlUniformGroupSystem:()=>sa,GlobalUniformSystem:()=>wo,GpuBatchAdaptor:()=>po,GpuBlendModesToPixi:()=>wt,GpuBufferSystem:()=>Do,GpuColorMaskSystem:()=>Io,GpuDeviceSystem:()=>Ks,GpuEncoderSystem:()=>ko,GpuGraphicsAdaptor:()=>ho,GpuGraphicsContext:()=>Bc,GpuLimitsSystem:()=>Fo,GpuMeshAdapter:()=>fo,GpuMipmapGenerator:()=>Ou,GpuParticleContainerAdaptor:()=>eu,GpuParticleContainerPipe:()=>$n,GpuProgram:()=>Fe,GpuRenderTarget:()=>Iu,GpuRenderTargetAdaptor:()=>ku,GpuRenderTargetSystem:()=>Ho,GpuShaderSystem:()=>Vo,GpuStateSystem:()=>zo,GpuStencilModesToPixi:()=>wr,GpuStencilSystem:()=>Oo,GpuTextureSystem:()=>Wo,GpuUboSystem:()=>Uo,GpuUniformBatchPipe:()=>Lo,Graphics:()=>Us,GraphicsContext:()=>Je,GraphicsContextRenderData:()=>Rc,GraphicsContextSystem:()=>Ms,GraphicsGpuData:()=>Dc,GraphicsPath:()=>ui,GraphicsPipe:()=>Wn,HTMLText:()=>El,HTMLTextPipe:()=>io,HTMLTextRenderData:()=>Ns,HTMLTextStyle:()=>Hs,HTMLTextSystem:()=>so,HardLightBlend:()=>nh,HardMixBlend:()=>oh,HelloSystem:()=>qs,IGLUniformData:()=>jg,ImageSource:()=>Rt,InstructionSet:()=>as,KTX:()=>Xe,LightenBlend:()=>ah,LinearBurnBlend:()=>uh,LinearDodgeBlend:()=>lh,LinearLightBlend:()=>ch,Loader:()=>qu,LoaderParserPriority:()=>Me,LuminosityBlend:()=>hh,MaskEffectManager:()=>Ea,MaskEffectManagerClass:()=>Ql,MaskFilter:()=>Su,Matrix:()=>D,Mesh:()=>rr,MeshGeometry:()=>Zt,MeshGpuData:()=>Ka,MeshPipe:()=>Xn,MeshPlane:()=>k_,MeshRope:()=>aR,MeshSimple:()=>O_,NOOP:()=>rc,NegationBlend:()=>dh,NineSliceGeometry:()=>zr,NineSlicePlane:()=>G_,NineSliceSprite:()=>cE,NineSliceSpriteGpuData:()=>qc,NineSliceSpritePipe:()=>ao,NoiseFilter:()=>aB,ObservablePoint:()=>we,OverlayBlend:()=>fh,PI_2:()=>qd,Particle:()=>fR,ParticleBuffer:()=>Qa,ParticleContainer:()=>gR,ParticleContainerPipe:()=>Ds,ParticleShader:()=>Ja,PerspectiveMesh:()=>eR,PerspectivePlaneGeometry:()=>Cl,PinLightBlend:()=>ph,PipelineSystem:()=>No,PlaneGeometry:()=>Ws,Point:()=>ne,Polygon:()=>ks,Pool:()=>Bi,PoolGroupClass:()=>Kl,PrepareBase:()=>E_,PrepareQueue:()=>Tl,PrepareSystem:()=>_d,PrepareUpload:()=>Al,QuadGeometry:()=>_u,RAD_TO_DEG:()=>Kd,Rectangle:()=>Z,RenderContainer:()=>R_,RenderGroup:()=>wa,RenderGroupPipe:()=>xo,RenderGroupSystem:()=>bo,RenderLayer:()=>$B,RenderTarget:()=>Ro,RenderTargetSystem:()=>Js,RenderTexture:()=>Eu,RenderableGCSystem:()=>mg,RendererInitHook:()=>To,RendererType:()=>Oe,ResizePlugin:()=>wn,Resolver:()=>Pt,RopeGeometry:()=>F_,RoundedRectangle:()=>nu,SCALE_MODES:()=>MB,STENCIL_MODES:()=>Be,SVGParser:()=>lm,SaturationBlend:()=>mh,SchedulerSystem:()=>Bo,ScissorMask:()=>w_,SdfShader:()=>du,Shader:()=>ze,ShaderStage:()=>Ss,ShapePath:()=>lu,SharedRenderPipes:()=>wu,SharedSystems:()=>Pu,SoftLightBlend:()=>gh,Sprite:()=>Ee,SpritePipe:()=>yo,Spritesheet:()=>hc,State:()=>Ue,StencilMask:()=>Fn,StencilMaskPipe:()=>Ao,SubtractBlend:()=>xh,SystemRunner:()=>$s,TEXTURE_FORMAT_BLOCK_SIZE:()=>Yx,Text:()=>Rr,TextStyle:()=>gt,Texture:()=>C,TextureGCSystem:()=>gg,TextureMatrix:()=>ls,TexturePool:()=>be,TexturePoolClass:()=>ic,TextureSource:()=>oe,TextureStyle:()=>st,TextureUvs:()=>B_,Ticker:()=>ye,TickerListener:()=>hs,TickerPlugin:()=>Rn,TilingSprite:()=>C_,TilingSpriteGpuData:()=>$c,TilingSpritePipe:()=>oo,TilingSpriteShader:()=>xu,Transform:()=>vl,Triangle:()=>S_,UNIFORM_TO_ARRAY_SETTERS:()=>ox,UNIFORM_TO_SINGLE_SETTERS:()=>nx,UNIFORM_TYPES_MAP:()=>yp,UNIFORM_TYPES_VALUES:()=>Tc,UPDATE_BLEND:()=>Ba,UPDATE_COLOR:()=>Pn,UPDATE_PRIORITY:()=>Ht,UPDATE_TRANSFORM:()=>mA,UPDATE_VISIBLE:()=>cs,UboBatch:()=>Mu,UboSystem:()=>Zs,UniformGroup:()=>ae,VERSION:()=>js,VideoSource:()=>_s,ViewContainer:()=>qe,ViewSystem:()=>bg,ViewableBuffer:()=>yr,VividLightBlend:()=>_h,WGSL_ALIGN_SIZE_DATA:()=>Go,WGSL_TO_STD40_SIZE:()=>Rh,WRAP_MODES:()=>RB,WebGLRenderer:()=>Fh,WebGPURenderer:()=>wh,WebWorkerAdapter:()=>j3,WorkerManager:()=>Vh,accessibilityTarget:()=>wf,addBits:()=>_c,addMaskBounds:()=>gs,addMaskLocalBounds:()=>xs,addProgramDefines:()=>rp,alphaFrag:()=>c_,alphaWgsl:()=>hd,applyMatrix:()=>Nm,applyProjectiveTransformationToPlane:()=>M_,applyStyleParams:()=>kh,assignWithIgnore:()=>Cn,autoDetectEnvironment:()=>DP,autoDetectRenderer:()=>bx,autoDetectSource:()=>zA,basisTranscoderUrls:()=>nl,bgr2rgb:()=>Ri,bitmapFontCachePlugin:()=>yx,bitmapFontTextParser:()=>Yu,bitmapFontXMLParser:()=>Gh,bitmapFontXMLStringParser:()=>Uh,blendTemplateFrag:()=>Xm,blendTemplateVert:()=>Ym,blendTemplateWgsl:()=>$m,blockDataMap:()=>Ph,blurTemplateWgsl:()=>m_,boundsPool:()=>Nt,browserExt:()=>u2,buildAdaptiveBezier:()=>au,buildAdaptiveQuadratic:()=>Jp,buildArc:()=>uu,buildArcTo:()=>tm,buildArcToSvg:()=>rm,buildCircle:()=>Rs,buildContextBatches:()=>Vp,buildEllipse:()=>Cp,buildLine:()=>Mp,buildPixelLine:()=>Dp,buildPolygon:()=>Up,buildRectangle:()=>Lp,buildRoundedRectangle:()=>Pp,buildSimpleUvs:()=>Ep,buildTriangle:()=>Np,buildUvs:()=>Sp,cacheAsTextureMixin:()=>tf,cacheTextureArray:()=>Tx,calculateProjection:()=>Dg,checkChildrenDidChange:()=>ec,checkDataUrl:()=>Qt,checkExtension:()=>We,checkMaxIfStatementsInShader:()=>Ua,childrenHelperMixin:()=>sf,cleanArray:()=>pg,cleanHash:()=>fg,clearList:()=>_o,closePointEps:()=>wp,collectAllRenderables:()=>LB,collectRenderablesMixin:()=>nf,color32BitToUniform:()=>Cr,colorBit:()=>As,colorBitGl:()=>Cs,colorMatrixFilterFrag:()=>x_,colorMatrixFilterWgsl:()=>fd,colorToUniform:()=>TC,compareModeToGlCompare:()=>mx,compileHighShader:()=>dp,compileHighShaderGl:()=>fp,compileHighShaderGlProgram:()=>Tr,compileHighShaderGpuProgram:()=>vr,compileHooks:()=>bc,compileInputs:()=>yc,compileOutputs:()=>hp,compileShader:()=>Mh,compute2DProjection:()=>I_,convertFormatIfRequired:()=>Hw,convertToList:()=>Ct,copySearchParams:()=>Dn,createIdFromString:()=>Nr,createIndicesForQuads:()=>kc,createLevelBuffers:()=>Pw,createLevelBuffersFromKTX:()=>zw,createStringVariations:()=>Of,createTexture:()=>kt,createUboElementsSTD40:()=>zg,createUboElementsWGSL:()=>Tg,createUboSyncFunction:()=>Bu,createUboSyncFunctionSTD40:()=>Yg,createUboSyncFunctionWGSL:()=>Bg,crossOrigin:()=>qS,cullingMixin:()=>jd,curveEps:()=>Bp,defaultFilterVert:()=>on,defaultValue:()=>Vu,definedProps:()=>mt,deprecation:()=>I,detectAvif:()=>Ex,detectBasis:()=>yw,detectCompressed:()=>Kw,detectDefaults:()=>Ax,detectMp4:()=>Cx,detectOgv:()=>Px,detectVideoAlphaMode:()=>Fa,detectWebm:()=>wx,detectWebp:()=>Bx,determineCrossOrigin:()=>ZS,displacementFrag:()=>b_,displacementVert:()=>y_,displacementWgsl:()=>pd,earcut:()=>Op,effectsMixin:()=>of,ensureAttributes:()=>Du,ensureIsBuffer:()=>xc,ensurePrecision:()=>ip,ensureTextOptions:()=>an,executeInstructions:()=>go,extensions:()=>O,extractAttributesFromGlProgram:()=>Jg,extractAttributesFromGpuProgram:()=>ap,extractFontFamilies:()=>Bm,extractStructAndGroups:()=>za,extractSvgUrlId:()=>Lc,fastCopy:()=>Un,findMixin:()=>af,fontStringFromTextStyle:()=>Hi,formatShader:()=>yB,fragmentGPUTemplate:()=>mp,fragmentGlTemplate:()=>xp,generateArraySyncSTD40:()=>Xg,generateArraySyncWGSL:()=>wg,generateBlurFragSource:()=>d_,generateBlurGlProgram:()=>p_,generateBlurProgram:()=>g_,generateBlurVertSource:()=>f_,generateGPULayout:()=>gB,generateGpuLayoutGroups:()=>up,generateLayout:()=>_B,generateLayoutHash:()=>lp,generateParticleUpdateFunction:()=>zp,generateProgram:()=>ix,generateShaderSyncCode:()=>$g,generateTextStyleKey:()=>hm,generateTextureBatchBit:()=>Ps,generateTextureBatchBitGl:()=>ws,generateTextureMatrix:()=>Hp,generateUniformsSync:()=>ax,getAdjustedBlendModeBlend:()=>Lr,getAttributeInfoFromFormat:()=>Dt,getBatchSamplersUniformGroup:()=>Bs,getBitmapTextLayout:()=>fu,getCanvasBoundingBox:()=>fm,getCanvasFillStyle:()=>Gs,getCanvasTexture:()=>Cu,getDefaultUniformValue:()=>vp,getFastGlobalBounds:()=>OB,getFastGlobalBoundsMixin:()=>lf,getFontCss:()=>Mm,getFontFamilyName:()=>VS,getGeometryBounds:()=>Jf,getGlTypeFromFormat:()=>Hg,getGlobalBounds:()=>ii,getGlobalMixin:()=>df,getGlobalRenderableBounds:()=>Wm,getLocalBounds:()=>os,getMaxFragmentPrecision:()=>tp,getMaxTexturesPerBatch:()=>Zf,getOrientationOfPoints:()=>Rp,getPo2TextureFromSource:()=>hu,getResolutionOfUrl:()=>rn,getSVGUrl:()=>Dm,getSupportedCompressedTextureFormats:()=>rl,getSupportedGPUCompressedTextureFormats:()=>Xh,getSupportedGlCompressedTextureFormats:()=>Wh,getSupportedTextureFormats:()=>gi,getTemporaryCanvasFromImage:()=>Im,getTestContext:()=>Ga,getTextureBatchBindGroup:()=>bs,getTextureDefaultMatrix:()=>cR,getTextureFormatFromKTXTexture:()=>Xw,getUboData:()=>ex,getUniformData:()=>tx,getUrlExtension:()=>ay,glFormatToGPUFormat:()=>Kx,glUploadBufferImageResource:()=>cx,glUploadCompressedTextureResource:()=>hx,glUploadImageResource:()=>Wu,glUploadVideoResource:()=>fx,globalUniformsBit:()=>_p,globalUniformsBitGl:()=>bp,globalUniformsUBOBitGl:()=>iC,gpuFormatToBasisTranscoderFormat:()=>Bw,gpuFormatToKTXBasisTranscoderFormat:()=>$w,gpuUploadBufferImageResource:()=>Fg,gpuUploadCompressedTextureResource:()=>Og,gpuUploadImageResource:()=>Fu,gpuUploadVideoResource:()=>Ug,groupD8:()=>le,hasCachedCanvasTexture:()=>YP,hslWgsl:()=>lB,hslgl:()=>Xs,hslgpu:()=>Ys,injectBits:()=>vc,insertVersion:()=>sp,isMobile:()=>Af,isPow2:()=>tc,isRenderingToScreen:()=>Ig,isSafari:()=>Am,isSingleItem:()=>ki,isWebGLSupported:()=>fi,isWebGPUSupported:()=>pi,ktxTranscoderUrls:()=>al,loadBasis:()=>Aw,loadBasisOnWorker:()=>zx,loadBitmapFont:()=>vx,loadDDS:()=>Mw,loadEnvironmentExtensions:()=>bh,loadFontAsBase64:()=>Rm,loadFontCSS:()=>Yc,loadImageBitmap:()=>jS,loadJson:()=>Rx,loadKTX:()=>Iw,loadKTX2:()=>Uw,loadKTX2onWorker:()=>qx,loadSVGImage:()=>km,loadSvg:()=>Ix,loadTextures:()=>Ju,loadTxt:()=>Mx,loadVideoTextures:()=>Fx,loadWebFont:()=>Dx,localUniformBit:()=>Wi,localUniformBitGl:()=>zs,localUniformBitGroup2:()=>Om,localUniformMSDFBit:()=>xm,localUniformMSDFBitGl:()=>_m,log2:()=>aA,logDebugTexture:()=>vR,logProgramError:()=>rx,logRenderGroupScene:()=>dE,logScene:()=>hE,mSDFBit:()=>bm,mSDFBitGl:()=>ym,mapFormatToGlFormat:()=>gx,mapFormatToGlInternalFormat:()=>xx,mapFormatToGlType:()=>_x,mapGlToVertexFormat:()=>Zg,mapSize:()=>AB,mapType:()=>Dh,mapWebGLBlendModesToPixi:()=>ux,maskFrag:()=>ug,maskVert:()=>lg,maskWgsl:()=>Sh,matrixPool:()=>je,measureHtmlText:()=>gu,measureMixin:()=>pf,migrateFragmentFromV7toV8:()=>SB,mipmapScaleModeToGlFilter:()=>px,multiplyColors:()=>ns,multiplyHexColors:()=>Ca,nextPow2:()=>kr,noiseFrag:()=>T_,noiseWgsl:()=>md,nonCompressedFormats:()=>r1,normalizeExtensionPriority:()=>va,onRenderMixin:()=>mf,parseDDS:()=>$x,parseFunctionBody:()=>kB,parseKTX:()=>jx,parseSVGDefinitions:()=>am,parseSVGFloatAttribute:()=>Ge,parseSVGPath:()=>jp,parseSVGStyle:()=>Nc,particleData:()=>vd,particlesFrag:()=>Wp,particlesVert:()=>Xp,particlesWgsl:()=>Fc,path:()=>De,pointInTriangle:()=>gd,preloadVideo:()=>KS,removeItems:()=>Sa,removeStructAndGroupDuplicates:()=>cp,resetUids:()=>tA,resolveCharacters:()=>Sm,resolveCompressedTextureUrl:()=>qw,resolveJsonUrl:()=>Gx,resolveTextureUrl:()=>el,resourceToTexture:()=>xy,roundPixelsBit:()=>Sr,roundPixelsBitGl:()=>Er,roundedShapeArc:()=>im,roundedShapeQuadraticCurve:()=>sm,sayHello:()=>dg,scaleModeToGlFilter:()=>Ih,setBasisTranscoderPath:()=>Sw,setKTXTranscoderPath:()=>Ow,setPositions:()=>Lm,setProgramName:()=>np,setUvs:()=>Hm,shapeBuilders:()=>qa,sortMixin:()=>gf,spritesheetAsset:()=>Uf,squaredDistanceToLineSegment:()=>Is,stripVersion:()=>op,styleAttributes:()=>um,testImageFormat:()=>ju,testVideoFormat:()=>en,textStyleToCSS:()=>Pm,textureBit:()=>Qm,textureBitGl:()=>Jm,textureFrom:()=>_y,tilingBit:()=>Gm,tilingBitGl:()=>Um,toFillStyle:()=>Vr,toLocalGlobalMixin:()=>xf,toStrokeStyle:()=>Fs,transformVertices:()=>Ec,triangulateWithHoles:()=>ja,uboSyncFunctionsSTD40:()=>Ah,uboSyncFunctionsWGSL:()=>Cg,uid:()=>re,uniformParsers:()=>Wr,unpremultiplyAlpha:()=>sw,unsafeEvalSupported:()=>bu,updateLocalTransform:()=>HB,updateQuadBounds:()=>ka,updateRenderGroupTransform:()=>v2,updateRenderGroupTransforms:()=>vh,updateTextBounds:()=>jn,updateTransformAndChildren:()=>sg,updateTransformBackwards:()=>Aa,updateWorldTransform:()=>zB,v8_0_0:()=>H,v8_3_4:()=>Jd,validFormats:()=>ul,validateRenderables:()=>ng,vertexGPUTemplate:()=>pp,vertexGlTemplate:()=>gp,vkFormatToGPUFormat:()=>Zx,warn:()=>F,webworkerExt:()=>l2,wrapModeToGlAddress:()=>Xu});var Ce=f(()=>{oP();uP();E();E();Wf();Lf();Yb();$b();hP();dP();fP();pP();mP();gP();xP();_P();bP();yP();vP();TP();SP();EP();AP();CP();PP();wP();BP();RP();MP();dw();jb();Kb();bw();MS();ni();DS();IS();kS();FS();OS();GS();US();Sx();Lh();LS();ar();NS();HS();zS();WS();kx();QS();Xi();$S();JS();Ox();ps();tn();hr();Ia();Gf();oy();lc();it();vw();Cw();ww();Rw();i1();s1();n1();Dw();o1();kw();l1();u1();Lw();Vw();Ww();Yw();f1();jw();c1();p1();h1();Zw();m1();x1();Qw();vb();FA();sy();Se();m2();ny();q3();ey();Df();Bf();sc();iy();oc();Rf();Mf();h2();d2();f2();cB();I1();k1();U1();H1();V1();cd();z1();W1();X1();Y1();$1();w2();B2();R2();$e();Kc();Zc();J3();rB();N1();h_();F1();G1();O1();L1();iB();sB();uB();hi();Zl();i2();o2();M2();yf();he();Qd();Pa();qp();is();jt();j1();K0();Z0();Q0();Ze();J0();hB();q1();J1();mB();rE();RT();Kf();yy();xB();bB();pc();_2();Sy();P2();Cy();vy();Tp();i0();Gi();Ky();Wy();Xy();Yy();$y();vB();jy();Zy();Wa();Xa();Qy();no();Ui();eg();cy();I2();hy();k2();Cb();TB();dy();F2();dc();fc();ES();MT();DT();IT();co();FT();UT();GT();NT();HT();VT();zT();jT();WT();$T();qT();KT();ZT();Sc();Kt();QT();oS();lS();EB();JT();qg();Rg();tS();nS();wy();qf();rS();iS();sS();CB();Qg();By();Ry();My();Dy();Iy();Wg();YT();XT();uS();aS();dS();cS();Ng();fS();TS();pS();mS();dx();gS();_S();e1();bS();yS();vS();xS();nw();SS();tT();rT();hT();iT();sT();nT();oT();aT();cT();dT();fT();pT();gT();xT();_T();Fi();ur();bT();Sg();lT();Gy();Uy();uT();Ny();Hy();Vy();yT();vT();Mg();CT();TT();ST();Gg();ET();t1();AT();PT();G2();U2();Oi();Ch();oi();Yf();H2();z2();BB();vs();n0();Ey();Ts();Ay();o0();_f();W2();mT();xg();kg();X2();Ly();Ar();t0();vg();Qe();Ag();r0();Pg();Eg();$2();ys();Oa();cr();yu();yg();qm();Qn();DB();K2();V2();vf();On();tl();Gn();ct();zf();ce();Q2();Tf();Fr();Mi();IB();_g();Hx();il();by();Va();FB();eT();lr();U0();L0();N0();Et();GB();vn();Jl();s2();ss();Sb();Eb();Ab();Pb();wb();Bb();ff();Mb();Db();Ib();kb();qt();b2();UB();Gb();y2();E2();Sf();Rb();ig();NB();us();rg();hf();cf();VB();T2();WB();S2();wT();zn();g2();Ap();Qp();iv();em();sv();av();a0();l0();c0();p0();m0();g0();lC();Vn();Oc();gm();Zn();Mc();R0();nm();uv();lv();cv();om();q0();dv();fv();hv();y0();cm();b0();u0();Gp();jB();tR();nE();iE();sE();rR();jc();uR();lR();oE();BT();x2();Ic();hR();ua();Vs();D0();k0();z0();V0();W0();pR();G0();xR();Yp();uE();H0();F0();O0();K1();zm();yR();t2();Xv();jv();Q1();Jv();Zv();qv();Kv();Qv();tu();ms();A2();vm();PS();wS();BS();RS();CS();Wc();eE();Rv();Pv();Tm();wv();Dv();tE();Iv();Cm();wm();zv();Ov();Lv();Nv();Hv();Gv();Uv();Vv();Fm();Fv();xd();Y0();mm();eo();$0();yv();Vc();pm();Cv();Tv();Sv();P_();Os();mv();dm();$p();Gr();uy();ly();Bn();ds();qb();Hf();Wb();kv();vu();Tu();jm();xv();og();St();j2();rf();lt();Nf();Xf();ag();xe();TR();SR();_e();Ob();Z1();Nh();fs();ef();ri();Y2();f0();O.add(u2,l2);});var kR=ti((j_,IR)=>{(function(r,e){typeof j_=="object"?IR.exports=j_=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(j_,function(){var r=r||function(e,t){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof db=="function")try{i=db("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function m(){}return function(v){var T;return m.prototype=v,T=new m,m.prototype=null,T}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(m){var v=n(this);return m&&v.mixIn(m),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments);}),v.init.prototype=v,v.$super=this,v},create:function(){var m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var v in m)m.hasOwnProperty(v)&&(this[v]=m[v]);m.hasOwnProperty("toString")&&(this.toString=m.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(m,v){m=this.words=m||[],v!=t?this.sigBytes=v:this.sigBytes=m.length*4;},toString:function(m){return (m||h).stringify(this)},concat:function(m){var v=this.words,T=m.words,S=this.sigBytes,B=m.sigBytes;if(this.clamp(),S%4)for(var A=0;A<B;A++){var R=T[A>>>2]>>>24-A%4*8&255;v[S+A>>>2]|=R<<24-(S+A)%4*8;}else for(var Y=0;Y<B;Y+=4)v[S+Y>>>2]=T[Y>>>2];return this.sigBytes+=B,this},clamp:function(){var m=this.words,v=this.sigBytes;m[v>>>2]&=4294967295<<32-v%4*8,m.length=e.ceil(v/4);},clone:function(){var m=u.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var v=[],T=0;T<m;T+=4)v.push(s());return new l.init(v,m)}}),c=o.enc={},h=c.Hex={stringify:function(m){for(var v=m.words,T=m.sigBytes,S=[],B=0;B<T;B++){var A=v[B>>>2]>>>24-B%4*8&255;S.push((A>>>4).toString(16)),S.push((A&15).toString(16));}return S.join("")},parse:function(m){for(var v=m.length,T=[],S=0;S<v;S+=2)T[S>>>3]|=parseInt(m.substr(S,2),16)<<24-S%8*4;return new l.init(T,v/2)}},d=c.Latin1={stringify:function(m){for(var v=m.words,T=m.sigBytes,S=[],B=0;B<T;B++){var A=v[B>>>2]>>>24-B%4*8&255;S.push(String.fromCharCode(A));}return S.join("")},parse:function(m){for(var v=m.length,T=[],S=0;S<v;S++)T[S>>>2]|=(m.charCodeAt(S)&255)<<24-S%4*8;return new l.init(T,v)}},p=c.Utf8={stringify:function(m){try{return decodeURIComponent(escape(d.stringify(m)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(m){return d.parse(unescape(encodeURIComponent(m)))}},_=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(m){typeof m=="string"&&(m=p.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes;},_process:function(m){var v,T=this._data,S=T.words,B=T.sigBytes,A=this.blockSize,R=A*4,Y=B/R;m?Y=e.ceil(Y):Y=e.max((Y|0)-this._minBufferSize,0);var M=Y*A,U=e.min(M*4,B);if(M){for(var k=0;k<M;k+=A)this._doProcessBlock(S,k);v=S.splice(0,M),T.sigBytes-=U;}return new l.init(v,U)},clone:function(){var m=u.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});a.Hasher=_.extend({cfg:u.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset();},reset:function(){_.reset.call(this),this._doReset();},update:function(m){return this._append(m),this._process(),this},finalize:function(m){m&&this._append(m);var v=this._doFinalize();return v},blockSize:512/32,_createHelper:function(m){return function(v,T){return new m.init(T).finalize(v)}},_createHmacHelper:function(m){return function(v,T){return new x.HMAC.init(m,T).finalize(v)}}});var x=o.algo={};return o}(Math);return r});});var OR=ti((q_,FR)=>{(function(r,e){typeof q_=="object"?FR.exports=q_=e(kR()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(q_,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],d=c[1],p=c[2],_=c[3],b=c[4],x=0;x<80;x++){if(x<16)o[x]=u[l+x]|0;else {var m=o[x-3]^o[x-8]^o[x-14]^o[x-16];o[x]=m<<1|m>>>31;}var v=(h<<5|h>>>27)+b+o[x];x<20?v+=(d&p|~d&_)+1518500249:x<40?v+=(d^p^_)+1859775393:x<60?v+=(d&p|d&_|p&_)-1894007588:v+=(d^p^_)-899497514,b=_,_=p,p=d<<30|d>>>2,d=h,h=v;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+p|0,c[3]=c[3]+_|0,c[4]=c[4]+b|0;},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,h=u.sigBytes*8;return l[h>>>5]|=128<<24-h%32,l[(h+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(h+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});Ce();var yi={};zd(yi,{DistortionFilter:()=>U_,EqualizerFilter:()=>Mr,Filter:()=>dt,MonoFilter:()=>L_,ReverbFilter:()=>N_,StereoFilter:()=>H_,StreamFilter:()=>V_,TelephoneFilter:()=>z_});var AR;function CR(r){return AR=r,r}function ve(){return AR}var dt=class{constructor(e,t){this.init(e,t);}init(e,t){this.destination=e,this.source=t||e;}connect(e){this.source?.connect(e);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var U_=class extends dt{constructor(e=0){let t;if(!ve().useLegacy){let{audioContext:i}=ve().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,ve().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var at=class{static setParamValue(e,t){if(e.setValueAtTime){let i=ve().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Te=class extends dt{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Te.F32,type:"lowshelf",gain:r},{f:Te.F64,type:"peaking",gain:e},{f:Te.F125,type:"peaking",gain:t},{f:Te.F250,type:"peaking",gain:i},{f:Te.F500,type:"peaking",gain:s},{f:Te.F1K,type:"peaking",gain:n},{f:Te.F2K,type:"peaking",gain:o},{f:Te.F4K,type:"peaking",gain:a},{f:Te.F8K,type:"peaking",gain:u},{f:Te.F16K,type:"highshelf",gain:l}];ve().useLegacy||(c=h.map(d=>{let p=ve().context.audioContext.createBiquadFilter();return p.type=d.type,at.setParamValue(p.Q,1),p.frequency.value=d.f,at.setParamValue(p.gain,d.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let p=this.bands[d];d>0&&this.bands[d-1].connect(p),this.bandsMap[p.frequency.value]=p;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);at.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(Te.F32,r);}get f32(){return this.getGain(Te.F32)}set f64(r){this.setGain(Te.F64,r);}get f64(){return this.getGain(Te.F64)}set f125(r){this.setGain(Te.F125,r);}get f125(){return this.getGain(Te.F125)}set f250(r){this.setGain(Te.F250,r);}get f250(){return this.getGain(Te.F250)}set f500(r){this.setGain(Te.F500,r);}get f500(){return this.getGain(Te.F500)}set f1k(r){this.setGain(Te.F1K,r);}get f1k(){return this.getGain(Te.F1K)}set f2k(r){this.setGain(Te.F2K,r);}get f2k(){return this.getGain(Te.F2K)}set f4k(r){this.setGain(Te.F4K,r);}get f4k(){return this.getGain(Te.F4K)}set f8k(r){this.setGain(Te.F8K,r);}get f8k(){return this.getGain(Te.F8K)}set f16k(r){this.setGain(Te.F16K,r);}get f16k(){return this.getGain(Te.F16K)}reset(){this.bands.forEach(r=>{at.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},Mr=Te;Mr.F32=32;Mr.F64=64;Mr.F125=125;Mr.F250=250;Mr.F500=500;Mr.F1K=1e3;Mr.F2K=2e3;Mr.F4K=4e3;Mr.F8K=8e3;Mr.F16K=16e3;var L_=class extends dt{constructor(){let e,t;if(!ve().useLegacy){let{audioContext:i}=ve().context;t=i.createChannelSplitter(),e=i.createChannelMerger(),e.connect(t);}super(e,t),this._merger=e;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var N_=class extends dt{constructor(e=3,t=2,i=false){super(null),this._seconds=this._clamp(e,1,50),this._decay=this._clamp(t,0,100),this._reverse=i,this._rebuild();}_clamp(e,t,i){return Math.min(i,Math.max(t,e))}get seconds(){return this._seconds}set seconds(e){this._seconds=this._clamp(e,1,50),this._rebuild();}get decay(){return this._decay}set decay(e){this._decay=this._clamp(e,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(e){this._reverse=e,this._rebuild();}_rebuild(){if(ve().useLegacy)return;let{audioContext:e}=ve().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var H_=class extends dt{constructor(e=0){let t,i,s;if(!ve().useLegacy){let{audioContext:n}=ve().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?at.setParamValue(this._stereo.pan,e):this._panner&&this._panner.setPosition(e,0,1-Math.abs(e));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var V_=class extends dt{constructor(){let e,t;if(!ve().useLegacy){let{audioContext:i}=ve().context;e=i.createMediaStreamDestination(),t=i.createMediaStreamSource(e.stream);}super(e,t),this._stream=e?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var z_=class extends dt{constructor(){let e,t;if(!ve().useLegacy){let{audioContext:i}=ve().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",at.setParamValue(s.frequency,2e3),n.type="lowpass",at.setParamValue(n.frequency,2e3),o.type="highpass",at.setParamValue(o.frequency,500),a.type="highpass",at.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};Ce();var Td=class extends ue{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};Ce();var RF=0,fE=class extends ue{constructor(r){super(),this.id=RF++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-fE.PADDING),this._end=Math.min(this._end+fE.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),ye.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){ye.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){ye.shared.remove(this._onUpdate,this),this.removeAllListeners();let r=this._source;r&&(r.onended=null,r.onplay=null,r.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},W_=fE;W_.PADDING=.1;Ce();var Sd=class extends ue{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new W_(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};Ce();var Ed=class{constructor(e,t){this.parent=e,Object.assign(this,t),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(e){return this.parent.play({complete:e,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var la=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],pE=["audio/mpeg","audio/ogg"],ca={};function PR(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;la.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(ca,i);}PR();Ce();Ce();var DF=0,Ad=class extends ue{constructor(e){super(),this.id=DF++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);at.setParamValue(this._gain.gain,n*s*i),at.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){ye.shared.remove(this._updateListener,this),e&&ye.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var ha=class{constructor(e,t){this._output=t,this._input=e;}get destination(){return this._input}get filters(){return this._filters}set filters(e){if(this._filters&&(this._filters.forEach(t=>{t&&t.disconnect();}),this._filters=null,this._input.connect(this._output)),e&&e.length){this._filters=e.slice(0),this._input.disconnect();let t=null;e.forEach(i=>{t===null?this._input.connect(i.destination):t.connect(i.destination),t=i;}),t.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var wR=class extends ha{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(wR.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let r=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=r.buffer,at.setParamValue(e.playbackRate,r.playbackRate.value),e.loop=r.loop;let t=this.context.audioContext.createGain();return e.connect(t),t.connect(this.destination),{source:e,gain:t}}get bufferSize(){return this.script.bufferSize}},X_=wR;X_.BUFFER_SIZE=0;var da=class{init(e){this.parent=e,this._nodes=new X_(this.context),this._source=this._nodes.bufferSource,this.source=e.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null,this.source=null;}create(){return new Ad(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await V.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var Pl=class{static from(r){let e={};typeof r=="string"?e.url=r:r instanceof ArrayBuffer||r instanceof AudioBuffer||r instanceof HTMLAudioElement?e.source=r:Array.isArray(r)?e.url=r:e=r,e={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...e},Object.freeze(e);let t=ve().useLegacy?new Sd:new da;return new Pl(t,e)}constructor(r,e){this.media=r,this.options=e,this._instances=[],this._sprites={},this.media.init(this);let t=e.complete;this._autoPlayOptions=t?{complete:t}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=Array.isArray(e.url)?this.preferUrl(e.url):e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded);}preferUrl(r){let[e]=r.map(t=>({url:t,ext:De.extname(t).slice(1)})).filter(({ext:t})=>ca[t]).sort((t,i)=>la.indexOf(t.ext)-la.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return ve().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new Ed(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(Pl._pool.length>0){let r=Pl._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Pl._pool.indexOf(r)<0&&Pl._pool.push(r);}},un=Pl;un._pool=[];Ce();var wl=class r extends ha{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new ue,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var Y_=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new wl),this._htmlAudioContext=new Td,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(e){this.useLegacy||(this._context.filters=e);}get supported(){return wl.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof un)return this._sounds[e]=t,t;let i=this._getOptions(t),s=un.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};Ce();Ce();var BR=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=De.basename(e,De.extname(e))),t},RR={extension:g.Asset,detection:{test:async()=>true,add:async r=>[...r,...la.filter(e=>ca[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[g.LoadParser],priority:Me.High},test(r){let e=De.extname(r).slice(1);return !!ca[e]||pE.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>un.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return ve().add(BR(e),t),t},async unload(r,e){ve().remove(BR(e));}}};O.add(RR);CR(new Y_);var Cd="repeat";({DistortionFilter:yi.DistortionFilter,EqualizerFilter:yi.EqualizerFilter,MonoFilter:yi.MonoFilter,ReverbFilter:yi.ReverbFilter,StereoFilter:yi.StereoFilter,StreamFilter:yi.StreamFilter,TelephoneFilter:yi.TelephoneFilter});var MR=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],Yr="__game_layer__",Bl="Container",$_="ImageContainer",mE="Image",Rl="Sprite",Ml="Text",gE="Video";var N;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(N||(N={}));function Gt(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw N.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function DR(r){var e;let t={importPixi:false,...r};t.app&&(t.renderer=t.app.renderer,t.stage=t.app.stage),t.importPixi&&!t.pixi&&(t.pixi=await Promise.resolve().then(()=>(Ce(),ER))),window.__PIXI_DEVTOOLS__={...window.__PIXI_DEVTOOLS__||{},app:t.app,stage:t.stage,renderer:t.renderer,extensions:[...((e=window.__PIXI_DEVTOOLS__)==null?void 0:e.extensions)||[],...t.extensions||[]],plugins:{}};}var UR=Wd(OR());Ce();var FF={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Pe||r instanceof Wt||r instanceof Le},testProp(r){switch(r){case "xAlign":case "yAlign":case "xPercentagePosition":case "yPercentagePosition":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof Pe||r instanceof Wt||r instanceof Le)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "xPercentagePosition":r.xPercentagePosition=t/100;break;case "yPercentagePosition":r.yPercentagePosition=t/100;break}},getProperties(r){return [{value:r.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:r.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:r.xPercentagePosition*100,prop:"xPercentagePosition",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yPercentagePosition*100,prop:"yPercentagePosition",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},GR=FF;function OF(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var W=class W{constructor(){}static get app(){if(!W._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return W._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(Yr);return e||(e=new te,e.label=Yr,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return W.canvasWidth=t,W.canvasHeight=i,W._app=new Oh,W.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=W.app,extensions:a=[],...u}=n||{};DR({app:o,extensions:[GR,...a],...u}),W._isInitialized=true,W.addCanvasIntoHTMLElement(e),window.addEventListener("resize",W.resize),W.resize(),W.gameLayer;})}static addCanvasIntoHTMLElement(e){W._isInitialized?e.appendChild(W.app.canvas):N.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return W.htmlLayers.push(s),W.resize(),n}static removeHtmlLayer(e){let t=W.htmlLayers.find(i=>i.id===e);t&&(t.remove(),W.htmlLayers=W.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return W.htmlLayers.find(t=>t.id===e)}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/W.canvasWidth,t/W.canvasHeight)}static get screenWidth(){return Math.floor(W.screenScale*W.canvasWidth)}static get screenHeight(){return Math.floor(W.screenScale*W.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-W.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-W.screenHeight)/2}static async resize(){await OF(async()=>{if(W._isInitialized){let i=W.app.canvas.style;i.width=`${W.screenWidth}px`,i.height=`${W.screenHeight}px`,i.marginLeft=`${W.horizontalMargin}px`,i.marginRight=`${W.horizontalMargin}px`,i.marginTop=`${W.verticalMargin}px`,i.marginBottom=`${W.verticalMargin}px`;}let t=W.htmlLayers.map(i=>{i.style.width=`${W.screenWidth}px`,i.style.height=`${W.screenHeight}px`,i.style.marginLeft=`${W.horizontalMargin}px`,i.style.marginRight=`${W.horizontalMargin}px`,i.style.marginTop=`${W.verticalMargin}px`,i.style.marginBottom=`${W.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return W.gameLayer.children.filter(e=>e.label).sort((e,t)=>W.gameLayer.getChildIndex(e)-W.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(W._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static generateTickerId(e){try{return (0,UR.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),W._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),W._currentTickersTimeouts[e]&&delete W._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),W.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(W._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&W.removeTickerTimeout(i);}else W._currentTickersTimeouts[i].aliases=n;});}};L(W,"_app"),L(W,"htmlLayers",[]),L(W,"canvasWidth",300),L(W,"canvasHeight",300),L(W,"_isInitialized",false),L(W,"_currentTickers",{}),L(W,"_currentTickersSequence",{}),L(W,"_currentTickersTimeouts",{}),L(W,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),L(W,"_tickersOnPause",{});var w=W;Ce();var Dl=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,VR=new Set,xE=typeof process=="object"&&process?process:{},zR=(r,e,t,i)=>{typeof xE.emitWarning=="function"?xE.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},Q_=globalThis.AbortController,LR=globalThis.AbortSignal;if(typeof Q_>"u"){LR=class{constructor(){L(this,"onabort");L(this,"_onabort",[]);L(this,"reason");L(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Q_=class{constructor(){L(this,"signal",new LR);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=xE.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,zR("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var GF=r=>!VR.has(r),ln=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),WR=r=>ln(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Il:null:null,Il=class extends Array{constructor(e){super(e),this.fill(0);}},kl,fa=class fa{constructor(e,t){L(this,"heap");L(this,"length");if(!y(fa,kl))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=WR(e);if(!t)return [];q(fa,kl,true);let i=new fa(e,t);return q(fa,kl,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};kl=new WeakMap,pe(fa,kl,false);var _E=fa,NR,HR,$r,dr,jr,pa,qr,Fl,Ol,ft,Kr,ut,He,se,Xt,fr,Ut,vt,Zr,Tt,Qr,Jr,pr,ei,fn,Yt,Gl,G,bE,ma,qi,wd,mr,XR,ga,Ul,Bd,cn,hn,yE,K_,Z_,Ne,vE,Pd,dn,TE,SE=class SE{constructor(e){pe(this,G);pe(this,$r);pe(this,dr);pe(this,jr);pe(this,pa);pe(this,qr);pe(this,Fl);pe(this,Ol);L(this,"ttl");L(this,"ttlResolution");L(this,"ttlAutopurge");L(this,"updateAgeOnGet");L(this,"updateAgeOnHas");L(this,"allowStale");L(this,"noDisposeOnSet");L(this,"noUpdateTTL");L(this,"maxEntrySize");L(this,"sizeCalculation");L(this,"noDeleteOnFetchRejection");L(this,"noDeleteOnStaleGet");L(this,"allowStaleOnFetchAbort");L(this,"allowStaleOnFetchRejection");L(this,"ignoreFetchAbort");pe(this,ft);pe(this,Kr);pe(this,ut);pe(this,He);pe(this,se);pe(this,Xt);pe(this,fr);pe(this,Ut);pe(this,vt);pe(this,Zr);pe(this,Tt);pe(this,Qr);pe(this,Jr);pe(this,pr);pe(this,ei);pe(this,fn);pe(this,Yt);pe(this,Gl);pe(this,ma,()=>{});pe(this,qi,()=>{});pe(this,wd,()=>{});pe(this,mr,()=>false);pe(this,ga,e=>{});pe(this,Ul,(e,t,i)=>{});pe(this,Bd,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});L(this,NR,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:p,maxSize:_=0,maxEntrySize:b=0,sizeCalculation:x,fetchMethod:m,memoMethod:v,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:B,allowStaleOnFetchAbort:A,ignoreFetchAbort:R}=e;if(t!==0&&!ln(t))throw new TypeError("max option must be a nonnegative integer");let Y=t?WR(t):Array;if(!Y)throw new Error("invalid max value: "+t);if(q(this,$r,t),q(this,dr,_),this.maxEntrySize=b||y(this,dr),this.sizeCalculation=x,this.sizeCalculation){if(!y(this,dr)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(q(this,Ol,v),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(q(this,Fl,m),q(this,fn,!!m),q(this,ut,new Map),q(this,He,new Array(t).fill(void 0)),q(this,se,new Array(t).fill(void 0)),q(this,Xt,new Y(t)),q(this,fr,new Y(t)),q(this,Ut,0),q(this,vt,0),q(this,Zr,_E.create(t)),q(this,ft,0),q(this,Kr,0),typeof l=="function"&&q(this,jr,l),typeof c=="function"&&q(this,pa,c),typeof h=="function"?(q(this,qr,h),q(this,Tt,[])):(q(this,qr,void 0),q(this,Tt,void 0)),q(this,ei,!!y(this,jr)),q(this,Gl,!!y(this,pa)),q(this,Yt,!!y(this,qr)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!B,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(y(this,dr)!==0&&!ln(y(this,dr)))throw new TypeError("maxSize must be a positive integer if specified");if(!ln(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");X(this,G,XR).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ln(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!ln(this.ttl))throw new TypeError("ttl must be a positive integer if specified");X(this,G,bE).call(this);}if(y(this,$r)===0&&this.ttl===0&&y(this,dr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!y(this,$r)&&!y(this,dr)){let M="LRU_CACHE_UNBOUNDED";GF(M)&&(VR.add(M),zR("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,SE));}}static unsafeExposeInternals(e){return {starts:y(e,Jr),ttls:y(e,pr),sizes:y(e,Qr),keyMap:y(e,ut),keyList:y(e,He),valList:y(e,se),next:y(e,Xt),prev:y(e,fr),get head(){return y(e,Ut)},get tail(){return y(e,vt)},free:y(e,Zr),isBackgroundFetch:t=>{var i;return X(i=e,G,Ne).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return X(o=e,G,Z_).call(o,t,i,s,n)},moveToTail:t=>{var i;return X(i=e,G,Pd).call(i,t)},indexes:t=>{var i;return X(i=e,G,cn).call(i,t)},rindexes:t=>{var i;return X(i=e,G,hn).call(i,t)},isStale:t=>{var i;return y(i=e,mr).call(i,t)}}}get max(){return y(this,$r)}get maxSize(){return y(this,dr)}get calculatedSize(){return y(this,Kr)}get size(){return y(this,ft)}get fetchMethod(){return y(this,Fl)}get memoMethod(){return y(this,Ol)}get dispose(){return y(this,jr)}get onInsert(){return y(this,pa)}get disposeAfter(){return y(this,qr)}getRemainingTTL(e){return y(this,ut).has(e)?1/0:0}*entries(){for(let e of X(this,G,cn).call(this))y(this,se)[e]!==void 0&&y(this,He)[e]!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield [y(this,He)[e],y(this,se)[e]]);}*rentries(){for(let e of X(this,G,hn).call(this))y(this,se)[e]!==void 0&&y(this,He)[e]!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield [y(this,He)[e],y(this,se)[e]]);}*keys(){for(let e of X(this,G,cn).call(this)){let t=y(this,He)[e];t!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield t);}}*rkeys(){for(let e of X(this,G,hn).call(this)){let t=y(this,He)[e];t!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield t);}}*values(){for(let e of X(this,G,cn).call(this))y(this,se)[e]!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield y(this,se)[e]);}*rvalues(){for(let e of X(this,G,hn).call(this))y(this,se)[e]!==void 0&&!X(this,G,Ne).call(this,y(this,se)[e])&&(yield y(this,se)[e]);}[(HR=Symbol.iterator,NR=Symbol.toStringTag,HR)](){return this.entries()}find(e,t={}){for(let i of X(this,G,cn).call(this)){let s=y(this,se)[i],n=X(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,y(this,He)[i],this))return this.get(y(this,He)[i],t)}}forEach(e,t=this){for(let i of X(this,G,cn).call(this)){let s=y(this,se)[i],n=X(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,y(this,He)[i],this);}}rforEach(e,t=this){for(let i of X(this,G,hn).call(this)){let s=y(this,se)[i],n=X(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,y(this,He)[i],this);}}purgeStale(){let e=false;for(let t of X(this,G,hn).call(this,{allowStale:true}))y(this,mr).call(this,t)&&(X(this,G,dn).call(this,y(this,He)[t],"expire"),e=true);return e}info(e){let t=y(this,ut).get(e);if(t===void 0)return;let i=y(this,se)[t],s=X(this,G,Ne).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(y(this,pr)&&y(this,Jr)){let o=y(this,pr)[t],a=y(this,Jr)[t];if(o&&a){let u=o-(Dl.now()-a);n.ttl=u,n.start=Date.now();}}return y(this,Qr)&&(n.size=y(this,Qr)[t]),n}dump(){let e=[];for(let t of X(this,G,cn).call(this,{allowStale:true})){let i=y(this,He)[t],s=y(this,se)[t],n=X(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(y(this,pr)&&y(this,Jr)){o.ttl=y(this,pr)[t];let a=Dl.now()-y(this,Jr)[t];o.start=Math.floor(Date.now()-a);}y(this,Qr)&&(o.size=y(this,Qr)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=Dl.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,p,_,b;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=y(this,Bd).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),X(this,G,dn).call(this,e,"set"),this;let h=y(this,ft)===0?void 0:y(this,ut).get(e);if(h===void 0)h=y(this,ft)===0?y(this,vt):y(this,Zr).length!==0?y(this,Zr).pop():y(this,ft)===y(this,$r)?X(this,G,K_).call(this,false):y(this,ft),y(this,He)[h]=e,y(this,se)[h]=t,y(this,ut).set(e,h),y(this,Xt)[y(this,vt)]=h,y(this,fr)[h]=y(this,vt),q(this,vt,h),Xd(this,ft)._++,y(this,Ul).call(this,h,c,u),u&&(u.set="add"),l=false,y(this,Gl)&&((d=y(this,pa))==null||d.call(this,t,e,"add"));else {X(this,G,Pd).call(this,h);let x=y(this,se)[h];if(t!==x){if(y(this,fn)&&X(this,G,Ne).call(this,x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=x;m!==void 0&&!o&&(y(this,ei)&&((p=y(this,jr))==null||p.call(this,m,e,"set")),y(this,Yt)&&y(this,Tt)?.push([m,e,"set"]));}else o||(y(this,ei)&&((_=y(this,jr))==null||_.call(this,x,e,"set")),y(this,Yt)&&y(this,Tt)?.push([x,e,"set"]));if(y(this,ga).call(this,h),y(this,Ul).call(this,h,c,u),y(this,se)[h]=t,u){u.set="replace";let m=x&&X(this,G,Ne).call(this,x)?x.__staleWhileFetching:x;m!==void 0&&(u.oldValue=m);}}else u&&(u.set="update");y(this,Gl)&&this.onInsert?.(t,e,t===x?"update":"replace");}if(s!==0&&!y(this,pr)&&X(this,G,bE).call(this),y(this,pr)&&(l||y(this,wd).call(this,h,s,n),u&&y(this,qi).call(this,u,h)),!o&&y(this,Yt)&&y(this,Tt)){let x=y(this,Tt),m;for(;m=x?.shift();)(b=y(this,qr))==null||b.call(this,...m);}return this}pop(){var e;try{for(;y(this,ft);){let t=y(this,se)[y(this,Ut)];if(X(this,G,K_).call(this,!0),X(this,G,Ne).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(y(this,Yt)&&y(this,Tt)){let t=y(this,Tt),i;for(;i=t?.shift();)(e=y(this,qr))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=y(this,ut).get(e);if(n!==void 0){let o=y(this,se)[n];if(X(this,G,Ne).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(y(this,mr).call(this,n))s&&(s.has="stale",y(this,qi).call(this,s,n));else return i&&y(this,ma).call(this,n),s&&(s.has="hit",y(this,qi).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=y(this,ut).get(e);if(s===void 0||!i&&y(this,mr).call(this,s))return;let n=y(this,se)[s];return X(this,G,Ne).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:b,forceRefresh:x=false,status:m,signal:v}=t;if(!y(this,fn))return m&&(m.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:m});let T={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:_,ignoreFetchAbort:p,status:m,signal:v},S=y(this,ut).get(e);if(S===void 0){m&&(m.fetch="miss");let B=X(this,G,Z_).call(this,e,S,T,b);return B.__returned=B}else {let B=y(this,se)[S];if(X(this,G,Ne).call(this,B)){let U=i&&B.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",U&&(m.returnedStale=true)),U?B.__staleWhileFetching:B.__returned=B}let A=y(this,mr).call(this,S);if(!x&&!A)return m&&(m.fetch="hit"),X(this,G,Pd).call(this,S),s&&y(this,ma).call(this,S),m&&y(this,qi).call(this,m,S),B;let R=X(this,G,Z_).call(this,e,S,T,b),M=R.__staleWhileFetching!==void 0&&i;return m&&(m.fetch=A?"stale":"refresh",M&&A&&(m.returnedStale=true)),M?R.__staleWhileFetching:R.__returned=R}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=y(this,Ol);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=y(this,ut).get(e);if(a!==void 0){let u=y(this,se)[a],l=X(this,G,Ne).call(this,u);return o&&y(this,qi).call(this,o,a),y(this,mr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||X(this,G,dn).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(X(this,G,Pd).call(this,a),s&&y(this,ma).call(this,a),u))}else o&&(o.get="miss");}delete(e){return X(this,G,dn).call(this,e,"delete")}clear(){return X(this,G,TE).call(this,"delete")}};$r=new WeakMap,dr=new WeakMap,jr=new WeakMap,pa=new WeakMap,qr=new WeakMap,Fl=new WeakMap,Ol=new WeakMap,ft=new WeakMap,Kr=new WeakMap,ut=new WeakMap,He=new WeakMap,se=new WeakMap,Xt=new WeakMap,fr=new WeakMap,Ut=new WeakMap,vt=new WeakMap,Zr=new WeakMap,Tt=new WeakMap,Qr=new WeakMap,Jr=new WeakMap,pr=new WeakMap,ei=new WeakMap,fn=new WeakMap,Yt=new WeakMap,Gl=new WeakMap,G=new WeakSet,bE=function(){let e=new Il(y(this,$r)),t=new Il(y(this,$r));q(this,pr,e),q(this,Jr,t),q(this,wd,(n,o,a=Dl.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{y(this,mr).call(this,n)&&X(this,G,dn).call(this,y(this,He)[n],"expire");},o+1);u.unref&&u.unref();}}),q(this,ma,n=>{t[n]=e[n]!==0?Dl.now():0;}),q(this,qi,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=Dl.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=y(this,ut).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},q(this,mr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},ma=new WeakMap,qi=new WeakMap,wd=new WeakMap,mr=new WeakMap,XR=function(){let e=new Il(y(this,$r));q(this,Kr,0),q(this,Qr,e),q(this,ga,t=>{q(this,Kr,y(this,Kr)-e[t]),e[t]=0;}),q(this,Bd,(t,i,s,n)=>{if(X(this,G,Ne).call(this,i))return 0;if(!ln(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!ln(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),q(this,Ul,(t,i,s)=>{if(e[t]=i,y(this,dr)){let n=y(this,dr)-e[t];for(;y(this,Kr)>n;)X(this,G,K_).call(this,true);}q(this,Kr,y(this,Kr)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=y(this,Kr));});},ga=new WeakMap,Ul=new WeakMap,Bd=new WeakMap,cn=function*({allowStale:e=this.allowStale}={}){if(y(this,ft))for(let t=y(this,vt);!(!X(this,G,yE).call(this,t)||((e||!y(this,mr).call(this,t))&&(yield t),t===y(this,Ut)));)t=y(this,fr)[t];},hn=function*({allowStale:e=this.allowStale}={}){if(y(this,ft))for(let t=y(this,Ut);!(!X(this,G,yE).call(this,t)||((e||!y(this,mr).call(this,t))&&(yield t),t===y(this,vt)));)t=y(this,Xt)[t];},yE=function(e){return e!==void 0&&y(this,ut).get(y(this,He)[e])===e},K_=function(e){var n;let t=y(this,Ut),i=y(this,He)[t],s=y(this,se)[t];return y(this,fn)&&X(this,G,Ne).call(this,s)?s.__abortController.abort(new Error("evicted")):(y(this,ei)||y(this,Yt))&&(y(this,ei)&&((n=y(this,jr))==null||n.call(this,s,i,"evict")),y(this,Yt)&&y(this,Tt)?.push([s,i,"evict"])),y(this,ga).call(this,t),e&&(y(this,He)[t]=void 0,y(this,se)[t]=void 0,y(this,Zr).push(t)),y(this,ft)===1?(q(this,Ut,q(this,vt,0)),y(this,Zr).length=0):q(this,Ut,y(this,Xt)[t]),y(this,ut).delete(i),Xd(this,ft)._--,t},Z_=function(e,t,i,s){let n=t===void 0?void 0:y(this,se)[t];if(X(this,G,Ne).call(this,n))return n;let o=new Q_,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(b,x=false)=>{let{aborted:m}=o.signal,v=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(m&&!x?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,v&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),m&&!v&&!x)return h(o.signal.reason);let T=p;return y(this,se)[t]===p&&(b===void 0?T.__staleWhileFetching?y(this,se)[t]=T.__staleWhileFetching:X(this,G,dn).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,b,u.options))),b},c=b=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=b),h(b)),h=b=>{let{aborted:x}=o.signal,m=x&&i.allowStaleOnFetchAbort,v=m||i.allowStaleOnFetchRejection,T=v||i.noDeleteOnFetchRejection,S=p;if(y(this,se)[t]===p&&(!T||S.__staleWhileFetching===void 0?X(this,G,dn).call(this,e,"fetch"):m||(y(this,se)[t]=S.__staleWhileFetching)),v)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw b},d=(b,x)=>{var v;let m=(v=y(this,Fl))==null?void 0:v.call(this,e,n,u);m&&m instanceof Promise&&m.then(T=>b(T===void 0?void 0:T),x),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=T=>l(T,true)));});};i.status&&(i.status.fetchDispatched=true);let p=new Promise(d).then(l,c),_=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,_,{...u.options,status:void 0}),t=y(this,ut).get(e)):y(this,se)[t]=_,_},Ne=function(e){if(!y(this,fn))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Q_},vE=function(e,t){y(this,fr)[t]=e,y(this,Xt)[e]=t;},Pd=function(e){e!==y(this,vt)&&(e===y(this,Ut)?q(this,Ut,y(this,Xt)[e]):X(this,G,vE).call(this,y(this,fr)[e],y(this,Xt)[e]),X(this,G,vE).call(this,y(this,vt),e),q(this,vt,e));},dn=function(e,t){var s,n;let i=false;if(y(this,ft)!==0){let o=y(this,ut).get(e);if(o!==void 0)if(i=true,y(this,ft)===1)X(this,G,TE).call(this,t);else {y(this,ga).call(this,o);let a=y(this,se)[o];if(X(this,G,Ne).call(this,a)?a.__abortController.abort(new Error("deleted")):(y(this,ei)||y(this,Yt))&&(y(this,ei)&&((s=y(this,jr))==null||s.call(this,a,e,t)),y(this,Yt)&&y(this,Tt)?.push([a,e,t])),y(this,ut).delete(e),y(this,He)[o]=void 0,y(this,se)[o]=void 0,o===y(this,vt))q(this,vt,y(this,fr)[o]);else if(o===y(this,Ut))q(this,Ut,y(this,Xt)[o]);else {let u=y(this,fr)[o];y(this,Xt)[u]=y(this,Xt)[o];let l=y(this,Xt)[o];y(this,fr)[l]=y(this,fr)[o];}Xd(this,ft)._--,y(this,Zr).push(o);}}if(y(this,Yt)&&y(this,Tt)?.length){let o=y(this,Tt),a;for(;a=o?.shift();)(n=y(this,qr))==null||n.call(this,...a);}return i},TE=function(e){var t,i;for(let s of X(this,G,hn).call(this,{allowStale:true})){let n=y(this,se)[s];if(X(this,G,Ne).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=y(this,He)[s];y(this,ei)&&((t=y(this,jr))==null||t.call(this,n,o,e)),y(this,Yt)&&y(this,Tt)?.push([n,o,e]);}}if(y(this,ut).clear(),y(this,se).fill(void 0),y(this,He).fill(void 0),y(this,pr)&&y(this,Jr)&&(y(this,pr).fill(0),y(this,Jr).fill(0)),y(this,Qr)&&y(this,Qr).fill(0),q(this,Ut,0),q(this,vt,0),y(this,Zr).length=0,q(this,Kr,0),q(this,ft,0),y(this,Yt)&&y(this,Tt)){let s=y(this,Tt),n;for(;n=s?.shift();)(i=y(this,qr))==null||i.call(this,...n);}};var J_=SE;var vi=class{constructor(e){L(this,"cache");L(this,"map",new Map);this.cache=new J_({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Rd=new vi({cacheSize:5});function UF(r){return function(e){eb.add(e,r);}}var eb;(s=>{function r(n,o){o||(o=n.name),Rd.get(o)&&N.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Rd.set(o,n);}s.add=r;function e(n){try{let o=Rd.get(n);if(!o){N.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){N.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Rd.values())}s.values=t;function i(n){return Rd.has(n)}s.has=i;})(eb||(eb={}));var $t=eb;var Ll=new vi({cacheSize:5});function LF(r){return function(e){tb.add(e,r);}}var tb;(n=>{function r(o,a){a||(a=o.name),Ll.get(a)&&N.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,Ll.set(a,o);}n.add=r;function e(o){try{let a=Ll.get(o);if(!a){N.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){N.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=Ll.get(o);if(!a){N.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){N.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(Ll.values())}n.values=i;function s(o){return Ll.has(o)}n.has=s;})(tb||(tb={}));var Ki=tb;async function rb(r){let e=NF(r.pixivnId);if(e)await e.setMemory(r);else throw new Error("[Pixi\u2019VN] The element "+r.pixivnId+" could not be created");return e}function NF(r){try{let e=$t.get(r);return e?new e:void 0}catch(e){N.error(`Error while getting CanvasElement ${r}`,e);return}}Ce();function EE(r){return "memory"in r?r.memory:r instanceof Rr?AE(r):r instanceof Ee?Md(r):xa(r)}function HF(r){return {width:r.width,height:r.height,isRenderGroup:r.isRenderGroup,blendMode:r.blendMode,tint:r.tint,alpha:r.alpha,angle:r.angle,renderable:r.renderable,rotation:r.rotation,scale:{x:r.scale.x,y:r.scale.y},pivot:{x:r.pivot.x,y:r.pivot.y},position:{x:r.position.x,y:r.position.y},skew:{x:r.skew.x,y:r.skew.y},visible:r.visible,x:r.x,y:r.y,boundsArea:r.boundsArea,cursor:r.cursor,eventMode:r.eventMode,interactive:r.interactive,interactiveChildren:r.interactiveChildren,hitArea:r.hitArea}}function YR(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function xa(r,e){let t=VF(r,Bl),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>EE(n)):[];return {pixivnId:t,elements:s,...HF(r)}}function Md(r){let e=xa(r),t=e.pixivnId??Rl,i=jR(r),s="textureAlias"in r?YR(r.texture,r.textureAlias):YR(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function AE(r){let e=xa(r),t=e.pixivnId??Ml,i=jR(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:zF(r.style),roundPixels:r.roundPixels,onEvents:i}}function VF(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function jR(r){return "onEvents"in r?r.onEvents:{}}function $R(r,e){if(typeof r!="object"||r===null)return r;N.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function zF(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:$R(r.stroke,"fill"),fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontVariant:r.fontVariant,fontWeight:r.fontWeight,leading:r.leading,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,padding:r.padding,stroke:$R(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var _a=class extends te{constructor(t){super(t);L(this,"pixivnId",Bl);L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Bl;}get memory(){return xa(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await Ti(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await rb(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ki.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):N.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};$t.add(_a,Bl);async function Ti(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}Ce();var Dd=class Dd{static init(e){Dd._getScreen=e.getScreen;}static get screen(){return Dd._getScreen()}};L(Dd,"_getScreen");var ir=Dd;function Zi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(ir.screen.width-t)+i+n*t+(s?t:0):e*(ir.screen.height-t)+i+n*t+(s?t:0)}function Si(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(ir.screen.width-t):(e-i-n*t-(s?t:0))/(ir.screen.height-t)}function Qi(r,e){return r==="width"?e*ir.screen.width:e*ir.screen.height}function Ei(r,e){return r==="width"?e/ir.screen.width:e/ir.screen.height}function rt(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.x*i-r.y*s,o=r.x*s+r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.y*s-r.x*i,o=r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.x*i+r.y*s,o=-r.x*s-r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.y*s-r.x*i,o=-r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}return {x:0,y:0}}function CE(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function Ai(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?e:i===90||i===270?t:Math.abs(e*Math.cos(i*Math.PI/180))+Math.abs(t*Math.sin(i*Math.PI/180))}function Ci(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?t:i===90||i===270?e:Math.abs(t*Math.cos(i*Math.PI/180))+Math.abs(e*Math.sin(i*Math.PI/180))}Ce();var WF=new RegExp(`(${MR.join("|")})$`);function Id(r){let e=et.cache.has(r)?et.get(r):null;return e instanceof C&&(r=e.source?.label||r),WF.test(r)}function ba(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===void 0?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===void 0?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.xPercentagePosition},delete r.xPercentagePosition):(r.percentagePosition.x=r.xPercentagePosition,delete r.xPercentagePosition)),r.yPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.yPercentagePosition},delete r.yPercentagePosition):(r.percentagePosition.y=r.yPercentagePosition,delete r.yPercentagePosition))),r)}Ce();Ce();async function Pi(r){if(r!=="EMPTY"){if(!r){N.error("Texture not found",r);return}if(et.cache.has(r)){let e=et.get(r);if(e)return e}return et.load(r).then(e=>{if(!e){N.error("Texture not found",r);return}if(!(e instanceof C)){N.error("File not is a file",r);return}return e}).catch(e=>{N.error("Error loading file",e);})}}Ce();var Ji=class r extends Ee{constructor(t){super(t);L(this,"pixivnId",Rl);L(this,"_textureAlias");L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Rl;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return Md(this)}set memory(t){}async setMemory(t){return this.memory=t,await kd(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ki.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):N.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}};$t.add(Ji,Rl);async function kd(r,e,t){let i=t?.ignoreTexture||false;if(await Ti(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await Pi(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&et.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await Pi(n);o&&(r.texture=o);}}let s=t?.half;if(s&&await s(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=Ki.get(o);a&&r.onEvent(n,a);}}var Pe=class r extends Ji{constructor(t,i){t=ba(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);L(this,"pixivnId",mE);L(this,"_loadIsStarted",false);L(this,"_align");L(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...Md(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Fd(this,t),this.reloadPosition();}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Pi(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,N.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return {x:Si("width",this.x,Ai(this),t.x,i.x<0,this.anchor.x),y:Si("height",this.y,Ci(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return Si("width",this.x,Ai(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return Si("height",this.y,Ci(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ei("width",this.x),y:Ei("height",this.y)}}get xPercentagePosition(){return Ei("width",this.x)}set xPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get yPercentagePosition(){return Ei("height",this.y)}set yPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);this._align.x!==void 0&&(super.x=Zi("width",this._align.x,Ai(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=Zi("height",this._align.y,Ci(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Qi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Qi("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};$t.add(Pe,mE);async function Fd(r,e,t){let i=t?.ignoreTexture||false;return e=ba(e),await kd(r,e,{half:async()=>{"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();},ignoreTexture:t?.ignoreTexture})}Ce();var Wt=class r extends Pe{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);L(this,"pixivnId",gE);L(this,"_looop",false);L(this,"_paused",false);L(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await PE(this,t)}static from(t,i){let s=Ee.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};$t.add(Wt,gE);async function PE(r,e,t){await Fd(r,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(r.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(r.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(r.paused=e.paused);}var Le=class extends _a{constructor(t,i=[]){t=ba(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);L(this,"pixivnId",$_);L(this,"_loadIsStarted",false);L(this,"_anchor");L(this,"_align");L(this,"_percentagePosition");t=ba(t),i&&i.forEach(a=>{let u;Id(a)?u=new Wt(void 0,a):u=new Pe(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:$_,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await wE(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,N.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new C}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return {x:Si("width",this.x,Ai(this),t.x,i.x<0,this.anchor.x),y:Si("height",this.y,Ci(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return Si("width",this.x,Ai(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);return Si("height",this.y,Ci(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ei("width",this.x),y:Ei("height",this.y)}}set xPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get xPercentagePosition(){return Ei("width",this.x)}set yPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get yPercentagePosition(){return Ei("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=rt(this.pivot,this.angle),i=rt(this.scale,this.angle);this._align.x!==void 0&&(super.x=Zi("width",this._align.x,Ai(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=Zi("height",this._align.y,Ci(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=Qi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=Qi("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};$t.add(Le,$_);async function wE(r,e,t){e=ba(e),Ti(r,e,{...t,end:async()=>{"anchor"in e&&e.anchor!==void 0&&(r.anchor=e.anchor),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}Ce();var ya=class extends Rr{constructor(t){super(t);L(this,"pixivnId",Ml);L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Ml;}get memory(){return AE(this)}set memory(t){}async setMemory(t){return this.memory=t,await BE(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Ki.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):N.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};$t.add(ya,Ml);async function BE(r,e){if(await Ti(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=Ki.get(i);s&&r.onEvent(t,s);}}var sr=class{constructor(e,t,i){L(this,"id","ticker_id_not_set");L(this,"args");L(this,"duration");L(this,"priority");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}fn(e,t,i,s){throw new Error("[Pixi\u2019VN] The method TickerBase.fn() must be overridden")}onEndOfTicker(e,t,i){let s="aliasToRemoveAfter"in i&&i.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in i&&i.tickerAliasToResume||[];typeof n=="string"&&(n=[n]),P.onEndOfTicker(t,{aliasToRemoveAfter:s,tickerAliasToResume:n});}};var Nl=new vi({cacheSize:5});function XF(r){return function(e){ib.add(e,r);}}var ib;(n=>{function r(o,a){a||(a=o.name),Nl.get(a)&&N.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,Nl.set(a,o);}n.add=r;function e(o){try{let a=Nl.get(o);if(!a){N.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){N.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=Nl.get(o);if(!c){N.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){N.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(Nl.values())}n.values=i;function s(o){return Nl.has(o)}n.has=s;})(ib||(ib={}));var nr=ib;var Hl="aliasToRemoveAfter";var Od=class{get app(){return w.app}get gameLayer(){return w.gameLayer}get isInitialized(){return w._isInitialized}get htmlLayout(){return w.htmlLayers[0]}set htmlLayout(e){this.addHtmlLayer("ui",e);}get canvasWidth(){return w.canvasWidth}get canvasHeight(){return w.canvasHeight}set canvasWidth(e){w.canvasWidth=e;}set canvasHeight(e){w.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await w.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await w.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){this.addHtmlLayer("ui",e);}get children(){return w.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {N.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {N.error(`Canvas element ${e} not found`);return}}e instanceof te&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof Wt?await PE(t,e,{ignoreTexture:true}):t instanceof Pe?await Fd(t,e,{ignoreTexture:true}):t instanceof Ji?await kd(t,e,{ignoreTexture:true}):t instanceof ya?await BE(t,e):t instanceof Le?await wE(t,e):t instanceof te&&await Ti(t,e);}transferTickers(e,t,i="move"){w._currentTickersSequence[e]&&(i==="move"?w._currentTickersSequence[t]=Gt(w._currentTickersSequence[e]):i==="duplicate"&&(w._currentTickersSequence[t]=Gt(w._currentTickersSequence[e]))),Object.entries(w._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.canvasElementAliases.includes(e)&&(i==="move"?n.canvasElementAliases=n.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&n.canvasElementAliases.find(o=>o===e)&&n.canvasElementAliases.push(t),n.args.hasOwnProperty(Hl))){let o=n.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?n.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(n.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(w._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),w._currentTickersSequence[t]&&Object.keys(w._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&w._currentTickersSequence[e]&&Object.keys(w._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===Yr){N.error(`The alias ${Yr} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?N.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===Yr){N.error(`The alias ${Yr} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}find(e){if(e===Yr)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren(),this.removeAllTickers();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return w._currentTickers}get currentTickersSteps(){return w._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!nr.getInstance(i,t.args,t.duration,t.priority)){N.error(`Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:Gt(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=w.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{w.removeTickerTimeoutInfo(o),w._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:Hl in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);w.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){w._currentTickers[e]=t,t.fn=s=>{let n=w._currentTickers[e];if(n){let o=n.canvasElementAliases;if(t.createdByTicketSteps){if(this.isTickerPaused(t.createdByTicketSteps.canvasElementAlias,t.createdByTicketSteps.id))return}else o=o.filter(a=>!this.isTickerPaused(a,e));i?.fn(s,n.args,o,e);}},this.app.ticker.add(t.fn,void 0,t.priority);}pushEndOfTicker(e,t,i){t.onEndOfTicker=()=>{i.onEndOfTicker(t.canvasElementAliases,e,t.args);};}addTickersSequence(e,t,i=0){if(t.length==0){N.warn("The steps of the tickers is empty");return}e in w._currentTickersSequence||(w._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Cd||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:Gt(o.args),duration:o.duration})},n=w.generateTickerId(s);return w._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!w._currentTickersSequence[e]||!w._currentTickersSequence[e][t])return;let i=w._currentTickersSequence[e][t].steps[w._currentTickersSequence[e][t].currentStepNumber];if(i===Cd&&(i=w._currentTickersSequence[e][t].steps[0],w._currentTickersSequence[e][t].currentStepNumber=0,i===Cd)){N.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=w._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),w.removeTickerTimeoutInfo(u);},i.duration*1e3);w.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=nr.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){N.error(`Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:Gt(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=w.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=w._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Hl in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),w.removeTickerTimeoutInfo(u);},s.duration*1e3);w.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(w._currentTickersSequence[e]&&w._currentTickersSequence[e][t]){let i=w._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,w._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&w._currentTickersSequence[e]&&w._currentTickersSequence[e][t]&&(delete w._currentTickersSequence[e][t],Object.entries(w._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=w._currentTickers[e],s=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!s&&i.duration==null&&i.createdByTicketSteps&&this.nextTickerStep(i.createdByTicketSteps.canvasElementAlias,i.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(w._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),w._currentTickersSequence[s]&&delete w._currentTickersSequence[s],w.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof sr?i=t.id:i=t.prototype.id,e.forEach(s=>{w._currentTickersSequence[s]&&Object.entries(w._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete w._currentTickersSequence[s][n];});}),Object.entries(w._currentTickers).forEach(([s,n])=>{n.id===i&&(w._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(w._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(w._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(w._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Hl in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(w._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete w._currentTickersSequence[e];}),Object.entries(w._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&w.removeTickerTimeout(e);});}removeAllTickers(){w._currentTickersSequence={},Object.keys(w._currentTickers).forEach(e=>{this.removeTicker(e);}),w._currentTickers={};for(let e in w._currentTickersTimeouts)w.removeTickerTimeout(e);w._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},w._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=w._currentTickers[t];if(i){if(i.args.hasOwnProperty(Hl)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete w._currentTickers[t];}});}pauseTicker(e,t={}){let i=w._tickersOnPause[e];if(!i){w._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?w._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:w._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?w._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:w._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete w._tickersOnPause[t];});}isTickerPaused(e,t){let i=w._tickersOnPause[e];if(i){if(t){if("tickerIdsIncluded"in i&&i.tickerIdsIncluded)return i.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in i&&i.tickerIdsExcluded)return !i.tickerIdsExcluded.includes(t)}return true}return false}completeTickerOnStepEnd(e){e.alias?w._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):w._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=w._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Cd)?N.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(s=>{if(typeof s=="object"&&"ticker"in s){let n=nr.getInstance(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=w._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===Yr){N.error(`The alias ${Yr} is reserved`);return}return t.label=e,w.app.stage.addChild(t)}getLayer(e){return w.app.stage.getChildByLabel(e)}removeLayer(e){w.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return w.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return w.removeHtmlLayer(e)}getHtmlLayer(e){return w.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=EE(t));}),{tickers:Gt(w.currentTickersWithoutCreatedBySteps),tickersSteps:Gt(w._currentTickersSequence),elements:Gt(e),stage:Gt(xa(this.gameLayer)),elementAliasesOrder:Gt(w.childrenAliasesOrder),tickersOnPause:Gt(w._tickersOnPause),tickersToCompleteOnStepEnd:Gt(w._tickersToCompleteOnStepEnd)}}async restore(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,s=e.elementAliasesOrder,n=s.filter(a=>i[a]).map(a=>rb(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),w.childrenAliasesOrder.push(l);});}else {N.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Ti(this.gameLayer,e.stage,{ignoreScale:!0}):N.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([s,n])=>{let o=n.canvasElementAliases,a=nr.getInstance(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else N.error(`Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{w._currentTickersSequence[s]=n,Object.keys(n).forEach(o=>{this.runTickersSequence(s,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(s=>{let n=i[s];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(i[s].tickerIdsExcluded=n.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(i[s].tickerIdsIncluded=n.tickerIdsIncluded.map(o=>t[o]||o));}),w._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds.map(o=>({id:t[o.id]||o.id})),n=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));w._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){N.error("Error importing data",t);}}};var sb=class{constructor(){L(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var nb=class{constructor(){L(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};Ce();Ce();function pn(r){return (r instanceof Pe||r instanceof Le)&&r.haveEmptyTexture?false:!(r instanceof Ee&&r.texture?.label=="EMPTY")}function mn(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=RE(r[e],t):t.type==="exponential"&&(r[e]=ME(r[e],t)):r[e]!==void 0&&typeof r[e]=="object"&&r[e].haveOwnProperty("x")&&r[e].haveOwnProperty("y")&&typeof r[e].x=="number"&&typeof r[e].y=="number"&&(t.type==="linear"?(r[e].x=RE(r[e].x,t),r[e].y=RE(r[e].y,t)):t.type==="exponential"&&(r[e].x=ME(r[e].x,t),r[e].y=ME(r[e].y,t))));}function RE(r,e){let{limit:t,amt:i}=e;if(t!==void 0){if(r>t&&i>0)return t;if(r<t&&i<0)return t}return r+i}function ME(r,e){let{limit:t}=e;if(t!==void 0){if(r>t&&e.percentage>0)return t;if(r<t&&e.percentage<0)return t}return r+r*e.percentage}var YF=5,es=class extends sr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=YF:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=P.find(c);return !(!h||o&&!pn(h))}).forEach(c=>{let h=P.find(c);if(h&&h instanceof te){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.onEndOfTicker(c,s,t);return}else if(n==="hide"&&h.alpha<=l){this.onEndOfTicker(c,s,t);return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){N.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,s,t,{editAlpha:false});return}}}),a&&mn(t,"speed",a);}onEndOfTicker(e,t,i,s={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=P.find(n);if(o&&s.editAlpha){let a=this.getLimit(i);o.alpha=a;}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}};nr.add(es);Ce();var $F=10;function jF(r,e){let t=Gt(r.destination);if(t.type==="align"){let i,s;e instanceof Ee&&(i=e.anchor.x,s=e.anchor.y);let n=rt(e.pivot,e.angle),o=rt(e.scale,e.angle);t.x=Zi("width",t.x,Ai(e),n.x,o.x<0,i),t.y=Zi("height",t.y,Ci(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=Qi("width",t.x),t.y=Qi("height",t.y)),t}var gr=class extends sr{fn(e,t,i,s){t.speed===void 0&&(t.speed=$F);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=P.find(u);return !(!l||o&&!pn(l))}).forEach(u=>{let l=P.find(u);if(l&&l instanceof te){let c=jF(t,l),h=c.x-l.x,d=c.y-l.y,p=h>0?1:-1,_=d>0?1:-1,b,x;if(typeof n=="number"){let m=this.speedConvert(n);h===0||d===0?b=x=m:(b=Math.abs(h/(h+d))*m,x=Math.abs(d/(h+d))*m);}else b=this.speedConvert(n.x),x=this.speedConvert(n.y);if(b>0){l.x+=p*b*e.deltaTime;let m=c.x-l.x;(p<0&&m>0||p>0&&m<0)&&(l.x=c.x);}if(x>0){l.y+=_*x*e.deltaTime;let m=c.y-l.y;(_<0&&m>0||_>0&&m<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.onEndOfTicker(u,s,t);return}else if(b<1e-5&&x<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){N.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,s,t,{editPosition:false});return}}}),a&&mn(t,"speed",a);}onEndOfTicker(e,t,i,s={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=P.find(n);if(o){let a=i.destination;s.editPosition&&(o instanceof Pe||o instanceof Le?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};nr.add(gr);Ce();var qF=1,Gd=class extends sr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=qF);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=P.find(l);return !(!c||t.startOnlyIfHaveTexture&&!pn(c))}).forEach(l=>{let c=P.find(l);if(c&&c instanceof te&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.onEndOfTicker(l,s,t)):!n&&c.angle<=a&&(c.angle=a,this.onEndOfTicker(l,s,t))),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){N.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,s,t,{editRotation:false});return}}),o&&mn(t,"speed",o);}onEndOfTicker(e,t,i,s={editRotation:true}){let{limit:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=P.find(o);a&&s.editRotation&&n!==void 0&&(a.angle=n);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};nr.add(Gd);Ce();var KF=10,gn=class extends sr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=KF);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(d=>{let p=P.find(d);return !(!p||a&&!pn(p))}).forEach(d=>{let p=P.find(d);if(p&&p instanceof te){if(o==="zoom"&&(p.scale.x<h.x||p.scale.y<h.y)?(p.scale.x+=l*e.deltaTime,p.scale.y+=c*e.deltaTime):o==="unzoom"&&(p.scale.x>h.x||p.scale.y>h.y)&&(p.scale.x-=l*e.deltaTime,p.scale.y-=c*e.deltaTime),o==="zoom"){if(p.scale.x>h.x&&(p.scale.x=h.x),p.scale.y>h.y&&(p.scale.y=h.y),p.scale.x>=h.x&&p.scale.y>=h.y){this.onEndOfTicker(d,s,t);return}}else if(o==="unzoom"&&(p.scale.x<h.x&&(p.scale.x=h.x),p.scale.y<h.y&&(p.scale.y=h.y),p.scale.x<=h.x&&p.scale.y<=h.y)){this.onEndOfTicker(d,s,t);return}if((l<1e-5&&c<1e-5||l<1e-5&&p.scale.y==h.y||c<1e-5&&p.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){N.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(d,s,t,{editScale:false});return}}}),u&&mn(t,"speed",u);}speedConvert(e){return e/600}onEndOfTicker(e,t,i,s={editScale:true}){let{isZoomInOut:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=P.find(o);if(a){if(s.editScale){let u=this.getLimit(i);a.scale.x=u.x,a.scale.y=u.y;}if(n){let{pivot:u,position:l}=n;a.pivot=u.x,a.position=l;}}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}};nr.add(gn);async function ZF(r,e={},t){let i=P.find(r);if(!i){N.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},n=e.speed||20,o=e.speedProgression||void 0,a=e.startOnlyIfHaveTexture||false,u=e.type||"horizontal",l=e.maximumShockSize||10,c=(e.shocksNumber||10)-1;if(c<2){N.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),d=Math.ceil(c/2),p=[];for(let x=0;x<h;x++){let m={x:s.x,y:s.y},v=l*(x+1)/h;u==="horizontal"?x%2!==0?m.x=s.x+v:m.x=s.x-v:x%2!==0?m.y=s.y+v:m.y=s.y-v,p.push(new gr({destination:m,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let _=h%2===0;for(let x=d;x>0;x--){let m={x:s.x,y:s.y},v=l*(x+1)/(d-1);u==="horizontal"?x%2===0&&!_||x%2!==0&&_?m.x=s.x-v:m.x=s.x+v:x%2===0&&!_||x%2!==0&&_?m.y=s.y-v:m.y=s.y+v,p.push(new gr({destination:m,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}p.push(new gr({destination:s,speed:n,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let b=P.addTickersSequence(r,p);b&&(P.completeTickerOnStepEnd({id:b,alias:r}),P.pauseTicker(r,{tickerIdsExcluded:[b]}));}function ob(r,e,t){let i=new Le(t,e);return P.add(r,i),i}async function QF(r,e,t){let i=new Le(t,e);return await i.load(),P.add(r,i),i}Ce();function ab(r,e,t){if(!e)if(et.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return P.add(r,i),i}async function JF(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Pi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function eO(r,e,t){if(!e)if(et.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return await i.load(),P.add(r,i),i}Ce();function ub(r,e,t){if(!e)if(et.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Wt(t,e);return P.add(r,i),i}async function tO(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Pi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function rO(r,e,t){if(!e)if(et.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Wt(t,e);return await i.load(),P.add(r,i),i}function Ud(r,e){if(typeof e=="string")return Id(e)?ub(r,e):ab(r,e);if(Array.isArray(e))return ob(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Id(e.value)?ub(r,e.value,e.options):ab(r,e.value,e.options);if(Array.isArray(e.value))return ob(r,e.value,e.options)}return P.add(r,e),e}async function qR(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(P.find(r)&&(a=r+"_temp_disolve",P.editAlias(r,a)),e=Ud(r,e),a&&P.copyCanvasElementProperty(a,r),a&&P.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=lb(a,t,i);c&&(o.push(...c),P.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new es({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},void 0,i),l=P.addTicker(r,u);if(l&&(s&&P.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function lb(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:s=[]}=e;typeof r=="string"&&(r=[r]),typeof s=="string"&&(s=[s]),s.push(...r);let n=new es({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},void 0,t),o=P.addTicker(r,n);if(o)return i&&P.completeTickerOnStepEnd({id:o}),[o]}async function iO(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!P.find(r))return qR(r,e,t,i);let a=r+"_temp_fade";P.editAlias(r,a),n.push(a),e=Ud(r,e),a&&P.copyCanvasElementProperty(a,r),a&&P.transferTickers(a,r,"duplicate"),e.alpha=0;let u=lb(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new es({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,i),c=P.addTicker(r,l);if(c&&(s&&P.completeTickerOnStepEnd({id:c}),o.push(c),P.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function sO(r,e={},t){return lb(r,e,t)}async function nO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;P.find(r)&&(c=r+"_temp_movein",P.editAlias(r,c)),e=Ud(r,e),c&&P.copyCanvasElementProperty(c,r),c&&P.transferTickers(c,r,"move");let h;e instanceof Pe||e instanceof Le?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d;switch(c&&(u?(d=DE(c,t,i),d&&(l.push(...d),o.push(c))):a.push(c)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),c&&P.pauseTicker(c,{tickerIdsIncluded:d}),s){case "up":e.y=P.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=P.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new gr({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),_=P.addTicker(r,p);if(_&&(P.pauseTicker(r,{tickerIdsExcluded:[_]}),n&&P.completeTickerOnStepEnd({id:_}),l.push(_)),l.length>0)return l}function DE(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=P.find(r);if(!o){N.warn("The canvas component is not found.");return}let a={x:o.x,y:o.y};switch(i){case "up":a.y=-o.height;break;case "down":a.y=P.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=P.canvasWidth+o.width;break}let u=new gr({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,t),l=P.addTicker(r,u);if(l)return P.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&P.completeTickerOnStepEnd({id:l}),[l]}async function oO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=P.find(r);c&&(l=r+"_temp_zoom",P.editAlias(r,l)),e=Ud(r,e),l&&P.copyCanvasElementProperty(l,r),l&&P.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=P.canvasHeight-e.y,e.pivot.x=P.canvasWidth/2-e.x,e.y=P.canvasHeight,e.x=P.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=P.canvasWidth/2-e.x,e.y=0,e.x=P.canvasWidth/2):s=="left"?(e.pivot.x=P.canvasWidth-e.x,e.pivot.y=P.canvasHeight/2-e.y,e.x=P.canvasWidth,e.y=P.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=P.canvasHeight/2-e.y,e.x=0,e.y=P.canvasHeight/2),e.pivot=CE(e.pivot,e.angle),e.scale.set(0);let h=c?{pivot:{x:c.pivot.x,y:c.pivot.y},position:{x:c.x,y:c.y}}:void 0;if(l){if(t.removeOldComponentWithZoomOut){let _=KR(l,t,i);_&&(u.push(..._),o.push(l));}else a.push(l);P.pauseTicker(l);}o.push(r);let d=new gn({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),p=P.addTicker(r,d);if(p&&(P.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&P.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function KR(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=P.find(r);if(!o){N.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=P.canvasHeight-o.y,o.pivot.x=P.canvasWidth/2-o.x,o.y=P.canvasHeight,o.x=P.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=P.canvasWidth/2-o.x,o.y=0,o.x=P.canvasWidth/2):i=="left"?(o.pivot.x=P.canvasWidth-o.x,o.pivot.y=P.canvasHeight/2-o.y,o.x=P.canvasWidth,o.y=P.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=P.canvasHeight/2-o.y,o.x=0,o.y=P.canvasHeight/2),o.pivot=CE(o.pivot,o.angle),o.scale.set(1);let a=new gn({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},void 0,t),u=P.addTicker(r,a);if(u)return P.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&P.completeTickerOnStepEnd({id:u}),[u]}async function aO(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;P.find(r)&&(u=r+"_temp_push",P.editAlias(r,u)),e=Ud(r,e),u&&P.copyCanvasElementProperty(u,r),u&&P.transferTickers(u,r,"move");let l;if((e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-P.canvasHeight+e.y:s=="down"?e.y=P.canvasHeight+e.y:s=="left"?e.x=-P.canvasWidth+e.x:s=="right"&&(e.x=P.canvasWidth+e.x),u){let d=ZR(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);d&&a.push(...d);}o.push(r);let c=new gr({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=P.addTicker(r,c);if(h&&(P.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&P.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function ZR(r,e={direction:"right"},t){return DE(r,e,t)}var P=new Od;ir.init({getScreen:()=>P.screen});exports.CanvasBaseItem=nb;exports.CanvasEvent=sb;exports.CanvasManagerStatic=w;exports.Container=_a;exports.FadeAlphaTicker=es;exports.ImageContainer=Le;exports.ImageSprite=Pe;exports.MoveTicker=gr;exports.RegisteredCanvasComponents=$t;exports.RegisteredEvents=Ki;exports.RegisteredTickers=nr;exports.RotateTicker=Gd;exports.Sprite=Ji;exports.Text=ya;exports.TickerBase=sr;exports.VideoSprite=Wt;exports.ZoomTicker=gn;exports.addImage=ab;exports.addImageCointainer=ob;exports.addVideo=ub;exports.canvas=P;exports.canvasComponentDecorator=UF;exports.eventDecorator=LF;exports.getTexture=Pi;exports.loadImage=JF;exports.loadVideo=tO;exports.moveIn=nO;exports.moveOut=DE;exports.pushIn=aO;exports.pushOut=ZR;exports.removeWithDissolve=lb;exports.removeWithFade=sO;exports.shakeEffect=ZF;exports.showImage=eO;exports.showImageContainer=QF;exports.showVideo=rO;exports.showWithDissolve=qR;exports.showWithFade=iO;exports.tickerDecorator=XF;exports.zoomIn=oO;exports.zoomOut=KR;
|