vizor_2d 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ /*! For license information please see vizor_2d.min.js.LICENSE.txt */
2
+ var t,e,r={8133:t=>{t.exports=function(t){var n=[];return t.replace(r,(function(t,r,s){var o=r.toLowerCase();for(s=function(t){var e=t.match(i);return e?e.map(Number):[]}(s),"m"==o&&s.length>2&&(n.push([r].concat(s.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(s.length==e[o])return s.unshift(r),n.push(s);if(s.length<e[o])throw new Error("malformed path data");n.push([r].concat(s.splice(0,e[o])))}})),n};var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi;var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},5585:t=>{var e=Object.prototype.hasOwnProperty,r="~";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function s(t,e,i,s,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,s||t,o),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,i,n=[];if(0===this._eventsCount)return n;for(i in t=this._events)e.call(t,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,o=new Array(s);n<s;n++)o[n]=i[n].fn;return o},a.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,n,s,o){var a=r?r+t:t;if(!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,n),!0;case 5:return u.fn.call(u.context,e,i,n,s),!0;case 6:return u.fn.call(u.context,e,i,n,s,o),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var d,f=u.length;for(l=0;l<f;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,i);break;case 4:u[l].fn.call(u[l].context,e,i,n);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];u[l].fn.apply(u[l].context,h)}}return!0},a.prototype.on=function(t,e,r){return s(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return s(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,i,n){var s=r?r+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||n&&!a.once||i&&a.context!==i||o(this,s);else{for(var h=0,l=[],u=a.length;h<u;h++)(a[h].fn!==e||n&&!a[h].once||i&&a[h].context!==i)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&o(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},2406:(t,e,r)=>{r.d(e,{z:()=>i});const i=(t,e,r=!1)=>(Array.isArray(t)||(t=[t]),e?t.map((t=>"string"==typeof t||r?e(t):t)):t)},2577:(t,e,r)=>{r.d(e,{Q:()=>I});var i={grad:.9,turn:360,rad:360/(2*Math.PI)},n=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},s=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},o=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),t>r?r:t>e?t:e},a=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},h=function(t){return{r:o(t.r,0,255),g:o(t.g,0,255),b:o(t.b,0,255),a:o(t.a)}},l=function(t){return{r:s(t.r),g:s(t.g),b:s(t.b),a:s(t.a,3)}},u=/^#([0-9a-f]{3,8})$/i,c=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},d=function(t){var e=t.r,r=t.g,i=t.b,n=t.a,s=Math.max(e,r,i),o=s-Math.min(e,r,i),a=o?s===e?(r-i)/o:s===r?2+(i-e)/o:4+(e-r)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:n}},f=function(t){var e=t.h,r=t.s,i=t.v,n=t.a;e=e/360*6,r/=100,i/=100;var s=Math.floor(e),o=i*(1-r),a=i*(1-(e-s)*r),h=i*(1-(1-e+s)*r),l=s%6;return{r:255*[i,a,o,o,h,i][l],g:255*[h,i,i,a,o,o][l],b:255*[o,o,h,i,i,a][l],a:n}},p=function(t){return{h:a(t.h),s:o(t.s,0,100),l:o(t.l,0,100),a:o(t.a)}},m=function(t){return{h:s(t.h),s:s(t.s),l:s(t.l),a:s(t.a,3)}},y=function(t){return f((r=(e=t).s,{h:e.h,s:(r*=((i=e.l)<50?i:100-i)/100)>0?2*r/(i+r)*100:0,v:i+r,a:e.a}));var e,r,i},g=function(t){return{h:(e=d(t)).h,s:(n=(200-(r=e.s))*(i=e.v)/100)>0&&n<200?r*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:e.a};var e,r,i,n},x=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,w={string:[[function(t){var e=u.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?s(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?s(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=b.exec(t)||_.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:h({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=x.exec(t)||v.exec(t);if(!e)return null;var r,n,s=p({h:(r=e[1],n=e[2],void 0===n&&(n="deg"),Number(r)*(i[n]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return y(s)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,i=t.b,s=t.a,o=void 0===s?1:s;return n(e)&&n(r)&&n(i)?h({r:Number(e),g:Number(r),b:Number(i),a:Number(o)}):null},"rgb"],[function(t){var e=t.h,r=t.s,i=t.l,s=t.a,o=void 0===s?1:s;if(!n(e)||!n(r)||!n(i))return null;var a=p({h:Number(e),s:Number(r),l:Number(i),a:Number(o)});return y(a)},"hsl"],[function(t){var e=t.h,r=t.s,i=t.v,s=t.a,h=void 0===s?1:s;if(!n(e)||!n(r)||!n(i))return null;var l=function(t){return{h:a(t.h),s:o(t.s,0,100),v:o(t.v,0,100),a:o(t.a)}}({h:Number(e),s:Number(r),v:Number(i),a:Number(h)});return f(l)},"hsv"]]},S=function(t,e){for(var r=0;r<e.length;r++){var i=e[r][0](t);if(i)return[i,e[r][1]]}return[null,void 0]},M=function(t){return"string"==typeof t?S(t.trim(),w.string):"object"==typeof t&&null!==t?S(t,w.object):[null,void 0]},A=function(t,e){var r=g(t);return{h:r.h,s:o(r.s+100*e,0,100),l:r.l,a:r.a}},C=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},T=function(t,e){var r=g(t);return{h:r.h,s:r.s,l:o(r.l+100*e,0,100),a:r.a}},P=function(){function t(t){this.parsed=M(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return null!==this.parsed},t.prototype.brightness=function(){return s(C(this.rgba),2)},t.prototype.isDark=function(){return C(this.rgba)<.5},t.prototype.isLight=function(){return C(this.rgba)>=.5},t.prototype.toHex=function(){return e=(t=l(this.rgba)).r,r=t.g,i=t.b,o=(n=t.a)<1?c(s(255*n)):"","#"+c(e)+c(r)+c(i)+o;var t,e,r,i,n,o},t.prototype.toRgb=function(){return l(this.rgba)},t.prototype.toRgbString=function(){return e=(t=l(this.rgba)).r,r=t.g,i=t.b,(n=t.a)<1?"rgba("+e+", "+r+", "+i+", "+n+")":"rgb("+e+", "+r+", "+i+")";var t,e,r,i,n},t.prototype.toHsl=function(){return m(g(this.rgba))},t.prototype.toHslString=function(){return e=(t=m(g(this.rgba))).h,r=t.s,i=t.l,(n=t.a)<1?"hsla("+e+", "+r+"%, "+i+"%, "+n+")":"hsl("+e+", "+r+"%, "+i+"%)";var t,e,r,i,n},t.prototype.toHsv=function(){return t=d(this.rgba),{h:s(t.h),s:s(t.s),v:s(t.v),a:s(t.a,3)};var t},t.prototype.invert=function(){return k({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),k(A(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),k(A(this.rgba,-t))},t.prototype.grayscale=function(){return k(A(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),k(T(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),k(T(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?k({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):s(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=g(this.rgba);return"number"==typeof t?k({h:t,s:e.s,l:e.l,a:e.a}):s(e.h)},t.prototype.isEqual=function(t){return this.toHex()===k(t).toHex()},t}(),k=function(t){return t instanceof P?t:new P(t)},E=[];!function(t){t.forEach((function(t){E.indexOf(t)<0&&(t(P,w),E.push(t))}))}([function(t,e){var r={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 n in r)i[r[n]]=n;var s={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var n,o,a=i[this.toHex()];if(a)return a;if(null==e?void 0:e.closest){var h=this.toRgb(),l=1/0,u="black";if(!s.length)for(var c in r)s[c]=new t(r[c]).toRgb();for(var d in r){var f=(n=h,o=s[d],Math.pow(n.r-o.r,2)+Math.pow(n.g-o.g,2)+Math.pow(n.b-o.b,2));f<l&&(l=f,u=d)}return u}},e.string.push([function(e){var i=e.toLowerCase(),n="transparent"===i?"#0000":r[i];return n?new t(n).toRgb():null},"name"])}]);const R=class t{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(e){if(e instanceof t)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(null===e)throw new Error("Cannot set Color#value to null");null!==this._value&&this._isSourceEqual(this._value,e)||(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?{...t}:t}_isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if("number"===r||"string"===r||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every(((t,r)=>t===e[r]));if(null!==t&&null!==e){const r=Object.keys(t),i=Object.keys(e);return r.length===i.length&&r.every((r=>t[r]===e[r]))}return t===e}toRgba(){const[t,e,r,i]=this._components;return{r:t,g:e,b:r,a:i}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,i]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(255*e),t[1]=Math.round(255*r),t[2]=Math.round(255*i),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,r,i,n]=this._components;return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,r,i]=this._components;return t[0]=e,t[1]=r,t[2]=i,t}toNumber(){return this._int}toBgrNumber(){const[t,e,r]=this.toUint8RgbArray();return(r<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(e){const[r,i,n,s]=t._temp.setValue(e)._components;return this._components[0]*=r,this._components[1]*=i,this._components[2]*=n,this._components[3]*=s,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let r=this._int>>16&255,i=this._int>>8&255,n=255&this._int;return e&&(r=r*t+.5|0,i=i*t+.5|0,n=n*t+.5|0),(255*t<<24)+(r<<16)+(i<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(e){let r,i,n,s;if(("number"==typeof e||e instanceof Number)&&e>=0&&e<=16777215){r=(e>>16&255)/255,i=(e>>8&255)/255,n=(255&e)/255,s=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[r,i,n,s=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[r,i,n,s=255]=e,r/=255,i/=255,n/=255,s/=255;else if("string"==typeof e||"object"==typeof e){if("string"==typeof e){const r=t.HEX_PATTERN.exec(e);r&&(e=`#${r[2]}`)}const o=k(e);o.isValid()&&(({r,g:i,b:n,a:s}=o.rgba),r/=255,i/=255,n/=255)}if(void 0===r)throw new Error(`Unable to convert color ${e}`);this._components[0]=r,this._components[1]=i,this._components[2]=n,this._components[3]=s,this._refreshInt()}_refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*r|0)}_clamp(t,e=0,r=1){return"number"==typeof t?Math.min(Math.max(t,e),r):(t.forEach(((i,n)=>{t[n]=Math.min(Math.max(i,e),r)})),t)}static isColorLike(e){return"number"==typeof e||"string"==typeof e||e instanceof Number||e instanceof t||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||void 0!==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}};R.shared=new R,R._temp=new R,R.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let I=R},1761:(t,e,r)=>{r.d(e,{e:()=>n});let i={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")};const n={get:()=>i,set(t){i=t}}},8507:(t,e,r)=>{r.d(e,{Ag:()=>i,XO:()=>o});var i=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(i||{});const n=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={..."object"!=typeof t.extension?{type:t.extension}:t.extension,ref:t}}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t={...t}).type&&(t.type=[t.type]),t},s=(t,e)=>n(t).priority??e,o={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(n).forEach((t=>{t.type.forEach((e=>this._removeHandlers[e]?.(t)))})),this},add(...t){return t.map(n).forEach((t=>{t.type.forEach((e=>{const r=this._addHandlers,i=this._queue;r[e]?r[e]?.(t):(i[e]=i[e]||[],i[e]?.push(t))}))})),this},handle(t,e,r){const i=this._addHandlers,n=this._removeHandlers;if(i[t]||n[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,n[t]=r;const s=this._queue;return s[t]&&(s[t]?.forEach((t=>e(t))),delete s[t]),this},handleByMap(t,e){return this.handle(t,(t=>{t.name&&(e[t.name]=t.ref)}),(t=>{t.name&&delete e[t.name]}))},handleByNamedList(t,e,r=-1){return this.handle(t,(t=>{e.findIndex((e=>e.name===t.name))>=0||(e.push({name:t.name,value:t.ref}),e.sort(((t,e)=>s(e.value,r)-s(t.value,r))))}),(t=>{const r=e.findIndex((e=>e.name===t.name));-1!==r&&e.splice(r,1)}))},handleByList(t,e,r=-1){return this.handle(t,(t=>{e.includes(t.ref)||(e.push(t.ref),e.sort(((t,e)=>s(e,r)-s(t,r))))}),(t=>{const r=e.indexOf(t.ref);-1!==r&&e.splice(r,1)}))},mixin(t,...e){for(const r of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(r))}}},9049:(t,e,r)=>{r.d(e,{a:()=>i});class i{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}},9313:(t,e,r)=>{r.d(e,{u:()=>s});var i=r(1652),n=r(5101);class s{constructor(t=1,e=0,r=0,i=1,n=0,s=0){this.array=null,this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=s}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,r,i,n,s){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=s,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(t,e){e=e||new n.b;const r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e}applyInverse(t,e){e=e||new n.b;const r=this.a,i=this.b,s=this.c,o=this.d,a=this.tx,h=this.ty,l=1/(r*o+s*-i),u=t.x,c=t.y;return e.x=o*l*u+-s*l*c+(h*s-a*o)*l,e.y=r*l*c+-i*l*u+(-h*r+a*i)*l,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,s=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=s*e-this.ty*r,this.ty=s*r+this.ty*e,this}append(t){const e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this}appendFrom(t,e){const r=t.a,i=t.b,n=t.c,s=t.d,o=t.tx,a=t.ty,h=e.a,l=e.b,u=e.c,c=e.d;return this.a=r*h+i*u,this.b=r*l+i*c,this.c=n*h+s*u,this.d=n*l+s*c,this.tx=o*h+a*u+e.tx,this.ty=o*l+a*c+e.ty,this}setTransform(t,e,r,i,n,s,o,a,h){return this.a=Math.cos(o+h)*n,this.b=Math.sin(o+h)*n,this.c=-Math.sin(o-a)*s,this.d=Math.cos(o-a)*s,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,r=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,r=this.b,n=this.c,s=this.d,o=t.pivot,a=-Math.atan2(-n,s),h=Math.atan2(r,e),l=Math.abs(a+h);return l<1e-5||Math.abs(i.TO-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(n*n+s*s),t.position.x=this.tx+(o.x*e+o.y*n),t.position.y=this.ty+(o.x*r+o.y*s),t}invert(){const t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,s=t*i-e*r;return this.a=i/s,this.b=-e/s,this.c=-r/s,this.d=t/s,this.tx=(r*this.ty-i*n)/s,this.ty=-(t*this.ty-e*n)/s,this}isIdentity(){return 1===this.a&&0===this.b&&0===this.c&&1===this.d&&0===this.tx&&0===this.ty}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new s;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}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 a.identity()}static get shared(){return o.identity()}}const o=new s,a=new s},2079:(t,e,r)=>{r.d(e,{E:()=>c});var i=r(9313);const n=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],s=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],o=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],a=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],h=[],l=[],u=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];h.push(e);for(let r=0;r<16;r++){const i=u(n[t]*n[r]+o[t]*s[r]),h=u(s[t]*n[r]+a[t]*s[r]),l=u(n[t]*o[r]+o[t]*a[r]),c=u(s[t]*o[r]+a[t]*a[r]);for(let t=0;t<16;t++)if(n[t]===i&&s[t]===h&&o[t]===l&&a[t]===c){e.push(t);break}}}for(let t=0;t<16;t++){const e=new i.u;e.set(n[t],s[t],o[t],a[t],0,0),l.push(e)}}();const c={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>n[t],uY:t=>s[t],vX:t=>o[t],vY:t=>a[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>h[t][e],sub:(t,e)=>h[t][c.inv(e)],rotate180:t=>4^t,isVertical:t=>2==(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?c.S:c.N:2*Math.abs(e)<=Math.abs(t)?t>0?c.E:c.W:e>0?t>0?c.SE:c.SW:t>0?c.NE:c.NW,matrixAppendRotationInv:(t,e,r=0,i=0,n=0,s=0)=>{const o=l[c.inv(e)],a=o.a,h=o.b,u=o.c,d=o.d,f=r-Math.min(0,a*n,u*s,a*n+u*s),p=i-Math.min(0,h*n,d*s,h*n+d*s),m=t.a,y=t.b,g=t.c,x=t.d;t.a=a*m+h*g,t.b=a*y+h*x,t.c=u*m+d*g,t.d=u*y+d*x,t.tx=f*m+p*g+t.tx,t.ty=f*y+p*x+t.ty},transformRectCoords:(t,e,r,i)=>{const{x:n,y:s,width:o,height:a}=t,{x:h,y:l,width:u,height:d}=e;return r===c.E?(i.set(n+h,s+l,o,a),i):r===c.S?i.set(u-s-a+h,n+l,a,o):r===c.W?i.set(u-n-o+h,d-s-a+l,o,a):r===c.N?i.set(s+h,d-n-o+l,a,o):i.set(n+h,s+l,o,a)}}},1652:(t,e,r)=>{r.d(e,{TO:()=>i,Td:()=>s,bO:()=>n});const i=2*Math.PI,n=180/Math.PI,s=Math.PI/180},9939:(t,e,r)=>{function i(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function n(t){return!(t&t-1||!t)}r.d(e,{U5:()=>i,f3:()=>n})},2812:(t,e,r)=>{r.d(e,{o:()=>i});class i{constructor(t,e,r){this._x=e||0,this._y=r||0,this._observer=t}clone(t){return new i(t??this._observer,this._x,this._y)}set(t=0,e=t){return this._x===t&&this._y===e||(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.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(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}},5101:(t,e,r)=>{r.d(e,{b:()=>i});class i{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new i(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return n.x=0,n.y=0,n}}const n=new i},9252:(t,e,r)=>{r.d(e,{M:()=>s});var i=r(5101);const n=[new i.b,new i.b,new i.b,new i.b];class s{constructor(t=0,e=0,r=0,i=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i)}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 s(0,0,0,0)}clone(){return new s(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)}strokeContains(t,e,r,i=.5){const{width:n,height:s}=this;if(n<=0||s<=0)return!1;const o=this.x,a=this.y,h=r*(1-i),l=r-h;return t>=o-h&&t<=o+n+h&&e>=a-h&&e<=a+s+h&&!(t>o+l&&t<o+n-l&&e>a+l&&e<a+s-l)}intersects(t,e){if(!e){const e=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=e)return!1;const r=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>r}const r=this.left,i=this.right,s=this.top,o=this.bottom;if(i<=r||o<=s)return!1;const a=n[0].set(t.left,t.top),h=n[1].set(t.left,t.bottom),l=n[2].set(t.right,t.top),u=n[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const c=Math.sign(e.a*e.d-e.b*e.c);if(0===c)return!1;if(e.apply(a,a),e.apply(h,h),e.apply(l,l),e.apply(u,u),Math.max(a.x,h.x,l.x,u.x)<=r||Math.min(a.x,h.x,l.x,u.x)>=i||Math.max(a.y,h.y,l.y,u.y)<=s||Math.min(a.y,h.y,l.y,u.y)>=o)return!1;const d=c*(h.y-a.y),f=c*(a.x-h.x),p=d*r+f*s,m=d*i+f*s,y=d*r+f*o,g=d*i+f*o;if(Math.max(p,m,y,g)<=d*a.x+f*a.y||Math.min(p,m,y,g)>=d*u.x+f*u.y)return!1;const x=c*(a.y-l.y),v=c*(l.x-a.x),b=x*r+v*s,_=x*i+v*s,w=x*r+v*o,S=x*i+v*o;return!(Math.max(b,_,w,S)<=x*a.x+v*a.y||Math.min(b,_,w,S)>=x*u.x+v*u.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=i,this.height=Math.max(n-i,0),this}ceil(t=1,e=.001){const r=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=i-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){const e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=i,this.height=n-i,this}getBounds(t){return t||(t=new s),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,r=t.y,i=t.x+t.width,n=t.y+t.height;return e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height&&i>=this.x&&i<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(t,e,r,i){return this.x=t,this.y=e,this.width=r,this.height=i,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}},6512:(t,e,r)=>{r.d(e,{u:()=>s});const i=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function n(t){let e="";for(let r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}function s(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const s=i.replace(/%forloop%/gi,n(t));if(e.shaderSource(r,s),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}}finally{e.deleteShader(r)}return t}},341:(t,e,r)=>{r.d(e,{w:()=>o});var i=r(3513),n=r(5589);const s={};function o(t,e,r){let o=2166136261;for(let r=0;r<e;r++)o^=t[r].uid,o=Math.imul(o,16777619),o>>>=0;return s[o]||function(t,e,r,o){const a={};let h=0;for(let r=0;r<o;r++){const i=r<e?t[r]:n.g.EMPTY.source;a[h++]=i.source,a[h++]=i.style}const l=new i.T(a);return s[r]=l,l}(t,e,o,r)}},2043:(t,e,r)=>{r.d(e,{J:()=>D});var i=r(8507),n=r(133);class s{constructor(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),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(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}var o=r(4670),a=r(6083),h=r(6736),l=r(1957);function u(t,e){return"no-premultiply-alpha"===e.alphaMode&&l.Q[t]||t}var c=r(3804),d=r(6512);let f=null;class p{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const e=this.textures[t];this.textures[t]=null,this.ids[e.uid]=null}this.count=0}}class m{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new p,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const y=[];let g=0;function x(){return g>0?y[--g]:new m}function v(t){t.elements=null,y[g++]=t}a.L.register({clear:()=>{if(y.length>0)for(const t of y)t&&t.destroy();y.length=0,g=0}});let b=0;const _=class t{constructor(e){this.uid=(0,n.L)("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],(e={...t.defaultOptions,...e}).maxTextures||((0,o.t6)("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=function(){if(f)return f;const t=(0,c.W)();return f=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),f=(0,d.u)(f,t),t.getExtension("WEBGL_lose_context")?.loseContext(),f}());const{maxTextures:r,attributesInitialSize:i,indicesInitialSize:a}=e;this.attributeBuffer=new s(4*i),this.indexBuffer=new Uint16Array(a),this.maxTextures=r}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)v(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,e){const r=t._batch.textures.ids[e._source.uid];return!(!r&&0!==r)&&(t._textureId=r,t.texture=e,!0)}updateElement(t){this.dirty=!0;const e=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId)}break(t){const e=this._elements;if(!e[this.elementStart])return;let r=x(),i=r.textures;i.clear();const n=e[this.elementStart];let s=u(n.blendMode,n.texture._source),o=n.topology;4*this.attributeSize>this.attributeBuffer.size&&this._resizeAttributeBuffer(4*this.attributeSize),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const a=this.attributeBuffer.float32View,h=this.attributeBuffer.uint32View,l=this.indexBuffer;let c=this._batchIndexSize,d=this._batchIndexStart,f="startBatch",p=[];const m=this.maxTextures;for(let n=this.elementStart;n<this.elementSize;++n){const y=e[n];e[n]=null;const g=y.texture._source,v=u(y.blendMode,g),_=s!==v||o!==y.topology;g._batchTick!==b||_?(g._batchTick=b,(i.count>=m||_)&&(this._finishBatch(r,d,c-d,i,s,o,t,f,p),f="renderBatch",d=c,s=v,o=y.topology,r=x(),i=r.textures,i.clear(),p=[],++b),y._textureId=g._textureBindLocation=i.count,i.ids[g.uid]=i.count,i.textures[i.count++]=g,y._batch=r,p.push(y),c+=y.indexSize,y.packAsQuad?(this.packQuadAttributes(y,a,h,y._attributeStart,y._textureId),this.packQuadIndex(l,y._indexStart,y._attributeStart/this.vertexSize)):(this.packAttributes(y,a,h,y._attributeStart,y._textureId),this.packIndex(y,l,y._indexStart,y._attributeStart/this.vertexSize))):(y._textureId=g._textureBindLocation,c+=y.indexSize,y.packAsQuad?(this.packQuadAttributes(y,a,h,y._attributeStart,y._textureId),this.packQuadIndex(l,y._indexStart,y._attributeStart/this.vertexSize)):(this.packAttributes(y,a,h,y._attributeStart,y._textureId),this.packIndex(y,l,y._indexStart,y._attributeStart/this.vertexSize)),y._batch=r,p.push(y))}i.count>0&&(this._finishBatch(r,d,c-d,i,s,o,t,f,p),d=c,++b),this.elementStart=this.elementSize,this._batchIndexStart=d,this._batchIndexSize=c}_finishBatch(t,e,r,i,n,s,o,a,h){t.gpuBindGroup=null,t.bindGroup=null,t.action=a,t.batcher=this,t.textures=i,t.blendMode=n,t.topology=s,t.start=e,t.size=r,t.elements=h,++b,this.batches[this.batchIndex++]=t,o.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){4*t<=this.attributeBuffer.size||this._resizeAttributeBuffer(4*t)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,2*this.attributeBuffer.size),r=new s(e);(0,h.W)(this.attributeBuffer.rawBinaryData,r.rawBinaryData),this.attributeBuffer=r}_resizeIndexBuffer(t){const e=this.indexBuffer;let r=Math.max(t,1.5*e.length);r+=r%2;const i=r>65535?new Uint32Array(r):new Uint16Array(r);if(i.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let t=0;t<e.length;t++)i[t]=e[t];else(0,h.W)(e.buffer,i.buffer);this.indexBuffer=i}packQuadIndex(t,e,r){t[e]=r+0,t[e+1]=r+1,t[e+2]=r+2,t[e+3]=r+0,t[e+4]=r+2,t[e+5]=r+3}packIndex(t,e,r,i){const n=t.indices,s=t.indexSize,o=t.indexOffset,a=t.attributeOffset;for(let t=0;t<s;t++)e[r++]=i+n[t+o]-a}destroy(t={}){if(null!==this.batches){for(let t=0;t<this.batchIndex;t++)v(this.batches[t]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&(this.shader?.destroy(),this.shader=null);for(let t=0;t<this._elements.length;t++)this._elements[t]&&(this._elements[t]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};_.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let w=_;var S=r(949),M=r(1132),A=r(6011);const C=new Float32Array(1),T=new Uint32Array(1);class P extends A.V{constructor(){const t=new S.h({data:C,label:"attribute-batch-buffer",usage:M.S.VERTEX|M.S.COPY_DST,shrinkToFit:!1});super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:24,offset:0},aUV:{buffer:t,format:"float32x2",stride:24,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:24,offset:16},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:24,offset:20}},indexBuffer:new S.h({data:T,label:"index-batch-buffer",usage:M.S.INDEX|M.S.COPY_DST,shrinkToFit:!1})})}}var k=r(5611),E=r(4459),R=r(4e3),I=r(6665),O=r(6040),L=r(8475);class B extends L.M{constructor(t){super({glProgram:(0,k.I)({name:"batch",bits:[E.a,(0,R.P)(t),I.m]}),gpuProgram:(0,k.v)({name:"batch",bits:[E.F,(0,R._)(t),I.b]}),resources:{batchSamplers:(0,O.n)(t)}}),this.maxTextures=t}}let G=null;const F=class t extends w{constructor(e){super(e),this.geometry=new P,this.name=t.extension.name,this.vertexSize=6,G??(G=new B(e.maxTextures)),this.shader=G}packAttributes(t,e,r,i,n){const s=n<<16|65535&t.roundPixels,o=t.transform,a=o.a,h=o.b,l=o.c,u=o.d,c=o.tx,d=o.ty,{positions:f,uvs:p}=t,m=t.color,y=t.attributeOffset,g=y+t.attributeSize;for(let t=y;t<g;t++){const n=2*t,o=f[n],y=f[n+1];e[i++]=a*o+l*y+c,e[i++]=u*y+h*o+d,e[i++]=p[n],e[i++]=p[n+1],r[i++]=m,r[i++]=s}}packQuadAttributes(t,e,r,i,n){const s=t.texture,o=t.transform,a=o.a,h=o.b,l=o.c,u=o.d,c=o.tx,d=o.ty,f=t.bounds,p=f.maxX,m=f.minX,y=f.maxY,g=f.minY,x=s.uvs,v=t.color,b=n<<16|65535&t.roundPixels;e[i+0]=a*m+l*g+c,e[i+1]=u*g+h*m+d,e[i+2]=x.x0,e[i+3]=x.y0,r[i+4]=v,r[i+5]=b,e[i+6]=a*p+l*g+c,e[i+7]=u*g+h*p+d,e[i+8]=x.x1,e[i+9]=x.y1,r[i+10]=v,r[i+11]=b,e[i+12]=a*p+l*y+c,e[i+13]=u*y+h*p+d,e[i+14]=x.x2,e[i+15]=x.y2,r[i+16]=v,r[i+17]=b,e[i+18]=a*m+l*y+c,e[i+19]=u*y+h*m+d,e[i+20]=x.x3,e[i+21]=x.y3,r[i+22]=v,r[i+23]=b}_updateMaxTextures(t){this.shader.maxTextures!==t&&(G=new B(t),this.shader=G)}destroy(){this.shader=null,super.destroy()}};F.extension={type:[i.Ag.Batcher],name:"default"};let D=F},5611:(t,e,r)=>{r.d(e,{I:()=>T,v:()=>C});var i=r(9113),n=r(3012),s=r(268);function o(t,e,r){if(t)for(const i in t){const n=e[i.toLocaleLowerCase()];if(n){let e=t[i];"header"===i&&(e=e.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),r&&n.push(`//----${r}----//`),n.push(e)}else(0,s.R)(`${i} placement hook does not exist in shader`)}}const a=/\{\{(.*?)\}\}/g;function h(t){const e={};return(t.match(a)?.map((t=>t.replace(/[{()}]/g,"")))??[]).forEach((t=>{e[t]=[]})),e}function l(t,e){let r;const i=/@in\s+([^;]+);/g;for(;null!==(r=i.exec(t));)e.push(r[1])}function u(t,e,r=!1){const i=[];l(e,i),t.forEach((t=>{t.header&&l(t.header,i)}));const n=i;r&&n.sort();const s=n.map(((t,e)=>` @location(${e}) ${t},`)).join("\n");let o=e.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",`\n${s}\n`),o}function c(t,e){let r;const i=/@out\s+([^;]+);/g;for(;null!==(r=i.exec(t));)e.push(r[1])}function d(t,e){let r=t;for(const t in e){const i=e[t];r=i.join("\n").length?r.replace(`{{${t}}}`,`//-----${t} START-----//\n${i.join("\n")}\n//----${t} FINISH----//`):r.replace(`{{${t}}}`,"")}return r}const f=Object.create(null),p=new Map;let m=0;function y({template:t,bits:e}){const r=x(t,e);if(f[r])return f[r];const{vertex:i,fragment:n}=function(t,e){const r=e.map((t=>t.vertex)).filter((t=>!!t)),i=e.map((t=>t.fragment)).filter((t=>!!t));let n=u(r,t.vertex,!0);n=function(t,e){const r=[];c(e,r),t.forEach((t=>{t.header&&c(t.header,r)}));let i=0;const n=r.sort().map((t=>t.indexOf("builtin")>-1?t:`@location(${i++}) ${t}`)).join(",\n"),s=r.sort().map((t=>{return` var ${e=t,e.replace(/@.*?\s+/g,"")};`;var e})).join("\n"),o=`return VSOutput(\n ${r.sort().map((t=>` ${function(t){const e=/\b(\w+)\s*:/g.exec(t);return e?e[1]:""}(t)}`)).join(",\n")});`;let a=e.replace(/@out\s+[^;]+;\s*/g,"");return a=a.replace("{{struct}}",`\n${n}\n`),a=a.replace("{{start}}",`\n${s}\n`),a=a.replace("{{return}}",`\n${o}\n`),a}(r,n);const s=u(i,t.fragment,!0);return{vertex:n,fragment:s}}(t,e);return f[r]=v(i,n,e),f[r]}function g({template:t,bits:e}){const r=x(t,e);return f[r]||(f[r]=v(t.vertex,t.fragment,e)),f[r]}function x(t,e){return e.map((t=>(p.has(t)||p.set(t,m++),p.get(t)))).sort(((t,e)=>t-e)).join("-")+t.vertex+t.fragment}function v(t,e,r){const i=h(t),n=h(e);return r.forEach((t=>{o(t.vertex,i,t.name),o(t.fragment,n,t.name)})),{vertex:d(t,i),fragment:d(e,n)}}const b="\n @in aPosition: vec2<f32>;\n @in aUV: vec2<f32>;\n\n @out @builtin(position) vPosition: vec4<f32>;\n @out vUV : vec2<f32>;\n @out vColor : vec4<f32>;\n\n {{header}}\n\n struct VSOutput {\n {{struct}}\n };\n\n @vertex\n fn main( {{in}} ) -> VSOutput {\n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;\n var modelMatrix = mat3x3<f32>(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n var position = aPosition;\n var uv = aUV;\n\n {{start}}\n\n vColor = vec4<f32>(1., 1., 1., 1.);\n\n {{main}}\n\n vUV = uv;\n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= globalUniforms.uWorldColorAlpha;\n\n {{end}}\n\n {{return}}\n };\n",_="\n @in vUV : vec2<f32>;\n @in vColor : vec4<f32>;\n\n {{header}}\n\n @fragment\n fn main(\n {{in}}\n ) -> @location(0) vec4<f32> {\n\n {{start}}\n\n var outColor:vec4<f32>;\n\n {{main}}\n\n var finalColor:vec4<f32> = outColor * vColor;\n\n {{end}}\n\n return finalColor;\n };\n",w="\n in vec2 aPosition;\n in vec2 aUV;\n\n out vec4 vColor;\n out vec2 vUV;\n\n {{header}}\n\n void main(void){\n\n mat3 worldTransformMatrix = uWorldTransformMatrix;\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n vec2 position = aPosition;\n vec2 uv = aUV;\n\n {{start}}\n\n vColor = vec4(1.);\n\n {{main}}\n\n vUV = uv;\n\n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= uWorldColorAlpha;\n\n {{end}}\n }\n",S="\n\n in vec4 vColor;\n in vec2 vUV;\n\n out vec4 finalColor;\n\n {{header}}\n\n void main(void) {\n\n {{start}}\n\n vec4 outColor;\n\n {{main}}\n\n finalColor = outColor * vColor;\n\n {{end}}\n }\n",M={name:"global-uniforms-bit",vertex:{header:"\n struct GlobalUniforms {\n uProjectionMatrix:mat3x3<f32>,\n uWorldTransformMatrix:mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n }\n\n @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;\n "}},A={name:"global-uniforms-bit",vertex:{header:"\n uniform mat3 uProjectionMatrix;\n uniform mat3 uWorldTransformMatrix;\n uniform vec4 uWorldColorAlpha;\n uniform vec2 uResolution;\n "}};function C({bits:t,name:e}){const r=y({template:{fragment:_,vertex:b},bits:[M,...t]});return n.B.from({name:e,vertex:{source:r.vertex,entryPoint:"main"},fragment:{source:r.fragment,entryPoint:"main"}})}function T({bits:t,name:e}){return new i.M({name:e,...g({template:{vertex:w,fragment:S},bits:[A,...t]})})}},4459:(t,e,r)=>{r.d(e,{F:()=>i,a:()=>n});const i={name:"color-bit",vertex:{header:"\n @in aColor: vec4<f32>;\n ",main:"\n vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);\n "}},n={name:"color-bit",vertex:{header:"\n in vec4 aColor;\n ",main:"\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n "}}},4e3:(t,e,r)=>{r.d(e,{P:()=>l,_:()=>o});const i={};function n(t){const e=[];if(1===t)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let r=0;for(let i=0;i<t;i++)e.push(`@group(1) @binding(${r++}) var textureSource${i+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${r++}) var textureSampler${i+1}: sampler;`)}return e.join("\n")}function s(t){const e=[];if(1===t)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{e.push("switch vTextureId {");for(let r=0;r<t;r++)r===t-1?e.push(" default:{"):e.push(` case ${r}:{`),e.push(` outColor = textureSampleGrad(textureSource${r+1}, textureSampler${r+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}")}return e.join("\n")}function o(t){return i[t]||(i[t]={name:"texture-batch-bit",vertex:{header:"\n @in aTextureIdAndRound: vec2<u32>;\n @out @interpolate(flat) vTextureId : u32;\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1)\n {\n vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "},fragment:{header:`\n @in @interpolate(flat) vTextureId: u32;\n\n ${n(t)}\n `,main:`\n var uvDx = dpdx(vUV);\n var uvDy = dpdy(vUV);\n\n ${s(t)}\n `}}),i[t]}const a={};function h(t){const e=[];for(let r=0;r<t;r++)r>0&&e.push("else"),r<t-1&&e.push(`if(vTextureId < ${r}.5)`),e.push("{"),e.push(`\toutColor = texture(uTextures[${r}], vUV);`),e.push("}");return e.join("\n")}function l(t){return a[t]||(a[t]={name:"texture-batch-bit",vertex:{header:"\n in vec2 aTextureIdAndRound;\n out float vTextureId;\n\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "},fragment:{header:`\n in float vTextureId;\n\n uniform sampler2D uTextures[${t}];\n\n `,main:`\n\n ${h(t)}\n `}}),a[t]}},6665:(t,e,r)=>{r.d(e,{b:()=>i,m:()=>n});const i={name:"round-pixels-bit",vertex:{header:"\n fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}},n={name:"round-pixels-bit",vertex:{header:"\n vec2 roundPixels(vec2 position, vec2 targetSize)\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}}},5753:(t,e,r)=>{var i=r(8507),n=r(0),s=r(9636),o=r(9443);const a=new s.c;function h(t,e,r){const i=a;t.measurable=!0,(0,o.f)(t,r,i),e.addBoundsMask(i),t.measurable=!1}var l=r(7269),u=r(2208),c=r(268);function d(t,e,r){const i=u.o.get();t.measurable=!0;const n=u.u.get().identity(),s=f(t,r,n);(0,l.n)(t,i,s),t.measurable=!1,e.addBoundsMask(i),u.u.return(n),u.o.return(i)}function f(t,e,r){return t?(t!==e&&(f(t.parent,e,r),t.updateLocalTransform(),r.append(t.localTransform)),r):((0,c.R)("Mask bounds, renderable is not inside the root container"),r)}class p{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof n.k),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){null!==this.mask&&(this.mask.measurable=!0,this.mask=null)}addBounds(t,e){this.inverse||h(this.mask,t,e)}addLocalBounds(t,e){d(this.mask,t,e)}containsPoint(t,e){return e(this.mask,t)}destroy(){this.reset()}static test(t){return t instanceof n.k}}p.extension=i.Ag.MaskEffect;class m{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return"number"==typeof t}}m.extension=i.Ag.MaskEffect;var y=r(5559);class g{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){null!==this.mask&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,e){h(this.mask,t,e)}addLocalBounds(t,e){d(this.mask,t,e)}containsPoint(t,e){return e(this.mask,t)}destroy(){this.reset()}static test(t){return t instanceof y.mc}}g.extension=i.Ag.MaskEffect;var x=r(4195),v=r(4884),b=r(8293),_=r(7309),w=r(1761);let S;var M=r(583);const A=class t extends M.v{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...t.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==e.autoPlay,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),!1!==e.autoLoad&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=_.R.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!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;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await async function(){return S??(S=(async()=>{const t=w.e.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise((t=>{const e=document.createElement("video");e.onloadeddata=()=>t(e),e.onerror=()=>t(null),e.autoplay=!1,e.crossOrigin="anonymous",e.preload="auto",e.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",e.load()}));if(!e)return"premultiply-alpha-on-upload";const r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);const i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(i),t.deleteTexture(r),t.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),S}(),this._load=new Promise(((r,i)=>{this.isValid?r(this):(this._resolve=r,this._reject=i,void 0!==e.preloadTimeoutMs&&(this._preloadTimeout=setTimeout((()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))}))),t.load())})),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.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(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.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();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(_.R.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(_.R.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(_.R.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};A.extension=i.Ag.TextureSource,A.defaultOptions={...M.v.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},A.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let C=A;r(9726);i.XO.add(p,m,g,C,b.b,v.q,x.P)},1257:(t,e,r)=>{r.d(e,{u:()=>i});var i=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(i||{})},9113:(t,e,r)=>{r.d(e,{M:()=>d});var i=r(7952),n=r(3804);let s;function o(){if(!s){s="mediump";const t=(0,n.W)();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);s=e.precision?"highp":"mediump"}}return s}const a={},h={};const l={stripVersion:function(t,e){return e?t.replace("#version 300 es",""):t},ensurePrecision:function(t,e,r){const i=r?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if("precision"!==t.substring(0,9)){let n=r?e.requestedFragmentPrecision:e.requestedVertexPrecision;return"highp"===n&&"highp"!==i&&(n="mediump"),`precision ${n} float;\n${t}`}return"highp"!==i&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t},addProgramDefines:function(t,e,r){return e?t:r?`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in varying\n #define finalColor gl_FragColor\n #define texture texture2D\n #endif\n ${t=t.replace("out vec4 finalColor;","")}\n `:`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in attribute\n #define out varying\n #endif\n ${t}\n `},setProgramName:function(t,{name:e="pixi-program"},r=!0){e=e.replace(/\s+/g,"-");const i=r?a:h;return i[e+=r?"-fragment":"-vertex"]?(i[e]++,e+=`-${i[e]}`):i[e]=1,-1!==t.indexOf("#define SHADER_NAME")?t:`${`#define SHADER_NAME ${e}`}\n${t}`},insertVersion:function(t,e){return e?`#version 300 es\n${t}`:t}},u=Object.create(null),c=class t{constructor(e){const r=-1!==(e={...t.defaultOptions,...e}).fragment.indexOf("#version 300 es"),n={stripVersion:r,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:o()},setProgramName:{name:e.name},addProgramDefines:r,insertVersion:r};let s=e.fragment,a=e.vertex;Object.keys(l).forEach((t=>{const e=n[t];s=l[t](s,e,!0),a=l[t](a,e,!1)})),this.fragment=s,this.vertex=a,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=(0,i.X)(`${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,u[this._cacheKey]=null}static from(e){const r=`${e.vertex}:${e.fragment}`;return u[r]||(u[r]=new t(e),u[r]._cacheKey=r),u[r]}};c.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let d=c},6040:(t,e,r)=>{r.d(e,{n:()=>s});var i=r(5811);const n={};function s(t){let e=n[t];if(e)return e;const r=new Int32Array(t);for(let e=0;e<t;e++)r[e]=e;return e=n[t]=new i.k({uTextures:{value:r,type:"i32",size:t}},{isStatic:!0}),e}},3804:(t,e,r)=>{r.d(e,{W:()=>s});var i=r(1761);let n;function s(){if(!n||n?.isContextLost()){const t=i.e.get().createCanvas();n=t.getContext("webgl",{})}return n}},3513:(t,e,r)=>{r.d(e,{T:()=>i});class i{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const r in t){const i=t[r];this.setResource(i,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const r in this.resources)t[e++]=this.resources[r]._resourceId;this._key=t.join("|")}setResource(t,e){const r=this.resources[e];t!==r&&(r?.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,e){const r=this.resources;for(const i in r)r[i]._gcLastUsed=t,r[i]._touched=e}destroy(){const t=this.resources;for(const e in t){const r=t[e];r?.off?.("change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}},3012:(t,e,r)=>{r.d(e,{B:()=>c});var i=r(7952),n=r(8306);const s={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",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function a(t,e){let r;for(;null!==(r=o.exec(t));){const t=s[r[3]]??"float32";e[r[2]]={location:parseInt(r[1],10),format:t,stride:(0,n.m)(t).stride,offset:0,instance:!1,start:0}}o.lastIndex=0}function h(t){const e=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,i=/var(<[^>]+>)? (\w+)/,n=/:\s*([\w<>]+)/,s=/(\w+)\s*:\s*([\w\<\>]+)/g,o=/struct\s+(\w+)/,a=t.match(/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g)?.map((t=>({group:parseInt(t.match(e)[1],10),binding:parseInt(t.match(r)[1],10),name:t.match(i)[2],isUniform:"<uniform>"===t.match(i)[1],type:t.match(n)[1]})));if(!a)return{groups:[],structs:[]};const h=t.match(/struct\s+(\w+)\s*{([^}]+)}/g)?.map((t=>{const e=t.match(o)[1],r=t.match(s).reduce(((t,e)=>{const[r,i]=e.split(":");return t[r.trim()]=i.trim(),t}),{});return r?{name:e,members:r}:null})).filter((({name:t})=>a.some((e=>e.type===t||e.type.includes(`<${t}>`)))))??[];return{groups:a,structs:h}}var l=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(l||{});const u=Object.create(null);class c{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:r,layout:i,gpuLayout:n,name:s}=t;if(this.name=s,this.fragment=e,this.vertex=r,e.source===r.source){const t=h(e.source);this.structsAndGroups=t}else{const t=h(r.source),i=h(e.source);this.structsAndGroups=function(t,e){const r=new Set,i=new Set;return{structs:[...t.structs,...e.structs].filter((t=>!r.has(t.name)&&(r.add(t.name),!0))),groups:[...t.groups,...e.groups].filter((t=>{const e=`${t.name}-${t.binding}`;return!i.has(e)&&(i.add(e),!0)}))}}(t,i)}this.layout=i??function({groups:t}){const e=[];for(let r=0;r<t.length;r++){const i=t[r];e[i.group]||(e[i.group]={}),e[i.group][i.name]=i.binding}return e}(this.structsAndGroups),this.gpuLayout=n??function({groups:t}){const e=[];for(let r=0;r<t.length;r++){const i=t[r];e[i.group]||(e[i.group]=[]),i.isUniform?e[i.group].push({binding:i.binding,visibility:l.VERTEX|l.FRAGMENT,buffer:{type:"uniform"}}):"sampler"===i.type?e[i.group].push({binding:i.binding,visibility:l.FRAGMENT,sampler:{type:"filtering"}}):"texture_2d"===i.type||i.type.startsWith("texture_2d<")?e[i.group].push({binding:i.binding,visibility:l.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):"texture_2d_array"===i.type||i.type.startsWith("texture_2d_array<")?e[i.group].push({binding:i.binding,visibility:l.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):("texture_cube"===i.type||i.type.startsWith("texture_cube<"))&&e[i.group].push({binding:i.binding,visibility:l.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let t=0;t<e.length;t++)e[t]||(e[t]=[]);return e}(this.structsAndGroups),this.autoAssignGlobalUniforms=!(void 0===this.layout[0]?.globalUniforms),this.autoAssignLocalUniforms=!(void 0===this.layout[1]?.localUniforms),this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,r=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=(0,i.X)(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=function({source:t,entryPoint:e}){const r={},i=function(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}(t),n=i.indexOf(`fn ${e}(`);if(-1===n)return r;const s=i.indexOf("->",n);if(-1===s)return r;const o=i.substring(n,s);if(a(o,r),0===Object.keys(r).length){const t=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(t){const e=t[1],n=new RegExp(`struct\\s+${e}\\s*\\{([^}]+)\\}`,"s"),s=i.match(n);s&&a(s[1],r)}}return r}(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,u[this._cacheKey]=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return u[e]||(u[e]=new c(t),u[e]._cacheKey=e),u[e]}}},949:(t,e,r)=>{r.d(e,{h:()=>o});var i=r(8875),n=r(133),s=r(1132);class o extends i.A{constructor(t){let{data:e,size:r}=t;const{usage:i,label:s,shrinkToFit:o}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=(0,n.L)("buffer"),this._resourceType="buffer",this._resourceId=(0,n.L)("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,r??(r=e?.byteLength);const a=!!e;this.descriptor={size:r,usage:i,mappedAtCreation:a,label:s},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&s.S.STATIC)}set static(t){t?this.descriptor.usage|=s.S.STATIC:this.descriptor.usage&=~s.S.STATIC}setDataWithSize(t,e,r){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t)return void(r&&this.emit("update",this));const i=this._data;this._data=t,this._dataInt32=null,i&&i.length===t.length||!this.shrinkToFit&&i&&t.byteLength<i.byteLength?r&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=(0,n.L)("resource"),this.emit("change",this))}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}},1132:(t,e,r)=>{r.d(e,{S:()=>i});var i=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(i||{})},6736:(t,e,r)=>{function i(t,e,r,i){if(r??(r=0),i??(i=Math.min(t.byteLength-r,e.byteLength)),7&r||7&i)if(3&r||3&i)new Uint8Array(e).set(new Uint8Array(t,r,i));else{const n=i/4;new Float32Array(e,0,n).set(new Float32Array(t,r,n))}else{const n=i/8;new Float64Array(e,0,n).set(new Float64Array(t,r,n))}}r.d(e,{W:()=>i})},6011:(t,e,r)=>{r.d(e,{V:()=>l});var i=r(8875),n=r(9636),s=r(133),o=r(949),a=r(1132);function h(t,e){if(!(t instanceof o.h)){let r=e?a.S.INDEX:a.S.VERTEX;t instanceof Array&&(e?(t=new Uint32Array(t),r=a.S.INDEX|a.S.COPY_DST):(t=new Float32Array(t),r=a.S.VERTEX|a.S.COPY_DST)),t=new o.h({data:t,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:r})}return t}class l extends i.A{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=(0,s.L)("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new n.c,this._boundsDirty=!0;const{attributes:e,indexBuffer:r,topology:i}=t;if(this.buffers=[],this.attributes={},e)for(const t in e)this.addAttribute(t,e[t]);this.instanceCount=t.instanceCount??1,r&&this.addIndex(r),this.topology=i||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}addAttribute(t,e){const r=function(t){return(t instanceof o.h||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={buffer:t}),t.buffer=h(t.buffer,!1),t}(e);-1===this.buffers.indexOf(r.buffer)&&(this.buffers.push(r.buffer),r.buffer.on("update",this.onBufferUpdate,this),r.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=r}addIndex(t){this.indexBuffer=h(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,function(t,e,r){const i=t.getAttribute(e);if(!i)return r.minX=0,r.minY=0,r.maxX=0,r.maxY=0,r;const n=i.buffer.data;let s=1/0,o=1/0,a=-1/0,h=-1/0;const l=n.BYTES_PER_ELEMENT,u=(i.offset||0)/l,c=(i.stride||8)/l;for(let t=u;t<n.length;t+=c){const e=n[t],r=n[t+1];e>a&&(a=e),r>h&&(h=r),e<s&&(s=e),r<o&&(o=r)}return r.minX=s,r.minY=o,r.maxX=a,r.maxY=h,r}(this,"aPosition",this._bounds)):this._bounds}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach((t=>t.destroy())),this.unload(),this.indexBuffer?.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}},8306:(t,e,r)=>{r.d(e,{m:()=>n});const i={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function n(t){return i[t]??i.float32}},848:(t,e,r)=>{r.d(e,{L:()=>n});var i=r(133);class n{constructor(){this.uid=(0,i.L)("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}},8475:(t,e,r)=>{r.d(e,{M:()=>u});var i=r(8875),n=r(133),s=r(9113),o=r(3513),a=r(3012),h=r(5099),l=r(5811);class u extends i.A{constructor(t){super(),this.uid=(0,n.L)("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:r,groups:i,resources:s,compatibleRenderers:a,groupMap:u}=t;this.gpuProgram=e,this.glProgram=r,void 0===a&&(a=0,e&&(a|=h.W.WEBGPU),r&&(a|=h.W.WEBGL)),this.compatibleRenderers=a;const c={};if(s||i||(s={}),s&&i)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&i&&!u)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&i&&u)for(const t in u)for(const e in u[t]){const r=u[t][e];c[r]={group:t,binding:e,name:r}}else if(e&&i&&!u){const t=e.structsAndGroups.groups;u={},t.forEach((t=>{u[t.group]=u[t.group]||{},u[t.group][t.binding]=t.name,c[t.name]=t}))}else if(s){if(i={},u={},e){e.structsAndGroups.groups.forEach((t=>{u[t.group]=u[t.group]||{},u[t.group][t.binding]=t.name,c[t.name]=t}))}let t=0;for(const e in s)c[e]||(i[99]||(i[99]=new o.T,this._ownedBindGroups.push(i[99])),c[e]={group:99,binding:t,name:e},u[99]=u[99]||{},u[99][t]=e,t++);for(const t in s){const e=t;let r=s[t];r.source||r._resourceType||(r=new l.k(r));const n=c[e];n&&(i[n.group]||(i[n.group]=new o.T,this._ownedBindGroups.push(i[n.group])),i[n.group].setResource(r,n.binding))}}this.groups=i,this._uniformBindMap=u,this.resources=this._buildResourceAccessor(i,c)}addResource(t,e,r){var i,n;(i=this._uniformBindMap)[e]||(i[e]={}),(n=this._uniformBindMap[e])[r]||(n[r]=t),this.groups[e]||(this.groups[e]=new o.T,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const r={};for(const i in e){const n=e[i];Object.defineProperty(r,n.name,{get:()=>t[n.group].getResource(n.binding),set(e){t[n.group].setResource(e,n.binding)}})}return r}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(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(t){const{gpu:e,gl:r,...i}=t;let n,o;return e&&(n=a.B.from(e)),r&&(o=s.M.from(r)),new u({gpuProgram:n,glProgram:o,...i})}}},5811:(t,e,r)=>{r.d(e,{k:()=>l});var i=r(133),n=r(7952);const s=["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>"],o=s.reduce(((t,e)=>(t[e]=!0,t)),{});function a(t,e){switch(t){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}const h=class t{constructor(e,r){this._touched=0,this.uid=(0,i.L)("uniform"),this._resourceType="uniformGroup",this._resourceId=(0,i.L)("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,r={...t.defaultOptions,...r},this.uniformStructures=e;const h={};for(const t in e){const r=e[t];if(r.name=t,r.size=r.size??1,!o[r.type]){const t=r.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(t){const[,e,i]=t;throw new Error(`Uniform type ${r.type} is not supported. Use type: '${e}', size: ${i} instead.`)}throw new Error(`Uniform type ${r.type} is not supported. Supported uniform types are: ${s.join(", ")}`)}r.value??(r.value=a(r.type,r.size)),h[t]=r.value}this.uniforms=h,this._dirtyId=1,this.ubo=r.ubo,this.isStatic=r.isStatic,this._signature=(0,n.X)(Object.keys(h).map((t=>`${t}-${e[t].type}`)).join("-"),"uniform-group")}update(){this._dirtyId++}};h.defaultOptions={ubo:!1,isStatic:!1};let l=h},7547:(t,e,r)=>{r.d(e,{U:()=>s});const i={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},n=class t{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(t){!!(1&this.data)!==t&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(t){!!(2&this.data)!==t&&(this.data^=2)}set cullMode(t){"none"!==t?(this.culling=!0,this.clockwiseFrontFace="front"===t):this.culling=!1}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(4&this.data)}set culling(t){!!(4&this.data)!==t&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(t){!!(8&this.data)!==t&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(t){!!(32&this.data)!==t&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(t){!!(16&this.data)!==t&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(t){this.blend="none"!==t,this._blendMode=t,this._blendModeId=i[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new t;return e.depthTest=!1,e.blend=!0,e}};n.default2d=n.for2d();let s=n},1957:(t,e,r)=>{r.d(e,{K:()=>n,Q:()=>i});const i={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var n=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(n||{})},800:(t,e,r)=>{r.d(e,{k:()=>g});var i=r(2577),n=r(8507);const s=[];async function o(t){if(!t)for(let t=0;t<s.length;t++){const e=s[t];if(e.value.test())return void await e.value.load()}}n.XO.handleByNamedList(n.Ag.Environment,s);var a=r(5559),h=r(4577),l=r(133),u=r(4670),c=r(6083),d=r(1257),f=r(7729),p=r(8875);const m=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],y=class t extends p.A{constructor(t){super(),this.tick=0,this.uid=(0,l.L)("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const e=[...m,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(e={}){const r=!0===e.skipExtensionImports||!1===e.manageImports;await o(r),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const t in this._systemsHash){e={...this._systemsHash[t].constructor.defaultOptions,...e}}e={...t.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let t=0;t<this.runners.init.items.length;t++)await this.runners.init.items[t].init(e);this._initOptions=e}render(t,e){this.tick++;let r=t;if(r instanceof a.mc&&(r={container:r},e&&((0,u.t6)(u.lj,"passing a second argument is deprecated, please use render options instead"),r.target=e.renderTexture)),r.target||(r.target=this.view.renderTarget),r.target===this.view.renderTarget&&(this._lastObjectRendered=r.container,r.clearColor??(r.clearColor=this.background.colorRgba),r.clear??(r.clear=this.background.clearBeforeRender)),r.clearColor){const t=Array.isArray(r.clearColor)&&4===r.clearColor.length;r.clearColor=t?r.clearColor:i.Q.shared.setValue(r.clearColor).toArray()}r.transform||(r.container.updateLocalTransform(),r.transform=r.container.localTransform),r.container.visible&&(r.container.enableRenderGroup(),this.runners.prerender.emit(r),this.runners.renderStart.emit(r),this.runners.render.emit(r),this.runners.renderEnd.emit(r),this.runners.postrender.emit(r))}resize(t,e,r){const i=this.view.resolution;this.view.resize(t,e,r),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),void 0!==r&&r!==i&&this.runners.resolutionChange.emit(r)}clear(t={}){t.target||(t.target=this.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=d.u.ALL);const{clear:e,clearColor:r,target:n,mipLevel:s,layer:o}=t;i.Q.shared.setValue(r??this.background.colorRgba),this.renderTarget.clear(n,e,i.Q.shared.toArray(),s??0,o??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}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(...t){t.forEach((t=>{this.runners[t]=new f.C(t)}))}_addSystems(t){let e;for(e in t){const r=t[e];this._addSystem(r.value,r.name)}}_addSystem(t,e){const r=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=r,this._systemsHash[e]=r;for(const t in this.runners)this.runners[t].add(r);return this}_addPipes(t,e){const r=e.reduce(((t,e)=>(t[e.name]=e.value,t)),{});t.forEach((t=>{const e=t.value,i=t.name,n=r[i];this.renderPipes[i]=new e(this,n?new n:null),this.runners.destroy.add(this.renderPipes[i])}))}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(!0===t||"object"==typeof t&&t.releaseGlobalResources)&&c.L.release(),Object.values(this.runners).forEach((t=>{t.destroy()})),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!(0,h.f)())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()}};y.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let g=y},7729:(t,e,r)=>{r.d(e,{C:()=>i});class i{constructor(t){this.items=[],this._name=t}emit(t,e,r,i,n,s,o,a){const{name:h,items:l}=this;for(let u=0,c=l.length;u<c;u++)l[u][h](t,e,r,i,n,s,o,a);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&this.items.splice(e,1),this}contains(t){return-1!==this.items.indexOf(t)}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return 0===this.items.length}get name(){return this._name}}},5589:(t,e,r)=>{r.d(e,{g:()=>d});var i=r(8875),n=r(2079),s=r(9252),o=r(133),a=r(4670);const h=()=>{};var l=r(4195),u=r(583),c=r(1196);class d extends i.A{constructor({source:t,label:e,frame:r,orig:i,trim:n,defaultAnchor:a,defaultBorders:h,rotate:l,dynamic:c}={}){if(super(),this.uid=(0,o.L)("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new s.M,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new u.v,this.noFrame=!r,r)this.frame.copyFrom(r);else{const{width:t,height:e}=this._source;this.frame.width=t,this.frame.height=e}this.orig=i||this.frame,this.trim=n,this.rotate=l??0,this.defaultAnchor=a,this.defaultBorders=h,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new c.N(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:e}=this,{width:r,height:i}=this._source,s=e.x/r,o=e.y/i,a=e.width/r,h=e.height/i;let l=this.rotate;if(l){const e=a/2,r=h/2,i=s+e,u=o+r;l=n.E.add(l,n.E.NW),t.x0=i+e*n.E.uX(l),t.y0=u+r*n.E.uY(l),l=n.E.add(l,2),t.x1=i+e*n.E.uX(l),t.y1=u+r*n.E.uY(l),l=n.E.add(l,2),t.x2=i+e*n.E.uX(l),t.y2=u+r*n.E.uY(l),l=n.E.add(l,2),t.x3=i+e*n.E.uX(l),t.y3=u+r*n.E.uY(l)}else t.x0=s,t.y0=o,t.x1=s+a,t.y1=o,t.x2=s+a,t.y2=o+h,t.x3=s,t.y3=o+h}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,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(0,a.t6)(a.lj,"Texture.baseTexture is now Texture.source"),this._source}}d.EMPTY=new d({label:"EMPTY",source:new u.v({label:"EMPTY"})}),d.EMPTY.destroy=h,d.WHITE=new d({source:new l.P({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),d.WHITE.destroy=h},1196:(t,e,r)=>{r.d(e,{N:()=>s});var i=r(9313);const n=new i.u;class s{constructor(t,e){this.mapCoord=new i.u,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?t.width<10?0:.5:e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this.texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){void 0===e&&(e=t);const r=this.mapCoord;for(let i=0;i<t.length;i+=2){const n=t[i],s=t[i+1];e[i]=n*r.a+s*r.c+r.tx,e[i+1]=n*r.b+s*r.d+r.ty}return e}update(){const t=this._texture;this._updateID++;const e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);const r=t.orig,i=t.trim;i&&(n.set(r.width/i.width,0,0,r.height/i.height,-i.x/i.width,-i.y/i.height),this.mapCoord.append(n));const s=t.source,o=this.uClampFrame,a=this.clampMargin/s._resolution,h=this.clampOffset/s._resolution;return o[0]=(t.frame.x+a+h)/s.width,o[1]=(t.frame.y+a+h)/s.height,o[2]=(t.frame.x+t.frame.width-a+h)/s.width,o[3]=(t.frame.y+t.frame.height-a+h)/s.height,this.uClampOffset[0]=this.clampOffset/s.pixelWidth,this.uClampOffset[1]=this.clampOffset/s.pixelHeight,this.isSimple=t.frame.width===s.width&&t.frame.height===s.height&&0===t.rotate,!0}}},2437:(t,e,r)=>{r.d(e,{W:()=>l});var i=r(9939),n=r(6083),s=r(583),o=r(5589),a=r(218);let h=0;const l=new class{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new a.n(this.textureOptions)}createTexture(t,e,r,i){const n=new s.v({...this.textureOptions,width:t,height:e,resolution:1,antialias:r,autoGarbageCollect:!1,autoGenerateMipmaps:i});return new o.g({source:n,label:"texturePool_"+h++})}getOptimalTexture(t,e,r=1,n,s=!1){let o=Math.ceil(t*r-1e-6),a=Math.ceil(e*r-1e-6);o=(0,i.U5)(o),a=(0,i.U5)(a);const h=(o<<17)+(a<<2)+((s?1:0)<<1)+(n?1:0);this._texturePool[h]||(this._texturePool[h]=[]);let l=this._texturePool[h].pop();return l||(l=this.createTexture(o,a,n,s)),l.source._resolution=r,l.source.width=o/r,l.source.height=a/r,l.source.pixelWidth=o,l.source.pixelHeight=a,l.frame.x=0,l.frame.y=0,l.frame.width=t,l.frame.height=e,l.updateUvs(),this._poolKeyHash[l.uid]=h,l}getSameSizeTexture(t,e=!1){const r=t.source;return this.getOptimalTexture(t.width,t.height,r._resolution,e)}returnTexture(t,e=!1){const r=this._poolKeyHash[t.uid];e&&(t.source.style=this.textureStyle),this._texturePool[r].push(t)}clear(t){if(t=!1!==t)for(const t in this._texturePool){const e=this._texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0)}this._texturePool={}}};n.L.register(l)},218:(t,e,r)=>{r.d(e,{n:()=>h});var i=r(8875),n=r(133),s=r(4670);const o=Object.create(null);const a=class t extends i.A{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...t.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(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){(0,s.t6)(s.lj,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=function(t){const e=o[t];return void 0===e&&(o[t]=(0,n.L)("resource")),e}(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};a.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let h=a},4195:(t,e,r)=>{r.d(e,{P:()=>s});var i=r(8507),n=r(583);class s extends n.v{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let r=t.format;r||(r=e instanceof Float32Array?"rgba32float":e instanceof Int32Array||e instanceof Uint32Array?"rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?"rgba16uint":(Int8Array,"bgra8unorm")),super({...t,resource:e,format:r}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}s.extension=i.Ag.TextureSource},4884:(t,e,r)=>{r.d(e,{q:()=>o});var i=r(1761),n=r(8507),s=r(583);class o extends s.v{constructor(t){t.resource||(t.resource=i.e.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.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(t=this.width,e=this.height,r=this._resolution){const i=super.resize(t,e,r);return i&&this.resizeCanvas(),i}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}o.extension=n.Ag.TextureSource},8293:(t,e,r)=>{r.d(e,{b:()=>s});var i=r(8507),n=r(583);class s extends n.v{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}s.extension=i.Ag.TextureSource},583:(t,e,r)=>{r.d(e,{v:()=>l});var i=r(8875),n=r(9939),s=r(2698),o=r(133),a=r(218);const h=class t extends i.A{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=(0,o.L)("textureSource"),this._resourceType="textureSource",this._resourceId=(0,o.L)("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=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...t.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.viewDimension=e.viewDimension??e.dimensions,this.arrayLayerCount=e.arrayLayerCount,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new a.n((0,s.S)(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=(0,o.L)("resource"),this.emit("change",this),this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,r){r||(r=this._resolution),t||(t=this.width),e||(e=this.height);const i=Math.round(t*r),n=Math.round(e*r);return this.width=i/r,this.height=n/r,this._resolution=r,(this.pixelWidth!==i||this.pixelHeight!==n)&&(this._refreshPOT(),this.pixelWidth=i,this.pixelHeight=n,this.emit("resize",this),this._resourceId=(0,o.L)("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=(0,n.f3)(this.pixelWidth)&&(0,n.f3)(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};h.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let l=h},9726:(t,e,r)=>{var i=r(268),n=r(2406);const s=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||(0,i.R)(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const r=(0,n.z)(t);let s;for(let t=0;t<this.parsers.length;t++){const i=this.parsers[t];if(i.test(e)){s=i.getCacheableAssets(r,e);break}}const o=new Map(Object.entries(s||{}));s||r.forEach((t=>{o.set(t,e)}));const a=[...o.keys()],h={cacheKeys:a,keys:r};r.forEach((t=>{this._cacheMap.set(t,h)})),a.forEach((t=>{const r=s?s[t]:e;this._cache.has(t)&&this._cache.get(t)!==r&&(0,i.R)("[Cache] already has key:",t),this._cache.set(t,o.get(t))}))}remove(t){if(!this._cacheMap.has(t))return void(0,i.R)(`[Assets] Asset id ${t} was not found in the Cache`);const e=this._cacheMap.get(t);e.cacheKeys.forEach((t=>{this._cache.delete(t)})),e.keys.forEach((t=>{this._cacheMap.delete(t)}))}get parsers(){return this._parsers}};var o=r(8507),a=r(583),h=r(5589);const l=[];function u(t={}){const e=t&&t.resource,r=e?t.resource:t,i=e?t:{resource:t};for(let t=0;t<l.length;t++){const e=l[t];if(e.test(r))return new e(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}o.XO.handleByList(o.Ag.TextureSource,l),h.g.from=function(t,e=!1){return"string"==typeof t?s.get(t):t instanceof a.v?new h.g({source:t}):function(t={},e=!1){const r=t&&t.resource,i=r?t.resource:t,n=r?t:{resource:t};if(!e&&s.has(i))return s.get(i);const o=new h.g({source:u(n)});return o.on("destroy",(()=>{s.has(i)&&s.remove(i)})),e||s.set(i,o),o}(t,e)},a.v.from=u},7952:(t,e,r)=>{r.d(e,{X:()=>s});const i=Object.create(null),n=Object.create(null);function s(t,e){let r=n[t];return void 0===r&&(void 0===i[e]&&(i[e]=1),n[t]=r=i[e]++),r}},5099:(t,e,r)=>{r.d(e,{W:()=>i});var i=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(i||{})},5559:(t,e,r)=>{r.d(e,{mc:()=>Y,u:()=>U,ig:()=>N,fR:()=>X});var i=r(8875),n=r(2577);var s=r(8507),o=r(9313),a=r(1652),h=r(2812),l=r(133),u=r(4670),c=r(268),d=r(8655);const f={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(t){"boolean"==typeof t&&!1===t?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(!0===t?{}:t))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(t){(0,u.t6)("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)}};var p=r(9903);const m={allowChildren:!0,removeChildren(t=0,e){const r=e??this.children.length,i=r-t,n=[];if(i>0&&i<=r){for(let e=r-1;e>=t;e--){const t=this.children[e];t&&(n.push(t),t.parent=null)}(0,p.d)(this.children,t,r);const e=this.renderGroup||this.parentRenderGroup;e&&e.removeChildren(n);for(let t=0;t<n.length;++t){const e=n[t];e.parentRenderLayer?.detach(e),this.emit("childRemoved",e,this,t),n[t].emit("removed",this)}return n.length>0&&this._didViewChangeTick++,n}if(0===i&&0===this.children.length)return n;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(t){const e=this.getChildAt(t);return this.removeChild(e)},getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]},setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(t),this.addChildAt(t,e)},getChildIndex(t){const e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(t,e){this.allowChildren||(0,u.t6)(u.lj,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:r}=this;if(e<0||e>r.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${r.length}`);const i=t.parent===this;if(t.parent){const r=t.parent.children.indexOf(t);if(i){if(r===e)return t;t.parent.children.splice(r,1)}else t.removeFromParent()}e===r.length?r.push(t):r.splice(e,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;const n=this.renderGroup||this.parentRenderGroup;return n&&n.addChild(t),this.sortableChildren&&(this.sortDirty=!0),i||(this.emit("childAdded",t,this,e),t.emit("added",this)),t},swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t;const n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...t){return 1===t.length?this.reparentChildAt(t[0],this.children.length):(t.forEach((t=>this.reparentChildAt(t,this.children.length))),t[0])},reparentChildAt(t,e){if(t.parent===this)return this.setChildIndex(t,e),t;const r=t.worldTransform.clone();t.removeFromParent(),this.addChildAt(t,e);const i=this.worldTransform.clone();return i.invert(),r.prepend(i),t.setFromMatrix(r),t},replaceChild(t,e){t.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(t)),e.setFromMatrix(t.localTransform),e.updateLocalTransform(),this.removeChild(t)}},y={collectRenderables(t,e,r){this.parentRenderLayer&&this.parentRenderLayer!==r||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,e,r):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,e,r))},collectRenderablesSimple(t,e,r){const i=this.children,n=i.length;for(let s=0;s<n;s++)i[s].collectRenderables(t,e,r)},collectRenderablesWithEffects(t,e,r){const{renderPipes:i}=e;for(let e=0;e<this.effects.length;e++){const r=this.effects[e];i[r.pipe].push(r,this,t)}this.collectRenderablesSimple(t,e,r);for(let e=this.effects.length-1;e>=0;e--){const r=this.effects[e];i[r.pipe].pop(r,this,t)}}};var g=r(9049);const x=new class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach((t=>{this.add({test:t.test,maskClass:t})})))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;e<this._tests.length;e++){const r=this._tests[e];if(r.test(t))return d.Z.get(r.maskClass,t)}return t}returnMaskEffect(t){d.Z.return(t)}};s.XO.handleByList(s.Ag.MaskEffect,x._effectClasses);const v={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0)},addEffect(t){-1===this.effects.indexOf(t)&&(this.effects.push(t),this.effects.sort(((t,e)=>t.priority-e.priority)),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(t){const e=this.effects.indexOf(t);-1!==e&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(t){const e=this._maskEffect;e?.mask!==t&&(e&&(this.removeEffect(e),x.returnMaskEffect(e),this._maskEffect=null),null!=t&&(this._maskEffect=x.getMaskEffect(t),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(t){this._maskOptions={...this._maskOptions,...t},t.mask&&(this.mask=t.mask),this._markStructureAsChanged()},set filters(t){!Array.isArray(t)&&t&&(t=[t]);const e=this._filterEffect||(this._filterEffect=new g.a),r=t?.length>0,i=r!==e.filters?.length>0;t=Array.isArray(t)?t.slice(0):t,e.filters=Object.freeze(t),i&&(r?this.addEffect(e):(this.removeEffect(e),e.filters=t??null))},get filters(){return this._filterEffect?.filters},set filterArea(t){this._filterEffect||(this._filterEffect=new g.a),this._filterEffect.filterArea=t},get filterArea(){return this._filterEffect?.filterArea}},b={label:null,get name(){return(0,u.t6)(u.lj,"Container.name property has been removed, use Container.label instead"),this.label},set name(t){(0,u.t6)(u.lj,"Container.name property has been removed, use Container.label instead"),this.label=t},getChildByName(t,e=!1){return this.getChildByLabel(t,e)},getChildByLabel(t,e=!1){const r=this.children;for(let e=0;e<r.length;e++){const i=r[e];if(i.label===t||t instanceof RegExp&&t.test(i.label))return i}if(e)for(let e=0;e<r.length;e++){const i=r[e].getChildByLabel(t,!0);if(i)return i}return null},getChildrenByLabel(t,e=!1,r=[]){const i=this.children;for(let e=0;e<i.length;e++){const n=i[e];(n.label===t||t instanceof RegExp&&t.test(n.label))&&r.push(n)}if(e)for(let e=0;e<i.length;e++)i[e].getChildrenByLabel(t,!0,r);return r}};var _=r(9636),w=r(2208);const S=new o.u,M={getFastGlobalBounds(t,e){e||(e=new _.c),e.clear(),this._getGlobalBoundsRecursive(!!t,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const r=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(r.worldTransform),e},_getGlobalBoundsRecursive(t,e,r){let i=e;if(t&&this.parentRenderLayer&&this.parentRenderLayer!==r)return;if(7!==this.localDisplayStatus||!this.measurable)return;const n=!!this.effects.length;if((this.renderGroup||n)&&(i=w.o.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const t=this.bounds;i.addFrame(t.minX,t.minY,t.maxX,t.maxY,this.groupTransform)}const e=this.children;for(let n=0;n<e.length;n++)e[n]._getGlobalBoundsRecursive(t,i,r)}if(n){let t=!1;const r=this.renderGroup||this.parentRenderGroup;for(let e=0;e<this.effects.length;e++)this.effects[e].addBounds&&(t||(t=!0,i.applyMatrix(r.worldTransform)),this.effects[e].addBounds(i,!0));t&&i.applyMatrix(r.worldTransform.copyTo(S).invert()),e.addBounds(i),w.o.return(i)}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),w.o.return(i))}};var A=r(198),C=r(9443),T=r(7269);function P(t,e){const r=t.children;for(let t=0;t<r.length;t++){const i=r[t],n=i.uid,s=(65535&i._didViewChangeTick)<<16|65535&i._didContainerChangeTick,o=e.index;e.data[o]===n&&e.data[o+1]===s||(e.data[e.index]=n,e.data[e.index+1]=s,e.didChange=!0),e.index=o+2,i.children.length&&P(i,e)}return e.didChange}const k=new o.u,E={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,e){const r=Math.sign(this.scale.x)||1;this.scale.x=0!==e?t/e*r:r},_setHeight(t,e){const r=Math.sign(this.scale.y)||1;this.scale.y=0!==e?t/e*r:r},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new _.c});const t=this._localBoundsCacheData;return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),P(this,t),t.didChange&&(0,T.n)(this,t.localBounds,k),t.localBounds},getBounds(t,e){return(0,C.f)(this,t,e||new _.c)}},R={_onRender:null,set onRender(t){const e=this.renderGroup||this.parentRenderGroup;if(!t)return this._onRender&&e?.removeOnRender(this),void(this._onRender=null);this._onRender||e?.addOnRender(this),this._onRender=t},get onRender(){return this._onRender}},I={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(O))}};function O(t,e){return t._zIndex-e._zIndex}var L=r(5101);const B={getGlobalPosition(t=new L.b,e=!1){return this.parent?this.parent.toGlobal(this._position,t,e):(t.x=this._position.x,t.y=this._position.y),t},toGlobal(t,e,r=!1){const i=this.getGlobalTransform(w.u.get(),r);return e=i.apply(t,e),w.u.return(i),e},toLocal(t,e,r,i){e&&(t=e.toGlobal(t,r,i));const n=this.getGlobalTransform(w.u.get(),i);return r=n.applyInverse(t,r),w.u.return(n),r}};var G=r(3284);const F=new h.o(null),D=new h.o(null),z=new h.o(null,1,1),j=new h.o(null),N=1,U=2,X=4;class Y extends i.A{constructor(t={}){super(),this.uid=(0,l.L)("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new o.u,this.relativeGroupTransform=new o.u,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new h.o(this,0,0),this._scale=z,this._pivot=D,this._origin=j,this._skew=F,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=[],function(t,e,r={}){for(const i in e)r[i]||void 0===e[i]||(t[i]=e[i])}(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach((t=>this.addChild(t))),t.parent?.addChild(this)}static mixin(t){(0,u.t6)("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),s.XO.mixin(Y,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=4095&t}get _didChangeId(){return 4095&this._didContainerChangeTick|(4095&this._didViewChangeTick)<<12}addChild(...t){if(this.allowChildren||(0,u.t6)(u.lj,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let e=0;e<t.length;e++)this.addChild(t[e]);return t[0]}const e=t[0],r=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),r&&(r.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e._updateFlags=15,r&&r.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,0!==e._zIndex&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let e=0;e<t.length;e++)this.removeChild(t[e]);return t[0]}const e=t[0],r=this.children.indexOf(e);return r>-1&&(this._didViewChangeTick++,this.children.splice(r,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,r),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,this.didChange||(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=d.Z.get(G.m,this),this.groupTransform=o.u.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),d.Z.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&0===this.effects.length}get worldTransform(){return this._worldTransform||(this._worldTransform=new o.u),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(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*a.bO}set angle(t){this.rotation=t*a.Td}get pivot(){return this._pivot===D&&(this._pivot=new h.o(this,0,0)),this._pivot}set pivot(t){this._pivot===D&&(this._pivot=new h.o(this,0,0),this._origin!==j&&(0,c.R)("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),"number"==typeof t?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===F&&(this._skew=new h.o(this,0,0)),this._skew}set skew(t){this._skew===F&&(this._skew=new h.o(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===z&&(this._scale=new h.o(this,1,1)),this._scale}set scale(t){this._scale===z&&(this._scale=new h.o(this,0,0)),"string"==typeof t&&(t=parseFloat(t)),"number"==typeof t?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===j&&(this._origin=new h.o(this,0,0)),this._origin}set origin(t){this._origin===j&&(this._origin=new h.o(this,0,0),this._pivot!==D&&(0,c.R)("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),"number"==typeof t?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const r=this.getLocalBounds();"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,r.width),void 0!==e&&this._setHeight(e,r.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set("number"==typeof t.x?t.x:this.position.x,"number"==typeof t.y?t.y:this.position.y),this.scale.set("number"==typeof t.scaleX?t.scaleX||1:this.scale.x,"number"==typeof t.scaleY?t.scaleY||1:this.scale.y),this.rotation="number"==typeof t.rotation?t.rotation:this.rotation,this.skew.set("number"==typeof t.skewX?t.skewX:this.skew.x,"number"==typeof t.skewY?t.skewY:this.skew.y),this.pivot.set("number"==typeof t.pivotX?t.pivotX:this.pivot.x,"number"==typeof t.pivotY?t.pivotY:this.pivot.y),this.origin.set("number"==typeof t.originX?t.originX:this.origin.x,"number"==typeof t.originY?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,r=this._scale,i=this._pivot,n=this._origin,s=this._position,o=r._x,a=r._y,h=i._x,l=i._y,u=-n._x,c=-n._y;e.a=this._cx*o,e.b=this._sx*o,e.c=this._cy*a,e.d=this._sy*a,e.tx=s._x-(h*e.a+l*e.c)+(u*e.a+c*e.c)-u,e.ty=s._y-(h*e.b+l*e.d)+(u*e.b+c*e.d)-c}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=N,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const e=n.Q.shared.setValue(t??16777215).toBgrNumber();e!==this.localColor&&(this.localColor=e,this._updateFlags|=N,this._onUpdate())}get tint(){return(0,A.D)(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=U,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(2&this.localDisplayStatus)}set visible(t){const e=t?2:0;(2&this.localDisplayStatus)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=X,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(4&this.localDisplayStatus)}set culled(t){const e=t?0:4;(4&this.localDisplayStatus)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=X,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(1&this.localDisplayStatus)}set renderable(t){const e=t?1:0;(1&this.localDisplayStatus)!==e&&(this._updateFlags|=X,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return 7===this.localDisplayStatus&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;let e;this.destroyed=!0,this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners();if(("boolean"==typeof t?t:t?.children)&&e)for(let r=0;r<e.length;++r)e[r].destroy(t);this.renderGroup?.destroy(),this.renderGroup=null}}s.XO.mixin(Y,m,M,B,R,E,v,b,I,{cullArea:null,cullable:!1,cullableChildren:!0},f,A.R,y)},3284:(t,e,r)=>{r.d(e,{m:()=>o});var i=r(9313),n=r(848),s=r(2437);class o{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new i.u,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=!0,this.instructionSet=new n.L,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const e=t.children;for(let t=0;t<e.length;t++){const r=e[t];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(s.W.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const e=this.childrenToUpdate[t];e.list.fill(null),e.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup)return void this.addRenderGroupChild(t.renderGroup);t._onRender&&this.addOnRender(t);const e=t.children;for(let t=0;t<e.length;t++)this.addChild(e[t])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup)return void this._removeRenderGroupChild(t.renderGroup);const e=t.children;for(let t=0;t<e.length;t++)this.removeChild(e[t])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return 7===this.root.localDisplayStatus&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}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(t=[]){const e=this.root.children;for(let r=0;r<e.length;r++)this._getChildren(e[r],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;const r=t.children;for(let t=0;t<r.length;t++)this._getChildren(r[t],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return 1&this._matrixDirty?(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new i.u),this._inverseWorldTransform.copyFrom(this.worldTransform).invert()):this._inverseWorldTransform}get textureOffsetInverseTransform(){return 2&this._matrixDirty?(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new i.u),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y)):this._textureOffsetInverseTransform}get inverseParentTextureTransform(){if(!(4&this._matrixDirty))return this._inverseParentTextureTransform;this._matrixDirty&=-5;const t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new i.u),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}},9636:(t,e,r)=>{r.d(e,{c:()=>o});var i=r(9313),n=r(9252);const s=new i.u;class o{constructor(t=1/0,e=1/0,r=-1/0,i=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=s,this.minX=t,this.minY=e,this.maxX=r,this.maxY=i}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new n.M);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=s,this}set(t,e,r,i){this.minX=t,this.minY=e,this.maxX=r,this.maxY=i}addFrame(t,e,r,i,n){n||(n=this.matrix);const s=n.a,o=n.b,a=n.c,h=n.d,l=n.tx,u=n.ty;let c=this.minX,d=this.minY,f=this.maxX,p=this.maxY,m=s*t+a*e+l,y=o*t+h*e+u;m<c&&(c=m),y<d&&(d=y),m>f&&(f=m),y>p&&(p=y),m=s*r+a*e+l,y=o*r+h*e+u,m<c&&(c=m),y<d&&(d=y),m>f&&(f=m),y>p&&(p=y),m=s*t+a*i+l,y=o*t+h*i+u,m<c&&(c=m),y<d&&(d=y),m>f&&(f=m),y>p&&(p=y),m=s*r+a*i+l,y=o*r+h*i+u,m<c&&(c=m),y<d&&(d=y),m>f&&(f=m),y>p&&(p=y),this.minX=c,this.minY=d,this.maxX=f,this.maxY=p}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,{a:s,b:o,c:a,d:h,tx:l,ty:u}=t;let c=s*e+a*r+l,d=o*e+h*r+u;this.minX=c,this.minY=d,this.maxX=c,this.maxY=d,c=s*i+a*r+l,d=o*i+h*r+u,this.minX=c<this.minX?c:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=c>this.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY,c=s*e+a*n+l,d=o*e+h*n+u,this.minX=c<this.minX?c:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=c>this.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY,c=s*i+a*n+l,d=o*i+h*n+u,this.minX=c<this.minX?c:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=c>this.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,r,i){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<r&&(this.minY=r),this.maxY>i&&(this.maxY=i),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,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 o(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}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(t,e,r,i){let n=this.minX,s=this.minY,o=this.maxX,a=this.maxY;i||(i=this.matrix);const h=i.a,l=i.b,u=i.c,c=i.d,d=i.tx,f=i.ty;for(let i=e;i<r;i+=2){const e=t[i],r=t[i+1],p=h*e+u*r+d,m=l*e+c*r+f;n=p<n?p:n,s=m<s?m:s,o=p>o?p:o,a=m>a?m:a}this.minX=n,this.minY=s,this.maxX=o,this.maxY=a}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}},9443:(t,e,r)=>{r.d(e,{E:()=>a,f:()=>s});var i=r(9313),n=r(2208);function s(t,e,r){let s,h;return r.clear(),t.parent?e?s=t.parent.worldTransform:(h=n.u.get().identity(),s=a(t,h)):s=i.u.IDENTITY,o(t,r,s,e),h&&n.u.return(h),r.isValid||r.set(0,0,0,0),r}function o(t,e,r,s){if(!t.visible||!t.measurable)return;let a;s?a=t.worldTransform:(t.updateLocalTransform(),a=n.u.get(),a.appendFrom(t.localTransform,r));const h=e,l=!!t.effects.length;if(l&&(e=n.o.get().clear()),t.boundsArea)e.addRect(t.boundsArea,a);else{const r=t.bounds;r&&!r.isEmpty()&&(e.matrix=a,e.addBounds(r));for(let r=0;r<t.children.length;r++)o(t.children[r],e,a,s)}if(l){for(let r=0;r<t.effects.length;r++)t.effects[r].addBounds?.(e);h.addBounds(e,i.u.IDENTITY),n.o.return(e)}s||n.u.return(a)}function a(t,e){const r=t.parent;return r&&(a(r,e),r.updateLocalTransform(),e.append(r.localTransform)),e}},7269:(t,e,r)=>{r.d(e,{n:()=>s});var i=r(9313),n=r(2208);function s(t,e,r){return e.clear(),r||(r=i.u.IDENTITY),o(t,e,r,t,!0),e.isValid||e.set(0,0,0,0),e}function o(t,e,r,s,a){let h;if(a)h=n.u.get(),h=r.copyTo(h);else{if(!t.visible||!t.measurable)return;t.updateLocalTransform();const e=t.localTransform;h=n.u.get(),h.appendFrom(e,r)}const l=e,u=!!t.effects.length;if(u&&(e=n.o.get().clear()),t.boundsArea)e.addRect(t.boundsArea,h);else{t.renderPipeId&&(e.matrix=h,e.addBounds(t.bounds));const r=t.children;for(let t=0;t<r.length;t++)o(r[t],e,h,s,!1)}if(u){for(let r=0;r<t.effects.length;r++)t.effects[r].addLocalBounds?.(e,s);l.addBounds(e,i.u.IDENTITY),n.o.return(e)}n.u.return(h)}},2208:(t,e,r)=>{r.d(e,{o:()=>a,u:()=>o});var i=r(9313),n=r(8655),s=r(9636);const o=n.Z.getPool(i.u),a=n.Z.getPool(s.c)},198:(t,e,r)=>{r.d(e,{D:()=>a,R:()=>h});var i=r(9313),n=r(9443),s=r(2208),o=r(753);function a(t){return((255&t)<<16)+(65280&t)+(t>>16&255)}const h={getGlobalAlpha(t){if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,r=this.parent;for(;r;)e*=r.alpha,r=r.parent;return e},getGlobalTransform(t=new i.u,e){if(e)return t.copyFrom(this.worldTransform);this.updateLocalTransform();const r=(0,n.E)(this,s.u.get().identity());return t.appendFrom(this.localTransform,r),s.u.return(r),t},getGlobalTint(t){if(t)return this.renderGroup?a(this.renderGroup.worldColor):this.parentRenderGroup?a((0,o.j)(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,r=this.parent;for(;r;)e=(0,o.j)(e,r.localColor),r=r.parent;return a(e)}}},2698:(t,e,r)=>{function i(t){const e={};for(const r in t)void 0!==t[r]&&(e[r]=t[r]);return e}r.d(e,{S:()=>i})},753:(t,e,r)=>{r.d(e,{j:()=>s});var i=r(4676);const n=16777215;function s(t,e){return t===n?e:e===n?t:(0,i.u)(t,e)}},4676:(t,e,r)=>{function i(t,e){if(16777215===t||!e)return e;if(16777215===e||!t)return t;return(((t>>16&255)*(e>>16&255)/255|0)<<16)+(((t>>8&255)*(e>>8&255)/255|0)<<8)+((255&t)*(255&e)/255|0)}r.d(e,{u:()=>i})},2760:(t,e,r)=>{function i(t,e,r){const i=(t>>24&255)/255;e[r++]=(255&t)/255*i,e[r++]=(t>>8&255)/255*i,e[r++]=(t>>16&255)/255*i,e[r++]=i}r.d(e,{V:()=>i})},6954:(t,e,r)=>{r.d(e,{G:()=>o});var i=r(9313),n=r(4676);const s=new i.u;class o{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,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(){const t=this.baseColor,e=t>>16|65280&t|(255&t)<<16,r=this.renderable;return r?(0,n.u)(e,r.groupColor)+(this.alpha*r.groupAlpha*255<<24):e+(255*this.alpha<<24)}get transform(){return this.renderable?.groupTransform||s}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}},9501:(t,e,r)=>{r.d(e,{A:()=>Ft});var i=r(4670),n=r(4985),s=r(8875),o=r(2577),a=r(9313),h=r(5101),l=r(5589),u=r(133),c=r(9636),d=r(268),f=r(8133);var p=r(9252);class m{constructor(t=0,e=0,r=0){this.type="circle",this.x=t,this.y=e,this.radius=r}clone(){return new m(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const r=this.radius*this.radius;let i=this.x-t,n=this.y-e;return i*=i,n*=n,i+n<=r}strokeContains(t,e,r,i=.5){if(0===this.radius)return!1;const n=this.x-t,s=this.y-e,o=this.radius,a=(1-i)*r,h=Math.sqrt(n*n+s*s);return h<=o+a&&h>o-(r-a)}getBounds(t){return t||(t=new p.M),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=2*this.radius,t.height=2*this.radius,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class y{constructor(t=0,e=0,r=0,i=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=r,this.halfHeight=i}clone(){return new y(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let r=(t-this.x)/this.halfWidth,i=(e-this.y)/this.halfHeight;return r*=r,i*=i,r+i<=1}strokeContains(t,e,r,i=.5){const{halfWidth:n,halfHeight:s}=this;if(n<=0||s<=0)return!1;const o=r*(1-i),a=r-o,h=n-a,l=s-a,u=n+o,c=s+o,d=t-this.x,f=e-this.y;return d*d/(h*h)+f*f/(l*l)>1&&d*d/(u*u)+f*f/(c*c)<=1}getBounds(t){return t||(t=new p.M),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=2*this.halfWidth,t.height=2*this.halfHeight,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function g(t,e,r,i,n,s){const o=n-r,a=s-i,h=o*o+a*a;let l,u,c=-1;0!==h&&(c=((t-r)*o+(e-i)*a)/h),c<0?(l=r,u=i):c>1?(l=n,u=s):(l=r+c*o,u=i+c*a);const d=t-l,f=e-u;return d*d+f*f}class x{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let r=0,i=e.length;r<i;r++)t.push(e[r].x,e[r].y);e=t}this.points=e,this.closePath=!0}isClockwise(){let t=0;const e=this.points,r=e.length;for(let i=0;i<r;i+=2){const n=e[i],s=e[i+1];t+=(e[(i+2)%r]-n)*(e[(i+3)%r]+s)}return t<0}containsPolygon(t){const e=this.getBounds(undefined),r=t.getBounds(undefined);if(!e.containsRect(r))return!1;const i=t.points;for(let t=0;t<i.length;t+=2){const e=i[t],r=i[t+1];if(!this.contains(e,r))return!1}return!0}clone(){const t=this.points.slice(),e=new x(t);return e.closePath=this.closePath,e}contains(t,e){let r=!1;const i=this.points.length/2;for(let n=0,s=i-1;n<i;s=n++){const i=this.points[2*n],o=this.points[2*n+1],a=this.points[2*s],h=this.points[2*s+1];o>e!=h>e&&t<(e-o)/(h-o)*(a-i)+i&&(r=!r)}return r}strokeContains(t,e,r,i=.5){const n=r*r,s=n*(1-i),o=n-s,{points:a}=this,h=a.length-(this.closePath?0:2);for(let r=0;r<h;r+=2){const i=a[r],n=a[r+1],h=a[(r+2)%a.length],l=a[(r+3)%a.length];if(g(t,e,i,n,h,l)<=(Math.sign((h-i)*(e-n)-(l-n)*(t-i))<0?o:s))return!0}return!1}getBounds(t){t||(t=new p.M);const e=this.points;let r=1/0,i=-1/0,n=1/0,s=-1/0;for(let t=0,o=e.length;t<o;t+=2){const o=e[t],a=e[t+1];r=o<r?o:r,i=o>i?o:i,n=a<n?a:n,s=a>s?a:s}return t.x=r,t.width=i-r,t.y=n,t.height=s-n,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce(((t,e)=>`${t}, ${e}`),"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return(0,i.t6)("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return(0,i.t6)("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const v=(t,e,r,i,n,s,o)=>{const a=t-r,h=e-i,l=Math.sqrt(a*a+h*h);return l>=n-s&&l<=n+o};class b{constructor(t=0,e=0,r=0,i=0,n=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n}getBounds(t){return t||(t=new p.M),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new b(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;let i=t-(this.x+r),n=e-(this.y+r);const s=r*r;if(i*i+n*n<=s)return!0;if(i=t-(this.x+this.width-r),i*i+n*n<=s)return!0;if(n=e-(this.y+this.height-r),i*i+n*n<=s)return!0;if(i=t-(this.x+r),i*i+n*n<=s)return!0}return!1}strokeContains(t,e,r,i=.5){const{x:n,y:s,width:o,height:a,radius:h}=this,l=r*(1-i),u=r-l,c=n+h,d=s+h,f=n+o,p=s+a;return(t>=n-l&&t<=n+u||t>=f-u&&t<=f+l)&&e>=d&&e<=d+(a-2*h)||((e>=s-l&&e<=s+u||e>=p-u&&e<=p+l)&&t>=c&&t<=c+(o-2*h)||(t<c&&e<d&&v(t,e,c,d,h,u,l)||t>f-h&&e<d&&v(t,e,f-h,d,h,u,l)||t>f-h&&e>p-h&&v(t,e,f-h,p-h,h,u,l)||t<c&&e>p-h&&v(t,e,c,p-h,h,u,l)))}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}var _=r(8507),w=r(341),S=r(2043),M=r(848),A=r(4334),C=r(8655),T=r(2801);class P{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach((t=>{C.Z.return(t)})),this.graphicsData&&C.Z.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}}class k{constructor(){this.instructions=new M.L}init(t){const e=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(e):this.batcher=new S.J({maxTextures:e}),this.instructions.reset()}get geometry(){return(0,i.t6)(i.Ek,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}const E=class t{constructor(t){this._renderer=t,this._managedContexts=new A.s({renderer:t,type:"resource",name:"graphicsContext"})}init(e){t.defaultOptions.bezierSmoothness=e?.bezierSmoothness??t.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const e=!!t._gpuData[this._renderer.uid],r=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!e){e&&r.reset(),(0,T.M)(t,r);const i=t.batchMode;t.customShader||"no-batch"===i?r.isBatchable=!1:r.isBatchable="auto"!==i||r.geometryData.vertices.length<400,t.dirty=!1}return r}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const e=C.Z.get(k,{maxTextures:this._renderer.limits.maxBatchableTextures}),r=t._gpuData[this._renderer.uid],{batches:i,geometryData:n}=r;r.graphicsData=e;const s=n.vertices.length,o=n.indices.length;for(let t=0;t<i.length;t++)i[t].applyTransform=!1;const a=e.batcher;a.ensureAttributeBuffer(s),a.ensureIndexBuffer(o),a.begin();for(let t=0;t<i.length;t++){const e=i[t];a.add(e)}a.finish(e.instructions);const h=a.geometry;h.indexBuffer.setDataWithSize(a.indexBuffer,a.indexSize,!0),h.buffers[0].setDataWithSize(a.attributeBuffer.float32View,a.attributeSize,!0);const l=a.batches;for(let t=0;t<l.length;t++){const e=l[t];e.bindGroup=(0,w.w)(e.textures.textures,e.textures.count,this._renderer.limits.maxBatchableTextures)}return e}_initContext(t){const e=new P;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};E.extension={type:[_.Ag.WebGLSystem,_.Ag.WebGPUSystem],name:"graphicsContext"},E.defaultOptions={bezierSmoothness:.5};let R=E;const I=8,O=1.1920929e-7,L=1,B=.01,G=0,F=0;function D(t,e,r,i,n,s,o,a,h,l){const u=Math.min(.99,Math.max(0,l??R.defaultOptions.bezierSmoothness));let c=(L-u)/1;return c*=c,function(t,e,r,i,n,s,o,a,h,l){z(t,e,r,i,n,s,o,a,h,l,0),h.push(o,a)}(e,r,i,n,s,o,a,h,t,c),t}function z(t,e,r,i,n,s,o,a,h,l,u){if(u>I)return;const c=Math.PI,d=(t+r)/2,f=(e+i)/2,p=(r+n)/2,m=(i+s)/2,y=(n+o)/2,g=(s+a)/2,x=(d+p)/2,v=(f+m)/2,b=(p+y)/2,_=(m+g)/2,w=(x+b)/2,S=(v+_)/2;if(u>0){let u=o-t,d=a-e;const f=Math.abs((r-o)*d-(i-a)*u),p=Math.abs((n-o)*d-(s-a)*u);let m,y;if(f>O&&p>O){if((f+p)*(f+p)<=l*(u*u+d*d)){if(G<B)return void h.push(w,S);const l=Math.atan2(s-i,n-r);if(m=Math.abs(l-Math.atan2(i-e,r-t)),y=Math.abs(Math.atan2(a-s,o-n)-l),m>=c&&(m=2*c-m),y>=c&&(y=2*c-y),m+y<G)return void h.push(w,S);if(0!==F){if(m>F)return void h.push(r,i);if(y>F)return void h.push(n,s)}}}else if(f>O){if(f*f<=l*(u*u+d*d)){if(G<B)return void h.push(w,S);if(m=Math.abs(Math.atan2(s-i,n-r)-Math.atan2(i-e,r-t)),m>=c&&(m=2*c-m),m<G)return h.push(r,i),void h.push(n,s);if(0!==F&&m>F)return void h.push(r,i)}}else if(p>O){if(p*p<=l*(u*u+d*d)){if(G<B)return void h.push(w,S);if(m=Math.abs(Math.atan2(a-s,o-n)-Math.atan2(s-i,n-r)),m>=c&&(m=2*c-m),m<G)return h.push(r,i),void h.push(n,s);if(0!==F&&m>F)return void h.push(n,s)}}else if(u=w-(t+o)/2,d=S-(e+a)/2,u*u+d*d<=l)return void h.push(w,S)}z(t,e,d,f,x,v,w,S,h,l,u+1),z(w,S,b,_,y,g,o,a,h,l,u+1)}const j=8,N=1.1920929e-7,U=.01,X=0;function Y(t,e,r,i,n,s,o,a){let h=(1-Math.min(.99,Math.max(0,a??R.defaultOptions.bezierSmoothness)))/1;return h*=h,function(t,e,r,i,n,s,o,a){V(o,t,e,r,i,n,s,a,0),o.push(n,s)}(e,r,i,n,s,o,t,h),t}function V(t,e,r,i,n,s,o,a,h){if(h>j)return;const l=Math.PI,u=(e+i)/2,c=(r+n)/2,d=(i+s)/2,f=(n+o)/2,p=(u+d)/2,m=(c+f)/2;let y=s-e,g=o-r;const x=Math.abs((i-s)*g-(n-o)*y);if(x>N){if(x*x<=a*(y*y+g*g)){if(X<U)return void t.push(p,m);let a=Math.abs(Math.atan2(o-n,s-i)-Math.atan2(n-r,i-e));if(a>=l&&(a=2*l-a),a<X)return void t.push(p,m)}}else if(y=p-(e+s)/2,g=m-(r+o)/2,y*y+g*g<=a)return void t.push(p,m);V(t,e,r,u,c,p,m,a,h+1),V(t,p,m,d,f,s,o,a,h+1)}function $(t,e,r,i,n,s,o,a){let h=Math.abs(n-s);(!o&&n>s||o&&s>n)&&(h=2*Math.PI-h),a||(a=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(h/Math.PI))));let l=h/(a=Math.max(a,3)),u=n;l*=o?-1:1;for(let n=0;n<a+1;n++){const n=e+Math.cos(u)*i,s=r+Math.sin(u)*i;t.push(n,s),u+=l}}const W=2*Math.PI,H={centerX:0,centerY:0,ang1:0,ang2:0},q=({x:t,y:e},r,i,n,s,o,a,h)=>{const l=n*(t*=r)-s*(e*=i),u=s*t+n*e;return h.x=l+o,h.y=u+a,h};function Z(t,e){const r=-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),i=1.5707963267948966===e?.551915024494:r,n=Math.cos(t),s=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:n-s*i,y:s+n*i},{x:o+a*i,y:a-o*i},{x:o,y:a}]}const K=(t,e,r,i)=>{let n=t*r+e*i;return n>1&&(n=1),n<-1&&(n=-1),(t*i-e*r<0?-1:1)*Math.acos(n)};function Q(t,e,r,i,n,s,o,a=0,h=0,l=0){if(0===s||0===o)return;const u=Math.sin(a*W/360),c=Math.cos(a*W/360),d=c*(e-i)/2+u*(r-n)/2,f=-u*(e-i)/2+c*(r-n)/2;if(0===d&&0===f)return;s=Math.abs(s),o=Math.abs(o);const p=Math.pow(d,2)/Math.pow(s,2)+Math.pow(f,2)/Math.pow(o,2);p>1&&(s*=Math.sqrt(p),o*=Math.sqrt(p)),((t,e,r,i,n,s,o,a,h,l,u,c,d)=>{const f=Math.pow(n,2),p=Math.pow(s,2),m=Math.pow(u,2),y=Math.pow(c,2);let g=f*p-f*y-p*m;g<0&&(g=0),g/=f*y+p*m,g=Math.sqrt(g)*(o===a?-1:1);const x=g*n/s*c,v=g*-s/n*u,b=l*x-h*v+(t+r)/2,_=h*x+l*v+(e+i)/2,w=(u-x)/n,S=(c-v)/s,M=(-u-x)/n,A=(-c-v)/s,C=K(1,0,w,S);let T=K(w,S,M,A);0===a&&T>0&&(T-=W),1===a&&T<0&&(T+=W),d.centerX=b,d.centerY=_,d.ang1=C,d.ang2=T})(e,r,i,n,s,o,h,l,u,c,d,f,H);let{ang1:m,ang2:y}=H;const{centerX:g,centerY:x}=H;let v=Math.abs(y)/(W/4);Math.abs(1-v)<1e-7&&(v=1);const b=Math.max(Math.ceil(v),1);y/=b;let _=t[t.length-2],w=t[t.length-1];const S={x:0,y:0};for(let e=0;e<b;e++){const e=Z(m,y),{x:r,y:i}=q(e[0],s,o,c,u,g,x,S),{x:n,y:a}=q(e[1],s,o,c,u,g,x,S),{x:h,y:l}=q(e[2],s,o,c,u,g,x,S);D(t,_,w,r,i,n,a,h,l),_=h,w=l,m+=y}}const J=new p.M;class tt{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new c.c,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();const r=this._currentPoly.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||r.push(t,e),this}arc(t,e,r,i,n,s){this._ensurePoly(!1);return $(this._currentPoly.points,t,e,r,i,n,s),this}arcTo(t,e,r,i,n){this._ensurePoly();return function(t,e,r,i,n,s){const o=t[t.length-2],a=t[t.length-1]-r,h=o-e,l=n-r,u=i-e,c=Math.abs(a*u-h*l);if(c<1e-8||0===s)return void(t[t.length-2]===e&&t[t.length-1]===r||t.push(e,r));const d=a*a+h*h,f=l*l+u*u,p=a*l+h*u,m=s*Math.sqrt(d)/c,y=s*Math.sqrt(f)/c,g=m*p/d,x=y*p/f,v=m*u+y*h,b=m*l+y*a,_=h*(y+g),w=a*(y+g),S=u*(m+x),M=l*(m+x);$(t,v+e,b+r,s,Math.atan2(w-b,_-v),Math.atan2(M-b,S-v),h*l>u*a)}(this._currentPoly.points,t,e,r,i,n),this}arcToSvg(t,e,r,i,n,s,o){return Q(this._currentPoly.points,this._currentPoly.lastX,this._currentPoly.lastY,s,o,t,e,r,i,n),this}bezierCurveTo(t,e,r,i,n,s,o){this._ensurePoly();const a=this._currentPoly;return D(this._currentPoly.points,a.lastX,a.lastY,t,e,r,i,n,s,o),this}quadraticCurveTo(t,e,r,i,n){this._ensurePoly();const s=this._currentPoly;return Y(this._currentPoly.points,s.lastX,s.lastY,t,e,r,i,n),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0)).transform(e);const r=this.shapePrimitives,i=r.length;for(let e=0;e<t.instructions.length;e++){const r=t.instructions[e];this[r.action](...r.data)}if(t.checkForHoles&&r.length-i>1){let t=null;for(let e=i;e<r.length;e++){const i=r[e];if("polygon"===i.shape.type){const n=i.shape,s=t?.shape;s&&s.containsPolygon(n)?(t.holes||(t.holes=[]),t.holes.push(i),r.copyWithin(e,e+1),r.length--,e--):t=i}}}return this}finish(t=!1){this.endPoly(t)}rect(t,e,r,i,n){return this.drawShape(new p.M(t,e,r,i),n),this}circle(t,e,r,i){return this.drawShape(new m(t,e,r),i),this}poly(t,e,r){const i=new x(t);return i.closePath=e,this.drawShape(i,r),this}regularPoly(t,e,r,i,n=0,s){i=Math.max(0|i,3);const o=-1*Math.PI/2+n,a=2*Math.PI/i,h=[];for(let n=0;n<i;n++){const i=o-n*a;h.push(t+r*Math.cos(i),e+r*Math.sin(i))}return this.poly(h,!0,s),this}roundPoly(t,e,r,i,n,s=0,o){if(i=Math.max(0|i,3),n<=0)return this.regularPoly(t,e,r,i,s);const a=r*Math.sin(Math.PI/i)-.001;n=Math.min(n,a);const h=-1*Math.PI/2+s,l=2*Math.PI/i,u=(i-2)*Math.PI/i/2;for(let s=0;s<i;s++){const i=s*l+h,a=t+r*Math.cos(i),c=e+r*Math.sin(i),d=i+Math.PI+u,f=i-Math.PI-u,p=a+n*Math.cos(d),m=c+n*Math.sin(d),y=a+n*Math.cos(f),g=c+n*Math.sin(f);0===s?this.moveTo(p,m):this.lineTo(p,m),this.quadraticCurveTo(a,c,y,g,o)}return this.closePath()}roundShape(t,e,r=!1,i){return t.length<3?this:(r?function(t,e,r,i){const n=(t,e)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),s=(t,e,r)=>({x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}),o=e.length;for(let a=0;a<o;a++){const h=e[(a+1)%o],l=h.radius??r;if(l<=0){0===a?t.moveTo(h.x,h.y):t.lineTo(h.x,h.y);continue}const u=e[a],c=e[(a+2)%o],d=n(u,h);let f;f=d<1e-4?h:s(h,u,Math.min(d/2,l)/d);const p=n(c,h);let m;m=p<1e-4?h:s(h,c,Math.min(p/2,l)/p),0===a?t.moveTo(f.x,f.y):t.lineTo(f.x,f.y),t.quadraticCurveTo(h.x,h.y,m.x,m.y,i)}}(this,t,e,i):function(t,e,r){const i=(t,e)=>{const r=e.x-t.x,i=e.y-t.y,n=Math.sqrt(r*r+i*i);return{len:n,nx:r/n,ny:i/n}},n=(e,r)=>{0===e?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y)};let s=e[e.length-1];for(let o=0;o<e.length;o++){const a=e[o%e.length],h=a.radius??r;if(h<=0){n(o,a),s=a;continue}const l=e[(o+1)%e.length],u=i(a,s),c=i(a,l);if(u.len<1e-4||c.len<1e-4){n(o,a),s=a;continue}let d=Math.asin(u.nx*c.ny-u.ny*c.nx),f=1,p=!1;u.nx*c.nx-u.ny*-c.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,f=-1,p=!0):d>0&&(f=-1,p=!0);const m=d/2;let y,g=Math.abs(Math.cos(m)*h/Math.sin(m));g>Math.min(u.len/2,c.len/2)?(g=Math.min(u.len/2,c.len/2),y=Math.abs(g*Math.sin(m)/Math.cos(m))):y=h;const x=a.x+c.nx*g+-c.ny*y*f,v=a.y+c.ny*g+c.nx*y*f,b=Math.atan2(u.ny,u.nx)+Math.PI/2*f,_=Math.atan2(c.ny,c.nx)-Math.PI/2*f;0===o&&t.moveTo(x+Math.cos(b)*y,v+Math.sin(b)*y),t.arc(x,v,y,b,_,p),s=a}}(this,t,e),this.closePath())}filletRect(t,e,r,i,n){if(0===n)return this.rect(t,e,r,i);const s=Math.min(r,i)/2,o=Math.min(s,Math.max(-s,n)),a=t+r,h=e+i,l=o<0?-o:0,u=Math.abs(o);return this.moveTo(t,e+u).arcTo(t+l,e+l,t+u,e,u).lineTo(a-u,e).arcTo(a-l,e+l,a,e+u,u).lineTo(a,h-u).arcTo(a-l,h-l,t+r-u,h,u).lineTo(t+u,h).arcTo(t+l,h-l,t,h-u,u).closePath()}chamferRect(t,e,r,i,n,s){if(n<=0)return this.rect(t,e,r,i);const o=Math.min(n,Math.min(r,i)/2),a=t+r,h=e+i,l=[t+o,e,a-o,e,a,e+o,a,h-o,a-o,h,t+o,h,t,h-o,t,e+o];for(let t=l.length-1;t>=2;t-=2)l[t]===l[t-2]&&l[t-1]===l[t-3]&&l.splice(t-1,2);return this.poly(l,!0,s)}ellipse(t,e,r,i,n){return this.drawShape(new y(t,e,r,i),n),this}roundRect(t,e,r,i,n,s){return this.drawShape(new b(t,e,r,i,n),s),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let r=this._currentPoly;return r&&this.endPoly(),r=new x,r.points.push(t,e),this._currentPoly=r,this}endPoly(t=!1){const e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new x,t)){const t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let e=t.shape.x,r=t.shape.y;if(t.transform&&!t.transform.isIdentity()){const i=t.transform,n=e;e=i.a*e+i.c*r+i.tx,r=i.b*n+i.d*r+i.ty}this._currentPoly.points.push(e,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;e<t.instructions.length;e++){const r=t.instructions[e];this[r.action](...r.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const e=this.shapePrimitives;for(let r=0;r<e.length;r++){const i=e[r],n=i.shape.getBounds(J);i.transform?t.addRect(n,i.transform):t.addRect(n)}return t}}class et{constructor(t,e=!1){this.instructions=[],this.uid=(0,u.L)("graphicsPath"),this._dirty=!0,this.checkForHoles=e,"string"==typeof t?function(t,e){const r=f(t),i=[];let n=null,s=0,o=0;for(let t=0;t<r.length;t++){const a=r[t],h=a[0],l=a;switch(h){case"M":s=l[1],o=l[2],e.moveTo(s,o);break;case"m":s+=l[1],o+=l[2],e.moveTo(s,o);break;case"H":s=l[1],e.lineTo(s,o);break;case"h":s+=l[1],e.lineTo(s,o);break;case"V":o=l[1],e.lineTo(s,o);break;case"v":o+=l[1],e.lineTo(s,o);break;case"L":s=l[1],o=l[2],e.lineTo(s,o);break;case"l":s+=l[1],o+=l[2],e.lineTo(s,o);break;case"C":s=l[5],o=l[6],e.bezierCurveTo(l[1],l[2],l[3],l[4],s,o);break;case"c":e.bezierCurveTo(s+l[1],o+l[2],s+l[3],o+l[4],s+l[5],o+l[6]),s+=l[5],o+=l[6];break;case"S":s=l[3],o=l[4],e.bezierCurveToShort(l[1],l[2],s,o);break;case"s":e.bezierCurveToShort(s+l[1],o+l[2],s+l[3],o+l[4]),s+=l[3],o+=l[4];break;case"Q":s=l[3],o=l[4],e.quadraticCurveTo(l[1],l[2],s,o);break;case"q":e.quadraticCurveTo(s+l[1],o+l[2],s+l[3],o+l[4]),s+=l[3],o+=l[4];break;case"T":s=l[1],o=l[2],e.quadraticCurveToShort(s,o);break;case"t":s+=l[1],o+=l[2],e.quadraticCurveToShort(s,o);break;case"A":s=l[6],o=l[7],e.arcToSvg(l[1],l[2],l[3],l[4],l[5],s,o);break;case"a":s+=l[6],o+=l[7],e.arcToSvg(l[1],l[2],l[3],l[4],l[5],s,o);break;case"Z":case"z":e.closePath(),i.length>0&&(n=i.pop(),n?(s=n.startX,o=n.startY):(s=0,o=0)),n=null;break;default:(0,d.R)(`Unknown SVG path command: ${h}`)}"Z"!==h&&"z"!==h&&null===n&&(n={startX:s,startY:o},i.push(n))}}(t,this):this.instructions=t?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new tt(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,e){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,e]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,e,r,i,n){const s=this.instructions[this.instructions.length-1],o=this.getLastPoint(h.b.shared);let a=0,l=0;if(s&&"bezierCurveTo"===s.action){a=s.data[2],l=s.data[3];const t=o.x,e=o.y;a=t+(t-a),l=e+(e-l)}else a=o.x,l=o.y;return this.instructions.push({action:"bezierCurveTo",data:[a,l,t,e,r,i,n]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,e,r){const i=this.instructions[this.instructions.length-1],n=this.getLastPoint(h.b.shared);let s=0,o=0;if(i&&"quadraticCurveTo"===i.action){s=i.data[0],o=i.data[1];const t=n.x,e=n.y;s=t+(t-s),o=e+(e-o)}else s=n.x,o=n.y;return this.instructions.push({action:"quadraticCurveTo",data:[s,o,t,e,r]}),this._dirty=!0,this}rect(t,e,r,i,n){return this.instructions.push({action:"rect",data:[t,e,r,i,n]}),this._dirty=!0,this}circle(t,e,r,i){return this.instructions.push({action:"circle",data:[t,e,r,i]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,e,r,i,n,s,o){n||(n=i/2);const a=-1*Math.PI/2+s,h=2*r,l=2*Math.PI/h,u=[];for(let r=0;r<h;r++){const s=r%2?n:i,o=r*l+a;u.push(t+s*Math.cos(o),e+s*Math.sin(o))}return this.poly(u,!0,o),this}clone(t=!1){const e=new et;if(e.checkForHoles=this.checkForHoles,t)for(let t=0;t<this.instructions.length;t++){const r=this.instructions[t];e.instructions.push({action:r.action,data:r.data.slice()})}else e.instructions=this.instructions.slice();return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const e=t.a,r=t.b,i=t.c,n=t.d,s=t.tx,o=t.ty;let a=0,h=0,l=0,u=0,c=0,f=0,p=0,m=0;for(let y=0;y<this.instructions.length;y++){const g=this.instructions[y],x=g.data;switch(g.action){case"moveTo":case"lineTo":a=x[0],h=x[1],x[0]=e*a+i*h+s,x[1]=r*a+n*h+o;break;case"bezierCurveTo":l=x[0],u=x[1],c=x[2],f=x[3],a=x[4],h=x[5],x[0]=e*l+i*u+s,x[1]=r*l+n*u+o,x[2]=e*c+i*f+s,x[3]=r*c+n*f+o,x[4]=e*a+i*h+s,x[5]=r*a+n*h+o;break;case"quadraticCurveTo":l=x[0],u=x[1],a=x[2],h=x[3],x[0]=e*l+i*u+s,x[1]=r*l+n*u+o,x[2]=e*a+i*h+s,x[3]=r*a+n*h+o;break;case"arcToSvg":a=x[5],h=x[6],p=x[0],m=x[1],x[0]=e*p+i*m,x[1]=r*p+n*m,x[5]=e*a+i*h+s,x[6]=r*a+n*h+o;break;case"circle":x[4]=rt(x[3],t);break;case"rect":x[4]=rt(x[4],t);break;case"ellipse":x[8]=rt(x[8],t);break;case"roundRect":x[5]=rt(x[5],t);break;case"addPath":x[0].transform(t);break;case"poly":x[2]=rt(x[2],t);break;default:(0,d.R)("unknown transform action",g.action)}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,r=this.instructions[e];if(!r)return t.x=0,t.y=0,t;for(;"closePath"===r.action;){if(e--,e<0)return t.x=0,t.y=0,t;r=this.instructions[e]}switch(r.action){case"moveTo":case"lineTo":t.x=r.data[0],t.y=r.data[1];break;case"quadraticCurveTo":t.x=r.data[2],t.y=r.data[3];break;case"bezierCurveTo":t.x=r.data[4],t.y=r.data[5];break;case"arc":case"arcToSvg":t.x=r.data[5],t.y=r.data[6];break;case"addPath":r.data[0].getLastPoint(t)}return t}}function rt(t,e){return t?t.prepend(e):e.clone()}var it=r(7276);function nt(t,e,r){const i=t.getAttribute(e);return i?Number(i):r}function st(t){const e=nt(t,"x1",0),r=nt(t,"y1",0),i=nt(t,"x2",1),n=nt(t,"y2",0),s=t.getAttribute("gradientUnits")||"objectBoundingBox",a=new it._(e,r,i,n,"objectBoundingBox"===s?"local":"global");for(let e=0;e<t.children.length;e++){const r=t.children[e],i=nt(r,"offset",0),n=o.Q.shared.setValue(r.getAttribute("stop-color")).toNumber();a.addColorStop(i,n)}return a}function ot(t){return(0,d.R)("[SVG Parser] Radial gradients are not yet supported"),new it._(0,0,1,0)}function at(t){const e=t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}const ht={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 lt(t,e){const r=t.getAttribute("style"),i={},n={},s={strokeStyle:i,fillStyle:n,useFill:!1,useStroke:!1};for(const r in ht){const i=t.getAttribute(r);i&&ut(e,s,r,i.trim())}if(r){const t=r.split(";");for(let r=0;r<t.length;r++){const i=t[r].trim(),[n,o]=i.split(":");ht[n]&&ut(e,s,n,o.trim())}}return{strokeStyle:s.useStroke?i:null,fillStyle:s.useFill?n:null,useFill:s.useFill,useStroke:s.useStroke}}function ut(t,e,r,i){switch(r){case"stroke":if("none"!==i){if(i.startsWith("url(")){const r=at(i);e.strokeStyle.fill=t.defs[r]}else e.strokeStyle.color=o.Q.shared.setValue(i).toNumber();e.useStroke=!0}break;case"stroke-width":e.strokeStyle.width=Number(i);break;case"fill":if("none"!==i){if(i.startsWith("url(")){const r=at(i);e.fillStyle.fill=t.defs[r]}else e.fillStyle.color=o.Q.shared.setValue(i).toNumber();e.useFill=!0}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)}}function ct(t){const e=t.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;const r=e.map(Number),i=[],n=[];for(let t=0;t<r.length;t+=2)t+1<r.length&&(i.push(r[t]),n.push(r[t+1]));if(0===i.length||0===n.length)return 0;const s=Math.min(...i),o=Math.max(...i),a=Math.min(...n);return(o-s)*(Math.max(...n)-a)}function dt(t,e){const r=new et(t,!1);for(const t of r.instructions)e.instructions.push(t)}function ft(t,e){if("string"==typeof t){const e=document.createElement("div");e.innerHTML=t.trim(),t=e.querySelector("svg")}const r={context:e,defs:{},path:new et};!function(t,e){const r=t.querySelectorAll("defs");for(let t=0;t<r.length;t++){const i=r[t];for(let t=0;t<i.children.length;t++){const r=i.children[t];switch(r.nodeName.toLowerCase()){case"lineargradient":e.defs[r.id]=st(r);break;case"radialgradient":e.defs[r.id]=ot()}}}}(t,r);const i=t.children,{fillStyle:n,strokeStyle:s}=lt(t,r);for(let t=0;t<i.length;t++){const e=i[t];"defs"!==e.nodeName.toLowerCase()&&pt(e,r,n,s)}return e}function pt(t,e,r,i){const n=t.children,{fillStyle:s,strokeStyle:o}=lt(t,e);s&&r?r={...r,...s}:s&&(r=s),o&&i?i={...i,...o}:o&&(i=o);const a=!r&&!i;let h,l,u,c,f,p,m,y,g,x,v,b,_,w,S,M,A;switch(a&&(r={color:0}),t.nodeName.toLowerCase()){case"path":{w=t.getAttribute("d");const n=t.getAttribute("fill-rule"),s=w.split(/(?=[Mm])/).filter((t=>t.trim().length>0)),o="evenodd"===n,a=s.length>1;if(o&&a){const t=s.map((t=>({path:t,area:ct(t)})));t.sort(((t,e)=>e.area-t.area));const n=s.length>3||!function(t){if(t.length<=2)return!0;const e=t.map((t=>t.area)).sort(((t,e)=>e-t)),[r,i]=e,n=e[e.length-1];return!(r/i>3&&i/n<2)}(t);if(n)for(let n=0;n<t.length;n++){const s=t[n],o=0===n;e.context.beginPath();const a=new et(void 0,!0);dt(s.path,a),e.context.path(a),o?(r&&e.context.fill(r),i&&e.context.stroke(i)):e.context.cut()}else for(let n=0;n<t.length;n++){const s=t[n],o=n%2==1;e.context.beginPath();const a=new et(void 0,!0);dt(s.path,a),e.context.path(a),o?e.context.cut():(r&&e.context.fill(r),i&&e.context.stroke(i))}}else{S=new et(w,!n||"evenodd"===n),e.context.path(S),r&&e.context.fill(r),i&&e.context.stroke(i)}break}case"circle":m=nt(t,"cx",0),y=nt(t,"cy",0),g=nt(t,"r",0),e.context.ellipse(m,y,g,g),r&&e.context.fill(r),i&&e.context.stroke(i);break;case"rect":h=nt(t,"x",0),l=nt(t,"y",0),M=nt(t,"width",0),A=nt(t,"height",0),x=nt(t,"rx",0),v=nt(t,"ry",0),x||v?e.context.roundRect(h,l,M,A,x||v):e.context.rect(h,l,M,A),r&&e.context.fill(r),i&&e.context.stroke(i);break;case"ellipse":m=nt(t,"cx",0),y=nt(t,"cy",0),x=nt(t,"rx",0),v=nt(t,"ry",0),e.context.beginPath(),e.context.ellipse(m,y,x,v),r&&e.context.fill(r),i&&e.context.stroke(i);break;case"line":u=nt(t,"x1",0),c=nt(t,"y1",0),f=nt(t,"x2",0),p=nt(t,"y2",0),e.context.beginPath(),e.context.moveTo(u,c),e.context.lineTo(f,p),i&&e.context.stroke(i);break;case"polygon":_=t.getAttribute("points"),b=_.match(/-?\d+/g).map((t=>parseInt(t,10))),e.context.poly(b,!0),r&&e.context.fill(r),i&&e.context.stroke(i);break;case"polyline":_=t.getAttribute("points"),b=_.match(/-?\d+/g).map((t=>parseInt(t,10))),e.context.poly(b,!1),i&&e.context.stroke(i);break;case"g":case"svg":break;default:(0,d.R)(`[SVG parser] <${t.nodeName}> elements unsupported`)}a&&(r=null);for(let t=0;t<n.length;t++)pt(n[t],e,r,i)}var mt=r(2806);function yt(t){return t instanceof mt.m}function gt(t){return t instanceof it._}function xt(t,e,r){return t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,{...r,...t}}function vt(t,e,r){return e.buildGradient(),t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,t.textureSpace=e.textureSpace,{...r,...t}}function bt(t,e){if(null==t)return null;const r={},i=t;return function(t){return o.Q.isColorLike(t)}(t)?function(t,e,r){const i=o.Q.shared.setValue(e??0);return t.color=i.toNumber(),t.alpha=1===i.alpha?r.alpha:i.alpha,t.texture=l.g.WHITE,{...r,...t}}(r,t,e):function(t){return t instanceof l.g}(t)?function(t,e,r){return t.texture=e,{...r,...t}}(r,t,e):yt(t)?xt(r,t,e):gt(t)?vt(r,t,e):i.fill&&yt(i.fill)?xt(i,i.fill,e):i.fill&&gt(i.fill)?vt(i,i.fill,e):function(t,e){const r={...e,...t},i=o.Q.shared.setValue(r.color);return r.alpha*=i.alpha,r.color=i.toNumber(),r}(i,e)}function _t(t,e){const{width:r,alignment:i,miterLimit:n,cap:s,join:o,pixelLine:a,...h}=e,l=bt(t,h);return l?{width:r,alignment:i,miterLimit:n,cap:s,join:o,pixelLine:a,...l}:null}function wt(t,e){let r=1;const i=t.shapePath.shapePrimitives;for(let t=0;t<i.length;t++){const n=i[t].shape;if("polygon"!==n.type)continue;const s=n.points,o=s.length;if(o<6)continue;const a=n.closePath;for(let t=0;t<o;t+=2){if(!a&&(0===t||t===o-2))continue;const i=(t-2+o)%o,n=(t+2)%o,h=s[i],l=s[i+1],u=s[t],c=s[t+1],d=h-u,f=l-c,p=s[n]-u,m=s[n+1]-c,y=d*d+f*f,g=p*p+m*m;if(y<1e-12||g<1e-12)continue;let x=(d*p+f*m)/Math.sqrt(y*g);x<-1?x=-1:x>1&&(x=1);const v=Math.sqrt(.5*(1-x));if(v<1e-6)continue;const b=Math.min(1/v,e);b>r&&(r=b)}}return r}const St=new h.b,Mt=new a.u,At=class t extends s.A{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=(0,u.L)("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new et,this._transform=new a.u,this._fillStyle={...t.defaultFillStyle},this._strokeStyle={...t.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new c.c,this._boundsDirty=!0}clone(){const e=new t;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=!0,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=bt(e,t.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=_t(e,t.defaultStrokeStyle)}setFillStyle(e){return this._fillStyle=bt(e,t.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=bt(e,t.defaultStrokeStyle),this}texture(t,e,r,i,n,s){return this.instructions.push({action:"texture",data:{image:t,dx:r||0,dy:i||0,dw:n||t.frame.width,dh:s||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e||0===e?o.Q.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new et,this}fill(e,r){let n;const s=this.instructions[this.instructions.length-1];return n=0===this._tick&&"stroke"===s?.action?s.data.path:this._activePath.clone(),n?(null!=e&&(void 0!==r&&"number"==typeof e&&((0,i.t6)(i.lj,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:r}),this._fillStyle=bt(e,t.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:e}=this._activePath.getLastPoint(h.b.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(e){let r;const i=this.instructions[this.instructions.length-1];return r=0===this._tick&&"fill"===i?.action?i.data.path:this._activePath.clone(),r?(null!=e&&(this._strokeStyle=_t(e,t.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:r}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const e=this.instructions[this.instructions.length-1-t],r=this._activePath.clone();if(e&&("stroke"===e.action||"fill"===e.action)){if(!e.data.hole){e.data.hole=r;break}e.data.hole.addPath(r)}}return this._initNextPathLocation(),this}arc(t,e,r,i,n,s){this._tick++;const o=this._transform;return this._activePath.arc(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,r,i,n,s),this}arcTo(t,e,r,i,n){this._tick++;const s=this._transform;return this._activePath.arcTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty,s.a*r+s.c*i+s.tx,s.b*r+s.d*i+s.ty,n),this}arcToSvg(t,e,r,i,n,s,o){this._tick++;const a=this._transform;return this._activePath.arcToSvg(t,e,r,i,n,a.a*s+a.c*o+a.tx,a.b*s+a.d*o+a.ty),this}bezierCurveTo(t,e,r,i,n,s,o){this._tick++;const a=this._transform;return this._activePath.bezierCurveTo(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,a.a*r+a.c*i+a.tx,a.b*r+a.d*i+a.ty,a.a*n+a.c*s+a.tx,a.b*n+a.d*s+a.ty,o),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(t,e,r,i){return this._tick++,this._activePath.ellipse(t,e,r,i,this._transform.clone()),this}circle(t,e,r){return this._tick++,this._activePath.circle(t,e,r,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,e){this._tick++;const r=this._transform;return this._activePath.lineTo(r.a*t+r.c*e+r.tx,r.b*t+r.d*e+r.ty),this}moveTo(t,e){this._tick++;const r=this._transform,i=this._activePath.instructions,n=r.a*t+r.c*e+r.tx,s=r.b*t+r.d*e+r.ty;return 1===i.length&&"moveTo"===i[0].action?(i[0].data[0]=n,i[0].data[1]=s,this):(this._activePath.moveTo(n,s),this)}quadraticCurveTo(t,e,r,i,n){this._tick++;const s=this._transform;return this._activePath.quadraticCurveTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty,s.a*r+s.c*i+s.tx,s.b*r+s.d*i+s.ty,n),this}rect(t,e,r,i){return this._tick++,this._activePath.rect(t,e,r,i,this._transform.clone()),this}roundRect(t,e,r,i,n){return this._tick++,this._activePath.roundRect(t,e,r,i,n,this._transform.clone()),this}poly(t,e){return this._tick++,this._activePath.poly(t,e,this._transform.clone()),this}regularPoly(t,e,r,i,n=0,s){return this._tick++,this._activePath.regularPoly(t,e,r,i,n,s),this}roundPoly(t,e,r,i,n,s){return this._tick++,this._activePath.roundPoly(t,e,r,i,n,s),this}roundShape(t,e,r,i){return this._tick++,this._activePath.roundShape(t,e,r,i),this}filletRect(t,e,r,i,n){return this._tick++,this._activePath.filletRect(t,e,r,i,n),this}chamferRect(t,e,r,i,n,s){return this._tick++,this._activePath.chamferRect(t,e,r,i,n,s),this}star(t,e,r,i,n=0,s=0){return this._tick++,this._activePath.star(t,e,r,i,n,s,this._transform.clone()),this}svg(t){return this._tick++,ft(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.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(t){return this._transform.rotate(t),this}scale(t,e=t){return this._transform.scale(t,e),this}setTransform(t,e,r,i,n,s){return t instanceof a.u?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,e,r,i,n,s),this)}transform(t,e,r,i,n,s){return t instanceof a.u?(this._transform.append(t),this):(Mt.set(t,e,r,i,n,s),this._transform.append(Mt),this)}translate(t,e=t){return this._transform.translate(t,e),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const t=this._bounds;t.clear();for(let e=0;e<this.instructions.length;e++){const r=this.instructions[e],i=r.action;if("fill"===i){const e=r.data;t.addBounds(e.path.bounds)}else if("texture"===i){const e=r.data;t.addFrame(e.dx,e.dy,e.dx+e.dw,e.dy+e.dh,e.transform)}if("stroke"===i){const e=r.data,i=e.style.alignment;let n=e.style.width*(1-i);"miter"===e.style.join&&(n*=wt(e.path,e.style.miterLimit));const s=e.path.bounds;t.addFrame(s.minX-n,s.minY-n,s.maxX+n,s.maxY+n)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){if(!this.bounds.containsPoint(t.x,t.y))return!1;const e=this.instructions;let r=!1;for(let i=0;i<e.length;i++){const n=e[i],s=n.data,o=s.path;if(!n.action||!o)continue;const a=s.style,h=o.shapePath.shapePrimitives;for(let e=0;e<h.length;e++){const i=h[e].shape;if(!a||!i)continue;const o=h[e].transform,l=o?o.applyInverse(t,St):t;if("fill"===n.action)r=i.contains(l.x,l.y);else{const t=a;r=i.strokeContains(l.x,l.y,t.width,t.alignment)}const u=s.hole;if(u){const t=u.shapePath?.shapePrimitives;if(t)for(let e=0;e<t.length;e++)t[e].shape.contains(l.x,l.y)&&(r=!1)}if(r)return!0}}return r}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners();if("boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(e)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(e))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};At.defaultFillStyle={color:16777215,alpha:1,texture:l.g.WHITE,matrix:null,fill:null,textureSpace:"local"},At.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:l.g.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let Ct=At;class Tt{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class Pt{constructor(){this.instructions=new M.L}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const kt=class t{constructor(t){this._renderer=t,this._managedContexts=new A.s({renderer:t,type:"resource",name:"graphicsContext"})}init(e){t.defaultOptions.bezierSmoothness=e?.bezierSmoothness??t.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const e=t._gpuData,r=!!e[this._renderer.uid],i=e[this._renderer.uid]||this._initContext(t);return!t.dirty&&r||(r&&i.reset(),i.isBatchable=!1,t.dirty=!1),i}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const e=new Pt;return this.getGpuContext(t).graphicsData=e,e.init(),e}_initContext(t){const e=new Tt;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};kt.extension={type:[_.Ag.CanvasSystem],name:"graphicsContext"},kt.defaultOptions={bezierSmoothness:.5};let Et=kt;var Rt=r(7547);class It{constructor(t,e){this.state=Rt.U.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new A.s({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}addRenderable(t,e){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(e),e.add(t)}updateRenderable(t){}execute(t){t.isRenderable&&this._adaptor.execute(this,t)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}It.extension={type:[_.Ag.CanvasPipes],name:"graphics"};var Ot=r(2760),Lt=r(6954);class Bt{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach((t=>{C.Z.return(t)})),this.batches.length=0}}class Gt{constructor(t,e){this.state=Rt.U.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new A.s({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const e=t.context,r=!!t._gpuData,i=this.renderer.graphicsContext.updateGpuContext(e);return!(!i.isBatchable&&r===i.isBatchable)}addRenderable(t,e){const r=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),r.isBatchable?this._addToBatcher(t,e):(this.renderer.renderPipes.batch.break(e),e.add(t))}updateRenderable(t){const e=this._getGpuDataForRenderable(t).batches;for(let t=0;t<e.length;t++){const r=e[t];r._batcher.updateElement(r)}}execute(t){if(!t.isRenderable)return;const e=this.renderer,r=t.context;if(!e.graphicsContext.getGpuContext(r).batches.length)return;const i=r.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const n=i.resources.localUniforms.uniforms;n.uTransformMatrix=t.groupTransform,n.uRound=e._roundPixels|t._roundPixels,(0,Ot.V)(t.groupColorAlpha,n.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const e=this._getGpuDataForRenderable(t),r=this.renderer.graphicsContext.updateGpuContext(t.context);e.destroy(),r.isBatchable&&this._updateBatchesForRenderable(t,e)}_addToBatcher(t,e){const r=this.renderer.renderPipes.batch,i=this._getGpuDataForRenderable(t).batches;for(let t=0;t<i.length;t++){const n=i[t];r.addToBatch(n,e)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const e=new Bt;return t._gpuData[this.renderer.uid]=e,this._managedGraphics.add(t),e}_updateBatchesForRenderable(t,e){const r=t.context,i=this.renderer.graphicsContext.getGpuContext(r),n=this.renderer._roundPixels|t._roundPixels;e.batches=i.batches.map((e=>{const r=C.Z.get(Lt.G);return e.copyTo(r),r.renderable=t,r.roundPixels=n,r}))}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}Gt.extension={type:[_.Ag.WebGLPipes,_.Ag.WebGPUPipes],name:"graphics"},_.XO.add(It),_.XO.add(Gt),_.XO.add(Et),_.XO.add(R);class Ft extends n.l{constructor(t){t instanceof Ct&&(t={context:t});const{context:e,roundPixels:r,...i}=t||{};super({label:"Graphics",...i}),this.renderPipeId="graphics",e?this.context=e:(this.context=this._ownedContext=new Ct,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=r??!1}set context(t){t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):!0!==t&&!0!==t?.context||this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_onTouch(t){this._gcLastUsed=t,this._context._gcLastUsed=t}_callContextMethod(t,e){return this.context[t](...e),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){if(t)return new Ft(this._context.clone());this._ownedContext=null;return new Ft(this._context)}lineStyle(t,e,r){(0,i.t6)(i.lj,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const n={};return t&&(n.width=t),e&&(n.color=e),r&&(n.alpha=r),this.context.strokeStyle=n,this}beginFill(t,e){(0,i.t6)(i.lj,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const r={};return void 0!==t&&(r.color=t),void 0!==e&&(r.alpha=e),this.context.fillStyle=r,this}endFill(){(0,i.t6)(i.lj,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return t.width===Ct.defaultStrokeStyle.width&&t.color===Ct.defaultStrokeStyle.color&&t.alpha===Ct.defaultStrokeStyle.alpha||this.context.stroke(),this}drawCircle(...t){return(0,i.t6)(i.lj,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return(0,i.t6)(i.lj,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return(0,i.t6)(i.lj,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return(0,i.t6)(i.lj,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return(0,i.t6)(i.lj,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return(0,i.t6)(i.lj,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}},115:(t,e,r)=>{r.d(e,{h:()=>a});var i=r(5101),n=r(4928);function s(t,e,r,i,n,s,o,a){let h,l;o?(h=i,l=-r):(h=-i,l=r);const u=t-r*n+h,c=e-i*n+l,d=t+r*s+h,f=e+i*s+l;return a.push(u,c),a.push(d,f),2}function o(t,e,r,i,n,s,o,a){const h=r-t,l=i-e;let u=Math.atan2(h,l),c=Math.atan2(n-t,s-e);a&&u<c?u+=2*Math.PI:!a&&u>c&&(c+=2*Math.PI);let d=u;const f=c-u,p=Math.abs(f),m=Math.sqrt(h*h+l*l),y=1+(15*p*Math.sqrt(m)/Math.PI|0),g=f/y;if(d+=g,a){o.push(t,e),o.push(r,i);for(let r=1,i=d;r<y;r++,i+=g)o.push(t,e),o.push(t+Math.sin(i)*m,e+Math.cos(i)*m);o.push(t,e),o.push(n,s)}else{o.push(r,i),o.push(t,e);for(let r=1,i=d;r<y;r++,i+=g)o.push(t+Math.sin(i)*m,e+Math.cos(i)*m),o.push(t,e);o.push(n,s),o.push(t,e)}return 2*y}function a(t,e,r,a,h,l){const u=n.B;if(0===t.length)return;const c=e;let d=c.alignment;if(.5!==e.alignment){let e=function(t){const e=t.length;if(e<6)return 1;let r=0;for(let i=0,n=t[e-2],s=t[e-1];i<e;i+=2){const e=t[i],o=t[i+1];r+=(e-n)*(o+s),n=e,s=o}return r<0?-1:1}(t);r&&(e*=-1),d=(d-.5)*e+.5}const f=new i.b(t[0],t[1]),p=new i.b(t[t.length-2],t[t.length-1]),m=a,y=Math.abs(f.x-p.x)<u&&Math.abs(f.y-p.y)<u;if(m){t=t.slice(),y&&(t.pop(),t.pop(),p.set(t[t.length-2],t[t.length-1]));const e=.5*(f.x+p.x),r=.5*(p.y+f.y);t.unshift(e,r),t.push(e,r)}const g=h,x=t.length/2;let v=t.length;const b=g.length/2,_=c.width/2,w=_*_,S=c.miterLimit*c.miterLimit;let M=t[0],A=t[1],C=t[2],T=t[3],P=0,k=0,E=-(A-T),R=M-C,I=0,O=0,L=Math.sqrt(E*E+R*R);E/=L,R/=L,E*=_,R*=_;const B=2*(1-d),G=2*d;m||("round"===c.cap?v+=o(M-E*(B-G)*.5,A-R*(B-G)*.5,M-E*B,A-R*B,M+E*G,A+R*G,g,!0)+2:"square"===c.cap&&(v+=s(M,A,E,R,B,G,!0,g))),g.push(M-E*B,A-R*B),g.push(M+E*G,A+R*G);for(let e=1;e<x-1;++e){M=t[2*(e-1)],A=t[2*(e-1)+1],C=t[2*e],T=t[2*e+1],P=t[2*(e+1)],k=t[2*(e+1)+1],E=-(A-T),R=M-C,L=Math.sqrt(E*E+R*R),E/=L,R/=L,E*=_,R*=_,I=-(T-k),O=C-P,L=Math.sqrt(I*I+O*O),I/=L,O/=L,I*=_,O*=_;const r=C-M,i=A-T,n=C-P,s=k-T,a=r*n+i*s,h=i*n-s*r,l=h<0;if(Math.abs(h)<.001*Math.abs(a)){g.push(C-E*B,T-R*B),g.push(C+E*G,T+R*G),a>=0&&("round"===c.join?v+=o(C,T,C-E*B,T-R*B,C-I*B,T-O*B,g,!1)+4:v+=2,g.push(C-I*G,T-O*G),g.push(C+I*B,T+O*B));continue}const u=(-E+M)*(-R+T)-(-E+C)*(-R+A),d=(-I+P)*(-O+T)-(-I+C)*(-O+k),f=(r*d-n*u)/h,p=(s*u-i*d)/h,m=(f-C)*(f-C)+(p-T)*(p-T),y=C+(f-C)*B,x=T+(p-T)*B,b=C-(f-C)*G,F=T-(p-T)*G,D=l?B:G;m<=Math.min(r*r+i*i,n*n+s*s)+D*D*w?"bevel"===c.join||m/w>S?(l?(g.push(y,x),g.push(C+E*G,T+R*G),g.push(y,x),g.push(C+I*G,T+O*G)):(g.push(C-E*B,T-R*B),g.push(b,F),g.push(C-I*B,T-O*B),g.push(b,F)),v+=2):"round"===c.join?l?(g.push(y,x),g.push(C+E*G,T+R*G),v+=o(C,T,C+E*G,T+R*G,C+I*G,T+O*G,g,!0)+4,g.push(y,x),g.push(C+I*G,T+O*G)):(g.push(C-E*B,T-R*B),g.push(b,F),v+=o(C,T,C-E*B,T-R*B,C-I*B,T-O*B,g,!1)+4,g.push(C-I*B,T-O*B),g.push(b,F)):(g.push(y,x),g.push(b,F)):(g.push(C-E*B,T-R*B),g.push(C+E*G,T+R*G),"round"===c.join?v+=l?o(C,T,C+E*G,T+R*G,C+I*G,T+O*G,g,!0)+2:o(C,T,C-E*B,T-R*B,C-I*B,T-O*B,g,!1)+2:"miter"===c.join&&m/w<=S&&(l?(g.push(b,F),g.push(b,F)):(g.push(y,x),g.push(y,x)),v+=2),g.push(C-I*B,T-O*B),g.push(C+I*G,T+O*G),v+=2)}M=t[2*(x-2)],A=t[2*(x-2)+1],C=t[2*(x-1)],T=t[2*(x-1)+1],E=-(A-T),R=M-C,L=Math.sqrt(E*E+R*R),E/=L,R/=L,E*=_,R*=_,g.push(C-E*B,T-R*B),g.push(C+E*G,T+R*G),m||("round"===c.cap?v+=o(C-E*(B-G)*.5,T-R*(B-G)*.5,C-E*B,T-R*B,C+E*G,T+R*G,g,!1)+2:"square"===c.cap&&(v+=s(C,T,E,R,B,G,!1,g)));const F=n.I*n.I;for(let t=b;t<v+b-2;++t)M=g[2*t],A=g[2*t+1],C=g[2*(t+1)],T=g[2*(t+1)+1],P=g[2*(t+2)],k=g[2*(t+2)+1],Math.abs(M*(T-k)+C*(k-A)+P*(A-T))<F||l.push(t,t+1,t+2)}},4928:(t,e,r)=>{r.d(e,{B:()=>i,I:()=>n});const i=1e-4,n=1e-4},7276:(t,e,r)=>{r.d(e,{_:()=>f});var i=r(2577),n=r(1761),s=r(9313),o=r(8293),a=r(5589),h=r(133),l=r(4670),u=r(2698);const c=[{offset:0,color:"white"},{offset:1,color:"black"}],d=class t{constructor(...e){this.uid=(0,h.L)("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let r=function(t){let e=t[0]??{};("number"==typeof e||t[1])&&((0,l.t6)("8.5.2","use options object instead"),e={type:"linear",start:{x:t[0],y:t[1]},end:{x:t[2],y:t[3]},textureSpace:t[4],textureSize:t[5]??f.defaultLinearOptions.textureSize});return e}(e);r={..."radial"===r.type?t.defaultRadialOptions:t.defaultLinearOptions,...(0,u.S)(r)},this._textureSize=r.textureSize,this._wrapMode=r.wrapMode,"radial"===r.type?(this.center=r.center,this.outerCenter=r.outerCenter??this.center,this.innerRadius=r.innerRadius,this.outerRadius=r.outerRadius,this.scale=r.scale,this.rotation=r.rotation):(this.start=r.start,this.end=r.end),this.textureSpace=r.textureSpace,this.type=r.type,r.colorStops.forEach((t=>{this.addColorStop(t.offset,t.color)}))}addColorStop(t,e){return this.colorStops.push({offset:t,color:i.Q.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:r,y:i}=this.end,n=r-t,h=i-e;const l=n<0||h<0;if("clamp-to-edge"===this._wrapMode){if(n<0){const e=t;t=r,r=e,n*=-1}if(h<0){const t=e;e=i,i=t,h*=-1}}const u=this.colorStops.length?this.colorStops:c,d=this._textureSize,{canvas:f,context:y}=m(d,1),g=l?y.createLinearGradient(this._textureSize,0,0,0):y.createLinearGradient(0,0,this._textureSize,0);p(g,u),y.fillStyle=g,y.fillRect(0,0,d,1),this.texture=new a.g({source:new o.b({resource:f,addressMode:this._wrapMode})});const x=Math.sqrt(n*n+h*h),v=Math.atan2(h,n),b=new s.u;b.scale(x/d,1),b.rotate(v),b.translate(t,e),"local"===this.textureSpace&&b.scale(d,d),this.transform=b}buildGradient(){this.texture||this._tick++,"linear"===this.type?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:c,e=this._textureSize,{canvas:r,context:i}=m(e,e),{x:n,y:h}=this.center,{x:l,y:u}=this.outerCenter,d=this.innerRadius,f=this.outerRadius,y=l-f,g=u-f,x=e/(2*f),v=(n-y)*x,b=(h-g)*x,_=i.createRadialGradient(v,b,d*x,(l-y)*x,(u-g)*x,f*x);p(_,t),i.fillStyle=t[t.length-1].color,i.fillRect(0,0,e,e),i.fillStyle=_,i.translate(v,b),i.rotate(this.rotation),i.scale(1,this.scale),i.translate(-v,-b),i.fillRect(0,0,e,e),this.texture=new a.g({source:new o.b({resource:r,addressMode:this._wrapMode})});const w=new s.u;w.scale(1/x,1/x),w.translate(y,g),"local"===this.textureSpace&&w.scale(e,e),this.transform=w}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};d.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"},d.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let f=d;function p(t,e){for(let r=0;r<e.length;r++){const i=e[r];t.addColorStop(i.offset,i.color)}}function m(t,e){const r=n.e.get().createCanvas(t,e),i=r.getContext("2d");return{canvas:r,context:i}}},2806:(t,e,r)=>{r.d(e,{m:()=>o});var i=r(9313),n=r(133);const s={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"}};class o{constructor(t,e){this.uid=(0,n.L)("fillPattern"),this._tick=0,this.transform=new i.u,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=s[e].addressModeU,t.source.style.addressModeV=s[e].addressModeV)}setTransform(t){const e=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/e.frame.width,1/e.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}},2801:(t,e,r)=>{r.d(e,{M:()=>Q,y:()=>q});var i=r(8507),n=r(9313),s=r(9252);function o(t,e,r,i,n){const s=e.a,o=e.b,a=e.c,h=e.d,l=e.tx,u=e.ty;r||(r=0),i||(i=2),n||(n=t.length/i-r);let c=r*i;for(let e=0;e<n;e++){const e=t[c],r=t[c+1];t[c]=s*e+a*r+l,t[c+1]=o*e+h*r+u,c+=i}}var a=r(5589),h=r(8655),l=r(6954);const u={extension:{type:i.Ag.ShapeBuilder,name:"circle"},build(t,e){let r,i,n,s,o,a;if("circle"===t.type){const e=t;if(o=a=e.radius,o<=0)return!1;r=e.x,i=e.y,n=s=0}else if("ellipse"===t.type){const e=t;if(o=e.halfWidth,a=e.halfHeight,o<=0||a<=0)return!1;r=e.x,i=e.y,n=s=0}else{const e=t,h=e.width/2,l=e.height/2;r=e.x+h,i=e.y+l,o=a=Math.max(0,Math.min(e.radius,Math.min(h,l))),n=h-o,s=l-a}if(n<0||s<0)return!1;const h=Math.ceil(2.3*Math.sqrt(o+a)),l=8*h+(n?4:0)+(s?4:0);if(0===l)return!1;if(0===h)return e[0]=e[6]=r+n,e[1]=e[3]=i+s,e[2]=e[4]=r-n,e[5]=e[7]=i-s,!0;let u=0,c=4*h+(n?2:0)+2,d=c,f=l,p=n+o,m=s,y=r+p,g=r-p,x=i+m;if(e[u++]=y,e[u++]=x,e[--c]=x,e[--c]=g,s){const t=i-m;e[d++]=g,e[d++]=t,e[--f]=t,e[--f]=y}for(let t=1;t<h;t++){const l=Math.PI/2*(t/h),p=n+Math.cos(l)*o,m=s+Math.sin(l)*a,y=r+p,g=r-p,x=i+m,v=i-m;e[u++]=y,e[u++]=x,e[--c]=x,e[--c]=g,e[d++]=g,e[d++]=v,e[--f]=v,e[--f]=y}p=n,m=s+a,y=r+p,g=r-p,x=i+m;const v=i-m;return e[u++]=y,e[u++]=x,e[--f]=v,e[--f]=y,n&&(e[u++]=g,e[u++]=x,e[--f]=v,e[--f]=g),!0},triangulate(t,e,r,i,n,s){if(0===t.length)return;let o=0,a=0;for(let e=0;e<t.length;e+=2)o+=t[e],a+=t[e+1];o/=t.length/2,a/=t.length/2;let h=i;e[h*r]=o,e[h*r+1]=a;const l=h++;for(let i=0;i<t.length;i+=2)e[h*r]=t[i],e[h*r+1]=t[i+1],i>0&&(n[s++]=h,n[s++]=l,n[s++]=h-1),h++;n[s++]=l+1,n[s++]=l,n[s++]=h-1}},c={...u,extension:{...u.extension,name:"ellipse"}},d={...u,extension:{...u.extension,name:"roundedRectangle"}};var f=r(115),p=r(4928);function m(t,e,r=2){const i=e&&e.length,n=i?e[0]*r:t.length;let s=y(t,0,n,r,!0);const o=[];if(!s||s.next===s.prev)return o;let a,h,l;if(i&&(s=function(t,e,r,i){const n=[];for(let r=0,s=e.length;r<s;r++){const o=y(t,e[r]*i,r<s-1?e[r+1]*i:t.length,i,!1);o===o.next&&(o.steiner=!0),n.push(T(o))}n.sort(S);for(let t=0;t<n.length;t++)r=M(n[t],r);return r}(t,e,s,r)),t.length>80*r){a=t[0],h=t[1];let e=a,i=h;for(let s=r;s<n;s+=r){const r=t[s],n=t[s+1];r<a&&(a=r),n<h&&(h=n),r>e&&(e=r),n>i&&(i=n)}l=Math.max(e-a,i-h),l=0!==l?32767/l:0}return x(s,o,r,a,h,l,0),o}function y(t,e,r,i,n){let s;if(n===N(t,e,r,i)>0)for(let n=e;n<r;n+=i)s=D(n/i|0,t[n],t[n+1],s);else for(let n=r-i;n>=e;n-=i)s=D(n/i|0,t[n],t[n+1],s);return s&&I(s,s.next)&&(z(s),s=s.next),s}function g(t,e){if(!t)return t;e||(e=t);let r,i=t;do{if(r=!1,i.steiner||!I(i,i.next)&&0!==R(i.prev,i,i.next))i=i.next;else{if(z(i),i=e=i.prev,i===i.next)break;r=!0}}while(r||i!==e);return e}function x(t,e,r,i,n,s,o){if(!t)return;!o&&s&&function(t,e,r,i){let n=t;do{0===n.z&&(n.z=C(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){let e,r=1;do{let i,n=t;t=null;let s=null;for(e=0;n;){e++;let o=n,a=0;for(let t=0;t<r&&(a++,o=o.nextZ,o);t++);let h=r;for(;a>0||h>0&&o;)0!==a&&(0===h||!o||n.z<=o.z)?(i=n,n=n.nextZ,a--):(i=o,o=o.nextZ,h--),s?s.nextZ=i:t=i,i.prevZ=s,s=i;n=o}s.nextZ=null,r*=2}while(e>1)}(n)}(t,i,n,s);let a=t;for(;t.prev!==t.next;){const h=t.prev,l=t.next;if(s?b(t,i,n,s):v(t))e.push(h.i,t.i,l.i),z(t),t=l.next,a=l.next;else if((t=l)===a){o?1===o?x(t=_(g(t),e),e,r,i,n,s,2):2===o&&w(t,e,r,i,n,s):x(g(t),e,r,i,n,s,1);break}}}function v(t){const e=t.prev,r=t,i=t.next;if(R(e,r,i)>=0)return!1;const n=e.x,s=r.x,o=i.x,a=e.y,h=r.y,l=i.y,u=Math.min(n,s,o),c=Math.min(a,h,l),d=Math.max(n,s,o),f=Math.max(a,h,l);let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=c&&p.y<=f&&k(n,a,s,h,o,l,p.x,p.y)&&R(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function b(t,e,r,i){const n=t.prev,s=t,o=t.next;if(R(n,s,o)>=0)return!1;const a=n.x,h=s.x,l=o.x,u=n.y,c=s.y,d=o.y,f=Math.min(a,h,l),p=Math.min(u,c,d),m=Math.max(a,h,l),y=Math.max(u,c,d),g=C(f,p,e,r,i),x=C(m,y,e,r,i);let v=t.prevZ,b=t.nextZ;for(;v&&v.z>=g&&b&&b.z<=x;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=y&&v!==n&&v!==o&&k(a,u,h,c,l,d,v.x,v.y)&&R(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,b.x>=f&&b.x<=m&&b.y>=p&&b.y<=y&&b!==n&&b!==o&&k(a,u,h,c,l,d,b.x,b.y)&&R(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;v&&v.z>=g;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=y&&v!==n&&v!==o&&k(a,u,h,c,l,d,v.x,v.y)&&R(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;b&&b.z<=x;){if(b.x>=f&&b.x<=m&&b.y>=p&&b.y<=y&&b!==n&&b!==o&&k(a,u,h,c,l,d,b.x,b.y)&&R(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function _(t,e){let r=t;do{const i=r.prev,n=r.next.next;!I(i,n)&&O(i,r,r.next,n)&&G(i,n)&&G(n,i)&&(e.push(i.i,r.i,n.i),z(r),z(r.next),r=t=n),r=r.next}while(r!==t);return g(r)}function w(t,e,r,i,n,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&E(o,t)){let a=F(o,t);return o=g(o,o.next),a=g(a,a.next),x(o,e,r,i,n,s,0),void x(a,e,r,i,n,s,0)}t=t.next}o=o.next}while(o!==t)}function S(t,e){let r=t.x-e.x;if(0===r&&(r=t.y-e.y,0===r)){r=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}return r}function M(t,e){const r=function(t,e){let r=e;const i=t.x,n=t.y;let s,o=-1/0;if(I(t,r))return r;do{if(I(t,r.next))return r.next;if(n<=r.y&&n>=r.next.y&&r.next.y!==r.y){const t=r.x+(n-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=i&&t>o&&(o=t,s=r.x<r.next.x?r:r.next,t===i))return s}r=r.next}while(r!==e);if(!s)return null;const a=s,h=s.x,l=s.y;let u=1/0;r=s;do{if(i>=r.x&&r.x>=h&&i!==r.x&&P(n<l?i:o,n,h,l,n<l?o:i,n,r.x,r.y)){const e=Math.abs(n-r.y)/(i-r.x);G(r,t)&&(e<u||e===u&&(r.x>s.x||r.x===s.x&&A(s,r)))&&(s=r,u=e)}r=r.next}while(r!==a);return s}(t,e);if(!r)return e;const i=F(r,t);return g(i,i.next),g(r,r.next)}function A(t,e){return R(t.prev,t,e.prev)<0&&R(e.next,t,t.next)<0}function C(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function T(t){let e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function P(t,e,r,i,n,s,o,a){return(n-o)*(e-a)>=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function k(t,e,r,i,n,s,o,a){return!(t===o&&e===a)&&P(t,e,r,i,n,s,o,a)}function E(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&O(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(G(t,e)&&G(e,t)&&function(t,e){let r=t,i=!1;const n=(t.x+e.x)/2,s=(t.y+e.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&n<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}(t,e)&&(R(t.prev,t,e.prev)||R(t,e.prev,e))||I(t,e)&&R(t.prev,t,t.next)>0&&R(e.prev,e,e.next)>0)}function R(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function I(t,e){return t.x===e.x&&t.y===e.y}function O(t,e,r,i){const n=B(R(t,e,r)),s=B(R(t,e,i)),o=B(R(r,i,t)),a=B(R(r,i,e));return n!==s&&o!==a||(!(0!==n||!L(t,r,e))||(!(0!==s||!L(t,i,e))||(!(0!==o||!L(r,t,i))||!(0!==a||!L(r,e,i)))))}function L(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function B(t){return t>0?1:t<0?-1:0}function G(t,e){return R(t.prev,t,t.next)<0?R(t,e,t.next)>=0&&R(t,t.prev,e)>=0:R(t,e,t.prev)<0||R(t,t.next,e)<0}function F(t,e){const r=j(t.i,t.x,t.y),i=j(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,s.next=i,i.prev=s,i}function D(t,e,r,i){const n=j(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function z(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function j(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function N(t,e,r,i){let n=0;for(let s=e,o=r-i;s<r;s+=i)n+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return n}r(8875);const U=m.default||m;function X(t,e,r,i,n,s,o){const a=U(t,e,2);if(!a)return;for(let t=0;t<a.length;t+=3)s[o++]=a[t]+n,s[o++]=a[t+1]+n,s[o++]=a[t+2]+n;let h=n*i;for(let e=0;e<t.length;e+=2)r[h]=t[e],r[h+1]=t[e+1],h+=i}const Y=[],V={extension:{type:i.Ag.ShapeBuilder,name:"polygon"},build(t,e){for(let r=0;r<t.points.length;r++)e[r]=t.points[r];return!0},triangulate(t,e,r,i,n,s){X(t,Y,e,r,i,n,s)}},$={extension:{type:i.Ag.ShapeBuilder,name:"rectangle"},build(t,e){const r=t,i=r.x,n=r.y,s=r.width,o=r.height;return s>0&&o>0&&(e[0]=i,e[1]=n,e[2]=i+s,e[3]=n,e[4]=i+s,e[5]=n+o,e[6]=i,e[7]=n+o,!0)},triangulate(t,e,r,i,n,s){let o=0;e[(i*=r)+o]=t[0],e[i+o+1]=t[1],o+=r,e[i+o]=t[2],e[i+o+1]=t[3],o+=r,e[i+o]=t[6],e[i+o+1]=t[7],o+=r,e[i+o]=t[4],e[i+o+1]=t[5],o+=r;const a=i/r;n[s++]=a,n[s++]=a+1,n[s++]=a+2,n[s++]=a+1,n[s++]=a+3,n[s++]=a+2}},W={extension:{type:i.Ag.ShapeBuilder,name:"triangle"},build:(t,e)=>(e[0]=t.x,e[1]=t.y,e[2]=t.x2,e[3]=t.y2,e[4]=t.x3,e[5]=t.y3,!0),triangulate(t,e,r,i,n,s){let o=0;e[(i*=r)+o]=t[0],e[i+o+1]=t[1],o+=r,e[i+o]=t[2],e[i+o+1]=t[3],o+=r,e[i+o]=t[4],e[i+o+1]=t[5];const a=i/r;n[s++]=a,n[s++]=a+1,n[s++]=a+2}};var H=r(2413);const q={};i.XO.handleByMap(i.Ag.ShapeBuilder,q),i.XO.add($,V,W,u,c,d);const Z=new s.M,K=new n.u;function Q(t,e){const{geometryData:r,batches:i}=e;i.length=0,r.indices.length=0,r.vertices.length=0,r.uvs.length=0;for(let e=0;e<t.instructions.length;e++){const n=t.instructions[e];if("texture"===n.action)J(n.data,i,r);else if("fill"===n.action||"stroke"===n.action){const t="stroke"===n.action,e=n.data.path.shapePath,s=n.data.style,o=n.data.hole;t&&o&&tt(o.shapePath,s,!0,i,r),o&&(e.shapePrimitives[e.shapePrimitives.length-1].holes=o.shapePath.shapePrimitives),tt(e,s,t,i,r)}}}function J(t,e,r){const i=[],n=q.rectangle,s=Z;s.x=t.dx,s.y=t.dy,s.width=t.dw,s.height=t.dh;const a=t.transform;if(!n.build(s,i))return;const{vertices:u,uvs:c,indices:d}=r,f=d.length,p=u.length/2;a&&o(i,a),n.triangulate(i,u,2,p,d,f);const m=t.image,y=m.uvs;c.push(y.x0,y.y0,y.x1,y.y1,y.x3,y.y3,y.x2,y.y2);const g=h.Z.get(l.G);g.indexOffset=f,g.indexSize=d.length-f,g.attributeOffset=p,g.attributeSize=u.length/2-p,g.baseColor=t.style,g.alpha=t.alpha,g.texture=m,g.geometryData=r,e.push(g)}function tt(t,e,r,i,n){const{vertices:s,uvs:u,indices:c}=n;t.shapePrimitives.forEach((({shape:t,transform:d,holes:m})=>{const y=[],g=q[t.type];if(!g.build(t,y))return;const x=c.length,v=s.length/2;let b="triangle-list";if(d&&o(y,d),r){const r=t.closePath??!0,i=e;i.pixelLine?(!function(t,e,r,i){const n=p.B;if(0===t.length)return;const s=t[0],o=t[1],a=t[t.length-2],h=t[t.length-1],l=e||Math.abs(s-a)<n&&Math.abs(o-h)<n,u=r,c=t.length/2,d=u.length/2;for(let e=0;e<c;e++)u.push(t[2*e]),u.push(t[2*e+1]);for(let t=0;t<c-1;t++)i.push(d+t,d+t+1);l&&i.push(d+c-1,d)}(y,r,s,c),b="line-list"):(0,f.h)(y,i,!1,r,s,c)}else if(m){const t=[],e=y.slice();(function(t){const e=[];for(let r=0;r<t.length;r++){const i=t[r].shape,n=[];q[i.type].build(i,n)&&e.push(n)}return e})(m).forEach((r=>{t.push(e.length/2),e.push(...r)})),X(e,t,s,2,v,c,x)}else g.triangulate(y,s,2,v,c,x);const _=u.length/2,w=e.texture;if(w!==a.g.WHITE){const r=(0,H.Y)(K,e,t,d);!function(t,e,r,i,n,s,o,a=null){let h=0;r*=e,n*=s;const l=a.a,u=a.b,c=a.c,d=a.d,f=a.tx,p=a.ty;for(;h<o;){const o=t[r],a=t[r+1];i[n]=l*o+c*a+f,i[n+1]=u*o+d*a+p,n+=s,r+=e,h++}}(s,2,v,u,_,2,s.length/2-v,r)}else!function(t,e,r,i){let n=0;for(e*=r;n<i;)t[e]=0,t[e+1]=0,e+=r,n++}(u,_,2,s.length/2-v);const S=h.Z.get(l.G);S.indexOffset=x,S.indexSize=c.length-x,S.attributeOffset=v,S.attributeSize=s.length/2-v,S.baseColor=e.color,S.alpha=e.alpha,S.texture=w,S.geometryData=n,S.topology=b,i.push(S)}))}},2413:(t,e,r)=>{r.d(e,{Y:()=>h});var i=r(9313),n=r(9252),s=r(7276);const o=new i.u,a=new n.M;function h(t,e,r,i){const n=e.matrix?t.copyFrom(e.matrix).invert():t.identity();if("local"===e.textureSpace){const t=r.getBounds(a);e.width&&t.pad(e.width);const{x:i,y:s}=t,o=1/t.width,h=1/t.height,l=-i*o,u=-s*h,c=n.a,d=n.b,f=n.c,p=n.d;n.a*=o,n.b*=o,n.c*=h,n.d*=h,n.tx=l*c+u*f+n.tx,n.ty=l*d+u*p+n.ty}else n.translate(e.texture.frame.x,e.texture.frame.y),n.scale(1/e.texture.source.width,1/e.texture.source.height);const h=e.texture.source.style;return e.fill instanceof s._||"clamp-to-edge"!==h.addressMode||(h.addressMode="repeat",h.update()),i&&n.append(o.copyFrom(i).invert()),n}},0:(t,e,r)=>{r.d(e,{k:()=>a});var i=r(2812),n=r(5589);var s=r(4670),o=r(4985);class a extends o.l{constructor(t=n.g.EMPTY){t instanceof n.g&&(t={texture:t});const{texture:e=n.g.EMPTY,anchor:r,roundPixels:s,width:o,height:a,...h}=t;super({label:"Sprite",...h}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new i.o({_onUpdate:()=>{this.onViewUpdate()}}),r?this.anchor=r:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=s??!1,void 0!==o&&(this.width=o),void 0!==a&&(this.height=a)}static from(t,e=!1){return t instanceof n.g?new a(t):new a(n.g.from(t,e))}set texture(t){t||(t=n.g.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,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 function(t,e,r){const{width:i,height:n}=r.orig,s=r.trim;if(s){const r=s.width,o=s.height;t.minX=s.x-e._x*i,t.maxX=t.minX+r,t.minY=s.y-e._y*n,t.maxY=t.minY+o}else t.minX=-e._x*i,t.maxX=t.minX+i,t.minY=-e._y*n,t.maxY=t.minY+n}(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return(0,s.t6)("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,r=this._bounds,{width:i,height:n}=e.orig;r.minX=-t._x*i,r.maxX=r.minX+i,r.minY=-t._y*n,r.maxY=r.minY+n}destroy(t=!1){super.destroy(t);if("boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._texture.destroy(e)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,this._texture.orig.width),void 0!==e&&this._setHeight(e,this._texture.orig.height)}}},4985:(t,e,r)=>{r.d(e,{l:()=>s});var i=r(9636),n=r(5559);class s extends n.mc{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new i.c(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const e=this.bounds,{x:r,y:i}=t;return r>=e.minX&&r<=e.maxX&&i>=e.minY&&i<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,e,r){const{renderPipes:i}=e;i.blendMode.pushBlendMode(this,this.groupBlendMode,t);const n=i[this.renderPipeId];n?.addRenderable&&n.addRenderable(this,t),this.didViewUpdate=!1;const s=this.children,o=s.length;for(let i=0;i<o;i++)s[i].collectRenderables(t,e,r);i.blendMode.popBlendMode(t)}}},6312:(t,e,r)=>{var i=r(8507),n=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(n||{}),s=r(268),o=r(1761);function a(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function h(t){return t.split("?")[0].split("#")[0]}const l={toPosix(t){return e="\\",r="/",t.replace(new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),r);var e,r},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),isBlobUrl:t=>t.startsWith("blob:"),hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){a(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const r=/^[^/:]+:\/{0,2}/.exec(t);return r?r[0]:""},toAbsolute(t,e,r){if(a(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const i=h(this.toPosix(e??o.e.get().getBaseUrl())),n=h(this.toPosix(r??this.rootname(i)));if((t=this.toPosix(t)).startsWith("/"))return l.join(n,t.slice(1));return this.isAbsolute(t)?t:this.join(i,t)},normalize(t){if(a(t),0===t.length)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;let e="";const r=(t=this.toPosix(t)).startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return(t=function(t,e){let r="",i=0,n=-1,s=0,o=-1;for(let a=0;a<=t.length;++a){if(a<t.length)o=t.charCodeAt(a);else{if(47===o)break;o=47}if(47===o){if(n===a-1||1===s);else if(n!==a-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){const t=r.lastIndexOf("/");if(t!==r.length-1){-1===t?(r="",i=0):(r=r.slice(0,t),i=r.length-1-r.lastIndexOf("/")),n=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,n=a,s=0;continue}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+=`/${t.slice(n+1,a)}`:r=t.slice(n+1,a),i=a-n-1;n=a,s=0}else 46===o&&-1!==s?++s:s=-1}return r}(t,!1)).length>0&&i&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return a(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){if(0===t.length)return".";let e;for(let r=0;r<t.length;++r){const i=t[r];if(a(i),i.length>0)if(void 0===e)e=i;else{const n=t[r-1]??"";this.joinExtensions.includes(this.extname(n).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return void 0===e?".":this.normalize(e)},dirname(t){if(a(t),0===t.length)return".";let e=(t=this.toPosix(t)).charCodeAt(0);const r=47===e;let i=-1,n=!0;const s=this.getProtocol(t),o=t;for(let r=(t=t.slice(s.length)).length-1;r>=1;--r)if(e=t.charCodeAt(r),47===e){if(!n){i=r;break}}else n=!1;return-1===i?r?"/":this.isUrl(o)?s+t:s:r&&1===i?"//":s+t.slice(0,i)},rootname(t){a(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);e=-1!==r?t.slice(0,r):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){a(t),e&&a(e),t=h(this.toPosix(t));let r,i=0,n=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let o=e.length-1,a=-1;for(r=t.length-1;r>=0;--r){const h=t.charCodeAt(r);if(47===h){if(!s){i=r+1;break}}else-1===a&&(s=!1,a=r+1),o>=0&&(h===e.charCodeAt(o)?-1==--o&&(n=r):(o=-1,n=a))}return i===n?n=a:-1===n&&(n=t.length),t.slice(i,n)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!s){i=r+1;break}}else-1===n&&(s=!1,n=r+1);return-1===n?"":t.slice(i,n)},extname(t){a(t);let e=-1,r=0,i=-1,n=!0,s=0;for(let o=(t=h(this.toPosix(t))).length-1;o>=0;--o){const a=t.charCodeAt(o);if(47!==a)-1===i&&(n=!1,i=o+1),46===a?-1===e?e=o:1!==s&&(s=1):-1!==e&&(s=-1);else if(!n){r=o+1;break}}return-1===e||-1===i||0===s||1===s&&e===i-1&&e===r+1?"":t.slice(e,i)},parse(t){a(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let r=(t=h(this.toPosix(t))).charCodeAt(0);const i=this.isAbsolute(t);let n;e.root=this.rootname(t),n=i||this.hasProtocol(t)?1:0;let s=-1,o=0,l=-1,u=!0,c=t.length-1,d=0;for(;c>=n;--c)if(r=t.charCodeAt(c),47!==r)-1===l&&(u=!1,l=c+1),46===r?-1===s?s=c:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){o=c+1;break}return-1===s||-1===l||0===d||1===d&&s===l-1&&s===o+1?-1!==l&&(e.base=e.name=0===o&&i?t.slice(1,l):t.slice(o,l)):(0===o&&i?(e.name=t.slice(1,s),e.base=t.slice(1,l)):(e.name=t.slice(o,s),e.base=t.slice(o,l)),e.ext=t.slice(s,l)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};var u=r(2406);function c(t,e,r,i,n){const s=e[r];for(let o=0;o<s.length;o++){const a=s[o];r<e.length-1?c(t.replace(i[r],a),e,r+1,i,n):n.push(t.replace(i[r],a))}}function d(t){const e=t.match(/\{(.*?)\}/g),r=[];if(e){const i=[];e.forEach((t=>{const e=t.substring(1,t.length-1).split(",");i.push(e)})),c(t,i,0,e,r)}else r.push(t);return r}const f=t=>!Array.isArray(t);class p{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach((t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))})),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if("string"==typeof t)this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}}getAlias(t){const{alias:e,src:r}=t;return(0,u.z)(e||r,(t=>"string"==typeof t?t:Array.isArray(t)?t.map((t=>t?.src??t)):t?.src?t.src:t),!0)}removeAlias(t,e){this._assetMap[t]&&(e&&e!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&(0,s.R)("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach((t=>{this.addBundle(t.name,t.assets)}))}addBundle(t,e){const r=[];let i=e;Array.isArray(e)||(i=Object.entries(e).map((([t,e])=>"string"==typeof e||Array.isArray(e)?{alias:t,src:e}:{alias:t,...e}))),i.forEach((e=>{const i=e.src,n=e.alias;let s;if("string"==typeof n){const e=this._createBundleAssetId(t,n);r.push(e),s=[n,e]}else{const e=n.map((e=>this._createBundleAssetId(t,e)));r.push(...e),s=[...n,...e]}this.add({...e,alias:s,src:i})})),this._bundles[t]=r}add(t){const e=[];let r;Array.isArray(t)?e.push(...t):e.push(t),r=t=>{this.hasKey(t)&&(0,s.R)(`[Resolver] already has key: ${t} overwriting`)};(0,u.z)(e).forEach((t=>{const{src:e}=t;let{data:i,format:n,loadParser:s,parser:o}=t;const a=(0,u.z)(e).map((t=>"string"==typeof t?d(t):Array.isArray(t)?t:[t])),h=this.getAlias(t);Array.isArray(h)?h.forEach(r):r(h);const l=[],c=t=>{const e=this._parsers.find((e=>e.test(t)));return{src:t,...e?.parse(t)}};a.forEach((e=>{e.forEach((e=>{let r={};if("object"!=typeof e?r=c(e):(i=e.data??i,n=e.format??n,(e.loadParser||e.parser)&&(s=e.loadParser??s,o=e.parser??o),r={...c(e.src),...e}),!h)throw new Error(`[Resolver] alias is undefined for this asset: ${r.src}`);r=this._buildResolvedAsset(r,{aliases:h,data:i,format:n,loadParser:s,parser:o,progressSize:t.progressSize}),l.push(r)}))})),h.forEach((t=>{this._assetMap[t]=l}))}))}resolveBundle(t){const e=f(t);t=(0,u.z)(t);const r={};return t.forEach((t=>{const e=this._bundles[t];if(e){const i=this.resolve(e),n={};for(const e in i){const r=i[e];n[this._extractAssetIdFromBundle(t,e)]=r}r[t]=n}})),e?r[t[0]]:r}resolveUrl(t){const e=this.resolve(t);if("string"!=typeof t){const t={};for(const r in e)t[r]=e[r].src;return t}return e.src}resolve(t){const e=f(t);t=(0,u.z)(t);const r={};return t.forEach((t=>{if(!this._resolverHash[t])if(this._assetMap[t]){let e=this._assetMap[t];const r=this._getPreferredOrder(e);r?.priority.forEach((t=>{r.params[t].forEach((r=>{const i=e.filter((e=>!!e[t]&&e[t]===r));i.length&&(e=i)}))})),this._resolverHash[t]=e[0]}else this._resolverHash[t]=this._buildResolvedAsset({alias:[t],src:t},{});r[t]=this._resolverHash[t]})),e?r[t[0]]:r}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const r=t[e],i=this._preferredOrder.find((t=>t.params.format.includes(r.format)));if(i)return i}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;return`${t}${/\?/.test(t)?"&":"?"}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){const{aliases:r,data:i,loadParser:n,parser:s,format:o,progressSize:a}=e;return(this._basePath||this._rootPath)&&(t.src=l.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=r??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...i||{},...t.data},t.loadParser=n??t.loadParser,t.parser=s??t.parser,t.format=o??t.format??t.src.split(".").pop().split("?").shift().split("#").shift(),void 0!==a&&(t.progressSize=a),t}}p.RETINA_PREFIX=/@([0-9\.]+)x/;const m=(t,e)=>{const r=e.split("?")[1];return r&&(t+=`?${r}`),t};var y=r(5589),g=r(9252),x=r(583);const v=class t{constructor(t,e){this.linkedSheets=[];let r=t;t?.source instanceof x.v&&(r={texture:t,data:e});const{texture:i,data:n,cachePrefix:s=""}=r;this.cachePrefix=s,this._texture=i instanceof y.g?i:null,this.textureSource=i.source,this.textures={},this.animations={},this.data=n;const o=parseFloat(n.meta.scale);o?(this.resolution=o,i.source.resolution=this.resolution):this.resolution=i.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<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()}))}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(e,r=!1){let i=e;const n=r?1/0:t.BATCH_SIZE;for(;i-e<n&&i<this._frameKeys.length;){const t=this._frameKeys[i],e=this._frames[t],r=e.frame;if(r){let i=null,n=null;const s=!1!==e.trimmed&&e.sourceSize?e.sourceSize:e.frame,o=new g.M(0,0,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution);i=e.rotated?new g.M(Math.floor(r.x)/this.resolution,Math.floor(r.y)/this.resolution,Math.floor(r.h)/this.resolution,Math.floor(r.w)/this.resolution):new g.M(Math.floor(r.x)/this.resolution,Math.floor(r.y)/this.resolution,Math.floor(r.w)/this.resolution,Math.floor(r.h)/this.resolution),!1!==e.trimmed&&e.spriteSourceSize&&(n=new g.M(Math.floor(e.spriteSourceSize.x)/this.resolution,Math.floor(e.spriteSourceSize.y)/this.resolution,Math.floor(r.w)/this.resolution,Math.floor(r.h)/this.resolution)),this.textures[t]=new y.g({source:this.textureSource,frame:i,orig:o,trim:n,rotate:e.rotated?2:0,defaultAnchor:e.anchor,defaultBorders:e.borders,label:t.toString()})}i++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let r=0;r<t[e].length;r++){const i=t[e][r];this.animations[e].push(this.textures[i])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((()=>{this._batchIndex*t.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())}),0)}destroy(t=!1){for(const t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};v.BATCH_SIZE=1e3;let b=v;const _=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function w(t,e,r){const i={};if(t.forEach((t=>{i[t]=e})),Object.keys(e.textures).forEach((t=>{i[`${e.cachePrefix}${t}`]=e.textures[t]})),!r){const r=l.dirname(t[0]);e.linkedSheets.forEach(((t,n)=>{const s=w([`${r}/${e.data.meta.related_multi_packs[n]}`],t,!0);Object.assign(i,s)}))}return i}const S={extension:i.Ag.Asset,cache:{test:t=>t instanceof b,getCacheableAssets:(t,e)=>w(t,e,!1)},resolver:{extension:{type:i.Ag.ResolveParser,name:"resolveSpritesheet"},test:t=>{const e=t.split("?")[0].split("."),r=e.pop(),i=e.pop();return"json"===r&&_.includes(i)},parse:t=>{const e=t.split(".");return{resolution:parseFloat(p.RETINA_PREFIX.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:i.Ag.LoadParser,priority:n.Normal,name:"spritesheetLoader"},testParse:async(t,e)=>".json"===l.extname(e.src).toLowerCase()&&!!t.frames,async parse(t,e,r){const{texture:i,imageFilename:n,textureOptions:s,cachePrefix:o}=e?.data??{};let a,h=l.dirname(e.src);if(h&&h.lastIndexOf("/")!==h.length-1&&(h+="/"),i instanceof y.g)a=i;else{const i=m(h+(n??t.meta.image),e.src);a=(await r.load([{src:i,data:s}]))[i]}const u=new b({texture:a.source,data:t,cachePrefix:o});await u.parse();const c=t?.meta?.related_multi_packs;if(Array.isArray(c)){const t=[];for(const i of c){if("string"!=typeof i)continue;let n=h+i;e.data?.ignoreMultiPack||(n=m(n,e.src),t.push(r.load({src:n,data:{textureOptions:s,ignoreMultiPack:!0}})))}const i=await Promise.all(t);u.linkedSheets=i,i.forEach((t=>{t.linkedSheets=[u].concat(u.linkedSheets.filter((e=>e!==t)))}))}return u},async unload(t,e,r){await r.unload(t.textureSource._sourceOrigin),t.destroy(!1)}}};i.XO.add(S)},7309:(t,e,r)=>{r.d(e,{R:()=>o});var i=r(4458);class n{constructor(t,e=null,r=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=r,this._once=i}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const s=class t{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new n(null,null,1/0),this.deltaMS=1/t.targetFPMS,this.elapsedMS=1/t.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=i.d.NORMAL){return this._addListener(new n(t,e,r))}addOnce(t,e,r=i.d.NORMAL){return this._addListener(new n(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let r;if(e>this.lastTime){if(r=this.elapsedMS=e-this.lastTime,r>this._maxElapsedMS&&(r=this._maxElapsedMS),r*=this.speed,this._minElapsedMS){const t=e-this._lastFrame|0;if(t<this._minElapsedMS)return;this._lastFrame=e-t%this._minElapsedMS}this.deltaMS=r,this.deltaTime=this.deltaMS*t.targetFPMS;const i=this._head;let n=i.next;for(;n;)n=n.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){const r=Math.min(Math.max(0,e)/1e3,t.targetFPMS);this._maxElapsedMS=1/r,this._minElapsedMS&&e>this.maxFPS&&(this.maxFPS=e)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){0===t?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!t._shared){const e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared}static get system(){if(!t._system){const e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system}};s.targetFPMS=.06;let o=s},4458:(t,e,r)=>{r.d(e,{d:()=>i});var i=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(i||{})},4577:(t,e,r)=>{let i;function n(){if("boolean"==typeof i)return i;try{const t=new Function("param1","param2","param3","return param1[param2] === param3;");i=!0===t({a:"b"},"a","b")}catch(t){i=!1}return i}r.d(e,{f:()=>n})},2571:(t,e,r)=>{r.d(e,{xv:()=>i});r(8875);const i="8.17.1"},4334:(t,e,r)=>{r.d(e,{s:()=>i});class i{constructor(t){this.items=Object.create(null);const{renderer:e,type:r,onUnload:i,priority:n,name:s}=t;this._renderer=e,e.gc.addResourceHash(this,"items",r,n??0),this._onUnload=i,this.name=s}add(t){return!this.items[t.uid]&&(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)}remove(t,...e){if(!this.items[t.uid])return;const r=t._gpuData[this._renderer.uid];r&&(this._onUnload?.(t,...e),r.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach((e=>e&&this.remove(e,...t)))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}},9903:(t,e,r)=>{function i(t,e,r){const i=t.length;let n;if(e>=i||0===r)return;const s=i-(r=e+r>i?i-e:r);for(n=e;n<s;++n)t[n]=t[n+r];t.length=s}r.d(e,{d:()=>i})},133:(t,e,r)=>{r.d(e,{L:()=>n});const i={default:-1};function n(t="default"){return void 0===i[t]&&(i[t]=-1),++i[t]}},7073:(t,e,r)=>{r.d(e,{M:()=>s,d:()=>o});var i=r(8507),n=r(2571);class s{static init(){globalThis.__PIXI_APP_INIT__?.(this,n.xv)}static destroy(){}}s.extension=i.Ag.Application;class o{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,n.xv)}destroy(){this._renderer=null}}o.extension={type:[i.Ag.WebGLSystem,i.Ag.WebGPUSystem],name:"initHook",priority:-10}},4670:(t,e,r)=>{r.d(e,{Ek:()=>s,lj:()=>n,t6:()=>a});const i=new Set,n="8.0.0",s="8.3.4",o={quiet:!1,noColor:!1},a=(t,e,r=3)=>{if(o.quiet||i.has(e))return;let n=(new Error).stack;const s=`${e}\nDeprecated since v${t}`,a="function"==typeof console.groupCollapsed&&!o.noColor;void 0===n?console.warn("PixiJS Deprecation Warning: ",s):(n=n.split("\n").splice(r).join("\n"),a?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",s),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",s),console.warn(n))),i.add(e)};Object.defineProperties(a,{quiet:{get:()=>o.quiet,set:t=>{o.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>o.noColor,set:t=>{o.noColor=t},enumerable:!0,configurable:!1}})},268:(t,e,r)=>{r.d(e,{R:()=>s});let i=0;const n=500;function s(...t){i!==n&&(i++,i===n?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}},6083:(t,e,r)=>{r.d(e,{L:()=>i});const i={_registeredResources:new Set,register(t){this._registeredResources.add(t)},unregister(t){this._registeredResources.delete(t)},release(){this._registeredResources.forEach((t=>t.clear()))},get registeredCount(){return this._registeredResources.size},isRegistered(t){return this._registeredResources.has(t)},reset(){this._registeredResources.clear()}}},8655:(t,e,r)=>{r.d(e,{Z:()=>s});var i=r(6083);class n{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return this._index>0?e=this._pool[--this._index]:(e=new this._classType,this._count++),e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}const s=new class{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new n(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach((e=>{const r=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[r]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}})),t}clear(){this._poolsByClass.forEach((t=>t.clear())),this._poolsByClass.clear()}};i.L.register(s)},8875:(t,e,r)=>{r.d(e,{A:()=>i});const i=r(5585)}},i={};function n(t){var e=i[t];if(void 0!==e)return e.exports;var s=i[t]={exports:{}};return r[t](s,s.exports,n),s.exports}n.m=r,n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.f={},n.e=t=>Promise.all(Object.keys(n.f).reduce(((e,r)=>(n.f[r](t,e),e)),[])),n.u=t=>t+".vizor_2d.min.js",n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="vizor_2d:",n.l=(r,i,s,o)=>{if(t[r])t[r].push(i);else{var a,h;if(void 0!==s)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var c=l[u];if(c.getAttribute("src")==r||c.getAttribute("data-webpack")==e+s){a=c;break}}a||(h=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,n.nc&&a.setAttribute("nonce",n.nc),a.setAttribute("data-webpack",e+s),a.src=r),t[r]=[i];var d=(e,i)=>{a.onerror=a.onload=null,clearTimeout(f);var n=t[r];if(delete t[r],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((t=>t(i))),e)return e(i)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),h&&document.head.appendChild(a)}},n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;if("string"==typeof import.meta.url&&(t=import.meta.url),!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),(()=>{var t={792:0};n.f.j=(e,r)=>{var i=n.o(t,e)?t[e]:void 0;if(0!==i)if(i)r.push(i[2]);else{var s=new Promise(((r,n)=>i=t[e]=[r,n]));r.push(i[2]=s);var o=n.p+n.u(e),a=new Error;n.l(o,(r=>{if(n.o(t,e)&&(0!==(i=t[e])&&(t[e]=void 0),i)){var s=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,i[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var i,s,[o,a,h]=r,l=0;if(o.some((e=>0!==t[e]))){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(h)h(n)}for(e&&e(r);l<o.length;l++)s=o[l],n.o(t,s)&&t[s]&&t[s][0](),t[s]=0},r=self.webpackChunkvizor_2d=self.webpackChunkvizor_2d||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var s={};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,h(i.key),i)}}function h(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}n.d(s,{o:()=>Jt,v:()=>Wt});var l=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return e=t,i=[{key:"build",value:function(e){if(!e)return function(){return!0};switch(e.op){case"and":var r=e.rules.map((function(e){return t.build(e)}));return function(t){return r.every((function(e){return e(t)}))};case"or":var i=e.rules.map((function(e){return t.build(e)}));return function(t){return i.some((function(e){return e(t)}))};case"not":var n=t.build(e.rule);return function(t){return!n(t)};case"eq":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])===e.value};case"neq":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])!==e.value};case"gt":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])>e.value};case"lt":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])<e.value};case"gte":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])>=e.value};case"lte":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])<=e.value};case"regex":var s=new RegExp(e.value);return function(t){var r,i=null===(r=t.data)||void 0===r?void 0:r[e.field];return s.test(String(null!=i?i:""))};case"in":return function(t){var r;return e.value.includes(null===(r=t.data)||void 0===r?void 0:r[e.field])};case"exists":return function(t){return e.field in(t.data||{})};default:return console.warn("Unknown rule:",e),function(){return!0}}}}],(r=null)&&a(e.prototype,r),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,i}();function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||f(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function f(t,e){if(t){if("string"==typeof t)return p(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function m(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,y(i.key),i)}}function y(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}var g=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.attractionStrength=.15,this.repulsionStrength=200,this.damping=.95,this.minDist=20,this.planetRadius=60,this.planetRepulsion=2,this.orbitStrength=0,this.collisionPadding=2,this.collisionIterations=2,this.velocityEpsilon=.01,this.energyThreshold=.1,this.cooling=.99,this.minStrength=.001},e=[{key:"setModel",value:function(t){this.model=t}},{key:"resolveMoonCollisions",value:function(t){for(var e=0;e<this.collisionIterations;e++)for(var r=0;r<t.length;r++)for(var i=r+1;i<t.length;i++){var n=t[r],s=t[i],o=n.radius||10,a=s.radius||10,h=s.x-n.x,l=s.y-n.y,u=Math.sqrt(h*h+l*l)||1e-4,c=o+a+this.collisionPadding;if(u<c){var d=h/u,f=l/u,p=.5*(c-u);n.fixed||(n.x-=d*p,n.y-=f*p),s.fixed||(s.x+=d*p,s.y+=f*p)}}}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),i=r.filter((function(t){return"moon"===t.type})),n=r.filter((function(t){return"planet"===t.type})),s=d(i);try{for(s.s();!(t=s.n()).done;){var o=t.value;o.vx*=this.damping,o.vy*=this.damping}}catch(t){s.e(t)}finally{s.f()}for(var a=0;a<i.length;a++)for(var h=a+1;h<i.length;h++){var l=i[a],u=i[h],f=l.x-u.x,p=l.y-u.y,m=Math.sqrt(f*f+p*p)||.01;m=Math.max(m,this.minDist);var y=this.repulsionStrength/(m*m),g=f/m*y,x=p/m*y;l.fixed||(l.vx+=g,l.vy+=x),u.fixed||(u.vx-=g,u.vy-=x)}var v,b=d(n);try{var _=function(){var t=v.value,r=i.filter((function(e){return t.rule(e)}));if(0===r.length)return 1;if(t.vector){var n,s={x:t.x,y:t.y},o=t.direction,a=t.length,h=t.scalarField,l=r.map((function(t){return t.data[h]})).filter((function(t){return null!=t})),u=Math.min.apply(Math,c(l)),f=Math.max.apply(Math,c(l)),p=d(r);try{for(p.s();!(n=p.n()).done;){var m=n.value,y=m.data[h];null==y&&(y=u);var g=f>u?(y-u)/(f-u):.5;m.x=s.x+o.x*a*g,m.y=s.y+o.y*a*g}}catch(t){p.e(t)}finally{p.f()}}else{var x,b=d(r);try{for(b.s();!(x=b.n()).done;){var _=x.value,w=t.x-_.x,S=t.y-_.y,M=Math.sqrt(w*w+S*S)||.01;M=Math.max(M,e.minDist);var A=e.attractionStrength*(M-100);_.fixed||(_.vx+=w/M*A,_.vy+=S/M*A),0!==e.orbitStrength&&(_.vx+=-S/M*e.orbitStrength,_.vy+=w/M*e.orbitStrength)}}catch(t){b.e(t)}finally{b.f()}}};for(b.s();!(v=b.n()).done;)_()}catch(t){b.e(t)}finally{b.f()}var w,S=d(n);try{for(S.s();!(w=S.n()).done;){var M,A=w.value,C=d(i);try{for(C.s();!(M=C.n()).done;){var T=M.value,P=T.x-A.x,k=T.y-A.y,E=Math.sqrt(P*P+k*k)||.01;if(E<this.planetRadius){var R=this.planetRadius-E,I=P/E*R*this.planetRepulsion,O=k/E*R*this.planetRepulsion;T.fixed||(T.vx+=I,T.vy+=O)}}}catch(t){C.e(t)}finally{C.f()}}}catch(t){S.e(t)}finally{S.f()}var L,B=this.bounds||{minX:-1/0,maxX:1/0,minY:-1/0,maxY:1/0},G=0,F=d(i);try{for(F.s();!(L=F.n()).done;){var D=L.value;D.fixed||(D.x+=D.vx,D.y+=D.vy,D.x=Math.max(B.minX,Math.min(B.maxX,D.x)),D.y=Math.max(B.minY,Math.min(B.maxY,D.y)),D.vx*=.95,D.vy*=.95,Math.abs(D.vx)<this.velocityEpsilon&&(D.vx=0),Math.abs(D.vy)<this.velocityEpsilon&&(D.vy=0),G+=Math.abs(D.vx)+Math.abs(D.vy))}}catch(t){F.e(t)}finally{F.f()}if(this.resolveMoonCollisions(i),G<this.energyThreshold){var z,j=d(i);try{for(j.s();!(z=j.n()).done;){var N=z.value;N.vx=0,N.vy=0}}catch(t){j.e(t)}finally{j.f()}}this.attractionStrength=Math.max(this.minStrength,this.attractionStrength*this.cooling),this.repulsionStrength=Math.max(this.minStrength,this.repulsionStrength*this.cooling)}}],e&&m(t.prototype,e),r&&m(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function v(t){return function(t){if(Array.isArray(t))return w(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function _(t,e){if(t){if("string"==typeof t)return w(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function S(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,M(i.key),i)}}function M(t){var e=function(t,e){if("object"!=x(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=x(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==x(e)?e:e+""}var A=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.attractionStrength=.05,this.repulsionStrength=200,this.damping=.9,this.minDist=20,this.minDistSq=this.minDist*this.minDist,this.planetRadius=60,this.planetRepulsion=2,this.orbitStrength=0,this.cellSize=80,this.maxNeighbors=15},e=[{key:"setModel",value:function(t){this.model=t}},{key:"_buildGrid",value:function(t){var e,r=new Map,i=b(t);try{for(i.s();!(e=i.n()).done;){var n=e.value,s=Math.floor(n.x/this.cellSize),o=Math.floor(n.y/this.cellSize),a=s+","+o;r.has(a)||r.set(a,[]),r.get(a).push(n),n._cellX=s,n._cellY=o}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"_getNeighbors",value:function(t,e){for(var r=[],i=-1;i<=1;i++)for(var n=-1;n<=1;n++){var s=e._cellX+i+","+(e._cellY+n),o=t.get(s);if(o){var a,h=b(o);try{for(h.s();!(a=h.n()).done;){var l=a.value;if(l!==e&&(r.push(l),r.length>=this.maxNeighbors))return r}}catch(t){h.e(t)}finally{h.f()}}}return r}},{key:"step",value:function(){var t=this,e=this.model.getNodes(),r=e.filter((function(t){return"moon"===t.type})),i=e.filter((function(t){return"planet"===t.type})),n=this.bounds;if(n){var s,o=b(r);try{for(o.s();!(s=o.n()).done;){var a=s.value;a.vx*=this.damping,a.vy*=this.damping}}catch(t){o.e(t)}finally{o.f()}var h,l=this._buildGrid(r),u=b(r);try{for(u.s();!(h=u.n()).done;){var c,d=h.value,f=b(this._getNeighbors(l,d));try{for(f.s();!(c=f.n()).done;){var p=c.value,m=d.x-p.x,y=d.y-p.y,g=m*m+y*y;g<this.minDistSq&&(g=this.minDistSq);var x=this.repulsionStrength/g,_=Math.sqrt(g),w=m/_*x,S=y/_*x;d.fixed||(d.vx+=w,d.vy+=S)}}catch(t){f.e(t)}finally{f.f()}}}catch(t){u.e(t)}finally{u.f()}var M,A=b(i);try{var C=function(){var e=M.value,i=r.filter((function(t){return e.rule(t)}));if(0===i.length)return 1;if(e.vector){var n,s={x:e.x,y:e.y},o=e.direction,a=e.length,h=e.scalarField,l=i.map((function(t){return t.data[h]})).filter((function(t){return null!=t})),u=Math.min.apply(Math,v(l)),c=Math.max.apply(Math,v(l)),d=b(i);try{for(d.s();!(n=d.n()).done;){var f=n.value,p=f.data[h];null==p&&(p=u);var m=c>u?(p-u)/(c-u):.5;f.x=s.x+o.x*a*m,f.y=s.y+o.y*a*m}}catch(t){d.e(t)}finally{d.f()}}else{var y,g=b(i);try{for(g.s();!(y=g.n()).done;){var x=y.value,_=e.x-x.x,w=e.y-x.y,S=_*_+w*w;S<t.minDistSq&&(S=t.minDistSq);var A=Math.sqrt(S),C=t.attractionStrength*A;x.fixed||(x.vx+=_/A*C,x.vy+=w/A*C),0!==t.orbitStrength&&(x.vx+=-w/A*t.orbitStrength,x.vy+=_/A*t.orbitStrength)}}catch(t){g.e(t)}finally{g.f()}}};for(A.s();!(M=A.n()).done;)C()}catch(t){A.e(t)}finally{A.f()}var T,P=b(i);try{for(P.s();!(T=P.n()).done;){var k,E=T.value,R=b(r);try{for(R.s();!(k=R.n()).done;){var I=k.value,O=I.x-E.x,L=I.y-E.y,B=Math.sqrt(O*O+L*L)||.01;if(B<this.planetRadius){var G=this.planetRadius-B,F=O/B*G*this.planetRepulsion,D=L/B*G*this.planetRepulsion;I.fixed||(I.vx+=F,I.vy+=D)}}}catch(t){R.e(t)}finally{R.f()}}}catch(t){P.e(t)}finally{P.f()}var z,j=b(r);try{for(j.s();!(z=j.n()).done;){var N=z.value;N.fixed||(N.x+=N.vx,N.y+=N.vy,N.x=Math.max(n.minX,Math.min(n.maxX,N.x)),N.y=Math.max(n.minY,Math.min(n.maxY,N.y)))}}catch(t){j.e(t)}finally{j.f()}}}}],e&&S(t.prototype,e),r&&S(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function T(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||k(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=k(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function k(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function R(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,I(i.key),i)}}function I(t){var e=function(t,e){if("object"!=C(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=C(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==C(e)?e:e+""}var O=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.innerRadius=20,this.outerRadius=300,this.turns=4,this.spread=1,this.smoothing=.15,this.angleOffset=0,this.arcStep=12,this.wobbleStrength=2,this.wobbleFrequency=2,this.wobbleSpeed=.02,this.wobbleThreshold=3e3},e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),i=r.filter((function(t){return"moon"===t.type})),n=P(r.filter((function(t){return"planet"===t.type})));try{var s=function(){var r=t.value,n=r.scalarField;if(!n)return 0;var s=i.filter((function(t){return r.rule(t)}));if(0===s.length)return 0;var o,a=1/0,h=-1/0,l=P(s);try{for(l.s();!(o=l.n()).done;){var u=o.value.data[n];null!=u&&(u<a&&(a=u),u>h&&(h=u))}}catch(t){l.e(t)}finally{l.f()}if(a===1/0||h===-1/0)return 0;r._sorted&&!r._dirty||(r._sorted=T(s).sort((function(t,e){var r,i;return(null!==(r=t.data[n])&&void 0!==r?r:a)-(null!==(i=e.data[n])&&void 0!==i?i:a)})),r._sorted.forEach((function(t,e){t._spiralIndex=e})),r._dirty=!1);var c,d=r._sorted,f=d.length<e.wobbleThreshold,p=P(d);try{for(p.s();!(c=p.n()).done;){var m=c.value,y=m.data[n];null==y&&(y=a);var g=h>a?(y-a)/(h-a):.5,x=e.angleOffset+g*e.turns*Math.PI*2,v=e.innerRadius+g*(e.outerRadius-e.innerRadius)*e.spread,b=m._spiralIndex||0,_=x+b*(e.arcStep/(v+1)),w=v+.5*b,S=0;f&&(void 0===m._spiralPhase&&(m._spiralPhase=Math.random()*Math.PI*2),m._spiralPhase+=e.wobbleSpeed,S=Math.sin(m._spiralPhase*e.wobbleFrequency)*e.wobbleStrength);var M=r.x+Math.cos(_)*(w+S),A=r.y+Math.sin(_)*(w+S);m.x+=(M-m.x)*e.smoothing,m.y+=(A-m.y)*e.smoothing}}catch(t){p.e(t)}finally{p.f()}};for(n.s();!(t=n.n()).done;)s()}catch(t){n.e(t)}finally{n.f()}}}],e&&R(t.prototype,e),r&&R(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function B(t){return function(t){if(Array.isArray(t))return F(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||G(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function D(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,z(i.key),i)}}function z(t){var e=function(t,e){if("object"!=L(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=L(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==L(e)?e:e+""}var j=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.smoothing=.2,this.padding=40,this.jitter=10},e=[{key:"setModel",value:function(t){this.model=t}},{key:"_mapCategorical",value:function(t){var e=B(new Set(t)),r=new Map;return e.forEach((function(t,e){r.set(t,e)})),r}},{key:"step",value:function(){var t=this,e=this.model.getNodes(),r=e.filter((function(t){return"moon"===t.type})),i=e.filter((function(t){return"vector"===t.type})),n=this.bounds;if(n){var s,o=n.minY+this.padding,a=n.maxY-this.padding-o,h=n.minX+this.padding,l=n.maxX-this.padding-h,u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=G(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}(i);try{var c=function(){var e=s.value,i=e.scalarField;if(!i)return 0;var n=r.filter((function(t){return e.rule(t)}));if(0===n.length)return 0;var u=n.map((function(t){return t.data[i]})).filter((function(t){return null!=t}));if(0===u.length)return 0;var c,d,f,p="number"==typeof u[0];p?(c=Math.min.apply(Math,B(u)),d=Math.max.apply(Math,B(u))):(f=t._mapCategorical(u),c=0,d=f.size-1),n.sort((function(t,e){var r,n,s=t.data[i],o=e.data[i];return p||(s=f.get(s),o=f.get(o)),(null!==(r=s)&&void 0!==r?r:0)-(null!==(n=o)&&void 0!==n?n:0)})),n.forEach((function(r,n){var s=r.data[i];null==s&&(s=c),p||(s=f.get(s));var u=r.x,m=r.y;if(p){var y,g,x=d>c?(s-c)/(d-c):.5;0!==(null===(y=e.direction)||void 0===y?void 0:y.x)&&(u=h+x*l),0!==(null===(g=e.direction)||void 0===g?void 0:g.y)&&(m=o+x*a)}else{var v,b,_=d+1;if(0!==(null===(v=e.direction)||void 0===v?void 0:v.y)){var w=a/_;m=o+s*w+w/2,u=r.x+(Math.random()-.5)*t.jitter}if(0!==(null===(b=e.direction)||void 0===b?void 0:b.x)){var S=l/_;u=h+s*S+S/2,m=r.y+(Math.random()-.5)*t.jitter}}r.x+=(u-r.x)*t.smoothing,r.y+=(m-r.y)*t.smoothing}))};for(u.s();!(s=u.n()).done;)c()}catch(t){u.e(t)}finally{u.f()}}}}],e&&D(t.prototype,e),r&&D(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function N(t){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(t)}function U(t){return function(t){if(Array.isArray(t))return Y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||X(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(t,e){if(t){if("string"==typeof t)return Y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Y(t,e):void 0}}function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function V(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,$(i.key),i)}}function $(t){var e=function(t,e){if("object"!=N(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=N(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==N(e)?e:e+""}var W=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.innerRadius=20,this.outerRadius=300,this.turns=4,this.spread=1,this.smoothing=.15,this.angleOffset=0,this.jitter=.002,this.wobbleStrength=2,this.wobbleFrequency=2},e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),i=r.filter((function(t){return"moon"===t.type})),n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=X(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}(r.filter((function(t){return"planet"===t.type})));try{var s=function(){var r=t.value,n=r.scalarField;if(!n)return 0;var s=i.filter((function(t){return r.rule(t)}));if(0===s.length)return 0;s.sort((function(t,e){var r,i;return(null!==(r=t.data[n])&&void 0!==r?r:0)-(null!==(i=e.data[n])&&void 0!==i?i:0)}));var o=s.map((function(t){return t.data[n]})).filter((function(t){return null!=t}));if(0===o.length)return 0;var a=Math.min.apply(Math,U(o)),h=Math.max.apply(Math,U(o));s.forEach((function(t,i){var s=t.data[n];null==s&&(s=a);var o=h>a?(s-a)/(h-a):.5,l=e.angleOffset+o*e.turns*Math.PI*2,u=e.innerRadius+o*(e.outerRadius-e.innerRadius)*e.spread;void 0===t._spiralPhase&&(t._spiralPhase=Math.random()*Math.PI*2),t._spiralPhase+=.02;var c=Math.sin(t._spiralPhase*e.wobbleFrequency)*e.wobbleStrength,d=r.x+Math.cos(l)*(u+c),f=r.y+Math.sin(l)*(u+c);Math.random(),e.jitter,t.x+=(d-t.x)*e.smoothing,t.y+=(f-t.y)*e.smoothing}))};for(n.s();!(t=n.n()).done;)s()}catch(t){n.e(t)}finally{n.f()}}}],e&&V(t.prototype,e),r&&V(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function q(t){return function(t){if(Array.isArray(t))return K(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Z(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(t,e){if(t){if("string"==typeof t)return K(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(t,e):void 0}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function Q(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,J(i.key),i)}}function J(t){var e=function(t,e){if("object"!=H(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=H(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==H(e)?e:e+""}var tt=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.innerRadius=50,this.outerRadius=240,this.rings=6,this.angularSpeed=.002,this.smoothing=.15,this.wobbleStrength=2,this.wobbleFrequency=2,this.angleJitter=.002},e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),i=r.filter((function(t){return"moon"===t.type})),n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Z(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}(r.filter((function(t){return"planet"===t.type})));try{var s=function(){var r=t.value,n=r.scalarField;if(!n)return 0;var s=i.filter((function(t){return r.rule(t)}));if(0===s.length)return 0;var o=s.map((function(t){return t.data[n]})).filter((function(t){return null!=t}));if(0===o.length)return 0;var a=Math.min.apply(Math,q(o)),h=Math.max.apply(Math,q(o));s.forEach((function(t){var i=t.data[n];null==i&&(i=a);var s=h>a?(i-a)/(h-a):.5,o=Math.floor(s*e.rings),l=Math.min(e.rings-1,o),u=Math.pow(l/(e.rings-1||1),1.5),c=e.innerRadius+u*(e.outerRadius-e.innerRadius);void 0===t._orbitAngle&&(t._orbitAngle=Math.random()*Math.PI*2);var d=e.angularSpeed/(1+.5*l);t._orbitAngle+=d;var f=Math.sin(t._orbitAngle*e.wobbleFrequency)*e.wobbleStrength,p=r.x+Math.cos(t._orbitAngle)*(c+f),m=r.y+Math.sin(t._orbitAngle)*(c+f);t._orbitAngle+=(Math.random()-.5)*e.angleJitter,t.x+=(p-t.x)*e.smoothing,t.y+=(m-t.y)*e.smoothing}))};for(n.s();!(t=n.n()).done;)s()}catch(t){n.e(t)}finally{n.f()}}}],e&&Q(t.prototype,e),r&&Q(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return it(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?it(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function it(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function nt(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,st(i.key),i)}}function st(t){var e=function(t,e){if("object"!=et(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==et(e)?e:e+""}var ot=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gravity=.005,this.damping=.999,this.restitution=.7,this.friction=.98,this.radius=10},(e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this.model.getNodes().filter((function(t){return"moon"===t.type})),r=this.bounds,i=r.maxY,n=rt(e);try{for(n.s();!(t=n.n()).done;){var s=t.value;s.fixed||(s.vy+=this.gravity,s.x+=s.vx,s.y+=s.vy,s.y+this.radius>i&&(s.y=i-this.radius,s.vy*=-this.restitution,s.vx*=this.friction),s.x-this.radius<r.minX&&(s.x=r.minX+this.radius,s.vx*=-this.restitution),s.x+this.radius>r.maxX&&(s.x=r.maxX-this.radius,s.vx*=-this.restitution),s.vx*=this.damping,s.vy*=this.damping)}}catch(t){n.e(t)}finally{n.f()}}}])&&nt(t.prototype,e),r&&nt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function at(t){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(t)}function ht(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,lt(i.key),i)}}function lt(t){var e=function(t,e){if("object"!=at(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=at(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==at(e)?e:e+""}var ut=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.view=e,this.model=r,this.selected=new Set,this._bindViewEvents()},(e=[{key:"_bindViewEvents",value:function(){var t=this;this.view.onNodeClick=function(e){t._inspectNode(e)},this.view.onNodeRightClick=function(e){var r=e.node,i=e.global,n=t.view.app.canvas.getBoundingClientRect(),s=n.left+i.x,o=n.top+i.y;t._showContextMenu(s,o,r)},this.view.onNodeDragStart=function(t){t.vx=0,t.vy=0,t.fixed=!0},this.view.onNodeDragMove=function(t,e){t.x=e.x,t.y=e.y},this.view.onNodeDragEnd=function(t){t.fixed=!1},this.view.onBackgroundPointerDown=function(){t._hideContextMenu()},this.view.onNodeClick=function(t,e){console.log("Selected:",t)},this.view.onSelectionChange=function(t){console.log("Selected nodes:",t)}}},{key:"_inspectNode",value:function(t){var e=document.getElementById("inspector");e||((e=document.createElement("div")).id="inspector",document.body.appendChild(e)),e.innerHTML="\n <pre>".concat(JSON.stringify(t.data,null,2),"</pre>\n ")}},{key:"_showContextMenu",value:function(t,e,r){var i=this;this._hideContextMenu();var n=document.createElement("div");n.className="context-menu";var s=this.view.app.canvas.parentElement,o=s.getBoundingClientRect();n.style.position="absolute",n.style.left="".concat(t-o.left,"px"),n.style.top="".concat(e-o.top,"px"),n.style.background="#222",n.style.color="#fff",n.style.padding="8px",n.style.borderRadius="6px",n.style.cursor="pointer",n.style.zIndex=1e3;var a=document.createElement("div");a.textContent="Delete Node",a.addEventListener("click",(function(){i._deleteNode(r),i._hideContextMenu()})),n.appendChild(a),s.appendChild(n),this._contextMenu=n}},{key:"_hideContextMenu",value:function(){this._contextMenu&&(this._contextMenu.remove(),this._contextMenu=null)}},{key:"_deleteNode",value:function(t){this.model.deleteNode(t.id);var e=this.view.graphicsMap.get(t.id);e&&(e.destroy(),this.view.graphicsMap.delete(t.id));var r=this.view.graphicsMap.get(t.id+"_axis");r&&(r.destroy(),this.view.graphicsMap.delete(t.id+"_axis")),this.selected.delete(t.id)}},{key:"_highlight",value:function(t){var e=this.view.graphicsMap.get(t);e&&(e.tint=16711680)}}])&&ht(t.prototype,e),r&&ht(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),ct=n(8507);const dt={extension:{type:ct.Ag.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Promise.all([n.e(859),n.e(397)]).then(n.bind(n,8397))}},ft={extension:{type:ct.Ag.Environment,name:"webworker",priority:0},test:()=>"undefined"!=typeof self&&void 0!==self.WorkerGlobalScope,load:async()=>{await Promise.all([n.e(859),n.e(162)]).then(n.bind(n,2162))}};n(5753),n(6312);var pt=n(1761),mt=n(800);let yt,gt;async function xt(t={}){return void 0!==gt||(gt=await(async()=>{const e=pt.e.get().getNavigator().gpu;if(!e)return!1;try{const r=await e.requestAdapter(t);return await r.requestDevice(),!0}catch(t){return!1}})()),gt}const vt=["webgl","webgpu","canvas"];var bt=n(5559),_t=n(7073),wt=n(4670);class St{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame((()=>this.resize())))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;let t,e;if(this._cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,e=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:i}=this._resizeTo;t=r,e=i}this.renderer.resize(t,e),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}St.extension=ct.Ag.Application;var Mt=n(4458),At=n(7309);class Ct{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Mt.d.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?At.R.shared:new At.R,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Ct.extension=ct.Ag.Application,ct.XO.add(St),ct.XO.add(Ct);const Tt=class t{constructor(...t){this.stage=new bt.mc,void 0!==t[0]&&(0,wt.t6)(wt.lj,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.stage||(this.stage=new bt.mc),this.renderer=await async function(t){let e,r=[];t.preference?(r.push(t.preference),vt.forEach((e=>{e!==t.preference&&r.push(e)}))):r=vt.slice();let i={};for(let o=0;o<r.length;o++){const a=r[o];if("webgpu"===a&&await xt()){const{WebGPURenderer:r}=await Promise.all([n.e(468),n.e(337)]).then(n.bind(n,1337));e=r,i={...t,...t.webgpu};break}if("webgl"===a&&(s=t.failIfMajorPerformanceCaveat??mt.k.defaultOptions.failIfMajorPerformanceCaveat,void 0!==yt||(yt=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:s??mt.k.defaultOptions.failIfMajorPerformanceCaveat};try{if(!pt.e.get().getWebGLRenderingContext())return!1;let e=pt.e.get().createCanvas().getContext("webgl",t);const r=!!e?.getContextAttributes()?.stencil;if(e){const t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}return e=null,r}catch(t){return!1}})()),yt)){const{WebGLRenderer:r}=await Promise.all([n.e(468),n.e(132)]).then(n.bind(n,4132));e=r,i={...t,...t.webgl};break}if("canvas"===a){const{CanvasRenderer:r}=await Promise.all([n.e(468),n.e(851)]).then(n.bind(n,6851));e=r,i={...t,...t.canvasOptions};break}}var s;if(delete i.webgpu,delete i.webgl,delete i.canvasOptions,!e)throw new Error("No available renderer for the current environment");const o=new e;return await o.init(i),o}(e),t._plugins.forEach((t=>{t.init.call(this,e)}))}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return(0,wt.t6)(wt.lj,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,r=!1){const i=t._plugins.slice(0);i.reverse(),i.forEach((t=>{t.destroy.call(this)})),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null}};Tt._plugins=[];let Pt=Tt;ct.XO.handleByList(ct.Ag.Application,Pt._plugins),ct.XO.add(_t.M);n(9726);var kt=n(9501);n(8875);function Et(t){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(t)}function Rt(){Rt=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",h=s.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,i){var s=e&&e.prototype instanceof g?e:g,o=Object.create(s.prototype),a=new E(i||[]);return n(o,"_invoke",{value:C(t,r,a)}),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",y={};function g(){}function x(){}function v(){}var b={};l(b,o,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(R([])));w&&w!==r&&i.call(w,o)&&(b=w);var S=v.prototype=g.prototype=Object.create(b);function M(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(n,s,o,a){var h=c(t[n],t,s);if("throw"!==h.type){var l=h.arg,u=l.value;return u&&"object"==Et(u)&&i.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(u).then((function(t){l.value=t,o(l)}),(function(t){return r("throw",t,o,a)}))}a(h.arg)}var s;n(this,"_invoke",{value:function(t,i){function n(){return new e((function(e,n){r(t,i,e,n)}))}return s=s?s.then(n,n):n()}})}function C(e,r,i){var n=d;return function(s,o){if(n===p)throw Error("Generator is already running");if(n===m){if("throw"===s)throw o;return{value:t,done:!0}}for(i.method=s,i.arg=o;;){var a=i.delegate;if(a){var h=T(a,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===d)throw n=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=p;var l=c(e,r,i);if("normal"===l.type){if(n=i.done?m:f,l.arg===y)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n=m,i.method="throw",i.arg=l.arg)}}}function T(e,r){var i=r.method,n=e.iterator[i];if(n===t)return r.delegate=null,"throw"===i&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var s=c(n,e.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,y;var o=s.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,s=function r(){for(;++n<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw new TypeError(Et(e)+" is not iterable")}return x.prototype=v,n(S,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:x,configurable:!0}),x.displayName=l(v,h,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,h,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},M(A.prototype),l(A.prototype,a,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,i,n,s){void 0===s&&(s=Promise);var o=new A(u(t,r,i,n),s);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(S),l(S,h,"Generator"),l(S,o,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var i in e)r.push(i);return r.reverse(),function t(){for(;r.length;){var i=r.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=R,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(i,n){return a.type="throw",a.arg=e,r.next=i,n&&(r.method="next",r.arg=t),!!n}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var h=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(h&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(h){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var s=n;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var n=i.arg;k(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,r,i){return this.delegate={iterator:R(e),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=t),y}},e}function It(t,e,r,i,n,s,o){try{var a=t[s](o),h=a.value}catch(t){return void r(t)}a.done?e(h):Promise.resolve(h).then(i,n)}function Ot(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var s=t.apply(e,r);function o(t){It(s,i,n,o,a,"next",t)}function a(t){It(s,i,n,o,a,"throw",t)}o(void 0)}))}}function Lt(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Bt(i.key),i)}}function Bt(t){var e=function(t,e){if("object"!=Et(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=Et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Et(e)?e:e+""}ct.XO.add(dt,ft);var Gt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=e,this.selectedNodes=new Set,this.isSelecting=!1,this.selectionStart=null,this.selectionBox=null,this.isCtrlPressed=!1,this.mode=null,this.graphicsMap=new Map,this.dragging=!1,this.lastPos=null,this.pointers=new Map,this.lastDist=null,this.minScale=.1,this.maxScale=10,this.onBackgroundPointerDown=null,this._initKeyboard()}return e=t,r=[{key:"_initPixi",value:(s=Ot(Rt().mark((function t(){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.app=new Pt,this.app.stage.eventMode="static",t.next=4,this.app.init({resizeTo:this.container,background:1973790});case 4:this.container.appendChild(this.app.canvas),this.world=new bt.mc,this.app.stage.addChild(this.world),this._initResizeObserver(),this._initPointers(),this._initWheelZoom(),this._initPinchZoom();case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_initKeyboard",value:function(){var t=this;window.addEventListener("keydown",(function(e){(e.ctrlKey||e.metaKey)&&(t.isCtrlPressed=!0)})),window.addEventListener("keyup",(function(e){e.ctrlKey||e.metaKey||(t.isCtrlPressed=!1)}))}},{key:"_initResizeObserver",value:function(){var t=this;this.resizeObserver=new ResizeObserver((function(){t.width=t.container.clientWidth,t.height=t.container.clientHeight;var e=t.screenToWorld(t.width/2,t.height/2);t.app.renderer.resize(t.width,t.height),t.center(e.x,e.y)})),this.resizeObserver.observe(this.container)}},{key:"_createSelectionBox",value:function(){var t=new kt.A;return this.world.addChild(t),t}},{key:"getWorldBounds",value:function(){var t=this.app.canvas,e=this.screenToWorld(0,0),r=this.screenToWorld(t.width,t.height);return{minX:e.x,minY:e.y,maxX:r.x,maxY:r.y}}},{key:"add",value:function(t){this.world.addChild(t)}},{key:"screenToWorld",value:function(t,e){return{x:(t-this.world.x)/this.world.scale.x,y:(e-this.world.y)/this.world.scale.y}}},{key:"center",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.app.screen.width,i=this.app.screen.height;this.world.x=r/2-t*this.world.scale.x,this.world.y=i/2-e*this.world.scale.y}},{key:"_initPointers",value:function(){var t=this,e=this.app.canvas,r=function(e){t.pointers.delete(e.pointerId),t.pointers.size<2&&(t.lastDist=null),0===t.pointers.size&&(t.dragging=!1,t.mode=null)};e.addEventListener("pointerdown",(function(r){var i;if(t.pointers.set(r.pointerId,r),r.target===e){null===(i=t.onBackgroundPointerDown)||void 0===i||i.call(t);var n=t.screenToWorld(r.offsetX,r.offsetY);t.isCtrlPressed?(t.mode="select",t.isSelecting=!0,t.selectionStart=n,t.selectionBox=t._createSelectionBox()):(t.mode="pan",t.dragging=!0,t.lastPos={x:r.clientX,y:r.clientY})}})),e.addEventListener("pointermove",(function(e){if("select"===t.mode&&t.isSelecting){var r=t.screenToWorld(e.offsetX,e.offsetY),i=Math.min(t.selectionStart.x,r.x),n=Math.min(t.selectionStart.y,r.y),s=Math.abs(r.x-t.selectionStart.x),o=Math.abs(r.y-t.selectionStart.y);t.selectionBox.clear().rect(i,n,s,o).stroke({width:1,color:16777215}).fill({color:16777215,alpha:.1})}else if("pan"===t.mode&&t.dragging&&1===t.pointers.size&&!t.lockPan){var a=e.clientX-t.lastPos.x,h=e.clientY-t.lastPos.y;t.world.x+=a,t.world.y+=h,t.lastPos={x:e.clientX,y:e.clientY}}})),e.addEventListener("pointerup",(function(e){if("select"===t.mode&&t.isSelecting){var i,n=t.screenToWorld(e.offsetX,e.offsetY),s=Math.min(t.selectionStart.x,n.x),o=Math.max(t.selectionStart.x,n.x),a=Math.min(t.selectionStart.y,n.y),h=Math.max(t.selectionStart.y,n.y);t.isCtrlPressed||t.selectedNodes.clear(),t.graphicsMap.forEach((function(e){var r=e.nodeRef;if(r){var i=r.radius||20;r.x+i>=s&&r.x-i<=o&&r.y+i>=a&&r.y-i<=h&&t.selectedNodes.add(r)}})),null===(i=t.onSelectionChange)||void 0===i||i.call(t,Array.from(t.selectedNodes)),t.world.removeChild(t.selectionBox),t.selectionBox.destroy(),t.selectionBox=null,t.isSelecting=!1}"pan"===t.mode&&(t.dragging=!1),t.mode=null,r(e)})),e.addEventListener("pointerupoutside",r),e.addEventListener("pointercancel",r),e.addEventListener("pointerleave",r)}},{key:"_initWheelZoom",value:function(){var t=this,e=this.app.canvas;e.addEventListener("wheel",(function(r){r.preventDefault();var i=e.getBoundingClientRect(),n=r.clientX-i.left,s=r.clientY-i.top,o=r.deltaY>0?1/1.1:1.1,a=t.screenToWorld(n,s);t.world.scale.x*=o,t.world.scale.y*=o,t.world.scale.x=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.x)),t.world.scale.y=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.y)),t.world.x=n-a.x*t.world.scale.x,t.world.y=s-a.y*t.world.scale.y}),{passive:!1})}},{key:"_initPinchZoom",value:function(){var t=this;this.app.canvas.addEventListener("pointermove",(function(e){if(t.pointers.has(e.pointerId)&&(t.pointers.set(e.pointerId,e),2===t.pointers.size)){var r=Array.from(t.pointers.values()),i=r[0],n=r[1],s=(i.clientX+n.clientX)/2,o=(i.clientY+n.clientY)/2,a=i.clientX-n.clientX,h=i.clientY-n.clientY,l=Math.sqrt(a*a+h*h);if(!t.lastDist)return void(t.lastDist=l);var u=l/t.lastDist,c=t.screenToWorld(s,o);t.world.scale.x*=u,t.world.scale.y*=u,t.world.scale.x=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.x)),t.world.scale.y=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.y)),t.world.x=s-c.x*t.world.scale.x,t.world.y=o-c.y*t.world.scale.y,t.lastDist=l}}))}},{key:"createCircle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.x,r=void 0===e?0:e,i=t.y,n=void 0===i?0:i,s=t.radius,o=void 0===s?50:s,a=t.color,h=void 0===a?16711680:a,l=t.node,u=void 0===l?null:l,c=(new kt.A).circle(0,0,o).fill(h);return c.eventMode="static",c.cursor="pointer",c.nodeRef=u,c.x=r,c.y=n,this.world.addChild(c),c}},{key:"renderGraph",value:function(t){var e=this;t.getNodes().forEach((function(t){var r=e.graphicsMap.get(t.id);if("vector"===t.type){var i=t.id+"_axis",n=e.graphicsMap.get(i),s=t.direction.x*t.length,o=t.direction.y*t.length,a=Math.atan2(o,s),h=Math.sqrt(s*s+o*o);return n||(n=new kt.A,e.world.addChild(n),e.graphicsMap.set(i,n),n.eventMode="static",n.cursor="pointer",n.nodeRef=t,e._bindNodeEvents(n)),n.clear().rect(-h/2,-5,h,10).fill(16755200),n.x=t.x,n.y=t.y,void(n.rotation=a)}r||(r=e.createCircle({x:t.x,y:t.y,radius:"planet"===t.type?40:10,color:"planet"===t.type?16763904:52479,node:t}),e._bindNodeEvents(r),e.graphicsMap.set(t.id,r)),r.x=t.x,r.y=t.y;var l=e.selectedNodes.has(t);r.tint=l?16729156:"planet"===t.type?16763904:52479}))}},{key:"toWorld",value:function(t,e){return this.screenToWorld(t,e)}},{key:"_bindNodeEvents",value:function(t){var e=this,r=!1,i=null;t.on("pointerdown",(function(r){var n=2===r.data.button;n||r.stopPropagation(),n||(i={x:r.global.x,y:r.global.y},t.dragData=r.data,t._ctrlOnDown=e.isCtrlPressed)})),t.on("rightclick",(function(r){var i;console.log("click derecho");var n=t.nodeRef;null===(i=e.onNodeRightClick)||void 0===i||i.call(e,{node:n,global:{x:r.global.x,y:r.global.y}})})),t.on("pointermove",(function(n){if(i){n.stopPropagation();var s=n.global.x-i.x,o=n.global.y-i.y,a=Math.sqrt(s*s+o*o);if(!r&&a>5&&(r=!0,e.lockPan=!0),r){var h=t.nodeRef,l=t.dragData.getLocalPosition(e.world);h.x=l.x,h.y=l.y}}}));var n=function(n){if(i){n.stopPropagation();var s,o=t.nodeRef;r||(t._ctrlOnDown?e.selectedNodes.has(o)?e.selectedNodes.delete(o):e.selectedNodes.add(o):(e.selectedNodes.clear(),e.selectedNodes.add(o)),null===(s=e.onSelectionChange)||void 0===s||s.call(e,Array.from(e.selectedNodes))),r=!1,i=null,e.lockPan=!1,t.dragData=null,t._ctrlOnDown=!1}};t.on("pointerup",n),t.on("pointerupoutside",n)}}],i=[{key:"create",value:(n=Ot(Rt().mark((function e(r){var i;return Rt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new t(r),e.next=3,i._initPixi();case 3:return e.abrupt("return",i);case 4:case"end":return e.stop()}}),e)}))),function(t){return n.apply(this,arguments)})}],r&&Lt(e.prototype,r),i&&Lt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,i,n,s}();function Ft(t){return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function Dt(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,zt(i.key),i)}}function zt(t){var e=function(t,e){if("object"!=Ft(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=Ft(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ft(e)?e:e+""}var jt=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.nodes=new Map,this.edges=[]},(e=[{key:"addNode",value:function(t){this.nodes.set(t.id,{id:t.id,type:t.type||"moon",x:t.x||0,y:t.y||0,vx:0,vy:0,data:t.data||{},rule:t.rule||null})}},{key:"addMoon",value:function(t){var e=t.id,r=t.x,i=t.y,n=t.data;this.nodes.set(e,{id:e,type:"moon",x:r,y:i,vx:0,vy:0,data:n})}},{key:"addPlanet",value:function(t){var e=t.id,r=t.x,i=t.y,n=t.rule,s=t.scalarField;this.nodes.set(e,{id:e,type:"planet",x:r,y:i,vx:0,vy:0,rule:n,scalarField:s})}},{key:"addVector",value:function(t){var e=t.id,r=t.x,i=t.y,n=t.direction,s=t.length,o=t.scalarField,a=t.rule,h=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2))||1,l={x:n.x/h,y:n.y/h};this.nodes.set(e,{id:e,type:"vector",vector:!0,x:r,y:i,direction:l,length:s||200,scalarField:o,rule:a,vx:0,vy:0})}},{key:"addEdge",value:function(t,e){this.edges.push({source:t,target:e})}},{key:"getNode",value:function(t){return this.nodes.get(t)}},{key:"getNodes",value:function(){return Array.from(this.nodes.values())}},{key:"deleteNode",value:function(t){this.nodes.delete(t),this.edges=this.edges.filter((function(e){return e.source!==t&&e.target!==t}))}}])&&Dt(t.prototype,e),r&&Dt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Nt(t){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}function Ut(){Ut=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",h=s.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,i){var s=e&&e.prototype instanceof g?e:g,o=Object.create(s.prototype),a=new E(i||[]);return n(o,"_invoke",{value:C(t,r,a)}),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",m="completed",y={};function g(){}function x(){}function v(){}var b={};l(b,o,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(R([])));w&&w!==r&&i.call(w,o)&&(b=w);var S=v.prototype=g.prototype=Object.create(b);function M(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(n,s,o,a){var h=c(t[n],t,s);if("throw"!==h.type){var l=h.arg,u=l.value;return u&&"object"==Nt(u)&&i.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(u).then((function(t){l.value=t,o(l)}),(function(t){return r("throw",t,o,a)}))}a(h.arg)}var s;n(this,"_invoke",{value:function(t,i){function n(){return new e((function(e,n){r(t,i,e,n)}))}return s=s?s.then(n,n):n()}})}function C(e,r,i){var n=d;return function(s,o){if(n===p)throw Error("Generator is already running");if(n===m){if("throw"===s)throw o;return{value:t,done:!0}}for(i.method=s,i.arg=o;;){var a=i.delegate;if(a){var h=T(a,i);if(h){if(h===y)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===d)throw n=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=p;var l=c(e,r,i);if("normal"===l.type){if(n=i.done?m:f,l.arg===y)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n=m,i.method="throw",i.arg=l.arg)}}}function T(e,r){var i=r.method,n=e.iterator[i];if(n===t)return r.delegate=null,"throw"===i&&e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var s=c(n,e.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,y;var o=s.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,s=function r(){for(;++n<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw new TypeError(Nt(e)+" is not iterable")}return x.prototype=v,n(S,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:x,configurable:!0}),x.displayName=l(v,h,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,h,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},M(A.prototype),l(A.prototype,a,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,i,n,s){void 0===s&&(s=Promise);var o=new A(u(t,r,i,n),s);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(S),l(S,h,"Generator"),l(S,o,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var i in e)r.push(i);return r.reverse(),function t(){for(;r.length;){var i=r.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=R,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(i,n){return a.type="throw",a.arg=e,r.next=i,n&&(r.method="next",r.arg=t),!!n}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var h=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(h&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(h){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var s=n;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var n=i.arg;k(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,r,i){return this.delegate={iterator:R(e),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=t),y}},e}function Xt(t,e,r,i,n,s,o){try{var a=t[s](o),h=a.value}catch(t){return void r(t)}a.done?e(h):Promise.resolve(h).then(i,n)}function Yt(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var s=t.apply(e,r);function o(t){Xt(s,i,n,o,a,"next",t)}function a(t){Xt(s,i,n,o,a,"throw",t)}o(void 0)}))}}function Vt(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,$t(i.key),i)}}function $t(t){var e=function(t,e){if("object"!=Nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=Nt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Nt(e)?e:e+""}var Wt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=e.contentContainer,this.algorithms={rule:g,rule_fast:A,gravity:ot,orbits:tt,spiral:W,spiral_no:O,vertical:j}}return e=t,r=[{key:"_init",value:(s=Yt(Ut().mark((function t(){var e=this;return Ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Gt.create(this.container);case 2:this.view=t.sent,this.view.app.renderer.events.cursorStyles.default="default",this.view.app.renderer.events.domElement.addEventListener("contextmenu",(function(t){t.preventDefault()})),this.model=new jt,this.controller=new ut(this.view,this.model),this._enableDrop(),this.algo=new ot,this.algo.setModel(this.model),this.view.app.ticker.add((function(){e.algo.bounds=e.view.getWorldBounds(),e.algo.model.viewportWidth=e.view.width,e.algo.model.viewportHeight=e.view.height,e.algo.step(),e.view.renderGraph(e.model)}));case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"setAlgorithm",value:function(t){this.algo=t}},{key:"addMoonData",value:function(t){var e=t.id,r=t.x,i=t.y,n=t.data,s=void 0===n?{}:n,o=t.fixed,a=void 0!==o&&o;if(this.model&&this.view){var h=this.view.app.screen.width,l=this.view.app.screen.height,u=void 0!==r?r:Math.random()*h,c=void 0!==i?i:Math.random()*l;this.model.addMoon({id:e,x:u,y:c,data:s,fixed:a}),this.view.renderGraph(this.model)}}},{key:"addRandomMoons",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=["male","female"],r=["a","b","c"],i=0;i<t;i++){var n=crypto.randomUUID(),s=e[Math.floor(Math.random()*e.length)],o=Math.floor(80*Math.random())+1,a=r[Math.floor(Math.random()*r.length)];this.addMoonData({id:n,data:{sex:s,age:o,class:a}})}}},{key:"_dropDataset",value:function(t,e){var r=this;t.forEach((function(t,i){var n=t.id||"moon_".concat(Date.now(),"_").concat(i),s=Math.random()*Math.PI*2,o=200*Math.random(),a=e.x+Math.cos(s)*o,h=e.y+Math.sin(s)*o;r.model.addMoon({id:n,x:a,y:h,data:t})}))}},{key:"_setAlgorithmByName",value:function(t){var e=this.algorithms[t];if(e){var r=new e;r.setModel(this.model),this.setAlgorithm(r)}else console.warn("Unknown algorithm:",t)}},{key:"_enableDrop",value:function(){var t=this,e=this.view.app.view;e.addEventListener("dragover",(function(t){return t.preventDefault()})),e.addEventListener("drop",(function(r){r.preventDefault();var i=e.getBoundingClientRect(),n=r.clientX-i.left,s=r.clientY-i.top,o=t.view.toWorld(n,s),a=r.dataTransfer.getData("application/json");if(a){var h=JSON.parse(a);if(Array.isArray(h))t._dropDataset(h,o);else if("algorithm"!==h.type){if("planet"===h.type){var u=l.build(h.rule);t.model.addPlanet({id:"p_"+Date.now(),x:o.x,y:o.y,rule:u,scalarField:h.scalarField})}if("vector"===h.type){var c=l.build(h.rule);t.model.addVector({id:"p_"+Date.now(),x:o.x,y:o.y,direction:h.direction,length:h.length,scalarField:h.scalarField,rule:c})}}else t._setAlgorithmByName(h.name)}}))}}],i=[{key:"create",value:(n=Yt(Ut().mark((function e(r){var i;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new t(r),e.next=3,i._init();case 3:return e.abrupt("return",i);case 4:case"end":return e.stop()}}),e)}))),function(t){return n.apply(this,arguments)})}],r&&Vt(e.prototype,r),i&&Vt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,i,n,s}();function Ht(t){return Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(t)}function qt(t){return function(t){if(Array.isArray(t))return Zt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Zt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function Kt(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Qt(i.key),i)}}function Qt(t){var e=function(t,e){if("object"!=Ht(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=Ht(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ht(e)?e:e+""}var Jt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=e},(e=[{key:"render",value:function(t){var e=this;if(Array.isArray(t)&&0!==t.length){this.container.innerHTML="";var r=document.createElement("table");r.style.borderCollapse="collapse",r.style.width="100%",Object.keys(t[0]).forEach((function(i){var n=t.map((function(t){return t[i]})).filter((function(t){return null!=t}));if(0!==n.length){var s=e._detectType(n),o=document.createElement("tr"),a=document.createElement("td");a.textContent=i,a.style.border="1px solid #ccc",a.style.padding="6px",a.style.fontWeight="bold";var h=document.createElement("td");if(h.style.border="1px solid #ccc",h.style.padding="6px","categorical"===s){var l=document.createElement("select");qt(new Set(n)).forEach((function(t){var e=document.createElement("option");e.value=t,e.textContent=t,l.appendChild(e)})),h.appendChild(l)}else{var u=Math.min.apply(Math,qt(n)),c=Math.max.apply(Math,qt(n)),d=document.createElement("span");d.textContent="min: ".concat(u," | max: ").concat(c),h.appendChild(d)}o.appendChild(a),o.appendChild(h),r.appendChild(o)}})),this.container.appendChild(r)}}},{key:"_detectType",value:function(t){var e=t[0];return"number"==typeof e?"scalar":"string"==typeof e?new Set(t).size<=10?"categorical":"scalar":"categorical"}}])&&Kt(t.prototype,e),r&&Kt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),te=s.o,ee=s.v;export{te as DataInspector,ee as vi_2dGRAP};